poly.h
Go to the documentation of this file.
1 /*<html><pre> -<a href="qh-poly.htm"
2  >-------------------------------</a><a name="TOP">-</a>
3 
4  poly.h
5  header file for poly.c and poly2.c
6 
7  see qh-poly.htm, libqhull.h and poly.c
8 
9  Copyright (c) 1993-2015 The Geometry Center.
10  $Id: //main/2015/qhull/src/libqhull/poly.h#3 $$Change: 2047 $
11  $DateTime: 2016/01/04 22:03:18 $$Author: bbarber $
12 */
13 
14 #ifndef qhDEFpoly
15 #define qhDEFpoly 1
16 
17 #include "libqhull.h"
18 
19 /*=============== constants ========================== */
20 
21 /*-<a href="qh-geom.htm#TOC"
22  >--------------------------------</a><a name="ALGORITHMfault">-</a>
23 
24  ALGORITHMfault
25  use as argument to checkconvex() to report errors during buildhull
26 */
27 #define qh_ALGORITHMfault 0
28 
29 /*-<a href="qh-poly.htm#TOC"
30  >--------------------------------</a><a name="DATAfault">-</a>
31 
32  DATAfault
33  use as argument to checkconvex() to report errors during initialhull
34 */
35 #define qh_DATAfault 1
36 
37 /*-<a href="qh-poly.htm#TOC"
38  >--------------------------------</a><a name="DUPLICATEridge">-</a>
39 
40  DUPLICATEridge
41  special value for facet->neighbor to indicate a duplicate ridge
42 
43  notes:
44  set by matchneighbor, used by matchmatch and mark_dupridge
45 */
46 #define qh_DUPLICATEridge (facetT *)1L
47 
48 /*-<a href="qh-poly.htm#TOC"
49  >--------------------------------</a><a name="MERGEridge">-</a>
50 
51  MERGEridge flag in facet
52  special value for facet->neighbor to indicate a merged ridge
53 
54  notes:
55  set by matchneighbor, used by matchmatch and mark_dupridge
56 */
57 #define qh_MERGEridge (facetT *)2L
58 
59 
60 /*============ -structures- ====================*/
61 
62 /*=========== -macros- =========================*/
63 
64 /*-<a href="qh-poly.htm#TOC"
65  >--------------------------------</a><a name="FORALLfacet_">-</a>
66 
67  FORALLfacet_( facetlist ) { ... }
68  assign 'facet' to each facet in facetlist
69 
70  notes:
71  uses 'facetT *facet;'
72  assumes last facet is a sentinel
73 
74  see:
75  FORALLfacets
76 */
77 #define FORALLfacet_( facetlist ) if (facetlist ) for ( facet=( facetlist ); facet && facet->next; facet= facet->next )
78 
79 /*-<a href="qh-poly.htm#TOC"
80  >--------------------------------</a><a name="FORALLnew_facets">-</a>
81 
82  FORALLnew_facets { ... }
83  assign 'newfacet' to each facet in qh.newfacet_list
84 
85  notes:
86  uses 'facetT *newfacet;'
87  at exit, newfacet==NULL
88 */
89 #define FORALLnew_facets for ( newfacet=qh newfacet_list;newfacet && newfacet->next;newfacet=newfacet->next )
90 
91 /*-<a href="qh-poly.htm#TOC"
92  >--------------------------------</a><a name="FORALLvertex_">-</a>
93 
94  FORALLvertex_( vertexlist ) { ... }
95  assign 'vertex' to each vertex in vertexlist
96 
97  notes:
98  uses 'vertexT *vertex;'
99  at exit, vertex==NULL
100 */
101 #define FORALLvertex_( vertexlist ) for (vertex=( vertexlist );vertex && vertex->next;vertex= vertex->next )
102 
103 /*-<a href="qh-poly.htm#TOC"
104  >--------------------------------</a><a name="FORALLvisible_facets">-</a>
105 
106  FORALLvisible_facets { ... }
107  assign 'visible' to each visible facet in qh.visible_list
108 
109  notes:
110  uses 'vacetT *visible;'
111  at exit, visible==NULL
112 */
113 #define FORALLvisible_facets for (visible=qh visible_list; visible && visible->visible; visible= visible->next)
114 
115 /*-<a href="qh-poly.htm#TOC"
116  >--------------------------------</a><a name="FORALLsame_">-</a>
117 
118  FORALLsame_( newfacet ) { ... }
119  assign 'same' to each facet in newfacet->f.samecycle
120 
121  notes:
122  uses 'facetT *same;'
123  stops when it returns to newfacet
124 */
125 #define FORALLsame_(newfacet) for (same= newfacet->f.samecycle; same != newfacet; same= same->f.samecycle)
126 
127 /*-<a href="qh-poly.htm#TOC"
128  >--------------------------------</a><a name="FORALLsame_cycle_">-</a>
129 
130  FORALLsame_cycle_( newfacet ) { ... }
131  assign 'same' to each facet in newfacet->f.samecycle
132 
133  notes:
134  uses 'facetT *same;'
135  at exit, same == NULL
136 */
137 #define FORALLsame_cycle_(newfacet) \
138  for (same= newfacet->f.samecycle; \
139  same; same= (same == newfacet ? NULL : same->f.samecycle))
140 
141 /*-<a href="qh-poly.htm#TOC"
142  >--------------------------------</a><a name="FOREACHneighborA_">-</a>
143 
144  FOREACHneighborA_( facet ) { ... }
145  assign 'neighborA' to each neighbor in facet->neighbors
146 
147  FOREACHneighborA_( vertex ) { ... }
148  assign 'neighborA' to each neighbor in vertex->neighbors
149 
150  declare:
151  facetT *neighborA, **neighborAp;
152 
153  see:
154  <a href="qset.h#FOREACHsetelement_">FOREACHsetelement_</a>
155 */
156 #define FOREACHneighborA_(facet) FOREACHsetelement_(facetT, facet->neighbors, neighborA)
157 
158 /*-<a href="qh-poly.htm#TOC"
159  >--------------------------------</a><a name="FOREACHvisible_">-</a>
160 
161  FOREACHvisible_( facets ) { ... }
162  assign 'visible' to each facet in facets
163 
164  notes:
165  uses 'facetT *facet, *facetp;'
166  see <a href="qset.h#FOREACHsetelement_">FOREACHsetelement_</a>
167 */
168 #define FOREACHvisible_(facets) FOREACHsetelement_(facetT, facets, visible)
169 
170 /*-<a href="qh-poly.htm#TOC"
171  >--------------------------------</a><a name="FOREACHnewfacet_">-</a>
172 
173  FOREACHnewfacet_( facets ) { ... }
174  assign 'newfacet' to each facet in facets
175 
176  notes:
177  uses 'facetT *newfacet, *newfacetp;'
178  see <a href="qset.h#FOREACHsetelement_">FOREACHsetelement_</a>
179 */
180 #define FOREACHnewfacet_(facets) FOREACHsetelement_(facetT, facets, newfacet)
181 
182 /*-<a href="qh-poly.htm#TOC"
183  >--------------------------------</a><a name="FOREACHvertexA_">-</a>
184 
185  FOREACHvertexA_( vertices ) { ... }
186  assign 'vertexA' to each vertex in vertices
187 
188  notes:
189  uses 'vertexT *vertexA, *vertexAp;'
190  see <a href="qset.h#FOREACHsetelement_">FOREACHsetelement_</a>
191 */
192 #define FOREACHvertexA_(vertices) FOREACHsetelement_(vertexT, vertices, vertexA)
193 
194 /*-<a href="qh-poly.htm#TOC"
195  >--------------------------------</a><a name="FOREACHvertexreverse12_">-</a>
196 
197  FOREACHvertexreverse12_( vertices ) { ... }
198  assign 'vertex' to each vertex in vertices
199  reverse order of first two vertices
200 
201  notes:
202  uses 'vertexT *vertex, *vertexp;'
203  see <a href="qset.h#FOREACHsetelement_">FOREACHsetelement_</a>
204 */
205 #define FOREACHvertexreverse12_(vertices) FOREACHsetelementreverse12_(vertexT, vertices, vertex)
206 
207 
208 /*=============== prototypes poly.c in alphabetical order ================*/
209 
210 void qh_appendfacet(facetT *facet);
211 void qh_appendvertex(vertexT *vertex);
212 void qh_attachnewfacets(void /* qh.visible_list, qh.newfacet_list */);
213 boolT qh_checkflipped(facetT *facet, realT *dist, boolT allerror);
214 void qh_delfacet(facetT *facet);
215 void qh_deletevisible(void /*qh.visible_list, qh.horizon_list*/);
216 setT *qh_facetintersect(facetT *facetA, facetT *facetB, int *skipAp,int *skipBp, int extra);
217 int qh_gethash(int hashsize, setT *set, int size, int firstindex, void *skipelem);
218 facetT *qh_makenewfacet(setT *vertices, boolT toporient, facetT *facet);
219 void qh_makenewplanes(void /* newfacet_list */);
220 facetT *qh_makenew_nonsimplicial(facetT *visible, vertexT *apex, int *numnew);
221 facetT *qh_makenew_simplicial(facetT *visible, vertexT *apex, int *numnew);
222 void qh_matchneighbor(facetT *newfacet, int newskip, int hashsize,
223  int *hashcount);
224 void qh_matchnewfacets(void);
225 boolT qh_matchvertices(int firstindex, setT *verticesA, int skipA,
226  setT *verticesB, int *skipB, boolT *same);
227 facetT *qh_newfacet(void);
228 ridgeT *qh_newridge(void);
229 int qh_pointid(pointT *point);
230 void qh_removefacet(facetT *facet);
231 void qh_removevertex(vertexT *vertex);
232 void qh_updatevertices(void);
233 
234 
235 /*========== -prototypes poly2.c in alphabetical order ===========*/
236 
237 void qh_addhash(void* newelem, setT *hashtable, int hashsize, int hash);
238 void qh_check_bestdist(void);
239 void qh_check_dupridge(facetT *facet1, realT dist1, facetT *facet2, realT dist2);
240 void qh_check_maxout(void);
241 void qh_check_output(void);
242 void qh_check_point(pointT *point, facetT *facet, realT *maxoutside, realT *maxdist, facetT **errfacet1, facetT **errfacet2);
243 void qh_check_points(void);
244 void qh_checkconvex(facetT *facetlist, int fault);
245 void qh_checkfacet(facetT *facet, boolT newmerge, boolT *waserrorp);
246 void qh_checkflipped_all(facetT *facetlist);
247 void qh_checkpolygon(facetT *facetlist);
248 void qh_checkvertex(vertexT *vertex);
250 void qh_createsimplex(setT *vertices);
251 void qh_delridge(ridgeT *ridge);
252 void qh_delvertex(vertexT *vertex);
253 setT *qh_facet3vertex(facetT *facet);
254 facetT *qh_findbestfacet(pointT *point, boolT bestoutside,
255  realT *bestdist, boolT *isoutside);
256 facetT *qh_findbestlower(facetT *upperfacet, pointT *point, realT *bestdistp, int *numpart);
257 facetT *qh_findfacet_all(pointT *point, realT *bestdist, boolT *isoutside,
258  int *numpart);
259 int qh_findgood(facetT *facetlist, int goodhorizon);
260 void qh_findgood_all(facetT *facetlist);
261 void qh_furthestnext(void /* qh.facet_list */);
262 void qh_furthestout(facetT *facet);
263 void qh_infiniteloop(facetT *facet);
264 void qh_initbuild(void);
265 void qh_initialhull(setT *vertices);
266 setT *qh_initialvertices(int dim, setT *maxpoints, pointT *points, int numpoints);
267 vertexT *qh_isvertex(pointT *point, setT *vertices);
268 vertexT *qh_makenewfacets(pointT *point /*horizon_list, visible_list*/);
269 void qh_matchduplicates(facetT *atfacet, int atskip, int hashsize, int *hashcount);
270 void qh_nearcoplanar(void /* qh.facet_list */);
271 vertexT *qh_nearvertex(facetT *facet, pointT *point, realT *bestdistp);
272 int qh_newhashtable(int newsize);
273 vertexT *qh_newvertex(pointT *point);
274 ridgeT *qh_nextridge3d(ridgeT *atridge, facetT *facet, vertexT **vertexp);
275 void qh_outcoplanar(void /* facet_list */);
276 pointT *qh_point(int id);
277 void qh_point_add(setT *set, pointT *point, void *elem);
278 setT *qh_pointfacet(void /*qh.facet_list*/);
279 setT *qh_pointvertex(void /*qh.facet_list*/);
280 void qh_prependfacet(facetT *facet, facetT **facetlist);
281 void qh_printhashtable(FILE *fp);
282 void qh_printlists(void);
283 void qh_resetlists(boolT stats, boolT resetVisible /*qh.newvertex_list qh.newfacet_list qh.visible_list*/);
284 void qh_setvoronoi_all(void);
285 void qh_triangulate(void /*qh.facet_list*/);
286 void qh_triangulate_facet(facetT *facetA, vertexT **first_vertex);
287 void qh_triangulate_link(facetT *oldfacetA, facetT *facetA, facetT *oldfacetB, facetT *facetB);
288 void qh_triangulate_mirror(facetT *facetA, facetT *facetB);
289 void qh_triangulate_null(facetT *facetA);
290 void qh_vertexintersect(setT **vertexsetA,setT *vertexsetB);
291 setT *qh_vertexintersect_new(setT *vertexsetA,setT *vertexsetB);
292 void qh_vertexneighbors(void /*qh.facet_list*/);
293 boolT qh_vertexsubset(setT *vertexsetA, setT *vertexsetB);
294 
295 
296 #endif /* qhDEFpoly */
qh_findfacet_all
facetT * qh_findfacet_all(pointT *point, realT *bestdist, boolT *isoutside, int *numpart)
Definition: poly2.c:1348
qh_delvertex
void qh_delvertex(vertexT *vertex)
Definition: poly2.c:1146
qh_furthestout
void qh_furthestout(facetT *facet)
Definition: poly2.c:1621
qh_checkpolygon
void qh_checkpolygon(facetT *facetlist)
Definition: poly2.c:878
doxygen_xml_parser.type
type
Definition: doxygen_xml_parser.py:885
qh_checkconvex
void qh_checkconvex(facetT *facetlist, int fault)
Definition: poly2.c:475
qh_infiniteloop
void qh_infiniteloop(facetT *facet)
Definition: poly2.c:1652
qh_check_maxout
void qh_check_maxout(void)
Definition: poly2.c:218
qh_delridge
void qh_delridge(ridgeT *ridge)
Definition: poly2.c:1126
qh_checkvertex
void qh_checkvertex(vertexT *vertex)
Definition: poly2.c:1001
qh_makenewplanes
void qh_makenewplanes(void)
Definition: poly.c:513
qh_triangulate
void qh_triangulate(void)
Definition: poly2.c:2767
qh_updatevertices
void qh_updatevertices(void)
Definition: poly.c:1155
qh_isvertex
vertexT * qh_isvertex(pointT *point, setT *vertices)
Definition: poly2.c:1975
qh_findgood
int qh_findgood(facetT *facetlist, int goodhorizon)
Definition: poly2.c:1408
realT
#define realT
Definition: user.h:154
qh_matchvertices
boolT qh_matchvertices(int firstindex, setT *verticesA, int skipA, setT *verticesB, int *skipB, boolT *same)
Definition: poly.c:952
qh_facet3vertex
setT * qh_facet3vertex(facetT *facet)
Definition: poly2.c:1169
qh_checkflipped
boolT qh_checkflipped(facetT *facet, realT *dist, boolT allerror)
Definition: poly.c:218
qh_newridge
ridgeT * qh_newridge(void)
Definition: poly.c:1018
qh_furthestnext
void qh_furthestnext(void)
Definition: poly2.c:1578
qh_newhashtable
int qh_newhashtable(int newsize)
Definition: poly2.c:2304
qh_checkfacet
void qh_checkfacet(facetT *facet, boolT newmerge, boolT *waserrorp)
Definition: poly2.c:627
qh_printlists
void qh_printlists(void)
Definition: poly2.c:2651
qh_clearcenters
void qh_clearcenters(qh_CENTER type)
Definition: poly2.c:1040
qh_vertexintersect_new
setT * qh_vertexintersect_new(setT *vertexsetA, setT *vertexsetB)
Definition: poly2.c:3135
qh_findbestfacet
facetT * qh_findbestfacet(pointT *point, boolT bestoutside, realT *bestdist, boolT *isoutside)
Definition: poly2.c:1239
qh_makenew_nonsimplicial
facetT * qh_makenew_nonsimplicial(facetT *visible, vertexT *apex, int *numnew)
Definition: poly.c:563
qh_removevertex
void qh_removevertex(vertexT *vertex)
Definition: poly.c:1115
libqhull.h
qh_nearvertex
vertexT * qh_nearvertex(facetT *facet, pointT *point, realT *bestdistp)
Definition: poly2.c:2248
facetT
Definition: libqhull.h:262
qh_nextridge3d
ridgeT * qh_nextridge3d(ridgeT *atridge, facetT *facet, vertexT **vertexp)
Definition: poly2.c:2368
qh_matchduplicates
void qh_matchduplicates(facetT *atfacet, int atskip, int hashsize, int *hashcount)
Definition: poly2.c:2088
qh_makenew_simplicial
facetT * qh_makenew_simplicial(facetT *visible, vertexT *apex, int *numnew)
Definition: poly.c:660
qh_check_dupridge
void qh_check_dupridge(facetT *facet1, realT dist1, facetT *facet2, realT dist2)
Definition: poly2.c:150
boolT
#define boolT
Definition: libqhull.h:121
qh_newfacet
facetT * qh_newfacet(void)
Definition: poly.c:985
qh_removefacet
void qh_removefacet(facetT *facet)
Definition: poly.c:1084
qh_check_point
void qh_check_point(pointT *point, facetT *facet, realT *maxoutside, realT *maxdist, facetT **errfacet1, facetT **errfacet2)
Definition: poly2.c:325
qh_makenewfacet
facetT * qh_makenewfacet(setT *vertices, boolT toporient, facetT *facet)
Definition: poly.c:479
qh_createsimplex
void qh_createsimplex(setT *vertices)
Definition: poly2.c:1082
qh_findbestlower
facetT * qh_findbestlower(facetT *upperfacet, pointT *point, realT *bestdistp, int *numpart)
Definition: poly2.c:1278
qh_deletevisible
void qh_deletevisible(void)
Definition: poly.c:292
qh_pointfacet
setT * qh_pointfacet(void)
Definition: poly2.c:2510
qh_pointid
int qh_pointid(pointT *point)
Definition: poly.c:1053
qh_check_output
void qh_check_output(void)
Definition: poly2.c:302
qh_makenewfacets
vertexT * qh_makenewfacets(pointT *point)
Definition: poly2.c:2020
qh_vertexsubset
boolT qh_vertexsubset(setT *vertexsetA, setT *vertexsetB)
Definition: poly2.c:3206
qh_initbuild
void qh_initbuild(void)
Definition: poly2.c:1683
setT
Definition: qset.h:83
qh_checkflipped_all
void qh_checkflipped_all(facetT *facetlist)
Definition: poly2.c:831
ridgeT
Definition: libqhull.h:371
qh_printhashtable
void qh_printhashtable(FILE *fp)
Definition: poly2.c:2613
qh_point
pointT * qh_point(int id)
Definition: poly2.c:2446
qh_outcoplanar
void qh_outcoplanar(void)
Definition: poly2.c:2417
qh_CENTER
qh_CENTER
Definition: libqhull.h:141
qh_appendvertex
void qh_appendvertex(vertexT *vertex)
Definition: poly.c:72
qh_nearcoplanar
void qh_nearcoplanar(void)
Definition: poly2.c:2198
qh_delfacet
void qh_delfacet(facetT *facet)
Definition: poly.c:247
qh_triangulate_mirror
void qh_triangulate_mirror(facetT *facetA, facetT *facetB)
Definition: poly2.c:3060
qh_setvoronoi_all
void qh_setvoronoi_all(void)
Definition: poly2.c:2735
qh_point_add
void qh_point_add(setT *set, pointT *point, void *elem)
Definition: poly2.c:2470
qh_initialhull
void qh_initialhull(setT *vertices)
Definition: poly2.c:1802
qh_addhash
void qh_addhash(void *newelem, setT *hashtable, int hashsize, int hash)
Definition: poly2.c:26
qh_triangulate_link
void qh_triangulate_link(facetT *oldfacetA, facetT *facetA, facetT *oldfacetB, facetT *facetB)
Definition: poly2.c:3029
qh_check_bestdist
void qh_check_bestdist(void)
Definition: poly2.c:66
qh_triangulate_null
void qh_triangulate_null(facetT *facetA)
Definition: poly2.c:3089
qh_resetlists
void qh_resetlists(boolT stats, boolT resetVisible)
Definition: poly2.c:2685
pointT
#define pointT
Definition: libqhull.h:96
qh_check_points
void qh_check_points(void)
Definition: poly2.c:365
vertexT
Definition: libqhull.h:396
qh_matchnewfacets
void qh_matchnewfacets(void)
Definition: poly.c:841
qh_initialvertices
setT * qh_initialvertices(int dim, setT *maxpoints, pointT *points, int numpoints)
Definition: poly2.c:1892
qh_findgood_all
void qh_findgood_all(facetT *facetlist)
Definition: poly2.c:1508
qh_triangulate_facet
void qh_triangulate_facet(facetT *facetA, vertexT **first_vertex)
Definition: poly2.c:2954
qh_facetintersect
setT * qh_facetintersect(facetT *facetA, facetT *facetB, int *skipAp, int *skipBp, int extra)
Definition: poly.c:343
qh_vertexintersect
void qh_vertexintersect(setT **vertexsetA, setT *vertexsetB)
Definition: poly2.c:3117
qh_pointvertex
setT * qh_pointvertex(void)
Definition: poly2.c:2547
qh_prependfacet
void qh_prependfacet(facetT *facet, facetT **facetlist)
Definition: poly2.c:2574
qh_matchneighbor
void qh_matchneighbor(facetT *newfacet, int newskip, int hashsize, int *hashcount)
Definition: poly.c:724
qh_attachnewfacets
void qh_attachnewfacets(void)
Definition: poly.c:129
qh_newvertex
vertexT * qh_newvertex(pointT *point)
Definition: poly2.c:2329
qh_gethash
int qh_gethash(int hashsize, setT *set, int size, int firstindex, void *skipelem)
Definition: poly.c:405
qh_appendfacet
void qh_appendfacet(facetT *facet)
Definition: poly.c:38
qh_vertexneighbors
void qh_vertexneighbors(void)
Definition: poly2.c:3174


hpp-fcl
Author(s):
autogenerated on Sat Nov 23 2024 03:44:58