Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Analysis.AlgorithmBehavior/qhull-2012.1/src/libqhull/poly.h @ 11303

Last change on this file since 11303 was 10207, checked in by ascheibe, 11 years ago

#1886 added a unit test for volume calculation and the qhull library

File size: 11.0 KB
Line 
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-2012 The Geometry Center.
10   $Id: //main/2011/qhull/src/libqhull/poly.h#3 $$Change: 1464 $
11   $DateTime: 2012/01/25 22:58:41 $$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
210void    qh_appendfacet(facetT *facet);
211void    qh_appendvertex(vertexT *vertex);
212void    qh_attachnewfacets(void);
213boolT   qh_checkflipped(facetT *facet, realT *dist, boolT allerror);
214void    qh_delfacet(facetT *facet);
215void    qh_deletevisible(void /*qh visible_list, qh horizon_list*/);
216setT   *qh_facetintersect(facetT *facetA, facetT *facetB, int *skipAp,int *skipBp, int extra);
217int     qh_gethash(int hashsize, setT *set, int size, int firstindex, void *skipelem);
218facetT *qh_makenewfacet(setT *vertices, boolT toporient, facetT *facet);
219void    qh_makenewplanes(void /* newfacet_list */);
220facetT *qh_makenew_nonsimplicial(facetT *visible, vertexT *apex, int *numnew);
221facetT *qh_makenew_simplicial(facetT *visible, vertexT *apex, int *numnew);
222void    qh_matchneighbor(facetT *newfacet, int newskip, int hashsize,
223                          int *hashcount);
224void    qh_matchnewfacets(void);
225boolT   qh_matchvertices(int firstindex, setT *verticesA, int skipA,
226                          setT *verticesB, int *skipB, boolT *same);
227facetT *qh_newfacet(void);
228ridgeT *qh_newridge(void);
229int     qh_pointid(pointT *point);
230void    qh_removefacet(facetT *facet);
231void    qh_removevertex(vertexT *vertex);
232void    qh_updatevertices(void);
233
234
235/*========== -prototypes poly2.c in alphabetical order ===========*/
236
237void    qh_addhash(void* newelem, setT *hashtable, int hashsize, int hash);
238void    qh_check_bestdist(void);
239void    qh_check_maxout(void);
240void    qh_check_output(void);
241void    qh_check_point(pointT *point, facetT *facet, realT *maxoutside, realT *maxdist, facetT **errfacet1, facetT **errfacet2);
242void    qh_check_points(void);
243void    qh_checkconvex(facetT *facetlist, int fault);
244void    qh_checkfacet(facetT *facet, boolT newmerge, boolT *waserrorp);
245void    qh_checkflipped_all(facetT *facetlist);
246void    qh_checkpolygon(facetT *facetlist);
247void    qh_checkvertex(vertexT *vertex);
248void    qh_clearcenters(qh_CENTER type);
249void    qh_createsimplex(setT *vertices);
250void    qh_delridge(ridgeT *ridge);
251void    qh_delvertex(vertexT *vertex);
252setT   *qh_facet3vertex(facetT *facet);
253facetT *qh_findbestfacet(pointT *point, boolT bestoutside,
254           realT *bestdist, boolT *isoutside);
255facetT *qh_findbestlower(facetT *upperfacet, pointT *point, realT *bestdistp, int *numpart);
256facetT *qh_findfacet_all(pointT *point, realT *bestdist, boolT *isoutside,
257                          int *numpart);
258int     qh_findgood(facetT *facetlist, int goodhorizon);
259void    qh_findgood_all(facetT *facetlist);
260void    qh_furthestnext(void /* qh facet_list */);
261void    qh_furthestout(facetT *facet);
262void    qh_infiniteloop(facetT *facet);
263void    qh_initbuild(void);
264void    qh_initialhull(setT *vertices);
265setT   *qh_initialvertices(int dim, setT *maxpoints, pointT *points, int numpoints);
266vertexT *qh_isvertex(pointT *point, setT *vertices);
267vertexT *qh_makenewfacets(pointT *point /*horizon_list, visible_list*/);
268void    qh_matchduplicates(facetT *atfacet, int atskip, int hashsize, int *hashcount);
269void    qh_nearcoplanar(void /* qh.facet_list */);
270vertexT *qh_nearvertex(facetT *facet, pointT *point, realT *bestdistp);
271int     qh_newhashtable(int newsize);
272vertexT *qh_newvertex(pointT *point);
273ridgeT *qh_nextridge3d(ridgeT *atridge, facetT *facet, vertexT **vertexp);
274void    qh_outcoplanar(void /* facet_list */);
275pointT *qh_point(int id);
276void    qh_point_add(setT *set, pointT *point, void *elem);
277setT   *qh_pointfacet(void /*qh facet_list*/);
278setT   *qh_pointvertex(void /*qh facet_list*/);
279void    qh_prependfacet(facetT *facet, facetT **facetlist);
280void    qh_printhashtable(FILE *fp);
281void    qh_printlists(void);
282void    qh_resetlists(boolT stats, boolT resetVisible /*qh newvertex_list newfacet_list visible_list*/);
283void    qh_setvoronoi_all(void);
284void    qh_triangulate(void /*qh facet_list*/);
285void    qh_triangulate_facet(facetT *facetA, vertexT **first_vertex);
286void    qh_triangulate_link(facetT *oldfacetA, facetT *facetA, facetT *oldfacetB, facetT *facetB);
287void    qh_triangulate_mirror(facetT *facetA, facetT *facetB);
288void    qh_triangulate_null(facetT *facetA);
289void    qh_vertexintersect(setT **vertexsetA,setT *vertexsetB);
290setT   *qh_vertexintersect_new(setT *vertexsetA,setT *vertexsetB);
291void    qh_vertexneighbors(void /*qh facet_list*/);
292boolT   qh_vertexsubset(setT *vertexsetA, setT *vertexsetB);
293
294
295#endif /* qhDEFpoly */
Note: See TracBrowser for help on using the repository browser.