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