Skip to content

AFNI/NIfTI Server

Sections
Personal tools
You are here: Home » AFNI » Documentation

Doxygen Source Code Documentation


Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Search  

poly.h

Go to the documentation of this file.
00001 /*<html><pre>  -<a                             href="qh-poly.htm"
00002   >-------------------------------</a><a name="TOP">-</a>
00003 
00004    poly.h 
00005    header file for poly.c and poly2.c
00006 
00007    see qh-poly.htm, qhull.h and poly.c
00008 
00009    copyright (c) 1993-2001, The Geometry Center
00010 */
00011 
00012 #ifndef qhDEFpoly
00013 #define qhDEFpoly 1
00014 
00015 /*===============   constants ========================== */
00016 
00017 /*-<a                             href="qh-geom.htm#TOC"
00018   >--------------------------------</a><a name="ALGORITHMfault">-</a>
00019   
00020   ALGORITHMfault   
00021     use as argument to checkconvex() to report errors during buildhull
00022 */
00023 #define qh_ALGORITHMfault 0
00024 
00025 /*-<a                             href="qh-poly.htm#TOC"
00026   >--------------------------------</a><a name="DATAfault">-</a>
00027   
00028   DATAfault        
00029     use as argument to checkconvex() to report errors during initialhull
00030 */
00031 #define qh_DATAfault 1
00032 
00033 /*-<a                             href="qh-poly.htm#TOC"
00034   >--------------------------------</a><a name="DUPLICATEridge">-</a>
00035   
00036   DUPLICATEridge
00037     special value for facet->neighbor to indicate a duplicate ridge
00038   
00039   notes:
00040     set by matchneighbor, used by matchmatch and mark_dupridge
00041 */
00042 #define qh_DUPLICATEridge ( facetT * ) 1L
00043 
00044 /*-<a                             href="qh-poly.htm#TOC"
00045   >--------------------------------</a><a name="MERGEridge">-</a>
00046   
00047   MERGEridge       flag in facet
00048     special value for facet->neighbor to indicate a merged ridge
00049   
00050   notes:
00051     set by matchneighbor, used by matchmatch and mark_dupridge
00052 */
00053 #define qh_MERGEridge ( facetT * ) 2L
00054 
00055 
00056 /*============ -structures- ====================*/
00057 
00058 /*=========== -macros- =========================*/
00059 
00060 /*-<a                             href="qh-poly.htm#TOC"
00061   >--------------------------------</a><a name="FORALLfacet_">-</a>
00062   
00063   FORALLfacet_( facetlist ) { ... }
00064     assign 'facet' to each facet in facetlist
00065     
00066   notes:
00067     uses 'facetT *facet;'
00068     assumes last facet is a sentinel
00069     
00070   see:
00071     FORALLfacets
00072 */
00073 #define FORALLfacet_( facetlist ) if ( facetlist ) for( facet=( facetlist );facet && facet->next;facet=facet->next )
00074 
00075 /*-<a                             href="qh-poly.htm#TOC"
00076   >--------------------------------</a><a name="FORALLnew_facets">-</a>
00077   
00078   FORALLnewfacets { ... } 
00079     assign 'facet' to each facet in qh.newfacet_list
00080     
00081   notes:
00082     uses 'facetT *newfacet;'
00083     at exit, newfacet==NULL
00084 */
00085 #define FORALLnew_facets for( newfacet=qh newfacet_list;newfacet && newfacet->next;newfacet=newfacet->next )
00086 
00087 /*-<a                             href="qh-poly.htm#TOC"
00088   >--------------------------------</a><a name="FORALLvertex_">-</a>
00089   
00090   FORALLvertex_( vertexlist ) { ... }
00091     assign 'vertex' to each vertex in vertexlist
00092     
00093   notes:
00094     uses 'vertexT *vertex;'
00095     at exit, vertex==NULL
00096 */
00097 #define FORALLvertex_( vertexlist ) for ( vertex=( vertexlist );vertex && vertex->next;vertex= vertex->next )
00098 
00099 /*-<a                             href="qh-poly.htm#TOC"
00100   >--------------------------------</a><a name="FORALLvisible_facets">-</a>
00101   
00102   FORALLvisible_facets { ... }
00103     assign 'visible' to each visible facet in qh.visible_list
00104     
00105   notes:
00106     uses 'vacetT *visible;'
00107     at exit, visible==NULL
00108 */
00109 #define FORALLvisible_facets for (visible=qh visible_list; visible && visible->visible; visible= visible->next)
00110 
00111 /*-<a                             href="qh-poly.htm#TOC"
00112   >--------------------------------</a><a name="FORALLsame_">-</a>
00113   
00114   FORALLsame_( newfacet ) { ... } 
00115     assign 'same' to each facet in newfacet->f.samecycle
00116     
00117   notes:
00118     uses 'facetT *same;'
00119     stops when it returns to newfacet
00120 */
00121 #define FORALLsame_(newfacet) for (same= newfacet->f.samecycle; same != newfacet; same= same->f.samecycle)
00122 
00123 /*-<a                             href="qh-poly.htm#TOC"
00124   >--------------------------------</a><a name="FORALLsame_cycle_">-</a>
00125   
00126   FORALLsame_cycle_( newfacet ) { ... } 
00127     assign 'same' to each facet in newfacet->f.samecycle
00128     
00129   notes:
00130     uses 'facetT *same;'
00131     at exit, same == NULL
00132 */
00133 #define FORALLsame_cycle_(newfacet) \
00134      for (same= newfacet->f.samecycle; \
00135          same; same= (same == newfacet ?  NULL : same->f.samecycle))
00136 
00137 /*-<a                             href="qh-poly.htm#TOC"
00138   >--------------------------------</a><a name="FOREACHneighborA_">-</a>
00139   
00140   FOREACHneighborA_( facet ) { ... }
00141     assign 'neighborA' to each neighbor in facet->neighbors
00142   
00143   FOREACHneighborA_( vertex ) { ... }
00144     assign 'neighborA' to each neighbor in vertex->neighbors
00145   
00146   declare:
00147     facetT *neighborA, **neighborAp;
00148 
00149   see:
00150     <a href="qset.h#FOREACHsetelement_">FOREACHsetelement_</a>
00151 */
00152 #define FOREACHneighborA_(facet)  FOREACHsetelement_(facetT, facet->neighbors, neighborA)
00153 
00154 /*-<a                             href="qh-poly.htm#TOC"
00155   >--------------------------------</a><a name="FOREACHvisible_">-</a>
00156   
00157   FOREACHvisible_( facets ) { ... } 
00158     assign 'visible' to each facet in facets
00159     
00160   notes:
00161     uses 'facetT *facet, *facetp;'
00162     see <a href="qset.h#FOREACHsetelement_">FOREACHsetelement_</a>
00163 */
00164 #define FOREACHvisible_(facets) FOREACHsetelement_(facetT, facets, visible)
00165 
00166 /*-<a                             href="qh-poly.htm#TOC"
00167   >--------------------------------</a><a name="FOREACHnewfacet_">-</a>
00168   
00169   FOREACHnewfacet_( facets ) { ... } 
00170     assign 'newfacet' to each facet in facets
00171     
00172   notes:
00173     uses 'facetT *newfacet, *newfacetp;'
00174     see <a href="qset.h#FOREACHsetelement_">FOREACHsetelement_</a>
00175 */
00176 #define FOREACHnewfacet_(facets) FOREACHsetelement_(facetT, facets, newfacet)
00177 
00178 /*-<a                             href="qh-poly.htm#TOC"
00179   >--------------------------------</a><a name="FOREACHvertexA_">-</a>
00180   
00181   FOREACHvertexA_( vertices ) { ... } 
00182     assign 'vertexA' to each vertex in vertices
00183     
00184   notes:
00185     uses 'vertexT *vertexA, *vertexAp;'
00186     see <a href="qset.h#FOREACHsetelement_">FOREACHsetelement_</a>
00187 */
00188 #define FOREACHvertexA_(vertices) FOREACHsetelement_(vertexT, vertices, vertexA)
00189 
00190 /*-<a                             href="qh-poly.htm#TOC"
00191   >--------------------------------</a><a name="FOREACHvertexreverse12_">-</a>
00192   
00193   FOREACHvertexreverse12_( vertices ) { ... } 
00194     assign 'vertex' to each vertex in vertices
00195     reverse order of first two vertices
00196     
00197   notes:
00198     uses 'vertexT *vertex, *vertexp;'
00199     see <a href="qset.h#FOREACHsetelement_">FOREACHsetelement_</a>
00200 */
00201 #define FOREACHvertexreverse12_(vertices) FOREACHsetelementreverse12_(vertexT, vertices, vertex)
00202 
00203 
00204 /*=============== prototypes poly.c in alphabetical order ================*/
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 /*qh visible_list, qh horizon_list*/);
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 /* newfacet_list */);
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 /*========== -prototypes poly2.c in alphabetical order ===========*/
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_findfacet_all (pointT *point, realT *bestdist, boolT *isoutside,
00252                           int *numpart);
00253 int     qh_findgood (facetT *facetlist, int goodhorizon);
00254 void    qh_findgood_all (facetT *facetlist);
00255 void    qh_furthestnext (void /* qh facet_list */);
00256 void    qh_furthestout (facetT *facet);
00257 void    qh_infiniteloop (facetT *facet);
00258 void    qh_initbuild(void);
00259 void    qh_initialhull(setT *vertices);
00260 setT   *qh_initialvertices(int dim, setT *maxpoints, pointT *points, int numpoints);
00261 vertexT *qh_isvertex (pointT *point, setT *vertices);
00262 vertexT *qh_makenewfacets (pointT *point /*horizon_list, visible_list*/);
00263 void    qh_matchduplicates (facetT *atfacet, int atskip, int hashsize, int *hashcount);
00264 void    qh_nearcoplanar ( void /* qh.facet_list */);
00265 vertexT *qh_nearvertex (facetT *facet, pointT *point, realT *bestdistp);
00266 int     qh_newhashtable(int newsize);
00267 vertexT *qh_newvertex(pointT *point);
00268 ridgeT *qh_nextridge3d (ridgeT *atridge, facetT *facet, vertexT **vertexp);
00269 void    qh_outcoplanar (void /* facet_list */);
00270 pointT *qh_point (int id);
00271 void    qh_point_add (setT *set, pointT *point, void *elem);
00272 setT   *qh_pointfacet (void /*qh facet_list*/);
00273 setT   *qh_pointvertex (void /*qh facet_list*/);
00274 void    qh_prependfacet(facetT *facet, facetT **facetlist);
00275 void    qh_printhashtable(FILE *fp);
00276 void    qh_printlists (void);
00277 void    qh_resetlists (boolT stats /*qh newvertex_list newfacet_list visible_list*/);
00278 void    qh_setvoronoi_all (void);
00279 void    qh_vertexintersect(setT **vertexsetA,setT *vertexsetB);
00280 setT   *qh_vertexintersect_new(setT *vertexsetA,setT *vertexsetB);
00281 void    qh_vertexneighbors (void /*qh facet_list*/);
00282 boolT   qh_vertexsubset(setT *vertexsetA, setT *vertexsetB);
00283 
00284 
00285 #endif /* qhDEFpoly */
 

Powered by Plone

This site conforms to the following standards: