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