Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Analysis.AlgorithmBehavior/qhull-2012.1/src/libqhull/merge.h @ 10621

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

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

File size: 7.3 KB
Line 
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-2012 C.B. Barber.
10   $Id: //main/2011/qhull/src/libqhull/merge.h#3 $$Change: 1464 $
11   $DateTime: 2012/01/25 22:58:41 $$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*/
56typedef 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 */
69  ENDmrg
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
89typedef struct mergeT mergeT;
90struct mergeT {         /* initialize in qh_appendmergeset */
91  realT   angle;        /* angle between normals of facet1 and facet2 */
92  facetT *facet1;       /* will merge facet1 into facet2 */
93  facetT *facet2;
94  mergeType type;
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
116void    qh_premerge(vertexT *apex, realT maxcentrum, realT maxangle);
117void    qh_postmerge(const char *reason, realT maxcentrum, realT maxangle,
118             boolT vneighbors);
119void    qh_all_merges(boolT othermerge, boolT vneighbors);
120void    qh_appendmergeset(facetT *facet, facetT *neighbor, mergeType mergetype, realT *angle);
121setT   *qh_basevertices( facetT *samecycle);
122void    qh_checkconnect(void /* qh new_facets */);
123boolT   qh_checkzero(boolT testall);
124int     qh_compareangle(const void *p1, const void *p2);
125int     qh_comparemerge(const void *p1, const void *p2);
126int     qh_comparevisit(const void *p1, const void *p2);
127void    qh_copynonconvex(ridgeT *atridge);
128void    qh_degen_redundant_facet(facetT *facet);
129void    qh_degen_redundant_neighbors(facetT *facet, facetT *delfacet);
130vertexT *qh_find_newvertex(vertexT *oldvertex, setT *vertices, setT *ridges);
131void    qh_findbest_test(boolT testcentrum, facetT *facet, facetT *neighbor,
132           facetT **bestfacet, realT *distp, realT *mindistp, realT *maxdistp);
133facetT *qh_findbestneighbor(facetT *facet, realT *distp, realT *mindistp, realT *maxdistp);
134void    qh_flippedmerges(facetT *facetlist, boolT *wasmerge);
135void    qh_forcedmerges( boolT *wasmerge);
136void    qh_getmergeset(facetT *facetlist);
137void    qh_getmergeset_initial(facetT *facetlist);
138void    qh_hashridge(setT *hashtable, int hashsize, ridgeT *ridge, vertexT *oldvertex);
139ridgeT *qh_hashridge_find(setT *hashtable, int hashsize, ridgeT *ridge,
140              vertexT *vertex, vertexT *oldvertex, int *hashslot);
141void    qh_makeridges(facetT *facet);
142void    qh_mark_dupridges(facetT *facetlist);
143void    qh_maydropneighbor(facetT *facet);
144int     qh_merge_degenredundant(void);
145void    qh_merge_nonconvex( facetT *facet1, facetT *facet2, mergeType mergetype);
146void    qh_mergecycle(facetT *samecycle, facetT *newfacet);
147void    qh_mergecycle_all(facetT *facetlist, boolT *wasmerge);
148void    qh_mergecycle_facets( facetT *samecycle, facetT *newfacet);
149void    qh_mergecycle_neighbors(facetT *samecycle, facetT *newfacet);
150void    qh_mergecycle_ridges(facetT *samecycle, facetT *newfacet);
151void    qh_mergecycle_vneighbors( facetT *samecycle, facetT *newfacet);
152void    qh_mergefacet(facetT *facet1, facetT *facet2, realT *mindist, realT *maxdist, boolT mergeapex);
153void    qh_mergefacet2d(facetT *facet1, facetT *facet2);
154void    qh_mergeneighbors(facetT *facet1, facetT *facet2);
155void    qh_mergeridges(facetT *facet1, facetT *facet2);
156void    qh_mergesimplex(facetT *facet1, facetT *facet2, boolT mergeapex);
157void    qh_mergevertex_del(vertexT *vertex, facetT *facet1, facetT *facet2);
158void    qh_mergevertex_neighbors(facetT *facet1, facetT *facet2);
159void    qh_mergevertices(setT *vertices1, setT **vertices);
160setT   *qh_neighbor_intersections(vertexT *vertex);
161void    qh_newvertices(setT *vertices);
162boolT   qh_reducevertices(void);
163vertexT *qh_redundant_vertex(vertexT *vertex);
164boolT   qh_remove_extravertices(facetT *facet);
165vertexT *qh_rename_sharedvertex(vertexT *vertex, facetT *facet);
166void    qh_renameridgevertex(ridgeT *ridge, vertexT *oldvertex, vertexT *newvertex);
167void    qh_renamevertex(vertexT *oldvertex, vertexT *newvertex, setT *ridges,
168                        facetT *oldfacet, facetT *neighborA);
169boolT   qh_test_appendmerge(facetT *facet, facetT *neighbor);
170boolT   qh_test_vneighbors(void /* qh newfacet_list */);
171void    qh_tracemerge(facetT *facet1, facetT *facet2);
172void    qh_tracemerging(void);
173void    qh_updatetested( facetT *facet1, facetT *facet2);
174setT   *qh_vertexridges(vertexT *vertex);
175void    qh_vertexridges_facet(vertexT *vertex, facetT *facet, setT **ridges);
176void    qh_willdelete(facetT *facet, facetT *replace);
177
178#endif /* qhDEFmerge */
Note: See TracBrowser for help on using the repository browser.