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 typedef struct hashentryT hashentryT;
00065
00066 struct hashentryT {
00067 facetT *facet;
00068 hashentryT *next;
00069 unsigned skipindex;
00070 };
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087 #define FORALLfacet_( facetlist ) if ( facetlist ) for( facet=( facetlist );facet && facet->next;facet=facet->next )
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099 #define FORALLnew_facets for( newfacet=qh newfacet_list;newfacet && newfacet->next;newfacet=newfacet->next )
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111 #define FORALLvertex_( vertexlist ) for ( vertex=( vertexlist );vertex && vertex->next;vertex= vertex->next )
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123 #define FORALLvisible_facets for (visible=qh visible_list; visible && visible->visible; visible= visible->next)
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135 #define FORALLsame_(newfacet) for (same= newfacet->f.samecycle; same != newfacet; same= same->f.samecycle)
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147 #define FORALLsame_cycle_(newfacet) \
00148 for (same= newfacet->f.samecycle; \
00149 same; same= (same == newfacet ? NULL : same->f.samecycle))
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161 #define FOREACHentry_(entries) FOREACHsetelement_(hashentryT, entries, entry)
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178 #define FOREACHneighborA_(facet) FOREACHsetelement_(facetT, facet->neighbors, neighborA)
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190 #define FOREACHvisible_(facets) FOREACHsetelement_(facetT, facets, visible)
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202 #define FOREACHnewfacet_(facets) FOREACHsetelement_(facetT, facets, newfacet)
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214 #define FOREACHvertexA_(vertices) FOREACHsetelement_(vertexT, vertices, vertexA)
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227 #define FOREACHvertexreverse12_(vertices) FOREACHsetelementreverse12_(vertexT, vertices, vertex)
00228
00229
00230
00231
00232 void qh_appendfacet(facetT *facet);
00233 void qh_appendvertex(vertexT *vertex);
00234 void qh_attachnewfacets (void);
00235 boolT qh_checkflipped (facetT *facet, realT *dist, boolT allerror);
00236 void qh_delfacet(facetT *facet);
00237 void qh_deletevisible(void );
00238 setT *qh_facetintersect (facetT *facetA, facetT *facetB, int *skipAp,int *skipBp, int extra);
00239 unsigned qh_gethash (int hashsize, setT *set, int size, int firstindex, void *skipelem);
00240 facetT *qh_makenewfacet(setT *vertices, boolT toporient, facetT *facet);
00241 void qh_makenewplanes ( void );
00242 facetT *qh_makenew_nonsimplicial (facetT *visible, vertexT *apex, int *numnew);
00243 facetT *qh_makenew_simplicial (facetT *visible, vertexT *apex, int *numnew);
00244 void qh_matchneighbor (facetT *newfacet, int newskip, int hashsize,
00245 int *hashcount);
00246 void qh_matchnewfacets (void);
00247 boolT qh_matchvertices (int firstindex, setT *verticesA, int skipA,
00248 setT *verticesB, int *skipB, boolT *same);
00249 facetT *qh_newfacet(void);
00250 ridgeT *qh_newridge(void);
00251 int qh_pointid (pointT *point);
00252 void qh_removefacet(facetT *facet);
00253 void qh_removevertex(vertexT *vertex);
00254 void qh_updatevertices (void);
00255
00256
00257
00258
00259 void qh_addhash (void* newelem, setT *hashtable, int hashsize, unsigned hash);
00260 void qh_check_bestdist (void);
00261 void qh_check_maxout (void);
00262 void qh_check_output (void);
00263 void qh_check_point (pointT *point, facetT *facet, realT *maxoutside, realT *maxdist, facetT **errfacet1, facetT **errfacet2);
00264 void qh_check_points(void);
00265 void qh_checkconvex(facetT *facetlist, int fault);
00266 void qh_checkfacet(facetT *facet, boolT newmerge, boolT *waserrorp);
00267 void qh_checkflipped_all (facetT *facetlist);
00268 void qh_checkpolygon(facetT *facetlist);
00269 void qh_checkvertex (vertexT *vertex);
00270 void qh_clearcenters (qh_CENTER type);
00271 void qh_createsimplex(setT *vertices);
00272 void qh_delridge(ridgeT *ridge);
00273 void qh_delvertex (vertexT *vertex);
00274 setT *qh_facet3vertex (facetT *facet);
00275 facetT *qh_findbestfacet (pointT *point, boolT bestoutside,
00276 realT *bestdist, boolT *isoutside);
00277 facetT *qh_findfacet_all (pointT *point, realT *bestdist, boolT *isoutside,
00278 int *numpart);
00279 int qh_findgood (facetT *facetlist, int goodhorizon);
00280 void qh_findgood_all (facetT *facetlist);
00281 void qh_furthestnext (void );
00282 void qh_furthestout (facetT *facet);
00283 void qh_infiniteloop (facetT *facet);
00284 void qh_initbuild(void);
00285 void qh_initialhull(setT *vertices);
00286 setT *qh_initialvertices(int dim, setT *maxpoints, pointT *points, int numpoints);
00287 vertexT *qh_isvertex (pointT *point, setT *vertices);
00288 vertexT *qh_makenewfacets (pointT *point );
00289 void qh_matchduplicates (facetT *atfacet, int atskip, int hashsize, int *hashcount);
00290 void qh_nearcoplanar ( void );
00291 vertexT *qh_nearvertex (facetT *facet, pointT *point, realT *bestdistp);
00292 int qh_newhashtable(int newsize);
00293 vertexT *qh_newvertex(pointT *point);
00294 ridgeT *qh_nextridge3d (ridgeT *atridge, facetT *facet, vertexT **vertexp);
00295 void qh_outcoplanar (void );
00296 pointT *qh_point (int id);
00297 void qh_point_add (setT *set, pointT *point, void *elem);
00298 setT *qh_pointfacet (void );
00299 setT *qh_pointvertex (void );
00300 void qh_prependfacet(facetT *facet, facetT **facetlist);
00301 void qh_printhashtable(FILE *fp);
00302 void qh_printlists (void);
00303 void qh_resetlists (boolT stats );
00304 void qh_setvoronoi_all (void);
00305 void qh_vertexintersect(setT **vertexsetA,setT *vertexsetB);
00306 setT *qh_vertexintersect_new(setT *vertexsetA,setT *vertexsetB);
00307 void qh_vertexneighbors (void );
00308 boolT qh_vertexsubset(setT *vertexsetA, setT *vertexsetB);
00309
00310
00311 #endif