libmove3d  3.13.0
/home/slemaign/softs-local/BioMove3D-git/graspPlanning/qhull/libqhull.h
00001 /*<html><pre>  -<a                             href="qh-qhull.htm"
00002   >-------------------------------</a><a name="TOP">-</a>
00003 
00004    libqhull.h
00005    user-level header file for using qhull.a library
00006 
00007    see qh-qhull.htm, qhull_a.h
00008 
00009    copyright (c) 1993-2010 The Geometry Center.
00010    $Id: //product/qhull/main/rel/src/libqhull.h#9 $$Change: 1172 $
00011    $DateTime: 2010/01/09 21:42:16 $$Author: bbarber $
00012 
00013    NOTE: access to qh_qh is via the 'qh' macro.  This allows
00014    qh_qh to be either a pointer or a structure.  An example
00015    of using qh is "qh DROPdim" which accesses the DROPdim
00016    field of qh_qh.  Similarly, access to qh_qhstat is via
00017    the 'qhstat' macro.
00018 
00019    includes function prototypes for libqhull.c, geom.c, global.c, io.c, user.c
00020 
00021    use mem.h for mem.c
00022    use qset.h for qset.c
00023 
00024    see unix.c for an example of using libqhull.h
00025 
00026    recompile qhull if you change this file
00027 */
00028 
00029 #ifndef qhDEFlibqhull
00030 #define qhDEFlibqhull 1
00031 
00032 /*=========================== -included files ==============*/
00033 
00034 #include "user.h"      /* user definable constants (e.g., qh_QHpointer) */
00035 
00036 #include <setjmp.h>
00037 #include <float.h>
00038 #include <time.h>
00039 #include <stdio.h>
00040 
00041 #if __MWERKS__ && __POWERPC__
00042 #include  <SIOUX.h>
00043 #include  <Files.h>
00044 #include        <Desk.h>
00045 #endif
00046 
00047 #ifndef __STDC__
00048 #ifndef __cplusplus
00049 #if     !_MSC_VER
00050 #error  Neither __STDC__ nor __cplusplus is defined.  Please use strict ANSI C or C++ to compile
00051 #error  Qhull.  You may need to turn off compiler extensions in your project configuration.  If
00052 #error  your compiler is a standard C compiler, you can delete this warning from libqhull.h
00053 #endif
00054 #endif
00055 #endif
00056 
00057 /*============ constants and basic types ====================*/
00058 
00059 extern const char *qh_version; /* defined in global.c */
00060 
00061 /*-<a                             href="qh-geom.htm#TOC"
00062   >--------------------------------</a><a name="coordT">-</a>
00063 
00064   coordT
00065     coordinates and coefficients are stored as realT (i.e., double)
00066 
00067   notes:
00068     Qhull works well if realT is 'float'.  If so joggle (QJ) is not effective.
00069 
00070     Could use 'float' for data and 'double' for calculations (realT vs. coordT)
00071       This requires many type casts, and adjusted error bounds.
00072       Also C compilers may do expressions in double anyway.
00073 */
00074 #define coordT realT
00075 
00076 /*-<a                             href="qh-geom.htm#TOC"
00077   >--------------------------------</a><a name="pointT">-</a>
00078 
00079   pointT
00080     a point is an array of coordinates, usually qh.hull_dim
00081 */
00082 #define pointT coordT
00083 
00084 /*-<a                             href="qh-qhull.htm#TOC"
00085   >--------------------------------</a><a name="flagT">-</a>
00086 
00087   flagT
00088     Boolean flag as a bit
00089 */
00090 #define flagT unsigned int
00091 
00092 /*-<a                             href="qh-qhull.htm#TOC"
00093   >--------------------------------</a><a name="boolT">-</a>
00094 
00095   boolT
00096     boolean value, either True or False
00097 
00098   notes:
00099     needed for portability
00100 */
00101 #define boolT unsigned int
00102 #ifdef False
00103 #undef False
00104 #endif
00105 #ifdef True
00106 #undef True
00107 #endif
00108 #define False 0
00109 #define True 1
00110 
00111 /*-<a                             href="qh-qhull.htm#TOC"
00112   >--------------------------------</a><a name="CENTERtype">-</a>
00113 
00114   qh_CENTER
00115     to distinguish facet->center
00116 */
00117 typedef enum
00118 {
00119     qh_ASnone = 0, qh_ASvoronoi, qh_AScentrum
00120 }
00121 qh_CENTER;
00122 
00123 /*-<a                             href="qh-qhull.htm#TOC"
00124   >--------------------------------</a><a name="qh_PRINT">-</a>
00125 
00126   qh_PRINT
00127     output formats for printing (qh.PRINTout).
00128     'Fa' 'FV' 'Fc' 'FC'
00129 
00130 
00131    notes:
00132    some of these names are similar to qh names.  The similar names are only
00133    used in switch statements in qh_printbegin() etc.
00134 */
00135 typedef enum {qh_PRINTnone= 0,
00136   qh_PRINTarea, qh_PRINTaverage,           /* 'Fa' 'FV' 'Fc' 'FC' */
00137   qh_PRINTcoplanars, qh_PRINTcentrums,
00138   qh_PRINTfacets, qh_PRINTfacets_xridge,   /* 'f' 'FF' 'G' 'FI' 'Fi' 'Fn' */
00139   qh_PRINTgeom, qh_PRINTids, qh_PRINTinner, qh_PRINTneighbors,
00140   qh_PRINTnormals, qh_PRINTouter, qh_PRINTmaple, /* 'n' 'Fo' 'i' 'm' 'Fm' 'FM', 'o' */
00141   qh_PRINTincidences, qh_PRINTmathematica, qh_PRINTmerges, qh_PRINToff,
00142   qh_PRINToptions, qh_PRINTpointintersect, /* 'FO' 'Fp' 'FP' 'p' 'FQ' 'FS' */
00143   qh_PRINTpointnearest, qh_PRINTpoints, qh_PRINTqhull, qh_PRINTsize,
00144   qh_PRINTsummary, qh_PRINTtriangles,      /* 'Fs' 'Ft' 'Fv' 'FN' 'Fx' */
00145   qh_PRINTvertices, qh_PRINTvneighbors, qh_PRINTextremes,
00146   qh_PRINTEND} qh_PRINT;
00147 
00148 /*-<a                             href="qh-qhull.htm#TOC"
00149   >--------------------------------</a><a name="qh_ALL">-</a>
00150 
00151   qh_ALL
00152     argument flag for selecting everything
00153 */
00154 #define qh_ALL      True
00155 #define qh_NOupper  True     /* argument for qh_findbest */
00156 #define qh_IScheckmax  True     /* argument for qh_findbesthorizon */
00157 #define qh_ISnewfacets  True     /* argument for qh_findbest */
00158 #define qh_RESETvisible  True     /* argument for qh_resetlists */
00159 
00160 /*-<a                             href="qh-qhull.htm#TOC"
00161   >--------------------------------</a><a name="qh_ERR">-</a>
00162 
00163   qh_ERR
00164     Qhull exit codes, for indicating errors
00165     See: MSG_ERROR and MSG_WARNING [user.h]
00166 */
00167 #define qh_ERRnone  0    /* no error occurred during qhull */
00168 #define qh_ERRinput 1    /* input inconsistency */
00169 #define qh_ERRsingular 2 /* singular input data */
00170 #define qh_ERRprec  3    /* precision error */
00171 #define qh_ERRmem   4    /* insufficient memory, matches mem.h */
00172 #define qh_ERRqhull 5    /* internal error detected, matches mem.h */
00173 
00174 /*-<a                             href="qh-qhull.htm#TOC"
00175 >--------------------------------</a><a name="qh_FILEstderr">-</a>
00176 
00177 qh_FILEstderr
00178 Fake stderr to distinguish error output from normal output
00179 For C++ interface.  Must redefine qh_fprintf_qhull
00180 */
00181 #define qh_FILEstderr (FILE*)1
00182 
00183 /* ============ -structures- ====================
00184    each of the following structures is defined by a typedef
00185    all realT and coordT fields occur at the beginning of a structure
00186         (otherwise space may be wasted due to alignment)
00187    define all flags together and pack into 32-bit number
00188 */
00189 
00190 typedef struct vertexT vertexT;
00191 typedef struct ridgeT ridgeT;
00192 typedef struct facetT facetT;
00193 #ifndef DEFsetT
00194 #define DEFsetT 1
00195 typedef struct setT setT;          /* defined in qset.h */
00196 #endif
00197 
00198 #ifndef DEFqhstatT
00199 #define DEFqhstatT 1
00200 typedef struct qhstatT qhstatT;    /* defined in stat.h */
00201 #endif
00202 
00203 /*-<a                             href="qh-poly.htm#TOC"
00204   >--------------------------------</a><a name="facetT">-</a>
00205 
00206   facetT
00207     defines a facet
00208 
00209   notes:
00210    qhull() generates the hull as a list of facets.
00211 
00212   topological information:
00213     f.previous,next     doubly-linked list of facets
00214     f.vertices          set of vertices
00215     f.ridges            set of ridges
00216     f.neighbors         set of neighbors
00217     f.toporient         True if facet has top-orientation (else bottom)
00218 
00219   geometric information:
00220     f.offset,normal     hyperplane equation
00221     f.maxoutside        offset to outer plane -- all points inside
00222     f.center            centrum for testing convexity
00223     f.simplicial        True if facet is simplicial
00224     f.flipped           True if facet does not include qh.interior_point
00225 
00226   for constructing hull:
00227     f.visible           True if facet on list of visible facets (will be deleted)
00228     f.newfacet          True if facet on list of newly created facets
00229     f.coplanarset       set of points coplanar with this facet
00230                         (includes near-inside points for later testing)
00231     f.outsideset        set of points outside of this facet
00232     f.furthestdist      distance to furthest point of outside set
00233     f.visitid           marks visited facets during a loop
00234     f.replace           replacement facet for to-be-deleted, visible facets
00235     f.samecycle,newcycle cycle of facets for merging into horizon facet
00236 
00237   see below for other flags and fields
00238 */
00239 struct facetT {
00240 #if !qh_COMPUTEfurthest
00241   coordT   furthestdist;/* distance to furthest point of outsideset */
00242 #endif
00243 #if qh_MAXoutside
00244   coordT   maxoutside;  /* max computed distance of point to facet
00245                         Before QHULLfinished this is an approximation
00246                         since maxdist not always set for mergefacet
00247                         Actual outer plane is +DISTround and
00248                         computed outer plane is +2*DISTround */
00249 #endif
00250   coordT   offset;      /* exact offset of hyperplane from origin */
00251   coordT  *normal;      /* normal of hyperplane, hull_dim coefficients */
00252                         /*   if tricoplanar, shared with a neighbor */
00253   union {               /* in order of testing */
00254    realT   area;        /* area of facet, only in io.c if  ->isarea */
00255    facetT *replace;     /*  replacement facet if ->visible and NEWfacets
00256                              is NULL only if qh_mergedegen_redundant or interior */
00257    facetT *samecycle;   /*  cycle of facets from the same visible/horizon intersection,
00258                              if ->newfacet */
00259    facetT *newcycle;    /*  in horizon facet, current samecycle of new facets */
00260    facetT *trivisible;  /* visible facet for ->tricoplanar facets during qh_triangulate() */
00261    facetT *triowner;    /* owner facet for ->tricoplanar, !isarea facets w/ ->keepcentrum */
00262   }f;
00263   coordT  *center;      /*  centrum for convexity, qh CENTERtype == qh_AScentrum */
00264                         /*  Voronoi center, qh CENTERtype == qh_ASvoronoi */
00265                         /*   if tricoplanar, shared with a neighbor */
00266   facetT  *previous;    /* previous facet in the facet_list */
00267   facetT  *next;        /* next facet in the facet_list */
00268   setT    *vertices;    /* vertices for this facet, inverse sorted by ID
00269                            if simplicial, 1st vertex was apex/furthest */
00270   setT    *ridges;      /* explicit ridges for nonsimplicial facets.
00271                            for simplicial facets, neighbors defines ridge */
00272   setT    *neighbors;   /* neighbors of the facet.  If simplicial, the kth
00273                            neighbor is opposite the kth vertex, and the first
00274                            neighbor is the horizon facet for the first vertex*/
00275   setT    *outsideset;  /* set of points outside this facet
00276                            if non-empty, last point is furthest
00277                            if NARROWhull, includes coplanars for partitioning*/
00278   setT    *coplanarset; /* set of points coplanar with this facet
00279                            > qh.min_vertex and <= facet->max_outside
00280                            a point is assigned to the furthest facet
00281                            if non-empty, last point is furthest away */
00282   unsigned visitid;     /* visit_id, for visiting all neighbors,
00283                            all uses are independent */
00284   unsigned id;          /* unique identifier from qh facet_id */
00285   unsigned nummerge:9;  /* number of merges */
00286 #define qh_MAXnummerge 511 /*     2^9-1, 32 flags total, see "flags:" in io.c */
00287   flagT    tricoplanar:1; /* True if TRIangulate and simplicial and coplanar with a neighbor */
00288                           /*   all tricoplanars share the same ->center, ->normal, ->offset, ->maxoutside */
00289                           /*   all tricoplanars share the same apex */
00290                           /*   if ->degenerate, does not span facet (one logical ridge) */
00291                           /*   one tricoplanar has ->keepcentrum and ->coplanarset */
00292                           /*   during qh_triangulate, f.trivisible points to original facet */
00293   flagT    newfacet:1;  /* True if facet on qh newfacet_list (new or merged) */
00294   flagT    visible:1;   /* True if visible facet (will be deleted) */
00295   flagT    toporient:1; /* True if created with top orientation
00296                            after merging, use ridge orientation */
00297   flagT    simplicial:1;/* True if simplicial facet, ->ridges may be implicit */
00298   flagT    seen:1;      /* used to perform operations only once, like visitid */
00299   flagT    seen2:1;     /* used to perform operations only once, like visitid */
00300   flagT    flipped:1;   /* True if facet is flipped */
00301   flagT    upperdelaunay:1; /* True if facet is upper envelope of Delaunay triangulation */
00302   flagT    notfurthest:1; /* True if last point of outsideset is not furthest*/
00303 
00304 /*-------- flags primarily for output ---------*/
00305   flagT    good:1;      /* True if a facet marked good for output */
00306   flagT    isarea:1;    /* True if facet->f.area is defined */
00307 
00308 /*-------- flags for merging ------------------*/
00309   flagT    dupridge:1;  /* True if duplicate ridge in facet */
00310   flagT    mergeridge:1; /* True if facet or neighbor contains a qh_MERGEridge
00311                             ->normal defined (also defined for mergeridge2) */
00312   flagT    mergeridge2:1; /* True if neighbor contains a qh_MERGEridge (mark_dupridges */
00313   flagT    coplanar:1;  /* True if horizon facet is coplanar at last use */
00314   flagT     mergehorizon:1; /* True if will merge into horizon (->coplanar) */
00315   flagT     cycledone:1;/* True if mergecycle_all already done */
00316   flagT    tested:1;    /* True if facet convexity has been tested (false after merge */
00317   flagT    keepcentrum:1; /* True if keep old centrum after a merge, or marks owner for ->tricoplanar */
00318   flagT    newmerge:1;  /* True if facet is newly merged for reducevertices */
00319   flagT    degenerate:1; /* True if facet is degenerate (degen_mergeset or ->tricoplanar) */
00320   flagT    redundant:1;  /* True if facet is redundant (degen_mergeset) */
00321 };
00322 
00323 
00324 /*-<a                             href="qh-poly.htm#TOC"
00325   >--------------------------------</a><a name="ridgeT">-</a>
00326 
00327   ridgeT
00328     defines a ridge
00329 
00330   notes:
00331   a ridge is hull_dim-1 simplex between two neighboring facets.  If the
00332   facets are non-simplicial, there may be more than one ridge between
00333   two facets.  E.G. a 4-d hypercube has two triangles between each pair
00334   of neighboring facets.
00335 
00336   topological information:
00337     vertices            a set of vertices
00338     top,bottom          neighboring facets with orientation
00339 
00340   geometric information:
00341     tested              True if ridge is clearly convex
00342     nonconvex           True if ridge is non-convex
00343 */
00344 struct ridgeT {
00345   setT    *vertices;    /* vertices belonging to this ridge, inverse sorted by ID
00346                            NULL if a degen ridge (matchsame) */
00347   facetT  *top;         /* top facet this ridge is part of */
00348   facetT  *bottom;      /* bottom facet this ridge is part of */
00349   unsigned id:24;       /* unique identifier, =>room for 8 flags, bit field matches qh.ridge_id */
00350   flagT    seen:1;      /* used to perform operations only once */
00351   flagT    tested:1;    /* True when ridge is tested for convexity */
00352   flagT    nonconvex:1; /* True if getmergeset detected a non-convex neighbor
00353                            only one ridge between neighbors may have nonconvex */
00354 };
00355 
00356 /*-<a                             href="qh-poly.htm#TOC"
00357   >--------------------------------</a><a name="vertexT">-</a>
00358 
00359   vertexT
00360      defines a vertex
00361 
00362   topological information:
00363     next,previous       doubly-linked list of all vertices
00364     neighbors           set of adjacent facets (only if qh.VERTEXneighbors)
00365 
00366   geometric information:
00367     point               array of DIM3 coordinates
00368 */
00369 struct vertexT {
00370   vertexT *next;        /* next vertex in vertex_list */
00371   vertexT *previous;    /* previous vertex in vertex_list */
00372   pointT  *point;       /* hull_dim coordinates (coordT) */
00373   setT    *neighbors;   /* neighboring facets of vertex, qh_vertexneighbors()
00374                            inits in io.c or after first merge */
00375   unsigned visitid:31;  /* for use with qh vertex_visit, size must match */
00376   flagT    seen2:1;     /* another seen flag */
00377   unsigned id:24;       /* unique identifier, bit field matches qh.vertex_id */
00378   unsigned dim:4;       /* dimension of point if non-zero, used by cpp */
00379                         /* =>room for 4 flags */
00380   flagT    seen:1;      /* used to perform operations only once */
00381   flagT    delridge:1;  /* vertex was part of a deleted ridge */
00382   flagT    deleted:1;   /* true if vertex on qh del_vertices */
00383   flagT    newlist:1;   /* true if vertex on qh newvertex_list */
00384 };
00385 
00386 #define MAX_vdim 15  /* Maximum size of vertex->dim */
00387 
00388 /*======= -global variables -qh ============================*/
00389 
00390 /*-<a                             href="qh-globa.htm#TOC"
00391   >--------------------------------</a><a name="qh">-</a>
00392 
00393   qh
00394    all global variables for qhull are in qh, qhmem, and qhstat
00395 
00396   notes:
00397    qhmem is defined in mem.h, qhstat is defined in stat.h, qhrbox is defined in rboxpoints.h
00398    Access to qh_qh is via the "qh" macro.  See qh_QHpointer in user.h
00399 
00400    All global variables for qhull are in qh, qhmem, and qhstat
00401    qh must be unique for each instance of qhull
00402    qhstat may be shared between qhull instances.
00403    qhmem may be shared across multiple instances of Qhull.
00404    Rbox uses global variables rbox_inuse and rbox, but does not persist data across calls.
00405 
00406    notes:
00407    Qhull is not multithreaded.  Global state could be stored in thread-local storage.
00408 */
00409 
00410 extern int qhull_inuse;
00411 
00412 typedef struct qhT qhT;
00413 #if qh_QHpointer
00414 #define qh qh_qh->
00415 extern qhT *qh_qh;     /* allocated in global.c */
00416 #else
00417 #define qh qh_qh.
00418 extern qhT qh_qh;
00419 #endif
00420 
00421 struct qhT {
00422 
00423 /*-<a                             href="qh-globa.htm#TOC"
00424   >--------------------------------</a><a name="qh-const">-</a>
00425 
00426   qh constants
00427     configuration flags and constants for Qhull
00428 
00429   notes:
00430     The user configures Qhull by defining flags.  They are
00431     copied into qh by qh_setflags().  qh-quick.htm#options defines the flags.
00432 */
00433   boolT ALLpoints;        /* true 'Qs' if search all points for initial simplex */
00434   boolT ANGLEmerge;       /* true 'Qa' if sort potential merges by angle */
00435   boolT APPROXhull;       /* true 'Wn' if MINoutside set */
00436   realT   MINoutside;     /*   'Wn' min. distance for an outside point */
00437   boolT ANNOTATEoutput;   /* true 'Ta' if annotate output with message codes */
00438   boolT ATinfinity;       /* true 'Qz' if point num_points-1 is "at-infinity"
00439                              for improving precision in Delaunay triangulations */
00440   boolT AVOIDold;         /* true 'Q4' if avoid old->new merges */
00441   boolT BESToutside;      /* true 'Qf' if partition points into best outsideset */
00442   boolT CDDinput;         /* true 'Pc' if input uses CDD format (1.0/offset first) */
00443   boolT CDDoutput;        /* true 'PC' if print normals in CDD format (offset first) */
00444   boolT CHECKfrequently;  /* true 'Tc' if checking frequently */
00445   realT premerge_cos;     /*   'A-n'   cos_max when pre merging */
00446   realT postmerge_cos;    /*   'An'    cos_max when post merging */
00447   boolT DELAUNAY;         /* true 'd' if computing DELAUNAY triangulation */
00448   boolT DOintersections;  /* true 'Gh' if print hyperplane intersections */
00449   int   DROPdim;          /* drops dim 'GDn' for 4-d -> 3-d output */
00450   boolT FORCEoutput;      /* true 'Po' if forcing output despite degeneracies */
00451   int   GOODpoint;        /* 1+n for 'QGn', good facet if visible/not(-) from point n*/
00452   pointT *GOODpointp;     /*   the actual point */
00453   boolT GOODthreshold;    /* true if qh lower_threshold/upper_threshold defined
00454                              false if qh SPLITthreshold */
00455   int   GOODvertex;       /* 1+n, good facet if vertex for point n */
00456   pointT *GOODvertexp;     /*   the actual point */
00457   boolT HALFspace;        /* true 'Hn,n,n' if halfspace intersection */
00458   int   IStracing;        /* trace execution, 0=none, 1=least, 4=most, -1=events */
00459   int   KEEParea;         /* 'PAn' number of largest facets to keep */
00460   boolT KEEPcoplanar;     /* true 'Qc' if keeping nearest facet for coplanar points */
00461   boolT KEEPinside;       /* true 'Qi' if keeping nearest facet for inside points
00462                               set automatically if 'd Qc' */
00463   int   KEEPmerge;        /* 'PMn' number of facets to keep with most merges */
00464   realT KEEPminArea;      /* 'PFn' minimum facet area to keep */
00465   realT MAXcoplanar;      /* 'Un' max distance below a facet to be coplanar*/
00466   boolT MERGEexact;       /* true 'Qx' if exact merges (coplanar, degen, dupridge, flipped) */
00467   boolT MERGEindependent; /* true 'Q2' if merging independent sets */
00468   boolT MERGING;          /* true if exact-, pre- or post-merging, with angle and centrum tests */
00469   realT   premerge_centrum;  /*   'C-n' centrum_radius when pre merging.  Default is round-off */
00470   realT   postmerge_centrum; /*   'Cn' centrum_radius when post merging.  Default is round-off */
00471   boolT MERGEvertices;    /* true 'Q3' if merging redundant vertices */
00472   realT MINvisible;       /* 'Vn' min. distance for a facet to be visible */
00473   boolT NOnarrow;         /* true 'Q10' if no special processing for narrow distributions */
00474   boolT NOnearinside;     /* true 'Q8' if ignore near-inside points when partitioning */
00475   boolT NOpremerge;       /* true 'Q0' if no defaults for C-0 or Qx */
00476   boolT ONLYgood;         /* true 'Qg' if process points with good visible or horizon facets */
00477   boolT ONLYmax;          /* true 'Qm' if only process points that increase max_outside */
00478   boolT PICKfurthest;     /* true 'Q9' if process furthest of furthest points*/
00479   boolT POSTmerge;        /* true if merging after buildhull (Cn or An) */
00480   boolT PREmerge;         /* true if merging during buildhull (C-n or A-n) */
00481                         /* NOTE: some of these names are similar to qh_PRINT names */
00482   boolT PRINTcentrums;    /* true 'Gc' if printing centrums */
00483   boolT PRINTcoplanar;    /* true 'Gp' if printing coplanar points */
00484   int   PRINTdim;         /* print dimension for Geomview output */
00485   boolT PRINTdots;        /* true 'Ga' if printing all points as dots */
00486   boolT PRINTgood;        /* true 'Pg' if printing good facets */
00487   boolT PRINTinner;       /* true 'Gi' if printing inner planes */
00488   boolT PRINTneighbors;   /* true 'PG' if printing neighbors of good facets */
00489   boolT PRINTnoplanes;    /* true 'Gn' if printing no planes */
00490   boolT PRINToptions1st;  /* true 'FO' if printing options to stderr */
00491   boolT PRINTouter;       /* true 'Go' if printing outer planes */
00492   boolT PRINTprecision;   /* false 'Pp' if not reporting precision problems */
00493   qh_PRINT PRINTout[qh_PRINTEND]; /* list of output formats to print */
00494   boolT PRINTridges;      /* true 'Gr' if print ridges */
00495   boolT PRINTspheres;     /* true 'Gv' if print vertices as spheres */
00496   boolT PRINTstatistics;  /* true 'Ts' if printing statistics to stderr */
00497   boolT PRINTsummary;     /* true 's' if printing summary to stderr */
00498   boolT PRINTtransparent; /* true 'Gt' if print transparent outer ridges */
00499   boolT PROJECTdelaunay;  /* true if DELAUNAY, no readpoints() and
00500                              need projectinput() for Delaunay in qh_init_B */
00501   int   PROJECTinput;     /* number of projected dimensions 'bn:0Bn:0' */
00502   boolT QUICKhelp;        /* true if quick help message for degen input */
00503   boolT RANDOMdist;       /* true if randomly change distplane and setfacetplane */
00504   realT RANDOMfactor;     /*    maximum random perturbation */
00505   realT RANDOMa;          /*    qh_randomfactor is randr * RANDOMa + RANDOMb */
00506   realT RANDOMb;
00507   boolT RANDOMoutside;    /* true if select a random outside point */
00508   int   REPORTfreq;       /* buildtracing reports every n facets */
00509   int   REPORTfreq2;      /* tracemerging reports every REPORTfreq/2 facets */
00510   int   RERUN;            /* 'TRn' rerun qhull n times (qh.build_cnt) */
00511   int   ROTATErandom;     /* 'QRn' seed, 0 time, >= rotate input */
00512   boolT SCALEinput;       /* true 'Qbk' if scaling input */
00513   boolT SCALElast;        /* true 'Qbb' if scale last coord to max prev coord */
00514   boolT SETroundoff;      /* true 'E' if qh DISTround is predefined */
00515   boolT SKIPcheckmax;     /* true 'Q5' if skip qh_check_maxout */
00516   boolT SKIPconvex;       /* true 'Q6' if skip convexity testing during pre-merge */
00517   boolT SPLITthresholds;  /* true if upper_/lower_threshold defines a region
00518                                used only for printing (!for qh ONLYgood) */
00519   int   STOPcone;         /* 'TCn' 1+n for stopping after cone for point n */
00520                           /*       also used by qh_build_withresart for err exit*/
00521   int   STOPpoint;        /* 'TVn' 'TV-n' 1+n for stopping after/before(-)
00522                                         adding point n */
00523   int   TESTpoints;       /* 'QTn' num of test points after qh.num_points.  Test points always coplanar. */
00524   boolT TESTvneighbors;   /*  true 'Qv' if test vertex neighbors at end */
00525   int   TRACElevel;       /* 'Tn' conditional IStracing level */
00526   int   TRACElastrun;     /*  qh.TRACElevel applies to last qh.RERUN */
00527   int   TRACEpoint;       /* 'TPn' start tracing when point n is a vertex */
00528   realT TRACEdist;        /* 'TWn' start tracing when merge distance too big */
00529   int   TRACEmerge;       /* 'TMn' start tracing before this merge */
00530   boolT TRIangulate;      /* true 'Qt' if triangulate non-simplicial facets */
00531   boolT TRInormals;       /* true 'Q11' if triangulate duplicates normals (sets Qt) */
00532   boolT UPPERdelaunay;    /* true 'Qu' if computing furthest-site Delaunay */
00533   boolT USEstdout;        /* true 'Tz' if using stdout instead of stderr */
00534   boolT VERIFYoutput;     /* true 'Tv' if verify output at end of qhull */
00535   boolT VIRTUALmemory;    /* true 'Q7' if depth-first processing in buildhull */
00536   boolT VORONOI;          /* true 'v' if computing Voronoi diagram */
00537 
00538   /*--------input constants ---------*/
00539   realT AREAfactor;       /* 1/(hull_dim-1)! for converting det's to area */
00540   boolT DOcheckmax;       /* true if calling qh_check_maxout (qh_initqhull_globals) */
00541   char  *feasible_string;  /* feasible point 'Hn,n,n' for halfspace intersection */
00542   coordT *feasible_point;  /*    as coordinates, both malloc'd */
00543   boolT GETarea;          /* true 'Fa', 'FA', 'FS', 'PAn', 'PFn' if compute facet area/Voronoi volume in io.c */
00544   boolT KEEPnearinside;   /* true if near-inside points in coplanarset */
00545   int   hull_dim;         /* dimension of hull, set by initbuffers */
00546   int   input_dim;        /* dimension of input, set by initbuffers */
00547   int   num_points;       /* number of input points */
00548   pointT *first_point;    /* array of input points, see POINTSmalloc */
00549   boolT POINTSmalloc;     /*   true if qh first_point/num_points allocated */
00550   pointT *input_points;   /* copy of original qh.first_point for input points for qh_joggleinput */
00551   boolT input_malloc;     /* true if qh input_points malloc'd */
00552   char  qhull_command[256];/* command line that invoked this program */
00553   int   qhull_commandsiz2; /*    size of qhull_command at qh_clear_outputflags */
00554   char  rbox_command[256]; /* command line that produced the input points */
00555   char  qhull_options[512];/* descriptive list of options */
00556   int   qhull_optionlen;  /*    length of last line */
00557   int   qhull_optionsiz;  /*    size of qhull_options at qh_build_withrestart */
00558   int   qhull_optionsiz2; /*    size of qhull_options at qh_clear_outputflags */
00559   int   run_id;           /* non-zero, random identifier for this instance of qhull */
00560   boolT VERTEXneighbors;  /* true if maintaining vertex neighbors */
00561   boolT ZEROcentrum;      /* true if 'C-0' or 'C-0 Qx'.  sets ZEROall_ok */
00562   realT *upper_threshold; /* don't print if facet->normal[k]>=upper_threshold[k]
00563                              must set either GOODthreshold or SPLITthreshold
00564                              if Delaunay, default is 0.0 for upper envelope */
00565   realT *lower_threshold; /* don't print if facet->normal[k] <=lower_threshold[k] */
00566   realT *upper_bound;     /* scale point[k] to new upper bound */
00567   realT *lower_bound;     /* scale point[k] to new lower bound
00568                              project if both upper_ and lower_bound == 0 */
00569 
00570 /*-<a                             href="qh-globa.htm#TOC"
00571   >--------------------------------</a><a name="qh-prec">-</a>
00572 
00573   qh precision constants
00574     precision constants for Qhull
00575 
00576   notes:
00577     qh_detroundoff() computes the maximum roundoff error for distance
00578     and other computations.  It also sets default values for the
00579     qh constants above.
00580 */
00581   realT ANGLEround;       /* max round off error for angles */
00582   realT centrum_radius;   /* max centrum radius for convexity (roundoff added) */
00583   realT cos_max;          /* max cosine for convexity (roundoff added) */
00584   realT DISTround;        /* max round off error for distances, 'E' overrides */
00585   realT MAXabs_coord;     /* max absolute coordinate */
00586   realT MAXlastcoord;     /* max last coordinate for qh_scalelast */
00587   realT MAXsumcoord;      /* max sum of coordinates */
00588   realT MAXwidth;         /* max rectilinear width of point coordinates */
00589   realT MINdenom_1;       /* min. abs. value for 1/x */
00590   realT MINdenom;         /*    use divzero if denominator < MINdenom */
00591   realT MINdenom_1_2;     /* min. abs. val for 1/x that allows normalization */
00592   realT MINdenom_2;       /*    use divzero if denominator < MINdenom_2 */
00593   realT MINlastcoord;     /* min. last coordinate for qh_scalelast */
00594   boolT NARROWhull;       /* set in qh_initialhull if angle < qh_MAXnarrow */
00595   realT *NEARzero;        /* hull_dim array for near zero in gausselim */
00596   realT NEARinside;       /* keep points for qh_check_maxout if close to facet */
00597   realT ONEmerge;         /* max distance for merging simplicial facets */
00598   realT outside_err;      /* application's epsilon for coplanar points
00599                              qh_check_bestdist() qh_check_points() reports error if point outside */
00600   realT WIDEfacet;        /* size of wide facet for skipping ridge in
00601                              area computation and locking centrum */
00602 
00603 /*-<a                             href="qh-globa.htm#TOC"
00604   >--------------------------------</a><a name="qh-codetern">-</a>
00605 
00606   qh internal constants
00607     internal constants for Qhull
00608 */
00609   char qhull[sizeof("qhull")]; /* "qhull" for checking ownership while debugging */
00610   jmp_buf errexit;        /* exit label for qh_errexit, defined by setjmp() */
00611   char jmpXtra[40];       /* extra bytes in case jmp_buf is defined wrong by compiler */
00612   jmp_buf restartexit;    /* restart label for qh_errexit, defined by setjmp() */
00613   char jmpXtra2[40];      /* extra bytes in case jmp_buf is defined wrong by compiler*/
00614   FILE *fin;              /* pointer to input file, init by qh_meminit */
00615   FILE *fout;             /* pointer to output file */
00616   FILE *ferr;             /* pointer to error file */
00617   pointT *interior_point; /* center point of the initial simplex*/
00618   int normal_size;     /* size in bytes for facet normals and point coords*/
00619   int center_size;     /* size in bytes for Voronoi centers */
00620   int   TEMPsize;         /* size for small, temporary sets (in quick mem) */
00621 
00622 /*-<a                             href="qh-globa.htm#TOC"
00623   >--------------------------------</a><a name="qh-lists">-</a>
00624 
00625   qh facet and vertex lists
00626     defines lists of facets, new facets, visible facets, vertices, and
00627     new vertices.  Includes counts, next ids, and trace ids.
00628   see:
00629     qh_resetlists()
00630 */
00631   facetT *facet_list;     /* first facet */
00632   facetT  *facet_tail;     /* end of facet_list (dummy facet) */
00633   facetT *facet_next;     /* next facet for buildhull()
00634                              previous facets do not have outside sets
00635                              NARROWhull: previous facets may have coplanar outside sets for qh_outcoplanar */
00636   facetT *newfacet_list;  /* list of new facets to end of facet_list */
00637   facetT *visible_list;   /* list of visible facets preceeding newfacet_list,
00638                              facet->visible set */
00639   int       num_visible;  /* current number of visible facets */
00640   unsigned tracefacet_id;  /* set at init, then can print whenever */
00641   facetT *tracefacet;     /*   set in newfacet/mergefacet, undone in delfacet*/
00642   unsigned tracevertex_id;  /* set at buildtracing, can print whenever */
00643   vertexT *tracevertex;     /*   set in newvertex, undone in delvertex*/
00644   vertexT *vertex_list;     /* list of all vertices, to vertex_tail */
00645   vertexT  *vertex_tail;    /*      end of vertex_list (dummy vertex) */
00646   vertexT *newvertex_list; /* list of vertices in newfacet_list, to vertex_tail
00647                              all vertices have 'newlist' set */
00648   int   num_facets;       /* number of facets in facet_list
00649                              includes visble faces (num_visible) */
00650   int   num_vertices;     /* number of vertices in facet_list */
00651   int   num_outside;      /* number of points in outsidesets (for tracing and RANDOMoutside)
00652                                includes coplanar outsideset points for NARROWhull/qh_outcoplanar() */
00653   int   num_good;         /* number of good facets (after findgood_all) */
00654   unsigned facet_id;      /* ID of next, new facet from newfacet() */
00655   unsigned ridge_id:24;   /* ID of next, new ridge from newridge() */
00656   unsigned vertex_id:24;  /* ID of next, new vertex from newvertex() */
00657 
00658 /*-<a                             href="qh-globa.htm#TOC"
00659   >--------------------------------</a><a name="qh-var">-</a>
00660 
00661   qh global variables
00662     defines minimum and maximum distances, next visit ids, several flags,
00663     and other global variables.
00664     initialize in qh_initbuild or qh_maxmin if used in qh_buildhull
00665 */
00666   unsigned long hulltime; /* ignore time to set up input and randomize */
00667                           /*   use unsigned to avoid wrap-around errors */
00668   boolT ALLOWrestart;     /* true if qh_precision can use qh.restartexit */
00669   int   build_cnt;        /* number of calls to qh_initbuild */
00670   qh_CENTER CENTERtype;   /* current type of facet->center, qh_CENTER */
00671   int   furthest_id;      /* pointid of furthest point, for tracing */
00672   facetT *GOODclosest;    /* closest facet to GOODthreshold in qh_findgood */
00673   boolT hasAreaVolume;    /* true if totarea, totvol was defined by qh_getarea */
00674   boolT hasTriangulation; /* true if triangulation created by qh_triangulate */
00675   realT JOGGLEmax;        /* set 'QJn' if randomly joggle input */
00676   boolT maxoutdone;       /* set qh_check_maxout(), cleared by qh_addpoint() */
00677   realT max_outside;      /* maximum distance from a point to a facet,
00678                                before roundoff, not simplicial vertices
00679                                actual outer plane is +DISTround and
00680                                computed outer plane is +2*DISTround */
00681   realT max_vertex;       /* maximum distance (>0) from vertex to a facet,
00682                                before roundoff, due to a merge */
00683   realT min_vertex;       /* minimum distance (<0) from vertex to a facet,
00684                                before roundoff, due to a merge
00685                                if qh.JOGGLEmax, qh_makenewplanes sets it
00686                                recomputed if qh.DOcheckmax, default -qh.DISTround */
00687   boolT NEWfacets;        /* true while visible facets invalid due to new or merge
00688                               from makecone/attachnewfacets to deletevisible */
00689   boolT findbestnew;      /* true if partitioning calls qh_findbestnew */
00690   boolT findbest_notsharp; /* true if new facets are at least 90 degrees */
00691   boolT NOerrexit;        /* true if qh.errexit is not available */
00692   realT PRINTcradius;     /* radius for printing centrums */
00693   realT PRINTradius;      /* radius for printing vertex spheres and points */
00694   boolT POSTmerging;      /* true when post merging */
00695   int   printoutvar;      /* temporary variable for qh_printbegin, etc. */
00696   int   printoutnum;      /* number of facets printed */
00697   boolT QHULLfinished;    /* True after qhull() is finished */
00698   realT totarea;          /* 'FA': total facet area computed by qh_getarea, hasAreaVolume */
00699   realT totvol;           /* 'FA': total volume computed by qh_getarea, hasAreaVolume */
00700   unsigned int visit_id;  /* unique ID for searching neighborhoods, */
00701   unsigned int vertex_visit:31; /* unique ID for searching vertices, reset with qh_buildtracing */
00702   boolT ZEROall_ok;       /* True if qh_checkzero always succeeds */
00703   boolT WAScoplanar;      /* True if qh_partitioncoplanar (qh_check_maxout) */
00704 
00705 /*-<a                             href="qh-globa.htm#TOC"
00706   >--------------------------------</a><a name="qh-set">-</a>
00707 
00708   qh global sets
00709     defines sets for merging, initial simplex, hashing, extra input points,
00710     and deleted vertices
00711 */
00712   setT *facet_mergeset;   /* temporary set of merges to be done */
00713   setT *degen_mergeset;   /* temporary set of degenerate and redundant merges */
00714   setT *hash_table;       /* hash table for matching ridges in qh_matchfacets
00715                              size is setsize() */
00716   setT *other_points;     /* additional points */
00717   setT *del_vertices;     /* vertices to partition and delete with visible
00718                              facets.  Have deleted set for checkfacet */
00719 
00720 /*-<a                             href="qh-globa.htm#TOC"
00721   >--------------------------------</a><a name="qh-buf">-</a>
00722 
00723   qh global buffers
00724     defines buffers for maxtrix operations, input, and error messages
00725 */
00726   coordT *gm_matrix;      /* (dim+1)Xdim matrix for geom.c */
00727   coordT **gm_row;        /* array of gm_matrix rows */
00728   char* line;             /* malloc'd input line of maxline+1 chars */
00729   int maxline;
00730   coordT *half_space;     /* malloc'd input array for halfspace (qh normal_size+coordT) */
00731   coordT *temp_malloc;    /* malloc'd input array for points */
00732 
00733 /*-<a                             href="qh-globa.htm#TOC"
00734   >--------------------------------</a><a name="qh-static">-</a>
00735 
00736   qh static variables
00737     defines static variables for individual functions
00738 
00739   notes:
00740     do not use 'static' within a function.  Multiple instances of qhull
00741     may exist.
00742 
00743     do not assume zero initialization, 'QPn' may cause a restart
00744 */
00745   boolT ERREXITcalled;    /* true during qh_errexit (prevents duplicate calls */
00746   boolT firstcentrum;     /* for qh_printcentrum */
00747   boolT old_randomdist;   /* save RANDOMdist flag during io, tracing, or statistics */
00748   setT *coplanarfacetset;  /* set of coplanar facets for searching qh_findbesthorizon() */
00749   realT last_low;         /* qh_scalelast parameters for qh_setdelaunay */
00750   realT last_high;
00751   realT last_newhigh;
00752   unsigned lastreport;    /* for qh_buildtracing */
00753   int mergereport;        /* for qh_tracemerging */
00754   qhstatT *old_qhstat;    /* for saving qh_qhstat in save_qhull() and UsingLibQhull.  Free with qh_free() */
00755   setT *old_tempstack;    /* for saving qhmem.tempstack in save_qhull */
00756   int   ridgeoutnum;      /* number of ridges for 4OFF output (qh_printbegin,etc) */
00757 };
00758 
00759 /*=========== -macros- =========================*/
00760 
00761 /*-<a                             href="qh-poly.htm#TOC"
00762   >--------------------------------</a><a name="otherfacet_">-</a>
00763 
00764   otherfacet_(ridge, facet)
00765     return neighboring facet for a ridge in facet
00766 */
00767 #define otherfacet_(ridge, facet) \
00768                         (((ridge)->top == (facet)) ? (ridge)->bottom : (ridge)->top)
00769 
00770 /*-<a                             href="qh-poly.htm#TOC"
00771   >--------------------------------</a><a name="getid_">-</a>
00772 
00773   getid_(p)
00774     return int ID for facet, ridge, or vertex
00775     return -1 if NULL
00776 */
00777 #define getid_(p)       ((p) ? (int)((p)->id) : -1)
00778 
00779 /*============== FORALL macros ===================*/
00780 
00781 /*-<a                             href="qh-poly.htm#TOC"
00782   >--------------------------------</a><a name="FORALLfacets">-</a>
00783 
00784   FORALLfacets { ... }
00785     assign 'facet' to each facet in qh.facet_list
00786 
00787   notes:
00788     uses 'facetT *facet;'
00789     assumes last facet is a sentinel
00790 
00791   see:
00792     FORALLfacet_( facetlist )
00793 */
00794 #define FORALLfacets for (facet=qh facet_list;facet && facet->next;facet=facet->next)
00795 
00796 /*-<a                             href="qh-poly.htm#TOC"
00797   >--------------------------------</a><a name="FORALLpoints">-</a>
00798 
00799   FORALLpoints { ... }
00800     assign 'point' to each point in qh.first_point, qh.num_points
00801 
00802   declare:
00803     coordT *point, *pointtemp;
00804 */
00805 #define FORALLpoints FORALLpoint_(qh first_point, qh num_points)
00806 
00807 /*-<a                             href="qh-poly.htm#TOC"
00808   >--------------------------------</a><a name="FORALLpoint_">-</a>
00809 
00810   FORALLpoint_( points, num) { ... }
00811     assign 'point' to each point in points array of num points
00812 
00813   declare:
00814     coordT *point, *pointtemp;
00815 */
00816 #define FORALLpoint_(points, num) for (point= (points), \
00817       pointtemp= (points)+qh hull_dim*(num); point < pointtemp; point += qh hull_dim)
00818 
00819 /*-<a                             href="qh-poly.htm#TOC"
00820   >--------------------------------</a><a name="FORALLvertices">-</a>
00821 
00822   FORALLvertices { ... }
00823     assign 'vertex' to each vertex in qh.vertex_list
00824 
00825   declare:
00826     vertexT *vertex;
00827 
00828   notes:
00829     assumes qh.vertex_list terminated with a sentinel
00830 */
00831 #define FORALLvertices for (vertex=qh vertex_list;vertex && vertex->next;vertex= vertex->next)
00832 
00833 /*-<a                             href="qh-poly.htm#TOC"
00834   >--------------------------------</a><a name="FOREACHfacet_">-</a>
00835 
00836   FOREACHfacet_( facets ) { ... }
00837     assign 'facet' to each facet in facets
00838 
00839   declare:
00840     facetT *facet, **facetp;
00841 
00842   see:
00843     <a href="qset.h#FOREACHsetelement_">FOREACHsetelement_</a>
00844 */
00845 #define FOREACHfacet_(facets)    FOREACHsetelement_(facetT, facets, facet)
00846 
00847 /*-<a                             href="qh-poly.htm#TOC"
00848   >--------------------------------</a><a name="FOREACHneighbor_">-</a>
00849 
00850   FOREACHneighbor_( facet ) { ... }
00851     assign 'neighbor' to each neighbor in facet->neighbors
00852 
00853   FOREACHneighbor_( vertex ) { ... }
00854     assign 'neighbor' to each neighbor in vertex->neighbors
00855 
00856   declare:
00857     facetT *neighbor, **neighborp;
00858 
00859   see:
00860     <a href="qset.h#FOREACHsetelement_">FOREACHsetelement_</a>
00861 */
00862 #define FOREACHneighbor_(facet)  FOREACHsetelement_(facetT, facet->neighbors, neighbor)
00863 
00864 /*-<a                             href="qh-poly.htm#TOC"
00865   >--------------------------------</a><a name="FOREACHpoint_">-</a>
00866 
00867   FOREACHpoint_( points ) { ... }
00868     assign 'point' to each point in points set
00869 
00870   declare:
00871     pointT *point, **pointp;
00872 
00873   see:
00874     <a href="qset.h#FOREACHsetelement_">FOREACHsetelement_</a>
00875 */
00876 #define FOREACHpoint_(points)    FOREACHsetelement_(pointT, points, point)
00877 
00878 /*-<a                             href="qh-poly.htm#TOC"
00879   >--------------------------------</a><a name="FOREACHridge_">-</a>
00880 
00881   FOREACHridge_( ridges ) { ... }
00882     assign 'ridge' to each ridge in ridges set
00883 
00884   declare:
00885     ridgeT *ridge, **ridgep;
00886 
00887   see:
00888     <a href="qset.h#FOREACHsetelement_">FOREACHsetelement_</a>
00889 */
00890 #define FOREACHridge_(ridges)    FOREACHsetelement_(ridgeT, ridges, ridge)
00891 
00892 /*-<a                             href="qh-poly.htm#TOC"
00893   >--------------------------------</a><a name="FOREACHvertex_">-</a>
00894 
00895   FOREACHvertex_( vertices ) { ... }
00896     assign 'vertex' to each vertex in vertices set
00897 
00898   declare:
00899     vertexT *vertex, **vertexp;
00900 
00901   see:
00902     <a href="qset.h#FOREACHsetelement_">FOREACHsetelement_</a>
00903 */
00904 #define FOREACHvertex_(vertices) FOREACHsetelement_(vertexT, vertices,vertex)
00905 
00906 /*-<a                             href="qh-poly.htm#TOC"
00907   >--------------------------------</a><a name="FOREACHfacet_i_">-</a>
00908 
00909   FOREACHfacet_i_( facets ) { ... }
00910     assign 'facet' and 'facet_i' for each facet in facets set
00911 
00912   declare:
00913     facetT *facet;
00914     int     facet_n, facet_i;
00915 
00916   see:
00917     <a href="qset.h#FOREACHsetelement_i_">FOREACHsetelement_i_</a>
00918 */
00919 #define FOREACHfacet_i_(facets)    FOREACHsetelement_i_(facetT, facets, facet)
00920 
00921 /*-<a                             href="qh-poly.htm#TOC"
00922   >--------------------------------</a><a name="FOREACHneighbor_i_">-</a>
00923 
00924   FOREACHneighbor_i_( facet ) { ... }
00925     assign 'neighbor' and 'neighbor_i' for each neighbor in facet->neighbors
00926 
00927   FOREACHneighbor_i_( vertex ) { ... }
00928     assign 'neighbor' and 'neighbor_i' for each neighbor in vertex->neighbors
00929 
00930   declare:
00931     facetT *neighbor;
00932     int     neighbor_n, neighbor_i;
00933 
00934   see:
00935     <a href="qset.h#FOREACHsetelement_i_">FOREACHsetelement_i_</a>
00936 */
00937 #define FOREACHneighbor_i_(facet)  FOREACHsetelement_i_(facetT, facet->neighbors, neighbor)
00938 
00939 /*-<a                             href="qh-poly.htm#TOC"
00940   >--------------------------------</a><a name="FOREACHpoint_i_">-</a>
00941 
00942   FOREACHpoint_i_( points ) { ... }
00943     assign 'point' and 'point_i' for each point in points set
00944 
00945   declare:
00946     pointT *point;
00947     int     point_n, point_i;
00948 
00949   see:
00950     <a href="qset.h#FOREACHsetelement_i_">FOREACHsetelement_i_</a>
00951 */
00952 #define FOREACHpoint_i_(points)    FOREACHsetelement_i_(pointT, points, point)
00953 
00954 /*-<a                             href="qh-poly.htm#TOC"
00955   >--------------------------------</a><a name="FOREACHridge_i_">-</a>
00956 
00957   FOREACHridge_i_( ridges ) { ... }
00958     assign 'ridge' and 'ridge_i' for each ridge in ridges set
00959 
00960   declare:
00961     ridgeT *ridge;
00962     int     ridge_n, ridge_i;
00963 
00964   see:
00965     <a href="qset.h#FOREACHsetelement_i_">FOREACHsetelement_i_</a>
00966 */
00967 #define FOREACHridge_i_(ridges)    FOREACHsetelement_i_(ridgeT, ridges, ridge)
00968 
00969 /*-<a                             href="qh-poly.htm#TOC"
00970   >--------------------------------</a><a name="FOREACHvertex_i_">-</a>
00971 
00972   FOREACHvertex_i_( vertices ) { ... }
00973     assign 'vertex' and 'vertex_i' for each vertex in vertices set
00974 
00975   declare:
00976     vertexT *vertex;
00977     int     vertex_n, vertex_i;
00978 
00979   see:
00980     <a href="qset.h#FOREACHsetelement_i_">FOREACHsetelement_i_</a>
00981 */
00982 #define FOREACHvertex_i_(vertices) FOREACHsetelement_i_(vertexT, vertices,vertex)
00983 
00984 /********* -libqhull.c prototypes (duplicated from qhull_a.h) **********************/
00985 
00986 void    qh_qhull(void);
00987 boolT   qh_addpoint(pointT *furthest, facetT *facet, boolT checkdist);
00988 void    qh_printsummary(FILE *fp);
00989 
00990 /********* -user.c prototypes (alphabetical) **********************/
00991 
00992 void    qh_errexit(int exitcode, facetT *facet, ridgeT *ridge);
00993 void    qh_errprint(const char* string, facetT *atfacet, facetT *otherfacet, ridgeT *atridge, vertexT *atvertex);
00994 int     qh_new_qhull(int dim, int numpoints, coordT *points, boolT ismalloc,
00995                 char *qhull_cmd, FILE *outfile, FILE *errfile);
00996 void    qh_printfacetlist(facetT *facetlist, setT *facets, boolT printall);
00997 void    qh_printhelp_degenerate(FILE *fp);
00998 void    qh_printhelp_narrowhull(FILE *fp, realT minangle);
00999 void    qh_printhelp_singular(FILE *fp);
01000 void    qh_user_memsizes(void);
01001 
01002 /********* -usermem.c prototypes (alphabetical) **********************/
01003 void    qh_exit(int exitcode);
01004 void    qh_free(void *mem);
01005 void   *qh_malloc(size_t size);
01006 
01007 /********* -userprintf.c prototypes (alphabetical) **********************/
01008 void    qh_fprintf(FILE *fp, int msgcode, const char *fmt, ... );
01009 void    qh_fprintf_rbox(FILE *fp, int msgcode, const char *fmt, ... );
01010 
01011 /***** -geom.c/geom2.c/random.c prototypes (duplicated from geom.h, random.h) ****************/
01012 
01013 facetT *qh_findbest(pointT *point, facetT *startfacet,
01014                      boolT bestoutside, boolT newfacets, boolT noupper,
01015                      realT *dist, boolT *isoutside, int *numpart);
01016 facetT *qh_findbestnew(pointT *point, facetT *startfacet,
01017                      realT *dist, boolT bestoutside, boolT *isoutside, int *numpart);
01018 boolT   qh_gram_schmidt(int dim, realT **rows);
01019 void    qh_outerinner(facetT *facet, realT *outerplane, realT *innerplane);
01020 void    qh_printsummary(FILE *fp);
01021 void    qh_projectinput(void);
01022 void    qh_randommatrix(realT *buffer, int dim, realT **row);
01023 void    qh_rotateinput(realT **rows);
01024 void    qh_scaleinput(void);
01025 void    qh_setdelaunay(int dim, int count, pointT *points);
01026 coordT  *qh_sethalfspace_all(int dim, int count, coordT *halfspaces, pointT *feasible);
01027 
01028 /***** -global.c prototypes (alphabetical) ***********************/
01029 
01030 unsigned long qh_clock(void);
01031 void    qh_checkflags(char *command, char *hiddenflags);
01032 void    qh_clear_outputflags(void);
01033 void    qh_freebuffers(void);
01034 void    qh_freeqhull(boolT allmem);
01035 void    qh_freeqhull2(boolT allmem);
01036 void    qh_init_A(FILE *infile, FILE *outfile, FILE *errfile, int argc, char *argv[]);
01037 void    qh_init_B(coordT *points, int numpoints, int dim, boolT ismalloc);
01038 void    qh_init_qhull_command(int argc, char *argv[]);
01039 void    qh_initbuffers(coordT *points, int numpoints, int dim, boolT ismalloc);
01040 void    qh_initflags(char *command);
01041 void    qh_initqhull_buffers(void);
01042 void    qh_initqhull_globals(coordT *points, int numpoints, int dim, boolT ismalloc);
01043 void    qh_initqhull_mem(void);
01044 void    qh_initqhull_outputflags(void);
01045 void    qh_initqhull_start(FILE *infile, FILE *outfile, FILE *errfile);
01046 void    qh_initqhull_start2(FILE *infile, FILE *outfile, FILE *errfile);
01047 void    qh_initthresholds(char *command);
01048 void    qh_option(const char *option, int *i, realT *r);
01049 #if qh_QHpointer
01050 void    qh_restore_qhull(qhT **oldqh);
01051 qhT    *qh_save_qhull(void);
01052 #endif
01053 
01054 /***** -io.c prototypes (duplicated from io.h) ***********************/
01055 
01056 void    dfacet( unsigned id);
01057 void    dvertex( unsigned id);
01058 void    qh_printneighborhood(FILE *fp, qh_PRINT format, facetT *facetA, facetT *facetB, boolT printall);
01059 void    qh_produce_output(void);
01060 coordT *qh_readpoints(int *numpoints, int *dimension, boolT *ismalloc);
01061 
01062 
01063 /********* -mem.c prototypes (duplicated from mem.h) **********************/
01064 
01065 void qh_meminit(FILE *ferr);
01066 void qh_memfreeshort(int *curlong, int *totlong);
01067 
01068 /********* -poly.c/poly2.c prototypes (duplicated from poly.h) **********************/
01069 
01070 void    qh_check_output(void);
01071 void    qh_check_points(void);
01072 setT   *qh_facetvertices(facetT *facetlist, setT *facets, boolT allfacets);
01073 facetT *qh_findbestfacet(pointT *point, boolT bestoutside,
01074            realT *bestdist, boolT *isoutside);
01075 vertexT *qh_nearvertex(facetT *facet, pointT *point, realT *bestdistp);
01076 pointT *qh_point(int id);
01077 setT   *qh_pointfacet(void /*qh.facet_list*/);
01078 int     qh_pointid(pointT *point);
01079 setT   *qh_pointvertex(void /*qh.facet_list*/);
01080 void    qh_setvoronoi_all(void);
01081 void    qh_triangulate(void /*qh facet_list*/);
01082 
01083 /********* -rboxpoints.c prototypes **********************/
01084 int     qh_rboxpoints(FILE* fout, FILE* ferr, char* rbox_command);
01085 void    qh_errexit_rbox(int exitcode);
01086 
01087 /********* -stat.c prototypes (duplicated from stat.h) **********************/
01088 
01089 void    qh_collectstatistics(void);
01090 void    qh_printallstatistics(FILE *fp, const char *string);
01091 
01092 #endif /* qhDEFlibqhull */
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines