00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef qhDEFpoly
00013 #define qhDEFpoly 1
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #define qh_ALGORITHMfault 0
00024
00025
00026
00027
00028
00029
00030
00031 #define qh_DATAfault 1
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #define qh_DUPLICATEridge ( facetT * ) 1L
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053 #define qh_MERGEridge ( facetT * ) 2L
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073 #define FORALLfacet_( facetlist ) if ( facetlist ) for( facet=( facetlist );facet && facet->next;facet=facet->next )
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085 #define FORALLnew_facets for( newfacet=qh newfacet_list;newfacet && newfacet->next;newfacet=newfacet->next )
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097 #define FORALLvertex_( vertexlist ) for ( vertex=( vertexlist );vertex && vertex->next;vertex= vertex->next )
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109 #define FORALLvisible_facets for (visible=qh visible_list; visible && visible->visible; visible= visible->next)
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121 #define FORALLsame_(newfacet) for (same= newfacet->f.samecycle; same != newfacet; same= same->f.samecycle)
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133 #define FORALLsame_cycle_(newfacet) \
00134 for (same= newfacet->f.samecycle; \
00135 same; same= (same == newfacet ? NULL : same->f.samecycle))
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152 #define FOREACHneighborA_(facet) FOREACHsetelement_(facetT, facet->neighbors, neighborA)
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164 #define FOREACHvisible_(facets) FOREACHsetelement_(facetT, facets, visible)
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176 #define FOREACHnewfacet_(facets) FOREACHsetelement_(facetT, facets, newfacet)
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188 #define FOREACHvertexA_(vertices) FOREACHsetelement_(vertexT, vertices, vertexA)
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201 #define FOREACHvertexreverse12_(vertices) FOREACHsetelementreverse12_(vertexT, vertices, vertex)
00202
00203
00204
00205
00206 void qh_appendfacet(facetT *facet);
00207 void qh_appendvertex(vertexT *vertex);
00208 void qh_attachnewfacets (void);
00209 boolT qh_checkflipped (facetT *facet, realT *dist, boolT allerror);
00210 void qh_delfacet(facetT *facet);
00211 void qh_deletevisible(void );
00212 setT *qh_facetintersect (facetT *facetA, facetT *facetB, int *skipAp,int *skipBp, int extra);
00213 unsigned qh_gethash (int hashsize, setT *set, int size, int firstindex, void *skipelem);
00214 facetT *qh_makenewfacet(setT *vertices, boolT toporient, facetT *facet);
00215 void qh_makenewplanes ( void );
00216 facetT *qh_makenew_nonsimplicial (facetT *visible, vertexT *apex, int *numnew);
00217 facetT *qh_makenew_simplicial (facetT *visible, vertexT *apex, int *numnew);
00218 void qh_matchneighbor (facetT *newfacet, int newskip, int hashsize,
00219 int *hashcount);
00220 void qh_matchnewfacets (void);
00221 boolT qh_matchvertices (int firstindex, setT *verticesA, int skipA,
00222 setT *verticesB, int *skipB, boolT *same);
00223 facetT *qh_newfacet(void);
00224 ridgeT *qh_newridge(void);
00225 int qh_pointid (pointT *point);
00226 void qh_removefacet(facetT *facet);
00227 void qh_removevertex(vertexT *vertex);
00228 void qh_updatevertices (void);
00229
00230
00231
00232
00233 void qh_addhash (void* newelem, setT *hashtable, int hashsize, unsigned hash);
00234 void qh_check_bestdist (void);
00235 void qh_check_maxout (void);
00236 void qh_check_output (void);
00237 void qh_check_point (pointT *point, facetT *facet, realT *maxoutside, realT *maxdist, facetT **errfacet1, facetT **errfacet2);
00238 void qh_check_points(void);
00239 void qh_checkconvex(facetT *facetlist, int fault);
00240 void qh_checkfacet(facetT *facet, boolT newmerge, boolT *waserrorp);
00241 void qh_checkflipped_all (facetT *facetlist);
00242 void qh_checkpolygon(facetT *facetlist);
00243 void qh_checkvertex (vertexT *vertex);
00244 void qh_clearcenters (qh_CENTER type);
00245 void qh_createsimplex(setT *vertices);
00246 void qh_delridge(ridgeT *ridge);
00247 void qh_delvertex (vertexT *vertex);
00248 setT *qh_facet3vertex (facetT *facet);
00249 facetT *qh_findbestfacet (pointT *point, boolT bestoutside,
00250 realT *bestdist, boolT *isoutside);
00251 facetT *qh_findbestlower (facetT *upperfacet, pointT *point, realT *bestdistp, int *numpart);
00252 facetT *qh_findfacet_all (pointT *point, realT *bestdist, boolT *isoutside,
00253 int *numpart);
00254 int qh_findgood (facetT *facetlist, int goodhorizon);
00255 void qh_findgood_all (facetT *facetlist);
00256 void qh_furthestnext (void );
00257 void qh_furthestout (facetT *facet);
00258 void qh_infiniteloop (facetT *facet);
00259 void qh_initbuild(void);
00260 void qh_initialhull(setT *vertices);
00261 setT *qh_initialvertices(int dim, setT *maxpoints, pointT *points, int numpoints);
00262 vertexT *qh_isvertex (pointT *point, setT *vertices);
00263 vertexT *qh_makenewfacets (pointT *point );
00264 void qh_matchduplicates (facetT *atfacet, int atskip, int hashsize, int *hashcount);
00265 void qh_nearcoplanar ( void );
00266 vertexT *qh_nearvertex (facetT *facet, pointT *point, realT *bestdistp);
00267 int qh_newhashtable(int newsize);
00268 vertexT *qh_newvertex(pointT *point);
00269 ridgeT *qh_nextridge3d (ridgeT *atridge, facetT *facet, vertexT **vertexp);
00270 void qh_outcoplanar (void );
00271 pointT *qh_point (int id);
00272 void qh_point_add (setT *set, pointT *point, void *elem);
00273 setT *qh_pointfacet (void );
00274 setT *qh_pointvertex (void );
00275 void qh_prependfacet(facetT *facet, facetT **facetlist);
00276 void qh_printhashtable(FILE *fp);
00277 void qh_printlists (void);
00278 void qh_resetlists (boolT stats, boolT resetVisible );
00279 void qh_setvoronoi_all (void);
00280 void qh_triangulate (void );
00281 void qh_triangulate_facet (facetT *facetA, vertexT **first_vertex);
00282 void qh_triangulate_link (facetT *oldfacetA, facetT *facetA, facetT *oldfacetB, facetT *facetB);
00283 void qh_triangulate_mirror (facetT *facetA, facetT *facetB);
00284 void qh_triangulate_null (facetT *facetA);
00285 void qh_vertexintersect(setT **vertexsetA,setT *vertexsetB);
00286 setT *qh_vertexintersect_new(setT *vertexsetA,setT *vertexsetB);
00287 void qh_vertexneighbors (void );
00288 boolT qh_vertexsubset(setT *vertexsetA, setT *vertexsetB);
00289
00290
00291 #endif