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);
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);
156 void qh_mergesimplex(facetT *facet1, facetT *facet2, boolT mergeapex);
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 */);
172 void qh_tracemerging(void);
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 */
void qh_mergesimplex(facetT *facet1, facetT *facet2, boolT mergeapex)
Definition: merge.c:2612
facetT * qh_findbestneighbor(facetT *facet, realT *distp, realT *mindistp, realT *maxdistp)
Definition: merge.c:913
int qh_comparevisit(const void *p1, const void *p2)
Definition: merge.c:593
int qh_compareangle(const void *p1, const void *p2)
Definition: merge.c:569
void qh_flippedmerges(facetT *facetlist, boolT *wasmerge)
Definition: merge.c:982
void qh_mark_dupridges(facetT *facetlist)
Definition: merge.c:1460
facetT * facet2
Definition: merge.h:93
ridgeT * qh_hashridge_find(setT *hashtable, int hashsize, ridgeT *ridge, vertexT *vertex, vertexT *oldvertex, int *hashslot)
Definition: merge.c:1319
#define boolT
Definition: libqhull.h:121
Definition: qset.h:83
void qh_vertexridges_facet(vertexT *vertex, facetT *facet, setT **ridges)
Definition: merge.c:3587
void qh_copynonconvex(ridgeT *atridge)
Definition: merge.c:613
tuple p1
Definition: octree.py:55
void qh_renameridgevertex(ridgeT *ridge, vertexT *oldvertex, vertexT *newvertex)
Definition: merge.c:3151
void qh_maydropneighbor(facetT *facet)
Definition: merge.c:1524
realT angle
Definition: merge.h:91
Definition: merge.h:63
void qh_mergeneighbors(facetT *facet1, facetT *facet2)
Definition: merge.c:2497
void qh_mergefacet(facetT *facet1, facetT *facet2, realT *mindist, realT *maxdist, boolT mergeapex)
Definition: merge.c:2271
void qh_tracemerge(facetT *facet1, facetT *facet2)
Definition: merge.c:3412
boolT qh_test_vneighbors(void)
Definition: merge.c:3376
void qh_mergecycle_ridges(facetT *samecycle, facetT *newfacet)
Definition: merge.c:2084
void qh_mergecycle_neighbors(facetT *samecycle, facetT *newfacet)
Definition: merge.c:1987
void qh_getmergeset(facetT *facetlist)
Definition: merge.c:1151
void qh_mergecycle_all(facetT *facetlist, boolT *wasmerge)
Definition: merge.c:1841
void qh_mergevertices(setT *vertices1, setT **vertices)
Definition: merge.c:2788
void qh_mergecycle_vneighbors(facetT *samecycle, facetT *newfacet)
Definition: merge.c:2186
Definition: merge.h:62
mergeType type
Definition: merge.h:94
void qh_mergeridges(facetT *facet1, facetT *facet2)
Definition: merge.c:2545
void qh_findbest_test(boolT testcentrum, facetT *facet, facetT *neighbor, facetT **bestfacet, realT *distp, realT *mindistp, realT *maxdistp)
Definition: merge.c:860
void qh_merge_nonconvex(facetT *facet1, facetT *facet2, mergeType mergetype)
Definition: merge.c:1673
mergeType
Definition: merge.h:56
void qh_forcedmerges(boolT *wasmerge)
Definition: merge.c:1056
void qh_mergecycle(facetT *samecycle, facetT *newfacet)
Definition: merge.c:1751
Definition: merge.h:90
void qh_appendmergeset(facetT *facet, facetT *neighbor, mergeType mergetype, realT *angle)
Definition: merge.c:320
void qh_premerge(vertexT *apex, realT maxcentrum, realT maxangle)
Definition: merge.c:56
void qh_getmergeset_initial(facetT *facetlist)
Definition: merge.c:1224
void qh_updatetested(facetT *facet1, facetT *facet2)
Definition: merge.c:3503
setT * qh_basevertices(facetT *samecycle)
Definition: merge.c:384
void qh_mergevertex_del(vertexT *vertex, facetT *facet1, facetT *facet2)
Definition: merge.c:2724
void qh_all_merges(boolT othermerge, boolT vneighbors)
Definition: merge.c:215
int qh_comparemerge(const void *p1, const void *p2)
Definition: merge.c:581
boolT qh_checkzero(boolT testall)
Definition: merge.c:488
int qh_merge_degenredundant(void)
Definition: merge.c:1584
void qh_degen_redundant_facet(facetT *facet)
Definition: merge.c:647
setT * qh_neighbor_intersections(vertexT *vertex)
Definition: merge.c:2841
void qh_hashridge(setT *hashtable, int hashsize, ridgeT *ridge, vertexT *oldvertex)
Definition: merge.c:1276
void qh_degen_redundant_neighbors(facetT *facet, facetT *delfacet)
Definition: merge.c:703
void qh_mergefacet2d(facetT *facet1, facetT *facet2)
Definition: merge.c:2422
boolT qh_reducevertices(void)
Definition: merge.c:2925
void qh_mergecycle_facets(facetT *samecycle, facetT *newfacet)
Definition: merge.c:1929
void qh_makeridges(facetT *facet)
Definition: merge.c:1370
void qh_renamevertex(vertexT *oldvertex, vertexT *newvertex, setT *ridges, facetT *oldfacet, facetT *neighborA)
Definition: merge.c:3213
facetT * facet1
Definition: merge.h:92
void qh_mergevertex_neighbors(facetT *facet1, facetT *facet2)
Definition: merge.c:2750
vertexT * qh_find_newvertex(vertexT *oldvertex, setT *vertices, setT *ridges)
Definition: merge.c:773
vertexT * qh_redundant_vertex(vertexT *vertex)
Definition: merge.c:2997
void qh_tracemerging(void)
Definition: merge.c:3461
setT * qh_vertexridges(vertexT *vertex)
Definition: merge.c:3546
void qh_willdelete(facetT *facet, facetT *replace)
Definition: merge.c:3610
void qh_newvertices(setT *vertices)
Definition: merge.c:2887
void qh_checkconnect(void)
Definition: merge.c:425
boolT qh_remove_extravertices(facetT *facet)
Definition: merge.c:3029
void qh_postmerge(const char *reason, realT maxcentrum, realT maxangle, boolT vneighbors)
Definition: merge.c:129
boolT qh_test_appendmerge(facetT *facet, facetT *neighbor)
Definition: merge.c:3293
#define realT
Definition: user.h:154
vertexT * qh_rename_sharedvertex(vertexT *vertex, facetT *facet)
Definition: merge.c:3088
Definition: merge.h:69
Definition: merge.h:65
Definition: merge.h:57


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