poly_r.h
Go to the documentation of this file.
1 /*<html><pre> -<a href="qh-poly_r.htm"
2  >-------------------------------</a><a name="TOP">-</a>
3 
4  poly_r.h
5  header file for poly_r.c and poly2_r.c
6 
7  see qh-poly_r.htm, libqhull_r.h and poly_r.c
8 
9  Copyright (c) 1993-2015 The Geometry Center.
10  $Id: //main/2015/qhull/src/libqhull_r/poly_r.h#4 $$Change: 2062 $
11  $DateTime: 2016/01/17 13:13:18 $$Author: bbarber $
12 */
13 
14 #ifndef qhDEFpoly
15 #define qhDEFpoly 1
16 
17 #include "libqhull_r.h"
18 
19 /*=============== constants ========================== */
20 
21 /*-<a href="qh-geom_r.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_r.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_r.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_r.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_r.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_r.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_r.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_r.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_r.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_r.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_r.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_r.h#FOREACHsetelement_">FOREACHsetelement_</a>
155 */
156 #define FOREACHneighborA_(facet) FOREACHsetelement_(facetT, facet->neighbors, neighborA)
157 
158 /*-<a href="qh-poly_r.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_r.h#FOREACHsetelement_">FOREACHsetelement_</a>
167 */
168 #define FOREACHvisible_(facets) FOREACHsetelement_(facetT, facets, visible)
169 
170 /*-<a href="qh-poly_r.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_r.h#FOREACHsetelement_">FOREACHsetelement_</a>
179 */
180 #define FOREACHnewfacet_(facets) FOREACHsetelement_(facetT, facets, newfacet)
181 
182 /*-<a href="qh-poly_r.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_r.h#FOREACHsetelement_">FOREACHsetelement_</a>
191 */
192 #define FOREACHvertexA_(vertices) FOREACHsetelement_(vertexT, vertices, vertexA)
193 
194 /*-<a href="qh-poly_r.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_r.h#FOREACHsetelement_">FOREACHsetelement_</a>
204 */
205 #define FOREACHvertexreverse12_(vertices) FOREACHsetelementreverse12_(vertexT, vertices, vertex)
206 
207 
208 /*=============== prototypes poly_r.c in alphabetical order ================*/
209 
210 void qh_appendfacet(qhT *qh, facetT *facet);
211 void qh_appendvertex(qhT *qh, vertexT *vertex);
212 void qh_attachnewfacets(qhT *qh /* qh.visible_list, qh.newfacet_list */);
213 boolT qh_checkflipped(qhT *qh, facetT *facet, realT *dist, boolT allerror);
214 void qh_delfacet(qhT *qh, facetT *facet);
215 void qh_deletevisible(qhT *qh /* qh.visible_list, qh.horizon_list */);
216 setT *qh_facetintersect(qhT *qh, facetT *facetA, facetT *facetB, int *skipAp,int *skipBp, int extra);
217 int qh_gethash(qhT *qh, int hashsize, setT *set, int size, int firstindex, void *skipelem);
218 facetT *qh_makenewfacet(qhT *qh, setT *vertices, boolT toporient, facetT *facet);
219 void qh_makenewplanes(qhT *qh /* qh.newfacet_list */);
220 facetT *qh_makenew_nonsimplicial(qhT *qh, facetT *visible, vertexT *apex, int *numnew);
221 facetT *qh_makenew_simplicial(qhT *qh, facetT *visible, vertexT *apex, int *numnew);
222 void qh_matchneighbor(qhT *qh, facetT *newfacet, int newskip, int hashsize,
223  int *hashcount);
224 void qh_matchnewfacets(qhT *qh);
225 boolT qh_matchvertices(qhT *qh, int firstindex, setT *verticesA, int skipA,
226  setT *verticesB, int *skipB, boolT *same);
229 int qh_pointid(qhT *qh, pointT *point);
230 void qh_removefacet(qhT *qh, facetT *facet);
231 void qh_removevertex(qhT *qh, vertexT *vertex);
232 void qh_updatevertices(qhT *qh);
233 
234 
235 /*========== -prototypes poly2_r.c in alphabetical order ===========*/
236 
237 void qh_addhash(void *newelem, setT *hashtable, int hashsize, int hash);
238 void qh_check_bestdist(qhT *qh);
239 void qh_check_dupridge(qhT *qh, facetT *facet1, realT dist1, facetT *facet2, realT dist2);
240 void qh_check_maxout(qhT *qh);
241 void qh_check_output(qhT *qh);
242 void qh_check_point(qhT *qh, pointT *point, facetT *facet, realT *maxoutside, realT *maxdist, facetT **errfacet1, facetT **errfacet2);
243 void qh_check_points(qhT *qh);
244 void qh_checkconvex(qhT *qh, facetT *facetlist, int fault);
245 void qh_checkfacet(qhT *qh, facetT *facet, boolT newmerge, boolT *waserrorp);
246 void qh_checkflipped_all(qhT *qh, facetT *facetlist);
247 void qh_checkpolygon(qhT *qh, facetT *facetlist);
248 void qh_checkvertex(qhT *qh, vertexT *vertex);
250 void qh_createsimplex(qhT *qh, setT *vertices);
251 void qh_delridge(qhT *qh, ridgeT *ridge);
252 void qh_delvertex(qhT *qh, vertexT *vertex);
253 setT *qh_facet3vertex(qhT *qh, facetT *facet);
254 facetT *qh_findbestfacet(qhT *qh, pointT *point, boolT bestoutside,
255  realT *bestdist, boolT *isoutside);
256 facetT *qh_findbestlower(qhT *qh, facetT *upperfacet, pointT *point, realT *bestdistp, int *numpart);
257 facetT *qh_findfacet_all(qhT *qh, pointT *point, realT *bestdist, boolT *isoutside,
258  int *numpart);
259 int qh_findgood(qhT *qh, facetT *facetlist, int goodhorizon);
260 void qh_findgood_all(qhT *qh, facetT *facetlist);
261 void qh_furthestnext(qhT *qh /* qh.facet_list */);
262 void qh_furthestout(qhT *qh, facetT *facet);
263 void qh_infiniteloop(qhT *qh, facetT *facet);
264 void qh_initbuild(qhT *qh);
265 void qh_initialhull(qhT *qh, setT *vertices);
266 setT *qh_initialvertices(qhT *qh, int dim, setT *maxpoints, pointT *points, int numpoints);
267 vertexT *qh_isvertex(pointT *point, setT *vertices);
268 vertexT *qh_makenewfacets(qhT *qh, pointT *point /*horizon_list, visible_list*/);
269 void qh_matchduplicates(qhT *qh, facetT *atfacet, int atskip, int hashsize, int *hashcount);
270 void qh_nearcoplanar(qhT *qh /* qh.facet_list */);
271 vertexT *qh_nearvertex(qhT *qh, facetT *facet, pointT *point, realT *bestdistp);
272 int qh_newhashtable(qhT *qh, int newsize);
273 vertexT *qh_newvertex(qhT *qh, pointT *point);
274 ridgeT *qh_nextridge3d(ridgeT *atridge, facetT *facet, vertexT **vertexp);
275 void qh_outcoplanar(qhT *qh /* qh.facet_list */);
276 pointT *qh_point(qhT *qh, int id);
277 void qh_point_add(qhT *qh, setT *set, pointT *point, void *elem);
278 setT *qh_pointfacet(qhT *qh /*qh.facet_list*/);
279 setT *qh_pointvertex(qhT *qh /*qh.facet_list*/);
280 void qh_prependfacet(qhT *qh, facetT *facet, facetT **facetlist);
281 void qh_printhashtable(qhT *qh, FILE *fp);
282 void qh_printlists(qhT *qh);
283 void qh_resetlists(qhT *qh, boolT stats, boolT resetVisible /*qh.newvertex_list qh.newfacet_list qh.visible_list*/);
284 void qh_setvoronoi_all(qhT *qh);
285 void qh_triangulate(qhT *qh /*qh.facet_list*/);
286 void qh_triangulate_facet(qhT *qh, facetT *facetA, vertexT **first_vertex);
287 void qh_triangulate_link(qhT *qh, facetT *oldfacetA, facetT *facetA, facetT *oldfacetB, facetT *facetB);
288 void qh_triangulate_mirror(qhT *qh, facetT *facetA, facetT *facetB);
289 void qh_triangulate_null(qhT *qh, facetT *facetA);
290 void qh_vertexintersect(qhT *qh, setT **vertexsetA,setT *vertexsetB);
291 setT *qh_vertexintersect_new(qhT *qh, setT *vertexsetA,setT *vertexsetB);
292 void qh_vertexneighbors(qhT *qh /*qh.facet_list*/);
293 boolT qh_vertexsubset(setT *vertexsetA, setT *vertexsetB);
294 
295 
296 #endif /* qhDEFpoly */
void qh_findgood_all(qhT *qh, facetT *facetlist)
Definition: poly2_r.c:1508
Definition: libqhull.h:465
void qh_initbuild(qhT *qh)
Definition: poly2_r.c:1683
void qh_vertexintersect(qhT *qh, setT **vertexsetA, setT *vertexsetB)
Definition: poly2_r.c:3117
void qh_clearcenters(qhT *qh, qh_CENTER type)
Definition: poly2_r.c:1040
#define boolT
Definition: libqhull.h:121
Definition: qset.h:83
void qh_vertexneighbors(qhT *qh)
Definition: poly2_r.c:3174
void qh_addhash(void *newelem, setT *hashtable, int hashsize, int hash)
Definition: poly2.c:26
setT * qh_initialvertices(qhT *qh, int dim, setT *maxpoints, pointT *points, int numpoints)
Definition: poly2_r.c:1892
int qh_newhashtable(qhT *qh, int newsize)
Definition: poly2_r.c:2304
void qh_furthestnext(qhT *qh)
Definition: poly2_r.c:1578
int qh_pointid(qhT *qh, pointT *point)
Definition: poly_r.c:1053
#define pointT
Definition: libqhull.h:96
ridgeT * qh_newridge(qhT *qh)
Definition: poly_r.c:1018
void qh_removevertex(qhT *qh, vertexT *vertex)
Definition: poly_r.c:1115
boolT qh_checkflipped(qhT *qh, facetT *facet, realT *dist, boolT allerror)
Definition: poly_r.c:218
void qh_updatevertices(qhT *qh)
Definition: poly_r.c:1155
void qh_makenewplanes(qhT *qh)
Definition: poly_r.c:513
void qh_delvertex(qhT *qh, vertexT *vertex)
Definition: poly2_r.c:1146
void qh_prependfacet(qhT *qh, facetT *facet, facetT **facetlist)
Definition: poly2_r.c:2574
void qh_matchneighbor(qhT *qh, facetT *newfacet, int newskip, int hashsize, int *hashcount)
Definition: poly_r.c:724
setT * qh_facet3vertex(qhT *qh, facetT *facet)
Definition: poly2_r.c:1169
boolT qh_vertexsubset(setT *vertexsetA, setT *vertexsetB)
Definition: poly2.c:3206
boolT qh_matchvertices(qhT *qh, int firstindex, setT *verticesA, int skipA, setT *verticesB, int *skipB, boolT *same)
Definition: poly_r.c:952
facetT * qh_newfacet(qhT *qh)
Definition: poly_r.c:985
facetT * qh_findbestfacet(qhT *qh, pointT *point, boolT bestoutside, realT *bestdist, boolT *isoutside)
Definition: poly2_r.c:1239
void qh_check_bestdist(qhT *qh)
Definition: poly2_r.c:66
void qh_checkflipped_all(qhT *qh, facetT *facetlist)
Definition: poly2_r.c:831
void qh_outcoplanar(qhT *qh)
Definition: poly2_r.c:2417
facetT * qh_findfacet_all(qhT *qh, pointT *point, realT *bestdist, boolT *isoutside, int *numpart)
Definition: poly2_r.c:1348
void qh_triangulate(qhT *qh)
Definition: poly2_r.c:2767
facetT * qh_makenew_simplicial(qhT *qh, facetT *visible, vertexT *apex, int *numnew)
Definition: poly_r.c:660
void qh_printlists(qhT *qh)
Definition: poly2_r.c:2651
void qh_setvoronoi_all(qhT *qh)
Definition: poly2_r.c:2735
facetT * qh_makenewfacet(qhT *qh, setT *vertices, boolT toporient, facetT *facet)
Definition: poly_r.c:479
#define qh
Definition: libqhull.h:457
void qh_triangulate_link(qhT *qh, facetT *oldfacetA, facetT *facetA, facetT *oldfacetB, facetT *facetB)
Definition: poly2_r.c:3029
void qh_checkconvex(qhT *qh, facetT *facetlist, int fault)
Definition: poly2_r.c:475
void qh_triangulate_facet(qhT *qh, facetT *facetA, vertexT **first_vertex)
Definition: poly2_r.c:2954
void qh_delridge(qhT *qh, ridgeT *ridge)
Definition: poly2_r.c:1126
void qh_printhashtable(qhT *qh, FILE *fp)
Definition: poly2_r.c:2613
pointT * qh_point(qhT *qh, int id)
Definition: poly2_r.c:2446
void qh_check_point(qhT *qh, pointT *point, facetT *facet, realT *maxoutside, realT *maxdist, facetT **errfacet1, facetT **errfacet2)
Definition: poly2_r.c:325
void qh_point_add(qhT *qh, setT *set, pointT *point, void *elem)
Definition: poly2_r.c:2470
void qh_furthestout(qhT *qh, facetT *facet)
Definition: poly2_r.c:1621
void qh_checkvertex(qhT *qh, vertexT *vertex)
Definition: poly2_r.c:1001
int qh_gethash(qhT *qh, int hashsize, setT *set, int size, int firstindex, void *skipelem)
Definition: poly_r.c:405
ridgeT * qh_nextridge3d(ridgeT *atridge, facetT *facet, vertexT **vertexp)
Definition: poly2.c:2368
void qh_createsimplex(qhT *qh, setT *vertices)
Definition: poly2_r.c:1082
void qh_nearcoplanar(qhT *qh)
Definition: poly2_r.c:2198
void qh_resetlists(qhT *qh, boolT stats, boolT resetVisible)
Definition: poly2_r.c:2685
setT * qh_vertexintersect_new(qhT *qh, setT *vertexsetA, setT *vertexsetB)
Definition: poly2_r.c:3135
void qh_deletevisible(qhT *qh)
Definition: poly_r.c:292
void qh_check_points(qhT *qh)
Definition: poly2_r.c:365
void qh_appendfacet(qhT *qh, facetT *facet)
Definition: poly_r.c:38
vertexT * qh_isvertex(pointT *point, setT *vertices)
Definition: poly2.c:1975
void qh_infiniteloop(qhT *qh, facetT *facet)
Definition: poly2_r.c:1652
void qh_triangulate_mirror(qhT *qh, facetT *facetA, facetT *facetB)
Definition: poly2_r.c:3060
void qh_checkfacet(qhT *qh, facetT *facet, boolT newmerge, boolT *waserrorp)
Definition: poly2_r.c:627
void qh_matchduplicates(qhT *qh, facetT *atfacet, int atskip, int hashsize, int *hashcount)
Definition: poly2_r.c:2088
void qh_check_maxout(qhT *qh)
Definition: poly2_r.c:218
vertexT * qh_makenewfacets(qhT *qh, pointT *point)
Definition: poly2_r.c:2020
setT * qh_pointvertex(qhT *qh)
Definition: poly2_r.c:2547
void qh_attachnewfacets(qhT *qh)
Definition: poly_r.c:129
void qh_initialhull(qhT *qh, setT *vertices)
Definition: poly2_r.c:1802
void qh_matchnewfacets(qhT *qh)
Definition: poly_r.c:841
int qh_findgood(qhT *qh, facetT *facetlist, int goodhorizon)
Definition: poly2_r.c:1408
void qh_check_dupridge(qhT *qh, facetT *facet1, realT dist1, facetT *facet2, realT dist2)
Definition: poly2_r.c:150
setT * qh_pointfacet(qhT *qh)
Definition: poly2_r.c:2510
void qh_removefacet(qhT *qh, facetT *facet)
Definition: poly_r.c:1084
facetT * qh_makenew_nonsimplicial(qhT *qh, facetT *visible, vertexT *apex, int *numnew)
Definition: poly_r.c:563
setT * qh_facetintersect(qhT *qh, facetT *facetA, facetT *facetB, int *skipAp, int *skipBp, int extra)
Definition: poly_r.c:343
facetT * qh_findbestlower(qhT *qh, facetT *upperfacet, pointT *point, realT *bestdistp, int *numpart)
Definition: poly2_r.c:1278
void qh_delfacet(qhT *qh, facetT *facet)
Definition: poly_r.c:247
vertexT * qh_nearvertex(qhT *qh, facetT *facet, pointT *point, realT *bestdistp)
Definition: poly2_r.c:2248
qh_CENTER
Definition: libqhull.h:141
void qh_check_output(qhT *qh)
Definition: poly2_r.c:302
void qh_triangulate_null(qhT *qh, facetT *facetA)
Definition: poly2_r.c:3089
#define realT
Definition: user.h:154
void qh_appendvertex(qhT *qh, vertexT *vertex)
Definition: poly_r.c:72
vertexT * qh_newvertex(qhT *qh, pointT *point)
Definition: poly2_r.c:2329
void qh_checkpolygon(qhT *qh, facetT *facetlist)
Definition: poly2_r.c:878


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