libqhull_r.h
Go to the documentation of this file.
1 /*<html><pre> -<a href="qh-qhull_r.htm"
2  >-------------------------------</a><a name="TOP">-</a>
3 
4  libqhull_r.h
5  user-level header file for using qhull.a library
6 
7  see qh-qhull_r.htm, qhull_ra.h
8 
9  Copyright (c) 1993-2015 The Geometry Center.
10  $Id: //main/2015/qhull/src/libqhull_r/libqhull_r.h#7 $$Change: 2066 $
11  $DateTime: 2016/01/18 19:29:17 $$Author: bbarber $
12 
13  includes function prototypes for libqhull_r.c, geom_r.c, global_r.c, io_r.c, user.c
14 
15  use mem_r.h for mem_r.c
16  use qset_r.h for qset_r.c
17 
18  see unix_r.c for an example of using libqhull_r.h
19 
20  recompile qhull if you change this file
21 */
22 
23 #ifndef qhDEFlibqhull
24 #define qhDEFlibqhull 1
25 
26 /*=========================== -included files ==============*/
27 
28 /* user_r.h first for QHULL_CRTDBG */
29 #include "user_r.h" /* user definable constants (e.g., realT). */
30 
31 #include "mem_r.h" /* Needed for qhT in libqhull_r.h */
32 #include "qset_r.h" /* Needed for QHULL_LIB_CHECK */
33 /* include stat_r.h after defining boolT. statT needed for qhT in libqhull_r.h */
34 
35 #include <setjmp.h>
36 #include <float.h>
37 #include <time.h>
38 #include <stdio.h>
39 
40 #ifndef __STDC__
41 #ifndef __cplusplus
42 #if !_MSC_VER
43 #error Neither __STDC__ nor __cplusplus is defined. Please use strict ANSI C or C++ to compile
44 #error Qhull. You may need to turn off compiler extensions in your project configuration. If
45 #error your compiler is a standard C compiler, you can delete this warning from libqhull_r.h
46 #endif
47 #endif
48 #endif
49 
50 /*============ constants and basic types ====================*/
51 
52 extern const char qh_version[]; /* defined in global_r.c */
53 extern const char qh_version2[]; /* defined in global_r.c */
54 
55 /*-<a href="qh-geom_r.htm#TOC"
56  >--------------------------------</a><a name="coordT">-</a>
57 
58  coordT
59  coordinates and coefficients are stored as realT (i.e., double)
60 
61  notes:
62  Qhull works well if realT is 'float'. If so joggle (QJ) is not effective.
63 
64  Could use 'float' for data and 'double' for calculations (realT vs. coordT)
65  This requires many type casts, and adjusted error bounds.
66  Also C compilers may do expressions in double anyway.
67 */
68 #define coordT realT
69 
70 /*-<a href="qh-geom_r.htm#TOC"
71  >--------------------------------</a><a name="pointT">-</a>
72 
73  pointT
74  a point is an array of coordinates, usually qh.hull_dim
75  qh_pointid returns
76  qh_IDnone if point==0 or qh is undefined
77  qh_IDinterior for qh.interior_point
78  qh_IDunknown if point is neither in qh.first_point... nor qh.other_points
79 
80  notes:
81  qh.STOPcone and qh.STOPpoint assume that qh_IDunknown==-1 (other negative numbers indicate points)
82  qh_IDunknown is also returned by getid_() for unknown facet, ridge, or vertex
83 */
84 #define pointT coordT
85 typedef enum
86 {
88 }
89 qh_pointT;
90 
91 /*-<a href="qh-qhull_r.htm#TOC"
92  >--------------------------------</a><a name="flagT">-</a>
93 
94  flagT
95  Boolean flag as a bit
96 */
97 #define flagT unsigned int
98 
99 /*-<a href="qh-qhull_r.htm#TOC"
100  >--------------------------------</a><a name="boolT">-</a>
101 
102  boolT
103  boolean value, either True or False
104 
105  notes:
106  needed for portability
107  Use qh_False/qh_True as synonyms
108 */
109 #define boolT unsigned int
110 #ifdef False
111 #undef False
112 #endif
113 #ifdef True
114 #undef True
115 #endif
116 #define False 0
117 #define True 1
118 #define qh_False 0
119 #define qh_True 1
120 
121 #include "stat_r.h" /* needs boolT */
122 
123 /*-<a href="qh-qhull_r.htm#TOC"
124  >--------------------------------</a><a name="CENTERtype">-</a>
125 
126  qh_CENTER
127  to distinguish facet->center
128 */
129 typedef enum
130 {
131  qh_ASnone = 0, /* If not MERGING and not VORONOI */
132  qh_ASvoronoi, /* Set by qh_clearcenters on qh_prepare_output, or if not MERGING and VORONOI */
133  qh_AScentrum /* If MERGING (assumed during merging) */
134 }
135 qh_CENTER;
136 
137 /*-<a href="qh-qhull_r.htm#TOC"
138  >--------------------------------</a><a name="qh_PRINT">-</a>
139 
140  qh_PRINT
141  output formats for printing (qh.PRINTout).
142  'Fa' 'FV' 'Fc' 'FC'
143 
144 
145  notes:
146  some of these names are similar to qhT names. The similar names are only
147  used in switch statements in qh_printbegin() etc.
148 */
149 typedef enum {qh_PRINTnone= 0,
150  qh_PRINTarea, qh_PRINTaverage, /* 'Fa' 'FV' 'Fc' 'FC' */
152  qh_PRINTfacets, qh_PRINTfacets_xridge, /* 'f' 'FF' 'G' 'FI' 'Fi' 'Fn' */
154  qh_PRINTnormals, qh_PRINTouter, qh_PRINTmaple, /* 'n' 'Fo' 'i' 'm' 'Fm' 'FM', 'o' */
156  qh_PRINToptions, qh_PRINTpointintersect, /* 'FO' 'Fp' 'FP' 'p' 'FQ' 'FS' */
158  qh_PRINTsummary, qh_PRINTtriangles, /* 'Fs' 'Ft' 'Fv' 'FN' 'Fx' */
161 
162 /*-<a href="qh-qhull_r.htm#TOC"
163  >--------------------------------</a><a name="qh_ALL">-</a>
164 
165  qh_ALL
166  argument flag for selecting everything
167 */
168 #define qh_ALL True
169 #define qh_NOupper True /* argument for qh_findbest */
170 #define qh_IScheckmax True /* argument for qh_findbesthorizon */
171 #define qh_ISnewfacets True /* argument for qh_findbest */
172 #define qh_RESETvisible True /* argument for qh_resetlists */
173 
174 /*-<a href="qh-qhull_r.htm#TOC"
175  >--------------------------------</a><a name="qh_ERR">-</a>
176 
177  qh_ERR
178  Qhull exit codes, for indicating errors
179  See: MSG_ERROR and MSG_WARNING [user.h]
180 */
181 #define qh_ERRnone 0 /* no error occurred during qhull */
182 #define qh_ERRinput 1 /* input inconsistency */
183 #define qh_ERRsingular 2 /* singular input data */
184 #define qh_ERRprec 3 /* precision error */
185 #define qh_ERRmem 4 /* insufficient memory, matches mem_r.h */
186 #define qh_ERRqhull 5 /* internal error detected, matches mem_r.h */
187 
188 /*-<a href="qh-qhull_r.htm#TOC"
189 >--------------------------------</a><a name="qh_FILEstderr">-</a>
190 
191 qh_FILEstderr
192 Fake stderr to distinguish error output from normal output
193 For C++ interface. Must redefine qh_fprintf_qhull
194 */
195 #define qh_FILEstderr ((FILE*)1)
196 
197 /* ============ -structures- ====================
198  each of the following structures is defined by a typedef
199  all realT and coordT fields occur at the beginning of a structure
200  (otherwise space may be wasted due to alignment)
201  define all flags together and pack into 32-bit number
202 
203  DEFqhT and DEFsetT are likewise defined in
204  mem_r.h, qset_r.h, and stat_r.h.
205 
206 */
207 
208 typedef struct vertexT vertexT;
209 typedef struct ridgeT ridgeT;
210 typedef struct facetT facetT;
211 
212 #ifndef DEFqhT
213 #define DEFqhT 1
214 typedef struct qhT qhT; /* defined below */
215 #endif
216 
217 #ifndef DEFsetT
218 #define DEFsetT 1
219 typedef struct setT setT; /* defined in qset_r.h */
220 #endif
221 
222 /*-<a href="qh-poly_r.htm#TOC"
223  >--------------------------------</a><a name="facetT">-</a>
224 
225  facetT
226  defines a facet
227 
228  notes:
229  qhull() generates the hull as a list of facets.
230 
231  topological information:
232  f.previous,next doubly-linked list of facets
233  f.vertices set of vertices
234  f.ridges set of ridges
235  f.neighbors set of neighbors
236  f.toporient True if facet has top-orientation (else bottom)
237 
238  geometric information:
239  f.offset,normal hyperplane equation
240  f.maxoutside offset to outer plane -- all points inside
241  f.center centrum for testing convexity or Voronoi center for output
242  f.simplicial True if facet is simplicial
243  f.flipped True if facet does not include qh.interior_point
244 
245  for constructing hull:
246  f.visible True if facet on list of visible facets (will be deleted)
247  f.newfacet True if facet on list of newly created facets
248  f.coplanarset set of points coplanar with this facet
249  (includes near-inside points for later testing)
250  f.outsideset set of points outside of this facet
251  f.furthestdist distance to furthest point of outside set
252  f.visitid marks visited facets during a loop
253  f.replace replacement facet for to-be-deleted, visible facets
254  f.samecycle,newcycle cycle of facets for merging into horizon facet
255 
256  see below for other flags and fields
257 */
258 struct facetT {
259 #if !qh_COMPUTEfurthest
260  coordT furthestdist;/* distance to furthest point of outsideset */
261 #endif
262 #if qh_MAXoutside
263  coordT maxoutside; /* max computed distance of point to facet
264  Before QHULLfinished this is an approximation
265  since maxdist not always set for mergefacet
266  Actual outer plane is +DISTround and
267  computed outer plane is +2*DISTround */
268 #endif
269  coordT offset; /* exact offset of hyperplane from origin */
270  coordT *normal; /* normal of hyperplane, hull_dim coefficients */
271  /* if ->tricoplanar, shared with a neighbor */
272  union { /* in order of testing */
273  realT area; /* area of facet, only in io_r.c if ->isarea */
274  facetT *replace; /* replacement facet if ->visible and NEWfacets
275  is NULL only if qh_mergedegen_redundant or interior */
276  facetT *samecycle; /* cycle of facets from the same visible/horizon intersection,
277  if ->newfacet */
278  facetT *newcycle; /* in horizon facet, current samecycle of new facets */
279  facetT *trivisible; /* visible facet for ->tricoplanar facets during qh_triangulate() */
280  facetT *triowner; /* owner facet for ->tricoplanar, !isarea facets w/ ->keepcentrum */
281  }f;
282  coordT *center; /* set according to qh.CENTERtype */
283  /* qh_ASnone: no center (not MERGING) */
284  /* qh_AScentrum: centrum for testing convexity (qh_getcentrum) */
285  /* assumed qh_AScentrum while merging */
286  /* qh_ASvoronoi: Voronoi center (qh_facetcenter) */
287  /* after constructing the hull, it may be changed (qh_clearcenter) */
288  /* if tricoplanar and !keepcentrum, shared with a neighbor */
289  facetT *previous; /* previous facet in the facet_list */
290  facetT *next; /* next facet in the facet_list */
291  setT *vertices; /* vertices for this facet, inverse sorted by ID
292  if simplicial, 1st vertex was apex/furthest */
293  setT *ridges; /* explicit ridges for nonsimplicial facets.
294  for simplicial facets, neighbors define the ridges */
295  setT *neighbors; /* neighbors of the facet. If simplicial, the kth
296  neighbor is opposite the kth vertex, and the first
297  neighbor is the horizon facet for the first vertex*/
298  setT *outsideset; /* set of points outside this facet
299  if non-empty, last point is furthest
300  if NARROWhull, includes coplanars for partitioning*/
301  setT *coplanarset; /* set of points coplanar with this facet
302  > qh.min_vertex and <= facet->max_outside
303  a point is assigned to the furthest facet
304  if non-empty, last point is furthest away */
305  unsigned visitid; /* visit_id, for visiting all neighbors,
306  all uses are independent */
307  unsigned id; /* unique identifier from qh.facet_id */
308  unsigned nummerge:9; /* number of merges */
309 #define qh_MAXnummerge 511 /* 2^9-1, 32 flags total, see "flags:" in io_r.c */
310  flagT tricoplanar:1; /* True if TRIangulate and simplicial and coplanar with a neighbor */
311  /* all tricoplanars share the same apex */
312  /* all tricoplanars share the same ->center, ->normal, ->offset, ->maxoutside */
313  /* ->keepcentrum is true for the owner. It has the ->coplanareset */
314  /* if ->degenerate, does not span facet (one logical ridge) */
315  /* during qh_triangulate, f.trivisible points to original facet */
316  flagT newfacet:1; /* True if facet on qh.newfacet_list (new or merged) */
317  flagT visible:1; /* True if visible facet (will be deleted) */
318  flagT toporient:1; /* True if created with top orientation
319  after merging, use ridge orientation */
320  flagT simplicial:1;/* True if simplicial facet, ->ridges may be implicit */
321  flagT seen:1; /* used to perform operations only once, like visitid */
322  flagT seen2:1; /* used to perform operations only once, like visitid */
323  flagT flipped:1; /* True if facet is flipped */
324  flagT upperdelaunay:1; /* True if facet is upper envelope of Delaunay triangulation */
325  flagT notfurthest:1; /* True if last point of outsideset is not furthest*/
326 
327 /*-------- flags primarily for output ---------*/
328  flagT good:1; /* True if a facet marked good for output */
329  flagT isarea:1; /* True if facet->f.area is defined */
330 
331 /*-------- flags for merging ------------------*/
332  flagT dupridge:1; /* True if duplicate ridge in facet */
333  flagT mergeridge:1; /* True if facet or neighbor contains a qh_MERGEridge
334  ->normal defined (also defined for mergeridge2) */
335  flagT mergeridge2:1; /* True if neighbor contains a qh_MERGEridge (qhT *qh, mark_dupridges */
336  flagT coplanar:1; /* True if horizon facet is coplanar at last use */
337  flagT mergehorizon:1; /* True if will merge into horizon (->coplanar) */
338  flagT cycledone:1;/* True if mergecycle_all already done */
339  flagT tested:1; /* True if facet convexity has been tested (false after merge */
340  flagT keepcentrum:1; /* True if keep old centrum after a merge, or marks owner for ->tricoplanar */
341  flagT newmerge:1; /* True if facet is newly merged for reducevertices */
342  flagT degenerate:1; /* True if facet is degenerate (degen_mergeset or ->tricoplanar) */
343  flagT redundant:1; /* True if facet is redundant (degen_mergeset) */
344 };
345 
346 
347 /*-<a href="qh-poly_r.htm#TOC"
348  >--------------------------------</a><a name="ridgeT">-</a>
349 
350  ridgeT
351  defines a ridge
352 
353  notes:
354  a ridge is hull_dim-1 simplex between two neighboring facets. If the
355  facets are non-simplicial, there may be more than one ridge between
356  two facets. E.G. a 4-d hypercube has two triangles between each pair
357  of neighboring facets.
358 
359  topological information:
360  vertices a set of vertices
361  top,bottom neighboring facets with orientation
362 
363  geometric information:
364  tested True if ridge is clearly convex
365  nonconvex True if ridge is non-convex
366 */
367 struct ridgeT {
368  setT *vertices; /* vertices belonging to this ridge, inverse sorted by ID
369  NULL if a degen ridge (matchsame) */
370  facetT *top; /* top facet this ridge is part of */
371  facetT *bottom; /* bottom facet this ridge is part of */
372  unsigned id; /* unique identifier. Same size as vertex_id and ridge_id */
373  flagT seen:1; /* used to perform operations only once */
374  flagT tested:1; /* True when ridge is tested for convexity */
375  flagT nonconvex:1; /* True if getmergeset detected a non-convex neighbor
376  only one ridge between neighbors may have nonconvex */
377 };
378 
379 /*-<a href="qh-poly_r.htm#TOC"
380  >--------------------------------</a><a name="vertexT">-</a>
381 
382  vertexT
383  defines a vertex
384 
385  topological information:
386  next,previous doubly-linked list of all vertices
387  neighbors set of adjacent facets (only if qh.VERTEXneighbors)
388 
389  geometric information:
390  point array of DIM3 coordinates
391 */
392 struct vertexT {
393  vertexT *next; /* next vertex in vertex_list */
394  vertexT *previous; /* previous vertex in vertex_list */
395  pointT *point; /* hull_dim coordinates (coordT) */
396  setT *neighbors; /* neighboring facets of vertex, qh_vertexneighbors()
397  inits in io_r.c or after first merge */
398  unsigned id; /* unique identifier. Same size as qh.vertex_id and qh.ridge_id */
399  unsigned visitid; /* for use with qh.vertex_visit, size must match */
400  flagT seen:1; /* used to perform operations only once */
401  flagT seen2:1; /* another seen flag */
402  flagT delridge:1; /* vertex was part of a deleted ridge */
403  flagT deleted:1; /* true if vertex on qh.del_vertices */
404  flagT newlist:1; /* true if vertex on qh.newvertex_list */
405 };
406 
407 /*======= -global variables -qh ============================*/
408 
409 /*-<a href="qh-globa_r.htm#TOC"
410  >--------------------------------</a><a name="qh">-</a>
411 
412  qhT
413  All global variables for qhull are in qhT. It includes qhmemT, qhstatT, and rbox globals
414 
415  This version of Qhull is reentrant, but it is not thread-safe.
416 
417  Do not run separate threads on the same instance of qhT.
418 
419  QHULL_LIB_CHECK checks that a program and the corresponding
420  qhull library were built with the same type of header files.
421 */
422 
423 #define QHULL_NON_REENTRANT 0
424 #define QHULL_QH_POINTER 1
425 #define QHULL_REENTRANT 2
426 
427 #define QHULL_LIB_TYPE QHULL_REENTRANT
428 
429 #define QHULL_LIB_CHECK qh_lib_check(QHULL_LIB_TYPE, sizeof(qhT), sizeof(vertexT), sizeof(ridgeT), sizeof(facetT), sizeof(setT), sizeof(qhmemT));
430 #define QHULL_LIB_CHECK_RBOX qh_lib_check(QHULL_LIB_TYPE, sizeof(qhT), sizeof(vertexT), sizeof(ridgeT), sizeof(facetT), 0, 0);
431 
432 struct qhT {
433 
434 /*-<a href="qh-globa_r.htm#TOC"
435  >--------------------------------</a><a name="qh-const">-</a>
436 
437  qh constants
438  configuration flags and constants for Qhull
439 
440  notes:
441  The user configures Qhull by defining flags. They are
442  copied into qh by qh_setflags(). qh-quick_r.htm#options defines the flags.
443 */
444  boolT ALLpoints; /* true 'Qs' if search all points for initial simplex */
445  boolT ANGLEmerge; /* true 'Qa' if sort potential merges by angle */
446  boolT APPROXhull; /* true 'Wn' if MINoutside set */
447  realT MINoutside; /* 'Wn' min. distance for an outside point */
448  boolT ANNOTATEoutput; /* true 'Ta' if annotate output with message codes */
449  boolT ATinfinity; /* true 'Qz' if point num_points-1 is "at-infinity"
450  for improving precision in Delaunay triangulations */
451  boolT AVOIDold; /* true 'Q4' if avoid old->new merges */
452  boolT BESToutside; /* true 'Qf' if partition points into best outsideset */
453  boolT CDDinput; /* true 'Pc' if input uses CDD format (1.0/offset first) */
454  boolT CDDoutput; /* true 'PC' if print normals in CDD format (offset first) */
455  boolT CHECKfrequently; /* true 'Tc' if checking frequently */
456  realT premerge_cos; /* 'A-n' cos_max when pre merging */
457  realT postmerge_cos; /* 'An' cos_max when post merging */
458  boolT DELAUNAY; /* true 'd' if computing DELAUNAY triangulation */
459  boolT DOintersections; /* true 'Gh' if print hyperplane intersections */
460  int DROPdim; /* drops dim 'GDn' for 4-d -> 3-d output */
461  boolT FORCEoutput; /* true 'Po' if forcing output despite degeneracies */
462  int GOODpoint; /* 1+n for 'QGn', good facet if visible/not(-) from point n*/
463  pointT *GOODpointp; /* the actual point */
464  boolT GOODthreshold; /* true if qh.lower_threshold/upper_threshold defined
465  false if qh.SPLITthreshold */
466  int GOODvertex; /* 1+n, good facet if vertex for point n */
467  pointT *GOODvertexp; /* the actual point */
468  boolT HALFspace; /* true 'Hn,n,n' if halfspace intersection */
469  boolT ISqhullQh; /* Set by Qhull.cpp on initialization */
470  int IStracing; /* trace execution, 0=none, 1=least, 4=most, -1=events */
471  int KEEParea; /* 'PAn' number of largest facets to keep */
472  boolT KEEPcoplanar; /* true 'Qc' if keeping nearest facet for coplanar points */
473  boolT KEEPinside; /* true 'Qi' if keeping nearest facet for inside points
474  set automatically if 'd Qc' */
475  int KEEPmerge; /* 'PMn' number of facets to keep with most merges */
476  realT KEEPminArea; /* 'PFn' minimum facet area to keep */
477  realT MAXcoplanar; /* 'Un' max distance below a facet to be coplanar*/
478  boolT MERGEexact; /* true 'Qx' if exact merges (coplanar, degen, dupridge, flipped) */
479  boolT MERGEindependent; /* true 'Q2' if merging independent sets */
480  boolT MERGING; /* true if exact-, pre- or post-merging, with angle and centrum tests */
481  realT premerge_centrum; /* 'C-n' centrum_radius when pre merging. Default is round-off */
482  realT postmerge_centrum; /* 'Cn' centrum_radius when post merging. Default is round-off */
483  boolT MERGEvertices; /* true 'Q3' if merging redundant vertices */
484  realT MINvisible; /* 'Vn' min. distance for a facet to be visible */
485  boolT NOnarrow; /* true 'Q10' if no special processing for narrow distributions */
486  boolT NOnearinside; /* true 'Q8' if ignore near-inside points when partitioning */
487  boolT NOpremerge; /* true 'Q0' if no defaults for C-0 or Qx */
488  boolT NOwide; /* true 'Q12' if no error on wide merge due to duplicate ridge */
489  boolT ONLYgood; /* true 'Qg' if process points with good visible or horizon facets */
490  boolT ONLYmax; /* true 'Qm' if only process points that increase max_outside */
491  boolT PICKfurthest; /* true 'Q9' if process furthest of furthest points*/
492  boolT POSTmerge; /* true if merging after buildhull (Cn or An) */
493  boolT PREmerge; /* true if merging during buildhull (C-n or A-n) */
494  /* NOTE: some of these names are similar to qh_PRINT names */
495  boolT PRINTcentrums; /* true 'Gc' if printing centrums */
496  boolT PRINTcoplanar; /* true 'Gp' if printing coplanar points */
497  int PRINTdim; /* print dimension for Geomview output */
498  boolT PRINTdots; /* true 'Ga' if printing all points as dots */
499  boolT PRINTgood; /* true 'Pg' if printing good facets */
500  boolT PRINTinner; /* true 'Gi' if printing inner planes */
501  boolT PRINTneighbors; /* true 'PG' if printing neighbors of good facets */
502  boolT PRINTnoplanes; /* true 'Gn' if printing no planes */
503  boolT PRINToptions1st; /* true 'FO' if printing options to stderr */
504  boolT PRINTouter; /* true 'Go' if printing outer planes */
505  boolT PRINTprecision; /* false 'Pp' if not reporting precision problems */
506  qh_PRINT PRINTout[qh_PRINTEND]; /* list of output formats to print */
507  boolT PRINTridges; /* true 'Gr' if print ridges */
508  boolT PRINTspheres; /* true 'Gv' if print vertices as spheres */
509  boolT PRINTstatistics; /* true 'Ts' if printing statistics to stderr */
510  boolT PRINTsummary; /* true 's' if printing summary to stderr */
511  boolT PRINTtransparent; /* true 'Gt' if print transparent outer ridges */
512  boolT PROJECTdelaunay; /* true if DELAUNAY, no readpoints() and
513  need projectinput() for Delaunay in qh_init_B */
514  int PROJECTinput; /* number of projected dimensions 'bn:0Bn:0' */
515  boolT QUICKhelp; /* true if quick help message for degen input */
516  boolT RANDOMdist; /* true if randomly change distplane and setfacetplane */
517  realT RANDOMfactor; /* maximum random perturbation */
518  realT RANDOMa; /* qh_randomfactor is randr * RANDOMa + RANDOMb */
519  realT RANDOMb;
520  boolT RANDOMoutside; /* true if select a random outside point */
521  int REPORTfreq; /* buildtracing reports every n facets */
522  int REPORTfreq2; /* tracemerging reports every REPORTfreq/2 facets */
523  int RERUN; /* 'TRn' rerun qhull n times (qh.build_cnt) */
524  int ROTATErandom; /* 'QRn' seed, 0 time, >= rotate input */
525  boolT SCALEinput; /* true 'Qbk' if scaling input */
526  boolT SCALElast; /* true 'Qbb' if scale last coord to max prev coord */
527  boolT SETroundoff; /* true 'E' if qh.DISTround is predefined */
528  boolT SKIPcheckmax; /* true 'Q5' if skip qh_check_maxout */
529  boolT SKIPconvex; /* true 'Q6' if skip convexity testing during pre-merge */
530  boolT SPLITthresholds; /* true if upper_/lower_threshold defines a region
531  used only for printing (!for qh.ONLYgood) */
532  int STOPcone; /* 'TCn' 1+n for stopping after cone for point n */
533  /* also used by qh_build_withresart for err exit*/
534  int STOPpoint; /* 'TVn' 'TV-n' 1+n for stopping after/before(-)
535  adding point n */
536  int TESTpoints; /* 'QTn' num of test points after qh.num_points. Test points always coplanar. */
537  boolT TESTvneighbors; /* true 'Qv' if test vertex neighbors at end */
538  int TRACElevel; /* 'Tn' conditional IStracing level */
539  int TRACElastrun; /* qh.TRACElevel applies to last qh.RERUN */
540  int TRACEpoint; /* 'TPn' start tracing when point n is a vertex */
541  realT TRACEdist; /* 'TWn' start tracing when merge distance too big */
542  int TRACEmerge; /* 'TMn' start tracing before this merge */
543  boolT TRIangulate; /* true 'Qt' if triangulate non-simplicial facets */
544  boolT TRInormals; /* true 'Q11' if triangulate duplicates ->normal and ->center (sets Qt) */
545  boolT UPPERdelaunay; /* true 'Qu' if computing furthest-site Delaunay */
546  boolT USEstdout; /* true 'Tz' if using stdout instead of stderr */
547  boolT VERIFYoutput; /* true 'Tv' if verify output at end of qhull */
548  boolT VIRTUALmemory; /* true 'Q7' if depth-first processing in buildhull */
549  boolT VORONOI; /* true 'v' if computing Voronoi diagram */
550 
551  /*--------input constants ---------*/
552  realT AREAfactor; /* 1/(hull_dim-1)! for converting det's to area */
553  boolT DOcheckmax; /* true if calling qh_check_maxout (qhT *qh, qh_initqhull_globals) */
554  char *feasible_string; /* feasible point 'Hn,n,n' for halfspace intersection */
555  coordT *feasible_point; /* as coordinates, both malloc'd */
556  boolT GETarea; /* true 'Fa', 'FA', 'FS', 'PAn', 'PFn' if compute facet area/Voronoi volume in io_r.c */
557  boolT KEEPnearinside; /* true if near-inside points in coplanarset */
558  int hull_dim; /* dimension of hull, set by initbuffers */
559  int input_dim; /* dimension of input, set by initbuffers */
560  int num_points; /* number of input points */
561  pointT *first_point; /* array of input points, see POINTSmalloc */
562  boolT POINTSmalloc; /* true if qh.first_point/num_points allocated */
563  pointT *input_points; /* copy of original qh.first_point for input points for qh_joggleinput */
564  boolT input_malloc; /* true if qh.input_points malloc'd */
565  char qhull_command[256];/* command line that invoked this program */
566  int qhull_commandsiz2; /* size of qhull_command at qh_clear_outputflags */
567  char rbox_command[256]; /* command line that produced the input points */
568  char qhull_options[512];/* descriptive list of options */
569  int qhull_optionlen; /* length of last line */
570  int qhull_optionsiz; /* size of qhull_options at qh_build_withrestart */
571  int qhull_optionsiz2; /* size of qhull_options at qh_clear_outputflags */
572  int run_id; /* non-zero, random identifier for this instance of qhull */
573  boolT VERTEXneighbors; /* true if maintaining vertex neighbors */
574  boolT ZEROcentrum; /* true if 'C-0' or 'C-0 Qx'. sets ZEROall_ok */
575  realT *upper_threshold; /* don't print if facet->normal[k]>=upper_threshold[k]
576  must set either GOODthreshold or SPLITthreshold
577  if Delaunay, default is 0.0 for upper envelope */
578  realT *lower_threshold; /* don't print if facet->normal[k] <=lower_threshold[k] */
579  realT *upper_bound; /* scale point[k] to new upper bound */
580  realT *lower_bound; /* scale point[k] to new lower bound
581  project if both upper_ and lower_bound == 0 */
582 
583 /*-<a href="qh-globa_r.htm#TOC"
584  >--------------------------------</a><a name="qh-prec">-</a>
585 
586  qh precision constants
587  precision constants for Qhull
588 
589  notes:
590  qh_detroundoff(qh) computes the maximum roundoff error for distance
591  and other computations. It also sets default values for the
592  qh constants above.
593 */
594  realT ANGLEround; /* max round off error for angles */
595  realT centrum_radius; /* max centrum radius for convexity (roundoff added) */
596  realT cos_max; /* max cosine for convexity (roundoff added) */
597  realT DISTround; /* max round off error for distances, 'E' overrides qh_distround() */
598  realT MAXabs_coord; /* max absolute coordinate */
599  realT MAXlastcoord; /* max last coordinate for qh_scalelast */
600  realT MAXsumcoord; /* max sum of coordinates */
601  realT MAXwidth; /* max rectilinear width of point coordinates */
602  realT MINdenom_1; /* min. abs. value for 1/x */
603  realT MINdenom; /* use divzero if denominator < MINdenom */
604  realT MINdenom_1_2; /* min. abs. val for 1/x that allows normalization */
605  realT MINdenom_2; /* use divzero if denominator < MINdenom_2 */
606  realT MINlastcoord; /* min. last coordinate for qh_scalelast */
607  boolT NARROWhull; /* set in qh_initialhull if angle < qh_MAXnarrow */
608  realT *NEARzero; /* hull_dim array for near zero in gausselim */
609  realT NEARinside; /* keep points for qh_check_maxout if close to facet */
610  realT ONEmerge; /* max distance for merging simplicial facets */
611  realT outside_err; /* application's epsilon for coplanar points
612  qh_check_bestdist() qh_check_points() reports error if point outside */
613  realT WIDEfacet; /* size of wide facet for skipping ridge in
614  area computation and locking centrum */
615 
616 /*-<a href="qh-globa_r.htm#TOC"
617  >--------------------------------</a><a name="qh-codetern">-</a>
618 
619  qh internal constants
620  internal constants for Qhull
621 */
622  char qhull[sizeof("qhull")]; /* "qhull" for checking ownership while debugging */
623  jmp_buf errexit; /* exit label for qh_errexit, defined by setjmp() and NOerrexit */
624  char jmpXtra[40]; /* extra bytes in case jmp_buf is defined wrong by compiler */
625  jmp_buf restartexit; /* restart label for qh_errexit, defined by setjmp() and ALLOWrestart */
626  char jmpXtra2[40]; /* extra bytes in case jmp_buf is defined wrong by compiler*/
627  FILE *fin; /* pointer to input file, init by qh_initqhull_start */
628  FILE *fout; /* pointer to output file */
629  FILE *ferr; /* pointer to error file */
630  pointT *interior_point; /* center point of the initial simplex*/
631  int normal_size; /* size in bytes for facet normals and point coords*/
632  int center_size; /* size in bytes for Voronoi centers */
633  int TEMPsize; /* size for small, temporary sets (in quick mem) */
634 
635 /*-<a href="qh-globa_r.htm#TOC"
636  >--------------------------------</a><a name="qh-lists">-</a>
637 
638  qh facet and vertex lists
639  defines lists of facets, new facets, visible facets, vertices, and
640  new vertices. Includes counts, next ids, and trace ids.
641  see:
642  qh_resetlists()
643 */
644  facetT *facet_list; /* first facet */
645  facetT *facet_tail; /* end of facet_list (dummy facet) */
646  facetT *facet_next; /* next facet for buildhull()
647  previous facets do not have outside sets
648  NARROWhull: previous facets may have coplanar outside sets for qh_outcoplanar */
649  facetT *newfacet_list; /* list of new facets to end of facet_list */
650  facetT *visible_list; /* list of visible facets preceding newfacet_list,
651  facet->visible set */
652  int num_visible; /* current number of visible facets */
653  unsigned tracefacet_id; /* set at init, then can print whenever */
654  facetT *tracefacet; /* set in newfacet/mergefacet, undone in delfacet*/
655  unsigned tracevertex_id; /* set at buildtracing, can print whenever */
656  vertexT *tracevertex; /* set in newvertex, undone in delvertex*/
657  vertexT *vertex_list; /* list of all vertices, to vertex_tail */
658  vertexT *vertex_tail; /* end of vertex_list (dummy vertex) */
659  vertexT *newvertex_list; /* list of vertices in newfacet_list, to vertex_tail
660  all vertices have 'newlist' set */
661  int num_facets; /* number of facets in facet_list
662  includes visible faces (num_visible) */
663  int num_vertices; /* number of vertices in facet_list */
664  int num_outside; /* number of points in outsidesets (for tracing and RANDOMoutside)
665  includes coplanar outsideset points for NARROWhull/qh_outcoplanar() */
666  int num_good; /* number of good facets (after findgood_all) */
667  unsigned facet_id; /* ID of next, new facet from newfacet() */
668  unsigned ridge_id; /* ID of next, new ridge from newridge() */
669  unsigned vertex_id; /* ID of next, new vertex from newvertex() */
670 
671 /*-<a href="qh-globa_r.htm#TOC"
672  >--------------------------------</a><a name="qh-var">-</a>
673 
674  qh global variables
675  defines minimum and maximum distances, next visit ids, several flags,
676  and other global variables.
677  initialize in qh_initbuild or qh_maxmin if used in qh_buildhull
678 */
679  unsigned long hulltime; /* ignore time to set up input and randomize */
680  /* use unsigned to avoid wrap-around errors */
681  boolT ALLOWrestart; /* true if qh_precision can use qh.restartexit */
682  int build_cnt; /* number of calls to qh_initbuild */
683  qh_CENTER CENTERtype; /* current type of facet->center, qh_CENTER */
684  int furthest_id; /* pointid of furthest point, for tracing */
685  facetT *GOODclosest; /* closest facet to GOODthreshold in qh_findgood */
686  boolT hasAreaVolume; /* true if totarea, totvol was defined by qh_getarea */
687  boolT hasTriangulation; /* true if triangulation created by qh_triangulate */
688  realT JOGGLEmax; /* set 'QJn' if randomly joggle input */
689  boolT maxoutdone; /* set qh_check_maxout(), cleared by qh_addpoint() */
690  realT max_outside; /* maximum distance from a point to a facet,
691  before roundoff, not simplicial vertices
692  actual outer plane is +DISTround and
693  computed outer plane is +2*DISTround */
694  realT max_vertex; /* maximum distance (>0) from vertex to a facet,
695  before roundoff, due to a merge */
696  realT min_vertex; /* minimum distance (<0) from vertex to a facet,
697  before roundoff, due to a merge
698  if qh.JOGGLEmax, qh_makenewplanes sets it
699  recomputed if qh.DOcheckmax, default -qh.DISTround */
700  boolT NEWfacets; /* true while visible facets invalid due to new or merge
701  from makecone/attachnewfacets to deletevisible */
702  boolT findbestnew; /* true if partitioning calls qh_findbestnew */
703  boolT findbest_notsharp; /* true if new facets are at least 90 degrees */
704  boolT NOerrexit; /* true if qh.errexit is not available, cleared after setjmp */
705  realT PRINTcradius; /* radius for printing centrums */
706  realT PRINTradius; /* radius for printing vertex spheres and points */
707  boolT POSTmerging; /* true when post merging */
708  int printoutvar; /* temporary variable for qh_printbegin, etc. */
709  int printoutnum; /* number of facets printed */
710  boolT QHULLfinished; /* True after qhull() is finished */
711  realT totarea; /* 'FA': total facet area computed by qh_getarea, hasAreaVolume */
712  realT totvol; /* 'FA': total volume computed by qh_getarea, hasAreaVolume */
713  unsigned int visit_id; /* unique ID for searching neighborhoods, */
714  unsigned int vertex_visit; /* unique ID for searching vertices, reset with qh_buildtracing */
715  boolT ZEROall_ok; /* True if qh_checkzero always succeeds */
716  boolT WAScoplanar; /* True if qh_partitioncoplanar (qhT *qh, qh_check_maxout) */
717 
718 /*-<a href="qh-globa_r.htm#TOC"
719  >--------------------------------</a><a name="qh-set">-</a>
720 
721  qh global sets
722  defines sets for merging, initial simplex, hashing, extra input points,
723  and deleted vertices
724 */
725  setT *facet_mergeset; /* temporary set of merges to be done */
726  setT *degen_mergeset; /* temporary set of degenerate and redundant merges */
727  setT *hash_table; /* hash table for matching ridges in qh_matchfacets
728  size is setsize() */
729  setT *other_points; /* additional points */
730  setT *del_vertices; /* vertices to partition and delete with visible
731  facets. Have deleted set for checkfacet */
732 
733 /*-<a href="qh-globa_r.htm#TOC"
734  >--------------------------------</a><a name="qh-buf">-</a>
735 
736  qh global buffers
737  defines buffers for maxtrix operations, input, and error messages
738 */
739  coordT *gm_matrix; /* (dim+1)Xdim matrix for geom_r.c */
740  coordT **gm_row; /* array of gm_matrix rows */
741  char* line; /* malloc'd input line of maxline+1 chars */
742  int maxline;
743  coordT *half_space; /* malloc'd input array for halfspace (qh.normal_size+coordT) */
744  coordT *temp_malloc; /* malloc'd input array for points */
745 
746 /*-<a href="qh-globa_r.htm#TOC"
747  >--------------------------------</a><a name="qh-static">-</a>
748 
749  qh static variables
750  defines static variables for individual functions
751 
752  notes:
753  do not use 'static' within a function. Multiple instances of qhull
754  may exist.
755 
756  do not assume zero initialization, 'QPn' may cause a restart
757 */
758  boolT ERREXITcalled; /* true during qh_errexit (qhT *qh, prevents duplicate calls */
759  boolT firstcentrum; /* for qh_printcentrum */
760  boolT old_randomdist; /* save RANDOMdist flag during io, tracing, or statistics */
761  setT *coplanarfacetset; /* set of coplanar facets for searching qh_findbesthorizon() */
762  realT last_low; /* qh_scalelast parameters for qh_setdelaunay */
763  realT last_high;
764  realT last_newhigh;
765  unsigned lastreport; /* for qh_buildtracing */
766  int mergereport; /* for qh_tracemerging */
767  setT *old_tempstack; /* for saving qh->qhmem.tempstack in save_qhull */
768  int ridgeoutnum; /* number of ridges for 4OFF output (qh_printbegin,etc) */
769 
770 /*-<a href="qh-globa_r.htm#TOC"
771  >--------------------------------</a><a name="qh-const">-</a>
772 
773  qh memory management, rbox globals, and statistics
774 
775  Replaces global data structures defined for libqhull
776 */
777  int last_random; /* Last random number from qh_rand (random_r.c) */
778  jmp_buf rbox_errexit; /* errexit from rboxlib_r.c, defined by qh_rboxpoints() only */
779  char jmpXtra3[40]; /* extra bytes in case jmp_buf is defined wrong by compiler */
782  void * cpp_object; /* C++ pointer. Currently used by RboxPoints.qh_fprintf_rbox */
783 
784  /* Last, otherwise zero'd by qh_initqhull_start2 (global_r.c */
785  qhmemT qhmem; /* Qhull managed memory (mem_r.h) */
786  /* After qhmem because its size depends on the number of statistics */
787  qhstatT qhstat; /* Qhull statistics (stat_r.h) */
788 };
789 
790 /*=========== -macros- =========================*/
791 
792 /*-<a href="qh-poly_r.htm#TOC"
793  >--------------------------------</a><a name="otherfacet_">-</a>
794 
795  otherfacet_(ridge, facet)
796  return neighboring facet for a ridge in facet
797 */
798 #define otherfacet_(ridge, facet) \
799  (((ridge)->top == (facet)) ? (ridge)->bottom : (ridge)->top)
800 
801 /*-<a href="qh-poly_r.htm#TOC"
802  >--------------------------------</a><a name="getid_">-</a>
803 
804  getid_(p)
805  return int ID for facet, ridge, or vertex
806  return qh_IDunknown(-1) if NULL
807 */
808 #define getid_(p) ((p) ? (int)((p)->id) : qh_IDunknown)
809 
810 /*============== FORALL macros ===================*/
811 
812 /*-<a href="qh-poly_r.htm#TOC"
813  >--------------------------------</a><a name="FORALLfacets">-</a>
814 
815  FORALLfacets { ... }
816  assign 'facet' to each facet in qh.facet_list
817 
818  notes:
819  uses 'facetT *facet;'
820  assumes last facet is a sentinel
821  assumes qh defined
822 
823  see:
824  FORALLfacet_( facetlist )
825 */
826 #define FORALLfacets for (facet=qh->facet_list;facet && facet->next;facet=facet->next)
827 
828 /*-<a href="qh-poly_r.htm#TOC"
829  >--------------------------------</a><a name="FORALLpoints">-</a>
830 
831  FORALLpoints { ... }
832  assign 'point' to each point in qh.first_point, qh.num_points
833 
834  notes:
835  assumes qh defined
836 
837  declare:
838  coordT *point, *pointtemp;
839 */
840 #define FORALLpoints FORALLpoint_(qh, qh->first_point, qh->num_points)
841 
842 /*-<a href="qh-poly_r.htm#TOC"
843  >--------------------------------</a><a name="FORALLpoint_">-</a>
844 
845  FORALLpoint_( qh, points, num) { ... }
846  assign 'point' to each point in points array of num points
847 
848  declare:
849  coordT *point, *pointtemp;
850 */
851 #define FORALLpoint_(qh, points, num) for (point= (points), \
852  pointtemp= (points)+qh->hull_dim*(num); point < pointtemp; point += qh->hull_dim)
853 
854 /*-<a href="qh-poly_r.htm#TOC"
855  >--------------------------------</a><a name="FORALLvertices">-</a>
856 
857  FORALLvertices { ... }
858  assign 'vertex' to each vertex in qh.vertex_list
859 
860  declare:
861  vertexT *vertex;
862 
863  notes:
864  assumes qh.vertex_list terminated with a sentinel
865  assumes qh defined
866 */
867 #define FORALLvertices for (vertex=qh->vertex_list;vertex && vertex->next;vertex= vertex->next)
868 
869 /*-<a href="qh-poly_r.htm#TOC"
870  >--------------------------------</a><a name="FOREACHfacet_">-</a>
871 
872  FOREACHfacet_( facets ) { ... }
873  assign 'facet' to each facet in facets
874 
875  declare:
876  facetT *facet, **facetp;
877 
878  see:
879  <a href="qset_r.h#FOREACHsetelement_">FOREACHsetelement_</a>
880 */
881 #define FOREACHfacet_(facets) FOREACHsetelement_(facetT, facets, facet)
882 
883 /*-<a href="qh-poly_r.htm#TOC"
884  >--------------------------------</a><a name="FOREACHneighbor_">-</a>
885 
886  FOREACHneighbor_( facet ) { ... }
887  assign 'neighbor' to each neighbor in facet->neighbors
888 
889  FOREACHneighbor_( vertex ) { ... }
890  assign 'neighbor' to each neighbor in vertex->neighbors
891 
892  declare:
893  facetT *neighbor, **neighborp;
894 
895  see:
896  <a href="qset_r.h#FOREACHsetelement_">FOREACHsetelement_</a>
897 */
898 #define FOREACHneighbor_(facet) FOREACHsetelement_(facetT, facet->neighbors, neighbor)
899 
900 /*-<a href="qh-poly_r.htm#TOC"
901  >--------------------------------</a><a name="FOREACHpoint_">-</a>
902 
903  FOREACHpoint_( points ) { ... }
904  assign 'point' to each point in points set
905 
906  declare:
907  pointT *point, **pointp;
908 
909  see:
910  <a href="qset_r.h#FOREACHsetelement_">FOREACHsetelement_</a>
911 */
912 #define FOREACHpoint_(points) FOREACHsetelement_(pointT, points, point)
913 
914 /*-<a href="qh-poly_r.htm#TOC"
915  >--------------------------------</a><a name="FOREACHridge_">-</a>
916 
917  FOREACHridge_( ridges ) { ... }
918  assign 'ridge' to each ridge in ridges set
919 
920  declare:
921  ridgeT *ridge, **ridgep;
922 
923  see:
924  <a href="qset_r.h#FOREACHsetelement_">FOREACHsetelement_</a>
925 */
926 #define FOREACHridge_(ridges) FOREACHsetelement_(ridgeT, ridges, ridge)
927 
928 /*-<a href="qh-poly_r.htm#TOC"
929  >--------------------------------</a><a name="FOREACHvertex_">-</a>
930 
931  FOREACHvertex_( vertices ) { ... }
932  assign 'vertex' to each vertex in vertices set
933 
934  declare:
935  vertexT *vertex, **vertexp;
936 
937  see:
938  <a href="qset_r.h#FOREACHsetelement_">FOREACHsetelement_</a>
939 */
940 #define FOREACHvertex_(vertices) FOREACHsetelement_(vertexT, vertices,vertex)
941 
942 /*-<a href="qh-poly_r.htm#TOC"
943  >--------------------------------</a><a name="FOREACHfacet_i_">-</a>
944 
945  FOREACHfacet_i_( qh, facets ) { ... }
946  assign 'facet' and 'facet_i' for each facet in facets set
947 
948  declare:
949  facetT *facet;
950  int facet_n, facet_i;
951 
952  see:
953  <a href="qset_r.h#FOREACHsetelement_i_">FOREACHsetelement_i_</a>
954 */
955 #define FOREACHfacet_i_(qh, facets) FOREACHsetelement_i_(qh, facetT, facets, facet)
956 
957 /*-<a href="qh-poly_r.htm#TOC"
958  >--------------------------------</a><a name="FOREACHneighbor_i_">-</a>
959 
960  FOREACHneighbor_i_( qh, facet ) { ... }
961  assign 'neighbor' and 'neighbor_i' for each neighbor in facet->neighbors
962 
963  FOREACHneighbor_i_( qh, vertex ) { ... }
964  assign 'neighbor' and 'neighbor_i' for each neighbor in vertex->neighbors
965 
966  declare:
967  facetT *neighbor;
968  int neighbor_n, neighbor_i;
969 
970  see:
971  <a href="qset_r.h#FOREACHsetelement_i_">FOREACHsetelement_i_</a>
972 */
973 #define FOREACHneighbor_i_(qh, facet) FOREACHsetelement_i_(qh, facetT, facet->neighbors, neighbor)
974 
975 /*-<a href="qh-poly_r.htm#TOC"
976  >--------------------------------</a><a name="FOREACHpoint_i_">-</a>
977 
978  FOREACHpoint_i_( qh, points ) { ... }
979  assign 'point' and 'point_i' for each point in points set
980 
981  declare:
982  pointT *point;
983  int point_n, point_i;
984 
985  see:
986  <a href="qset_r.h#FOREACHsetelement_i_">FOREACHsetelement_i_</a>
987 */
988 #define FOREACHpoint_i_(qh, points) FOREACHsetelement_i_(qh, pointT, points, point)
989 
990 /*-<a href="qh-poly_r.htm#TOC"
991  >--------------------------------</a><a name="FOREACHridge_i_">-</a>
992 
993  FOREACHridge_i_( qh, ridges ) { ... }
994  assign 'ridge' and 'ridge_i' for each ridge in ridges set
995 
996  declare:
997  ridgeT *ridge;
998  int ridge_n, ridge_i;
999 
1000  see:
1001  <a href="qset_r.h#FOREACHsetelement_i_">FOREACHsetelement_i_</a>
1002 */
1003 #define FOREACHridge_i_(qh, ridges) FOREACHsetelement_i_(qh, ridgeT, ridges, ridge)
1004 
1005 /*-<a href="qh-poly_r.htm#TOC"
1006  >--------------------------------</a><a name="FOREACHvertex_i_">-</a>
1007 
1008  FOREACHvertex_i_( qh, vertices ) { ... }
1009  assign 'vertex' and 'vertex_i' for each vertex in vertices set
1010 
1011  declare:
1012  vertexT *vertex;
1013  int vertex_n, vertex_i;
1014 
1015  see:
1016  <a href="qset_r.h#FOREACHsetelement_i_">FOREACHsetelement_i_</a>
1017 */
1018 #define FOREACHvertex_i_(qh, vertices) FOREACHsetelement_i_(qh, vertexT, vertices,vertex)
1019 
1020 /********* -libqhull_r.c prototypes (duplicated from qhull_ra.h) **********************/
1021 
1022 void qh_qhull(qhT *qh);
1023 boolT qh_addpoint(qhT *qh, pointT *furthest, facetT *facet, boolT checkdist);
1024 void qh_printsummary(qhT *qh, FILE *fp);
1025 
1026 /********* -user.c prototypes (alphabetical) **********************/
1027 
1028 void qh_errexit(qhT *qh, int exitcode, facetT *facet, ridgeT *ridge);
1029 void qh_errprint(qhT *qh, const char* string, facetT *atfacet, facetT *otherfacet, ridgeT *atridge, vertexT *atvertex);
1030 int qh_new_qhull(qhT *qh, int dim, int numpoints, coordT *points, boolT ismalloc,
1031  char *qhull_cmd, FILE *outfile, FILE *errfile);
1032 void qh_printfacetlist(qhT *qh, facetT *facetlist, setT *facets, boolT printall);
1033 void qh_printhelp_degenerate(qhT *qh, FILE *fp);
1034 void qh_printhelp_narrowhull(qhT *qh, FILE *fp, realT minangle);
1035 void qh_printhelp_singular(qhT *qh, FILE *fp);
1036 void qh_user_memsizes(qhT *qh);
1037 
1038 /********* -usermem_r.c prototypes (alphabetical) **********************/
1039 void qh_exit(int exitcode);
1040 void qh_fprintf_stderr(int msgcode, const char *fmt, ... );
1041 void qh_free(void *mem);
1042 void *qh_malloc(size_t size);
1043 
1044 /********* -userprintf_r.c and userprintf_rbox_r.c prototypes **********************/
1045 void qh_fprintf(qhT *qh, FILE *fp, int msgcode, const char *fmt, ... );
1046 void qh_fprintf_rbox(qhT *qh, FILE *fp, int msgcode, const char *fmt, ... );
1047 
1048 /***** -geom_r.c/geom2_r.c/random_r.c prototypes (duplicated from geom_r.h, random_r.h) ****************/
1049 
1050 facetT *qh_findbest(qhT *qh, pointT *point, facetT *startfacet,
1051  boolT bestoutside, boolT newfacets, boolT noupper,
1052  realT *dist, boolT *isoutside, int *numpart);
1053 facetT *qh_findbestnew(qhT *qh, pointT *point, facetT *startfacet,
1054  realT *dist, boolT bestoutside, boolT *isoutside, int *numpart);
1055 boolT qh_gram_schmidt(qhT *qh, int dim, realT **rows);
1056 void qh_outerinner(qhT *qh, facetT *facet, realT *outerplane, realT *innerplane);
1057 void qh_printsummary(qhT *qh, FILE *fp);
1058 void qh_projectinput(qhT *qh);
1059 void qh_randommatrix(qhT *qh, realT *buffer, int dim, realT **row);
1060 void qh_rotateinput(qhT *qh, realT **rows);
1061 void qh_scaleinput(qhT *qh);
1062 void qh_setdelaunay(qhT *qh, int dim, int count, pointT *points);
1063 coordT *qh_sethalfspace_all(qhT *qh, int dim, int count, coordT *halfspaces, pointT *feasible);
1064 
1065 /***** -global_r.c prototypes (alphabetical) ***********************/
1066 
1067 unsigned long qh_clock(qhT *qh);
1068 void qh_checkflags(qhT *qh, char *command, char *hiddenflags);
1069 void qh_clear_outputflags(qhT *qh);
1070 void qh_freebuffers(qhT *qh);
1071 void qh_freeqhull(qhT *qh, boolT allmem);
1072 void qh_init_A(qhT *qh, FILE *infile, FILE *outfile, FILE *errfile, int argc, char *argv[]);
1073 void qh_init_B(qhT *qh, coordT *points, int numpoints, int dim, boolT ismalloc);
1074 void qh_init_qhull_command(qhT *qh, int argc, char *argv[]);
1075 void qh_initbuffers(qhT *qh, coordT *points, int numpoints, int dim, boolT ismalloc);
1076 void qh_initflags(qhT *qh, char *command);
1077 void qh_initqhull_buffers(qhT *qh);
1078 void qh_initqhull_globals(qhT *qh, coordT *points, int numpoints, int dim, boolT ismalloc);
1079 void qh_initqhull_mem(qhT *qh);
1081 void qh_initqhull_start(qhT *qh, FILE *infile, FILE *outfile, FILE *errfile);
1082 void qh_initqhull_start2(qhT *qh, FILE *infile, FILE *outfile, FILE *errfile);
1083 void qh_initthresholds(qhT *qh, char *command);
1084 void qh_lib_check(int qhullLibraryType, int qhTsize, int vertexTsize, int ridgeTsize, int facetTsize, int setTsize, int qhmemTsize);
1085 void qh_option(qhT *qh, const char *option, int *i, realT *r);
1086 void qh_zero(qhT *qh, FILE *errfile);
1087 
1088 /***** -io_r.c prototypes (duplicated from io_r.h) ***********************/
1089 
1090 void qh_dfacet(qhT *qh, unsigned id);
1091 void qh_dvertex(qhT *qh, unsigned id);
1092 void qh_printneighborhood(qhT *qh, FILE *fp, qh_PRINT format, facetT *facetA, facetT *facetB, boolT printall);
1093 void qh_produce_output(qhT *qh);
1094 coordT *qh_readpoints(qhT *qh, int *numpoints, int *dimension, boolT *ismalloc);
1095 
1096 
1097 /********* -mem_r.c prototypes (duplicated from mem_r.h) **********************/
1098 
1099 void qh_meminit(qhT *qh, FILE *ferr);
1100 void qh_memfreeshort(qhT *qh, int *curlong, int *totlong);
1101 
1102 /********* -poly_r.c/poly2_r.c prototypes (duplicated from poly_r.h) **********************/
1103 
1104 void qh_check_output(qhT *qh);
1105 void qh_check_points(qhT *qh);
1106 setT *qh_facetvertices(qhT *qh, facetT *facetlist, setT *facets, boolT allfacets);
1107 facetT *qh_findbestfacet(qhT *qh, pointT *point, boolT bestoutside,
1108  realT *bestdist, boolT *isoutside);
1109 vertexT *qh_nearvertex(qhT *qh, facetT *facet, pointT *point, realT *bestdistp);
1110 pointT *qh_point(qhT *qh, int id);
1111 setT *qh_pointfacet(qhT *qh /*qh.facet_list*/);
1112 int qh_pointid(qhT *qh, pointT *point);
1113 setT *qh_pointvertex(qhT *qh /*qh.facet_list*/);
1114 void qh_setvoronoi_all(qhT *qh);
1115 void qh_triangulate(qhT *qh /*qh.facet_list*/);
1116 
1117 /********* -rboxpoints_r.c prototypes **********************/
1118 int qh_rboxpoints(qhT *qh, char* rbox_command);
1119 void qh_errexit_rbox(qhT *qh, int exitcode);
1120 
1121 /********* -stat_r.c prototypes (duplicated from stat_r.h) **********************/
1122 
1123 void qh_collectstatistics(qhT *qh);
1124 void qh_printallstatistics(qhT *qh, FILE *fp, const char *string);
1125 
1126 #endif /* qhDEFlibqhull */
Definition: libqhull.h:465
void qh_setdelaunay(qhT *qh, int dim, int count, pointT *points)
Definition: geom2_r.c:1808
flagT newfacet
Definition: libqhull.h:320
#define flagT
Definition: libqhull_r.h:97
void qh_free(void *mem)
Definition: usermem.c:77
void qh_dfacet(qhT *qh, unsigned id)
Definition: io_r.c:91
flagT notfurthest
Definition: libqhull.h:329
void qh_rotateinput(qhT *qh, realT **rows)
Definition: geom2_r.c:1586
void qh_initqhull_mem(qhT *qh)
Definition: global_r.c:1657
setT * neighbors
Definition: libqhull.h:299
Definition: qset.h:83
qhstatT qhstat
Definition: libqhull_r.h:787
coordT * center
Definition: libqhull.h:286
#define coordT
Definition: libqhull_r.h:68
facetT * qh_findbestnew(qhT *qh, pointT *point, facetT *startfacet, realT *dist, boolT bestoutside, boolT *isoutside, int *numpart)
Definition: geom_r.c:412
void qh_initbuffers(qhT *qh, coordT *points, int numpoints, int dim, boolT ismalloc)
void qh_checkflags(qhT *qh, char *command, char *hiddenflags)
Definition: global_r.c:78
void qh_printhelp_narrowhull(qhT *qh, FILE *fp, realT minangle)
Definition: user_r.c:410
#define pointT
Definition: libqhull_r.h:84
int qh_rboxpoints(qhT *qh, char *rbox_command)
Definition: rboxlib_r.c:72
void qh_fprintf_stderr(int msgcode, const char *fmt,...)
Definition: usermem.c:57
flagT mergehorizon
Definition: libqhull.h:341
facetT * newcycle
Definition: libqhull.h:282
facetT * qh_findbestfacet(qhT *qh, pointT *point, boolT bestoutside, realT *bestdist, boolT *isoutside)
Definition: poly2_r.c:1239
qh_pointT
Definition: libqhull_r.h:85
Definition: mem.h:116
void qh_outerinner(qhT *qh, facetT *facet, realT *outerplane, realT *innerplane)
Definition: geom2_r.c:1280
facetT * previous
Definition: libqhull.h:293
void qh_initqhull_buffers(qhT *qh)
Definition: global_r.c:1415
jmp_buf rbox_errexit
Definition: libqhull_r.h:778
double rbox_out_offset
Definition: libqhull_r.h:781
setT * coplanarset
Definition: libqhull.h:305
void qh_scaleinput(qhT *qh)
Definition: geom2_r.c:1648
void qh_initqhull_outputflags(qhT *qh)
Definition: global_r.c:1695
void qh_freeqhull(qhT *qh, boolT allmem)
Definition: global_r.c:431
void qh_fprintf(qhT *qh, FILE *fp, int msgcode, const char *fmt,...)
Definition: userprintf_r.c:41
void qh_user_memsizes(qhT *qh)
Definition: user_r.c:518
void qh_init_qhull_command(qhT *qh, int argc, char *argv[])
Definition: global_r.c:548
setT * ridges
Definition: libqhull.h:297
void qh_lib_check(int qhullLibraryType, int qhTsize, int vertexTsize, int ridgeTsize, int facetTsize, int setTsize, int qhmemTsize)
Definition: global.c:2039
bottom
Definition: obb.py:82
void qh_initqhull_start2(qhT *qh, FILE *infile, FILE *outfile, FILE *errfile)
Definition: global_r.c:1819
boolT qh_addpoint(qhT *qh, pointT *furthest, facetT *facet, boolT checkdist)
Definition: libqhull_r.c:168
unsigned visitid
Definition: libqhull.h:309
setT * vertices
Definition: libqhull.h:295
void qh_errexit(qhT *qh, int exitcode, facetT *facet, ridgeT *ridge)
Definition: user_r.c:200
pointT * qh_point(qhT *qh, int id)
Definition: poly2_r.c:2446
void qh_printhelp_singular(qhT *qh, FILE *fp)
Definition: user_r.c:427
void qh_check_points(qhT *qh)
Definition: poly2_r.c:365
void qh_dvertex(qhT *qh, unsigned id)
Definition: io_r.c:109
void qh_option(qhT *qh, const char *option, int *i, realT *r)
Definition: global_r.c:2066
void * cpp_object
Definition: libqhull_r.h:782
facetT * trivisible
Definition: libqhull.h:283
flagT simplicial
Definition: libqhull.h:324
Definition: stat.h:503
setT * outsideset
Definition: libqhull.h:302
flagT tested
Definition: libqhull.h:343
setT * qh_facetvertices(qhT *qh, facetT *facetlist, setT *facets, boolT allfacets)
Definition: io_r.c:801
flagT dupridge
Definition: libqhull.h:336
void qh_collectstatistics(qhT *qh)
Definition: stat_r.c:308
unsigned nummerge
Definition: libqhull.h:312
#define qh
Definition: libqhull.h:457
void qh_produce_output(qhT *qh)
Definition: io_r.c:39
flagT redundant
Definition: libqhull.h:347
void qh_meminit(qhT *qh, FILE *ferr)
Definition: mem_r.c:303
const char qh_version2[]
Definition: global.c:51
flagT upperdelaunay
Definition: libqhull.h:328
int last_random
Definition: libqhull_r.h:777
unsigned long qh_clock(qhT *qh)
Definition: global_r.c:231
flagT flipped
Definition: libqhull.h:327
void qh_setvoronoi_all(qhT *qh)
Definition: poly2_r.c:2735
void qh_freebuffers(qhT *qh)
Definition: global_r.c:268
int qh_pointid(qhT *qh, pointT *point)
Definition: poly_r.c:1053
flagT mergeridge2
Definition: libqhull.h:339
qh_PRINT
Definition: libqhull.h:161
void qh_memfreeshort(qhT *qh, int *curlong, int *totlong)
Definition: mem_r.c:274
coordT maxoutside
Definition: libqhull.h:267
void qh_exit(int exitcode)
Definition: usermem.c:38
flagT isarea
Definition: libqhull.h:333
void qh_projectinput(qhT *qh)
Definition: geom2_r.c:1426
facetT * samecycle
Definition: libqhull.h:280
void qh_printhelp_degenerate(qhT *qh, FILE *fp)
Definition: user_r.c:333
void qh_initflags(qhT *qh, char *command)
Definition: global_r.c:588
void qh_clear_outputflags(qhT *qh)
Definition: global_r.c:159
flagT keepcentrum
Definition: libqhull.h:344
facetT * qh_findbest(qhT *qh, pointT *point, facetT *startfacet, boolT bestoutside, boolT newfacets, boolT noupper, realT *dist, boolT *isoutside, int *numpart)
Definition: geom_r.c:140
facetT * next
Definition: libqhull.h:294
flagT visible
Definition: libqhull.h:321
const char qh_version[]
Definition: global.c:50
void qh_triangulate(qhT *qh)
Definition: poly2_r.c:2767
flagT cycledone
Definition: libqhull.h:342
flagT newmerge
Definition: libqhull.h:345
boolT qh_gram_schmidt(qhT *qh, int dim, realT **rows)
Definition: geom2_r.c:764
void qh_printneighborhood(qhT *qh, FILE *fp, qh_PRINT format, facetT *facetA, facetT *facetB, boolT printall)
Definition: io_r.c:2809
coordT furthestdist
Definition: libqhull.h:264
facetT * replace
Definition: libqhull.h:278
qhmemT qhmem
Definition: libqhull_r.h:785
void * qh_malloc(size_t size)
Definition: usermem.c:90
flagT mergeridge
Definition: libqhull.h:337
int qh_new_qhull(qhT *qh, int dim, int numpoints, coordT *points, boolT ismalloc, char *qhull_cmd, FILE *outfile, FILE *errfile)
Definition: user_r.c:122
flagT seen2
Definition: libqhull.h:326
void qh_check_output(qhT *qh)
Definition: poly2_r.c:302
void qh_fprintf_rbox(qhT *qh, FILE *fp, int msgcode, const char *fmt,...)
qh_CENTER
Definition: libqhull_r.h:129
void qh_initthresholds(qhT *qh, char *command)
Definition: global_r.c:1893
vertexT * qh_nearvertex(qhT *qh, facetT *facet, pointT *point, realT *bestdistp)
Definition: poly2_r.c:2248
#define boolT
Definition: libqhull_r.h:109
void qh_errprint(qhT *qh, const char *string, facetT *atfacet, facetT *otherfacet, ridgeT *atridge, vertexT *atvertex)
Definition: user_r.c:264
void qh_zero(qhT *qh, FILE *errfile)
Definition: global_r.c:2095
void qh_qhull(qhT *qh)
Definition: libqhull_r.c:60
fmt
Definition: obb.py:126
flagT seen
Definition: libqhull.h:325
coordT offset
Definition: libqhull.h:273
flagT good
Definition: libqhull.h:332
coordT * qh_readpoints(qhT *qh, int *numpoints, int *dimension, boolT *ismalloc)
Definition: io_r.c:3673
setT * qh_pointvertex(qhT *qh)
Definition: poly2_r.c:2547
void qh_init_B(qhT *qh, coordT *points, int numpoints, int dim, boolT ismalloc)
Definition: global_r.c:507
void qh_printallstatistics(qhT *qh, FILE *fp, const char *string)
Definition: stat_r.c:524
qh_PRINT
Definition: libqhull_r.h:149
void qh_init_A(qhT *qh, FILE *infile, FILE *outfile, FILE *errfile, int argc, char *argv[])
Definition: global_r.c:460
void qh_errexit_rbox(qhT *qh, int exitcode)
Definition: rboxlib_r.c:838
facetT * triowner
Definition: libqhull.h:284
setT * qh_pointfacet(qhT *qh)
Definition: poly2_r.c:2510
void qh_initqhull_globals(qhT *qh, coordT *points, int numpoints, int dim, boolT ismalloc)
Definition: global_r.c:1469
flagT toporient
Definition: libqhull.h:322
qh_CENTER
Definition: libqhull.h:141
realT area
Definition: libqhull.h:277
coordT * qh_sethalfspace_all(qhT *qh, int dim, int count, coordT *halfspaces, pointT *feasible)
Definition: geom2_r.c:1920
int rbox_isinteger
Definition: libqhull_r.h:780
void qh_initqhull_start(qhT *qh, FILE *infile, FILE *outfile, FILE *errfile)
Definition: global_r.c:1800
unsigned id
Definition: libqhull.h:311
void qh_printsummary(qhT *qh, FILE *fp)
Definition: libqhull_r.c:1205
void qh_printfacetlist(qhT *qh, facetT *facetlist, setT *facets, boolT printall)
Definition: user_r.c:312
#define realT
Definition: user.h:154
flagT coplanar
Definition: libqhull.h:340
coordT * normal
Definition: libqhull.h:274
union facetT::@20 f
flagT tricoplanar
Definition: libqhull.h:314
void qh_randommatrix(qhT *qh, realT *buffer, int dim, realT **row)
Definition: random_r.c:206
flagT degenerate
Definition: libqhull.h:346


hpp-fcl
Author(s):
autogenerated on Fri Jun 2 2023 02:39:01