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