📄 qhull.h
字号:
> qh.min_vertex and <= facet->max_outside
a point is assigned to the furthest facet
if non-empty, last point is furthest away */
unsigned visitid; /* visit_id, for visiting all neighbors,
all uses are independent */
unsigned id; /* unique identifier from qh facet_id */
unsigned nummerge:9; /* number of merges */
#define qh_MAXnummerge 511 /* 2^9-1, 32 flags total, see "flags:" in io.c */
flagT tricoplanar:1; /* True if TRIangulate and simplicial and coplanar with a neighbor */
/* all tricoplanars share the same ->center, ->normal, ->offset, ->maxoutside */
/* all tricoplanars share the same apex */
/* if ->degenerate, does not span facet (one logical ridge) */
/* one tricoplanar has ->keepcentrum and ->coplanarset */
/* during qh_triangulate, f.trivisible points to original facet */
flagT newfacet:1; /* True if facet on qh newfacet_list (new or merged) */
flagT visible:1; /* True if visible facet (will be deleted) */
flagT toporient:1; /* True if created with top orientation
after merging, use ridge orientation */
flagT simplicial:1;/* True if simplicial facet, ->ridges may be implicit */
flagT seen:1; /* used to perform operations only once, like visitid */
flagT seen2:1; /* used to perform operations only once, like visitid */
flagT flipped:1; /* True if facet is flipped */
flagT upperdelaunay:1; /* True if facet is upper envelope of Delaunay triangulation */
flagT notfurthest:1; /* True if last point of outsideset is not furthest*/
/*-------- flags primarily for output ---------*/
flagT good:1; /* True if a facet marked good for output */
flagT isarea:1; /* True if facet->f.area is defined */
/*-------- flags for merging ------------------*/
flagT dupridge:1; /* True if duplicate ridge in facet */
flagT mergeridge:1; /* True if facet or neighbor contains a qh_MERGEridge
->normal defined (also defined for mergeridge2) */
flagT mergeridge2:1; /* True if neighbor contains a qh_MERGEridge (mark_dupridges */
flagT coplanar:1; /* True if horizon facet is coplanar at last use */
flagT mergehorizon:1; /* True if will merge into horizon (->coplanar) */
flagT cycledone:1;/* True if mergecycle_all already done */
flagT tested:1; /* True if facet convexity has been tested (false after merge */
flagT keepcentrum:1; /* True if keep old centrum after a merge, or marks owner for ->tricoplanar */
flagT newmerge:1; /* True if facet is newly merged for reducevertices */
flagT degenerate:1; /* True if facet is degenerate (degen_mergeset or ->tricoplanar) */
flagT redundant:1; /* True if facet is redundant (degen_mergeset) */
};
/*-<a href="qh-poly.htm#TOC"
>--------------------------------</a><a name="ridgeT">-</a>
ridgeT
defines a ridge
notes:
a ridge is DIM3-1 simplex between two neighboring facets. If the
facets are non-simplicial, there may be more than one ridge between
two facets. E.G. a 4-d hypercube has two triangles between each pair
of neighboring facets.
topological information:
vertices a set of vertices
top,bottom neighboring facets with orientation
geometric information:
tested True if ridge is clearly convex
nonconvex True if ridge is non-convex
*/
struct ridgeT {
setT *vertices; /* vertices belonging to this ridge, inverse sorted by ID
NULL if a degen ridge (matchsame) */
facetT *top; /* top facet this ridge is part of */
facetT *bottom; /* bottom facet this ridge is part of */
unsigned id:24; /* unique identifier, =>room for 8 flags */
flagT seen:1; /* used to perform operations only once */
flagT tested:1; /* True when ridge is tested for convexity */
flagT nonconvex:1; /* True if getmergeset detected a non-convex neighbor
only one ridge between neighbors may have nonconvex */
};
/*-<a href="qh-poly.htm#TOC"
>--------------------------------</a><a name="vertexT">-</a>
vertexT
defines a vertex
topological information:
next,previous doubly-linked list of all vertices
neighbors set of adjacent facets (only if qh.VERTEXneighbors)
geometric information:
point array of DIM3 coordinates
*/
struct vertexT {
vertexT *next; /* next vertex in vertex_list */
vertexT *previous; /* previous vertex in vertex_list */
pointT *point; /* hull_dim coordinates (coordT) */
setT *neighbors; /* neighboring facets of vertex, qh_vertexneighbors()
inits in io.c or after first merge */
unsigned visitid; /* for use with qh vertex_visit */
unsigned id:24; /* unique identifier, =>room for 8 flags */
flagT seen:1; /* used to perform operations only once */
flagT seen2:1; /* another seen flag */
flagT delridge:1; /* vertex was part of a deleted ridge */
flagT deleted:1; /* true if vertex on qh del_vertices */
flagT newlist:1; /* true if vertex on qh newvertex_list */
};
/*======= -global variables -qh ============================*/
/*-<a href="qh-globa.htm#TOC"
>--------------------------------</a><a name="qh">-</a>
qh
all global variables for qhull are in qh, qhmem, and qhstat
notes:
qhmem is defined in mem.h and qhstat is defined in stat.h
Access to qh_qh is via the "qh" macro. See qh_QHpointer in user.h
*/
typedef struct qhT qhT;
#if qh_QHpointer
#define qh qh_qh->
extern qhT *qh_qh; /* allocated in global.c */
#else
#define qh qh_qh.
extern qhT qh_qh;
#endif
struct qhT {
/*-<a href="qh-globa.htm#TOC"
>--------------------------------</a><a name="qh-const">-</a>
qh constants
configuration flags and constants for Qhull
notes:
The user configures Qhull by defining flags. They are
copied into qh by qh_setflags(). qh-quick.htm#options defines the flags.
*/
boolT ALLpoints; /* true 'Qs' if search all points for initial simplex */
boolT ANGLEmerge; /* true 'Qa' if sort potential merges by angle */
boolT APPROXhull; /* true 'Wn' if MINoutside set */
realT MINoutside; /* 'Wn' min. distance for an outside point */
boolT ATinfinity; /* true 'Qz' if point num_points-1 is "at-infinity"
for improving precision in Delaunay triangulations */
boolT AVOIDold; /* true 'Q4' if avoid old->new merges */
boolT BESToutside; /* true 'Qf' if partition points into best outsideset */
boolT CDDinput; /* true 'Pc' if input uses CDD format (1.0/offset first) */
boolT CDDoutput; /* true 'PC' if print normals in CDD format (offset first) */
boolT CHECKfrequently; /* true 'Tc' if checking frequently */
realT premerge_cos; /* 'A-n' cos_max when pre merging */
realT postmerge_cos; /* 'An' cos_max when post merging */
boolT DELAUNAY; /* true 'd' if computing DELAUNAY triangulation */
boolT DOintersections; /* true 'Gh' if print hyperplane intersections */
int DROPdim; /* drops dim 'GDn' for 4-d -> 3-d output */
boolT FORCEoutput; /* true 'Po' if forcing output despite degeneracies */
int GOODpoint; /* 1+n for 'QGn', good facet if visible/not(-) from point n*/
pointT *GOODpointp; /* the actual point */
boolT GOODthreshold; /* true if qh lower_threshold/upper_threshold defined
false if qh SPLITthreshold */
int GOODvertex; /* 1+n, good facet if vertex for point n */
pointT *GOODvertexp; /* the actual point */
boolT HALFspace; /* true 'Hn,n,n' if halfspace intersection */
int IStracing; /* trace execution, 0=none, 1=least, 4=most, -1=events */
int KEEParea; /* 'PAn' number of largest facets to keep */
boolT KEEPcoplanar; /* true 'Qc' if keeping nearest facet for coplanar points */
boolT KEEPinside; /* true 'Qi' if keeping nearest facet for inside points
set automatically if 'd Qc' */
int KEEPmerge; /* 'PMn' number of facets to keep with most merges */
realT KEEPminArea; /* 'PFn' minimum facet area to keep */
realT MAXcoplanar; /* 'Un' max distance below a facet to be coplanar*/
boolT MERGEexact; /* true 'Qx' if exact merges (coplanar, degen, dupridge, flipped) */
boolT MERGEindependent; /* true 'Q2' if merging independent sets */
boolT MERGING; /* true if exact-, pre- or post-merging, with angle and centrum tests */
realT premerge_centrum; /* 'C-n' centrum_radius when pre merging. Default is round-off */
realT postmerge_centrum; /* 'Cn' centrum_radius when post merging. Default is round-off */
boolT MERGEvertices; /* true 'Q3' if merging redundant vertices */
realT MINvisible; /* 'Vn' min. distance for a facet to be visible */
boolT NOnarrow; /* true 'Q10' if no special processing for narrow distributions */
boolT NOnearinside; /* true 'Q8' if ignore near-inside points when partitioning */
boolT NOpremerge; /* true 'Q0' if no defaults for C-0 or Qx */
boolT ONLYgood; /* true 'Qg' if process points with good visible or horizon facets */
boolT ONLYmax; /* true 'Qm' if only process points that increase max_outside */
boolT PICKfurthest; /* true 'Q9' if process furthest of furthest points*/
boolT POSTmerge; /* true if merging after buildhull (Cn or An) */
boolT PREmerge; /* true if merging during buildhull (C-n or A-n) */
/* NOTE: some of these names are similar to qh_PRINT names */
boolT PRINTcentrums; /* true 'Gc' if printing centrums */
boolT PRINTcoplanar; /* true 'Gp' if printing coplanar points */
int PRINTdim; /* print dimension for Geomview output */
boolT PRINTdots; /* true 'Ga' if printing all points as dots */
boolT PRINTgood; /* true 'Pg' if printing good facets */
boolT PRINTinner; /* true 'Gi' if printing inner planes */
boolT PRINTneighbors; /* true 'PG' if printing neighbors of good facets */
boolT PRINTnoplanes; /* true 'Gn' if printing no planes */
boolT PRINToptions1st; /* true 'FO' if printing options to stderr */
boolT PRINTouter; /* true 'Go' if printing outer planes */
boolT PRINTprecision; /* false 'Pp' if not reporting precision problems */
qh_PRINT PRINTout[qh_PRINTEND]; /* list of output formats to print */
boolT PRINTridges; /* true 'Gr' if print ridges */
boolT PRINTspheres; /* true 'Gv' if print vertices as spheres */
boolT PRINTstatistics; /* true 'Ts' if printing statistics to stderr */
boolT PRINTsummary; /* true 's' if printing summary to stderr */
boolT PRINTtransparent; /* true 'Gt' if print transparent outer ridges */
boolT PROJECTdelaunay; /* true if DELAUNAY, no readpoints() and
need projectinput() for Delaunay in qh_init_B */
int PROJECTinput; /* number of projected dimensions 'bn:0Bn:0' */
boolT QUICKhelp; /* true if quick help message for degen input */
boolT RANDOMdist; /* true if randomly change distplane and setfacetplane */
realT RANDOMfactor; /* maximum random perturbation */
realT RANDOMa; /* qh_randomfactor is randr * RANDOMa + RANDOMb */
realT RANDOMb;
boolT RANDOMoutside; /* true if select a random outside point */
int REPORTfreq; /* buildtracing reports every n facets */
int REPORTfreq2; /* tracemerging reports every REPORTfreq/2 facets */
int RERUN; /* 'TRn' rerun qhull n times (qh.build_cnt) */
int ROTATErandom; /* 'QRn' seed, 0 time, >= rotate input */
boolT SCALEinput; /* true 'Qbk' if scaling input */
boolT SCALElast; /* true 'Qbb' if scale last coord to max prev coord */
boolT SETroundoff; /* true 'E' if qh DISTround is predefined */
boolT SKIPcheckmax; /* true 'Q5' if skip qh_check_maxout */
boolT SKIPconvex; /* true 'Q6' if skip convexity testing during pre-merge */
boolT SPLITthresholds; /* true if upper_/lower_threshold defines a region
used only for printing (not for qh ONLYgood) */
int STOPcone; /* 'TCn' 1+n for stopping after cone for point n*/
/* also used by qh_build_withresart for err exit*/
int STOPpoint; /* 'TVn' 'TV-n' 1+n for stopping after/before(-)
adding point n */
int TESTpoints; /* 'QTn' num of test points after qh.num_points. Test points always coplanar. */
boolT TESTvneighbors; /* true 'Qv' if test vertex neighbors at end */
int TRACElevel; /* 'Tn' conditional IStracing level */
int TRACElastrun; /* qh.TRACElevel applies to last qh.RERUN */
int TRACEpoint; /* 'TPn' start tracing when point n is a vertex */
realT TRACEdist; /* 'TWn' start tracing when merge distance too big */
int TRACEmerge; /* 'TMn' start tracing before this merge */
boolT TRIangulate; /* true 'Qt' if triangulate non-simplicial facets */
boolT TRInormals; /* true 'Q11' if triangulate duplicates normals (sets Qt) */
boolT UPPERdelaunay; /* true 'Qu' if computing furthest-site Delaunay */
boolT VERIFYoutput; /* true 'Tv' if verify output at end of qhull */
boolT VIRTUALmemory; /* true 'Q7' if depth-first processing in buildhull */
boolT VORONOI; /* true 'v' if computing Voronoi diagram */
/*--------input constants ---------*/
realT AREAfactor; /* 1/(hull_dim-1)! for converting det's to area */
boolT DOcheckmax; /* true if calling qh_check_maxout (qh_initqhull_globals) */
char *feasible_string; /* feasible point 'Hn,n,n' for halfspace intersection */
coordT *feasible_point; /* as coordinates, both malloc'd */
boolT GETarea; /* true 'Fa', 'FA', 'FS', 'PAn', 'PFn' if compute facet area/Voronoi volume in io.c */
boolT KEEPnearinside; /* true if near-inside points in coplanarset */
int hull_dim; /* dimension of hull, set by initbuffers */
int input_dim; /* dimension of input, set by initbuffers */
int num_points; /* number of input points */
pointT *first_point; /* array of input points, see POINTSmalloc */
boolT POINTSmalloc; /* true if qh first_point/num_points allocated */
pointT *input_points; /* copy of original qh.first_point for input points for qh_joggleinput */
boolT input_malloc; /* true if qh input_points malloc'd */
char qhull_command[256];/* command line that invoked this program */
char rbox_command[256]; /* command line that produced the input points */
char qhull_options[512];/* descriptive list of options */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -