merge.h
Go to the documentation of this file.
1 /*<html><pre> -<a href="qh-merge.htm"
2  >-------------------------------</a><a name="TOP">-</a>
3 
4  merge.h
5  header file for merge.c
6 
7  see qh-merge.htm and merge.c
8 
9  Copyright (c) 1993-2015 C.B. Barber.
10  $Id: //main/2015/qhull/src/libqhull/merge.h#1 $$Change: 1981 $
11  $DateTime: 2015/09/28 20:26:32 $$Author: bbarber $
12 */
13 
14 #ifndef qhDEFmerge
15 #define qhDEFmerge 1
16 
17 #include "libqhull.h"
18 
19 
20 /*============ -constants- ==============*/
21 
22 /*-<a href="qh-merge.htm#TOC"
23  >--------------------------------</a><a name="qh_ANGLEredundant">-</a>
24 
25  qh_ANGLEredundant
26  indicates redundant merge in mergeT->angle
27 */
28 #define qh_ANGLEredundant 6.0
29 
30 /*-<a href="qh-merge.htm#TOC"
31  >--------------------------------</a><a name="qh_ANGLEdegen">-</a>
32 
33  qh_ANGLEdegen
34  indicates degenerate facet in mergeT->angle
35 */
36 #define qh_ANGLEdegen 5.0
37 
38 /*-<a href="qh-merge.htm#TOC"
39  >--------------------------------</a><a name="qh_ANGLEconcave">-</a>
40 
41  qh_ANGLEconcave
42  offset to indicate concave facets in mergeT->angle
43 
44  notes:
45  concave facets are assigned the range of [2,4] in mergeT->angle
46  roundoff error may make the angle less than 2
47 */
48 #define qh_ANGLEconcave 1.5
49 
50 /*-<a href="qh-merge.htm#TOC"
51  >--------------------------------</a><a name="MRG">-</a>
52 
53  MRG... (mergeType)
54  indicates the type of a merge (mergeT->type)
55 */
56 typedef enum { /* in sort order for facet_mergeset */
57  MRGnone= 0,
58  MRGcoplanar, /* centrum coplanar */
59  MRGanglecoplanar, /* angle coplanar */
60  /* could detect half concave ridges */
61  MRGconcave, /* concave ridge */
62  MRGflip, /* flipped facet. facet1 == facet2 */
63  MRGridge, /* duplicate ridge (qh_MERGEridge) */
64  /* degen and redundant go onto degen_mergeset */
65  MRGdegen, /* degenerate facet (!enough neighbors) facet1 == facet2 */
66  MRGredundant, /* redundant facet (vertex subset) */
67  /* merge_degenredundant assumes degen < redundant */
68  MRGmirror, /* mirror facet from qh_triangulate */
70 } mergeType;
71 
72 /*-<a href="qh-merge.htm#TOC"
73  >--------------------------------</a><a name="qh_MERGEapex">-</a>
74 
75  qh_MERGEapex
76  flag for qh_mergefacet() to indicate an apex merge
77 */
78 #define qh_MERGEapex True
79 
80 /*============ -structures- ====================*/
81 
82 /*-<a href="qh-merge.htm#TOC"
83  >--------------------------------</a><a name="mergeT">-</a>
84 
85  mergeT
86  structure used to merge facets
87 */
88 
89 typedef struct mergeT mergeT;
90 struct mergeT { /* initialize in qh_appendmergeset */
91  realT angle; /* angle between normals of facet1 and facet2 */
92  facetT *facet1; /* will merge facet1 into facet2 */
95 };
96 
97 
98 /*=========== -macros- =========================*/
99 
100 /*-<a href="qh-merge.htm#TOC"
101  >--------------------------------</a><a name="FOREACHmerge_">-</a>
102 
103  FOREACHmerge_( merges ) {...}
104  assign 'merge' to each merge in merges
105 
106  notes:
107  uses 'mergeT *merge, **mergep;'
108  if qh_mergefacet(),
109  restart since qh.facet_mergeset may change
110  see <a href="qset.h#FOREACHsetelement_">FOREACHsetelement_</a>
111 */
112 #define FOREACHmerge_( merges ) FOREACHsetelement_(mergeT, merges, merge)
113 
114 /*============ prototypes in alphabetical order after pre/postmerge =======*/
115 
116 void qh_premerge(vertexT *apex, realT maxcentrum, realT maxangle);
117 void qh_postmerge(const char *reason, realT maxcentrum, realT maxangle,
118  boolT vneighbors);
119 void qh_all_merges(boolT othermerge, boolT vneighbors);
120 void qh_appendmergeset(facetT *facet, facetT *neighbor, mergeType mergetype, realT *angle);
121 setT *qh_basevertices( facetT *samecycle);
122 void qh_checkconnect(void /* qh.new_facets */);
123 boolT qh_checkzero(boolT testall);
124 int qh_compareangle(const void *p1, const void *p2);
125 int qh_comparemerge(const void *p1, const void *p2);
126 int qh_comparevisit(const void *p1, const void *p2);
127 void qh_copynonconvex(ridgeT *atridge);
128 void qh_degen_redundant_facet(facetT *facet);
129 void qh_degen_redundant_neighbors(facetT *facet, facetT *delfacet);
130 vertexT *qh_find_newvertex(vertexT *oldvertex, setT *vertices, setT *ridges);
131 void qh_findbest_test(boolT testcentrum, facetT *facet, facetT *neighbor,
132  facetT **bestfacet, realT *distp, realT *mindistp, realT *maxdistp);
133 facetT *qh_findbestneighbor(facetT *facet, realT *distp, realT *mindistp, realT *maxdistp);
134 void qh_flippedmerges(facetT *facetlist, boolT *wasmerge);
135 void qh_forcedmerges( boolT *wasmerge);
136 void qh_getmergeset(facetT *facetlist);
137 void qh_getmergeset_initial(facetT *facetlist);
138 void qh_hashridge(setT *hashtable, int hashsize, ridgeT *ridge, vertexT *oldvertex);
139 ridgeT *qh_hashridge_find(setT *hashtable, int hashsize, ridgeT *ridge,
140  vertexT *vertex, vertexT *oldvertex, int *hashslot);
141 void qh_makeridges(facetT *facet);
142 void qh_mark_dupridges(facetT *facetlist);
143 void qh_maydropneighbor(facetT *facet);
144 int qh_merge_degenredundant(void);
145 void qh_merge_nonconvex( facetT *facet1, facetT *facet2, mergeType mergetype);
146 void qh_mergecycle(facetT *samecycle, facetT *newfacet);
147 void qh_mergecycle_all(facetT *facetlist, boolT *wasmerge);
148 void qh_mergecycle_facets( facetT *samecycle, facetT *newfacet);
149 void qh_mergecycle_neighbors(facetT *samecycle, facetT *newfacet);
150 void qh_mergecycle_ridges(facetT *samecycle, facetT *newfacet);
151 void qh_mergecycle_vneighbors( facetT *samecycle, facetT *newfacet);
152 void qh_mergefacet(facetT *facet1, facetT *facet2, realT *mindist, realT *maxdist, boolT mergeapex);
153 void qh_mergefacet2d(facetT *facet1, facetT *facet2);
154 void qh_mergeneighbors(facetT *facet1, facetT *facet2);
155 void qh_mergeridges(facetT *facet1, facetT *facet2);
156 void qh_mergesimplex(facetT *facet1, facetT *facet2, boolT mergeapex);
157 void qh_mergevertex_del(vertexT *vertex, facetT *facet1, facetT *facet2);
158 void qh_mergevertex_neighbors(facetT *facet1, facetT *facet2);
159 void qh_mergevertices(setT *vertices1, setT **vertices);
161 void qh_newvertices(setT *vertices);
165 vertexT *qh_rename_sharedvertex(vertexT *vertex, facetT *facet);
166 void qh_renameridgevertex(ridgeT *ridge, vertexT *oldvertex, vertexT *newvertex);
167 void qh_renamevertex(vertexT *oldvertex, vertexT *newvertex, setT *ridges,
168  facetT *oldfacet, facetT *neighborA);
169 boolT qh_test_appendmerge(facetT *facet, facetT *neighbor);
170 boolT qh_test_vneighbors(void /* qh.newfacet_list */);
171 void qh_tracemerge(facetT *facet1, facetT *facet2);
172 void qh_tracemerging(void);
173 void qh_updatetested( facetT *facet1, facetT *facet2);
174 setT *qh_vertexridges(vertexT *vertex);
175 void qh_vertexridges_facet(vertexT *vertex, facetT *facet, setT **ridges);
176 void qh_willdelete(facetT *facet, facetT *replace);
177 
178 #endif /* qhDEFmerge */
qh_degen_redundant_neighbors
void qh_degen_redundant_neighbors(facetT *facet, facetT *delfacet)
Definition: merge.c:703
qh_mergecycle_ridges
void qh_mergecycle_ridges(facetT *samecycle, facetT *newfacet)
Definition: merge.c:2084
qh_renameridgevertex
void qh_renameridgevertex(ridgeT *ridge, vertexT *oldvertex, vertexT *newvertex)
Definition: merge.c:3151
qh_mergecycle
void qh_mergecycle(facetT *samecycle, facetT *newfacet)
Definition: merge.c:1751
qh_mergeneighbors
void qh_mergeneighbors(facetT *facet1, facetT *facet2)
Definition: merge.c:2497
qh_renamevertex
void qh_renamevertex(vertexT *oldvertex, vertexT *newvertex, setT *ridges, facetT *oldfacet, facetT *neighborA)
Definition: merge.c:3213
mergeT
Definition: merge.h:90
qh_tracemerge
void qh_tracemerge(facetT *facet1, facetT *facet2)
Definition: merge.c:3412
mergeT::facet2
facetT * facet2
Definition: merge.h:93
qh_makeridges
void qh_makeridges(facetT *facet)
Definition: merge.c:1370
qh_getmergeset_initial
void qh_getmergeset_initial(facetT *facetlist)
Definition: merge.c:1224
qh_redundant_vertex
vertexT * qh_redundant_vertex(vertexT *vertex)
Definition: merge.c:2997
qh_getmergeset
void qh_getmergeset(facetT *facetlist)
Definition: merge.c:1151
MRGridge
@ MRGridge
Definition: merge.h:63
qh_mergecycle_neighbors
void qh_mergecycle_neighbors(facetT *samecycle, facetT *newfacet)
Definition: merge.c:1987
qh_mark_dupridges
void qh_mark_dupridges(facetT *facetlist)
Definition: merge.c:1460
qh_mergecycle_all
void qh_mergecycle_all(facetT *facetlist, boolT *wasmerge)
Definition: merge.c:1841
qh_test_appendmerge
boolT qh_test_appendmerge(facetT *facet, facetT *neighbor)
Definition: merge.c:3293
qh_tracemerging
void qh_tracemerging(void)
Definition: merge.c:3461
qh_hashridge_find
ridgeT * qh_hashridge_find(setT *hashtable, int hashsize, ridgeT *ridge, vertexT *vertex, vertexT *oldvertex, int *hashslot)
Definition: merge.c:1319
qh_compareangle
int qh_compareangle(const void *p1, const void *p2)
Definition: merge.c:569
mergeT::type
mergeType type
Definition: merge.h:94
realT
#define realT
Definition: user.h:154
qh_remove_extravertices
boolT qh_remove_extravertices(facetT *facet)
Definition: merge.c:3029
qh_mergeridges
void qh_mergeridges(facetT *facet1, facetT *facet2)
Definition: merge.c:2545
qh_mergevertex_del
void qh_mergevertex_del(vertexT *vertex, facetT *facet1, facetT *facet2)
Definition: merge.c:2724
mergeT::angle
realT angle
Definition: merge.h:91
qh_merge_degenredundant
int qh_merge_degenredundant(void)
Definition: merge.c:1584
qh_checkconnect
void qh_checkconnect(void)
Definition: merge.c:425
qh_premerge
void qh_premerge(vertexT *apex, realT maxcentrum, realT maxangle)
Definition: merge.c:56
qh_mergefacet
void qh_mergefacet(facetT *facet1, facetT *facet2, realT *mindist, realT *maxdist, boolT mergeapex)
Definition: merge.c:2271
libqhull.h
qh_degen_redundant_facet
void qh_degen_redundant_facet(facetT *facet)
Definition: merge.c:647
facetT
Definition: libqhull.h:262
qh_find_newvertex
vertexT * qh_find_newvertex(vertexT *oldvertex, setT *vertices, setT *ridges)
Definition: merge.c:773
qh_mergesimplex
void qh_mergesimplex(facetT *facet1, facetT *facet2, boolT mergeapex)
Definition: merge.c:2612
qh_mergevertices
void qh_mergevertices(setT *vertices1, setT **vertices)
Definition: merge.c:2788
qh_mergecycle_facets
void qh_mergecycle_facets(facetT *samecycle, facetT *newfacet)
Definition: merge.c:1929
qh_updatetested
void qh_updatetested(facetT *facet1, facetT *facet2)
Definition: merge.c:3503
boolT
#define boolT
Definition: libqhull.h:121
MRGredundant
@ MRGredundant
Definition: merge.h:66
qh_comparemerge
int qh_comparemerge(const void *p1, const void *p2)
Definition: merge.c:581
qh_mergefacet2d
void qh_mergefacet2d(facetT *facet1, facetT *facet2)
Definition: merge.c:2422
MRGmirror
@ MRGmirror
Definition: merge.h:68
setT
Definition: qset.h:83
qh_vertexridges
setT * qh_vertexridges(vertexT *vertex)
Definition: merge.c:3546
mergeType
mergeType
Definition: merge.h:56
qh_all_merges
void qh_all_merges(boolT othermerge, boolT vneighbors)
Definition: merge.c:215
qh_test_vneighbors
boolT qh_test_vneighbors(void)
Definition: merge.c:3376
MRGflip
@ MRGflip
Definition: merge.h:62
qh_checkzero
boolT qh_checkzero(boolT testall)
Definition: merge.c:488
qh_flippedmerges
void qh_flippedmerges(facetT *facetlist, boolT *wasmerge)
Definition: merge.c:982
ridgeT
Definition: libqhull.h:371
qh_postmerge
void qh_postmerge(const char *reason, realT maxcentrum, realT maxangle, boolT vneighbors)
Definition: merge.c:129
MRGdegen
@ MRGdegen
Definition: merge.h:65
qh_forcedmerges
void qh_forcedmerges(boolT *wasmerge)
Definition: merge.c:1056
MRGnone
@ MRGnone
Definition: merge.h:57
qh_hashridge
void qh_hashridge(setT *hashtable, int hashsize, ridgeT *ridge, vertexT *oldvertex)
Definition: merge.c:1276
MRGconcave
@ MRGconcave
Definition: merge.h:61
qh_willdelete
void qh_willdelete(facetT *facet, facetT *replace)
Definition: merge.c:3610
qh_rename_sharedvertex
vertexT * qh_rename_sharedvertex(vertexT *vertex, facetT *facet)
Definition: merge.c:3088
octree.p1
tuple p1
Definition: octree.py:54
qh_mergevertex_neighbors
void qh_mergevertex_neighbors(facetT *facet1, facetT *facet2)
Definition: merge.c:2750
mergeT::facet1
facetT * facet1
Definition: merge.h:92
qh_comparevisit
int qh_comparevisit(const void *p1, const void *p2)
Definition: merge.c:593
qh_findbestneighbor
facetT * qh_findbestneighbor(facetT *facet, realT *distp, realT *mindistp, realT *maxdistp)
Definition: merge.c:913
qh_neighbor_intersections
setT * qh_neighbor_intersections(vertexT *vertex)
Definition: merge.c:2841
MRGanglecoplanar
@ MRGanglecoplanar
Definition: merge.h:59
qh_maydropneighbor
void qh_maydropneighbor(facetT *facet)
Definition: merge.c:1524
qh_newvertices
void qh_newvertices(setT *vertices)
Definition: merge.c:2887
ENDmrg
@ ENDmrg
Definition: merge.h:69
vertexT
Definition: libqhull.h:396
qh_mergecycle_vneighbors
void qh_mergecycle_vneighbors(facetT *samecycle, facetT *newfacet)
Definition: merge.c:2186
MRGcoplanar
@ MRGcoplanar
Definition: merge.h:58
qh_basevertices
setT * qh_basevertices(facetT *samecycle)
Definition: merge.c:384
qh_appendmergeset
void qh_appendmergeset(facetT *facet, facetT *neighbor, mergeType mergetype, realT *angle)
Definition: merge.c:320
qh_findbest_test
void qh_findbest_test(boolT testcentrum, facetT *facet, facetT *neighbor, facetT **bestfacet, realT *distp, realT *mindistp, realT *maxdistp)
Definition: merge.c:860
qh_reducevertices
boolT qh_reducevertices(void)
Definition: merge.c:2925
qh_merge_nonconvex
void qh_merge_nonconvex(facetT *facet1, facetT *facet2, mergeType mergetype)
Definition: merge.c:1673
qh_copynonconvex
void qh_copynonconvex(ridgeT *atridge)
Definition: merge.c:613
qh_vertexridges_facet
void qh_vertexridges_facet(vertexT *vertex, facetT *facet, setT **ridges)
Definition: merge.c:3587


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