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  

user.c File Reference

#include "qhull_a.h"

Go to the source code of this file.


Functions

int qh_new_qhull (int dim, int numpoints, coordT *points, boolT ismalloc, char *qhull_cmd, FILE *outfile, FILE *errfile)
void qh_errexit (int exitcode, facetT *facet, ridgeT *ridge)
void qh_errprint (char *string, facetT *atfacet, facetT *otherfacet, ridgeT *atridge, vertexT *atvertex)
void qh_printfacetlist (facetT *facetlist, setT *facets, boolT printall)
void qh_user_memsizes (void)

Function Documentation

void qh_errexit int    exitcode,
facetT   facet,
ridgeT   ridge
 

Definition at line 192 of file user.c.

References qh, qh_collectstatistics(), qh_CPUclock, qh_ERRprec, qh_errprint(), qh_ERRqhull, qh_ERRsingular, qh_memstatistics(), qh_printhelp_degenerate(), qh_printhelp_singular(), qh_printstatistics(), qh_printstats(), qh_printsummary(), qh_produce_output(), qhstat, Zsetplane, Ztotmerge, and zzval_.

Referenced by qh_addpoint(), qh_build_withrestart(), qh_buildhull(), qh_checkconnect(), qh_checkconvex(), qh_checkfacet(), qh_checkflags(), qh_checkflipped_all(), qh_checkpolygon(), qh_checkvertex(), qh_clock(), qh_copypoints(), qh_deletevisible(), qh_determinant(), qh_detroundoff(), qh_detsimplex(), qh_detvnorm(), qh_detvridge3(), qh_errexit2(), qh_facet3vertex(), qh_facetarea_simplex(), qh_findbest(), qh_findbestfacet(), qh_findbestneighbor(), qh_findbestnew(), qh_findhorizon(), qh_getcenter(), qh_infiniteloop(), qh_initbuild(), qh_initflags(), qh_initialhull(), qh_initqhull_globals(), qh_joggleinput(), qh_matchduplicates(), qh_matchnewfacets(), qh_maxmin(), qh_maxsimplex(), qh_memalloc(), qh_meminitbuffers(), qh_memsetup(), qh_memsize(), qh_mergecycle_all(), qh_mergecycle_ridges(), qh_mergefacet(), qh_mergevertices(), qh_newvertex(), qh_nextfurthest(), qh_order_vertexneighbors(), qh_point_add(), qh_printafacet(), qh_printbegin(), qh_printend(), qh_printvdiagram(), qh_produce_output(), qh_projectinput(), qh_projectpoints(), qh_qhull(), qh_readfeasible(), qh_readpoints(), qh_rename_sharedvertex(), qh_scalelast(), qh_scalepoints(), qh_setaddnth(), qh_setcheck(), qh_setdelnth(), qh_setdelnthsorted(), qh_setfeasible(), qh_sethalfspace_all(), qh_setnew_delnthsorted(), qh_setreplace(), qh_setsize(), qh_settempfree(), qh_settemppop(), qh_settruncate(), qh_setzero(), qh_tracemerge(), and qh_voronoi_center().

00192                                                             {
00193 
00194   if (qh ERREXITcalled) {
00195     fprintf (qh ferr, "\nqhull error while processing previous error.  Exit program\n");
00196     exit(1);
00197   }
00198   qh ERREXITcalled= True;
00199   if (!qh QHULLfinished)
00200     qh hulltime= qh_CPUclock - qh hulltime;
00201   qh_errprint("ERRONEOUS", facet, NULL, ridge, NULL);
00202   fprintf (qh ferr, "\nWhile executing: %s | %s\n", qh rbox_command, qh qhull_command);
00203   fprintf(qh ferr, "Options selected for Qhull %s:\n%s\n", qh_version, qh qhull_options);
00204   if (qh furthest_id >= 0) {
00205     fprintf(qh ferr, "Last point added to hull was p%d.", qh furthest_id);
00206     if (zzval_(Ztotmerge))
00207       fprintf(qh ferr, "  Last merge was #%d.", zzval_(Ztotmerge));
00208     if (qh QHULLfinished)
00209       fprintf(qh ferr, "\nQhull has finished constructing the hull.");
00210     else if (qh POSTmerging)
00211       fprintf(qh ferr, "\nQhull has started post-merging.");
00212     fprintf (qh ferr, "\n");
00213   }
00214   if (qh FORCEoutput && (qh QHULLfinished || (!facet && !ridge)))
00215     qh_produce_output();
00216   else {
00217     if (exitcode != qh_ERRsingular && zzval_(Zsetplane) > qh hull_dim+1) {
00218       fprintf (qh ferr, "\nAt error exit:\n");
00219       qh_printsummary (qh ferr);
00220       if (qh PRINTstatistics) {
00221         qh_collectstatistics();
00222         qh_printstatistics(qh ferr, "at error exit");
00223         qh_memstatistics (qh ferr);
00224       }
00225     }
00226     if (qh PRINTprecision)
00227       qh_printstats (qh ferr, qhstat precision, NULL);
00228   }
00229   if (!exitcode)
00230     exitcode= qh_ERRqhull;
00231   else if (exitcode == qh_ERRsingular)
00232     qh_printhelp_singular(qh ferr);
00233   else if (exitcode == qh_ERRprec && !qh PREmerge)
00234     qh_printhelp_degenerate (qh ferr);
00235   if (qh NOerrexit) {
00236     fprintf (qh ferr, "qhull error while ending program.  Exit program\n");
00237     exit(1);
00238   }
00239   qh NOerrexit= True;
00240   longjmp(qh errexit, exitcode);
00241 } /* errexit */

void qh_errprint char *    string,
facetT   atfacet,
facetT   otherfacet,
ridgeT   atridge,
vertexT   atvertex
 

Definition at line 254 of file user.c.

References ridgeT::bottom, fout, i, otherfacet_, qh, qh_ALL, qh_PRINTEND, qh_printfacet(), qh_printneighborhood(), qh_printridge(), qh_printvertex(), and ridgeT::top.

Referenced by qh_buildhull(), qh_checkfacet(), qh_checkflipped_all(), qh_checkvertex(), qh_errexit(), qh_errexit2(), qh_findhorizon(), qh_matchduplicates(), qh_mergecycle(), qh_mergefacet(), qh_mergevertex_neighbors(), qh_partitioncoplanar(), qh_rename_sharedvertex(), qh_setfacetplane(), and qh_tracemerge().

00254                                                                                                         {
00255   int i;
00256 
00257   if (atfacet) {
00258     fprintf(qh ferr, "%s FACET:\n", string);
00259     qh_printfacet(qh ferr, atfacet);
00260   }
00261   if (otherfacet) {
00262     fprintf(qh ferr, "%s OTHER FACET:\n", string);
00263     qh_printfacet(qh ferr, otherfacet);
00264   }
00265   if (atridge) {
00266     fprintf(qh ferr, "%s RIDGE:\n", string);
00267     qh_printridge(qh ferr, atridge);
00268     if (atridge->top && atridge->top != atfacet && atridge->top != otherfacet)
00269       qh_printfacet(qh ferr, atridge->top);
00270     if (atridge->bottom
00271         && atridge->bottom != atfacet && atridge->bottom != otherfacet)
00272       qh_printfacet(qh ferr, atridge->bottom);
00273     if (!atfacet)
00274       atfacet= atridge->top;
00275     if (!otherfacet)
00276       otherfacet= otherfacet_(atridge, atfacet);
00277   }
00278   if (atvertex) {
00279     fprintf(qh ferr, "%s VERTEX:\n", string);
00280     qh_printvertex (qh ferr, atvertex);
00281   }
00282   if (qh fout && qh FORCEoutput && atfacet && !qh QHULLfinished && !qh IStracing) {
00283     fprintf(qh ferr, "ERRONEOUS and NEIGHBORING FACETS to output\n");
00284     for (i= 0; i < qh_PRINTEND; i++)  /* use fout for geomview output */
00285       qh_printneighborhood (qh fout, qh PRINTout[i], atfacet, otherfacet,
00286                             !qh_ALL);
00287   }
00288 } /* errprint */

int qh_new_qhull int    dim,
int    numpoints,
coordT *    points,
boolT    ismalloc,
char *    qhull_cmd,
FILE *    outfile,
FILE *    errfile
 

Definition at line 120 of file user.c.

References boolT, coordT, free, qh, qh_check_output(), qh_check_points(), qh_init_B(), qh_initflags(), qh_initqhull_start(), qh_meminit(), qh_produce_output(), qh_qhull(), qh_setfeasible(), qh_sethalfspace_all(), and trace1.

00121                                                                {
00122   int exitcode, hulldim;
00123   boolT new_ismalloc;
00124   static boolT firstcall = True;
00125   coordT *new_points;
00126 
00127   if (firstcall) {
00128     qh_meminit (errfile);
00129     firstcall= False;
00130   }
00131   if (strncmp (qhull_cmd,"qhull ", 6)) {
00132     fprintf (errfile, "qh_new_qhull: start qhull_cmd argument with \"qhull \"\n");
00133     exit(1);
00134   }
00135   qh_initqhull_start (NULL, outfile, errfile);
00136   trace1(( qh ferr, "qh_new_qhull: build new Qhull for %d %d-d points with %s\n", numpoints, dim, qhull_cmd));
00137   exitcode = setjmp (qh errexit);
00138   if (!exitcode)
00139   {
00140     qh NOerrexit = False;
00141     qh_initflags (qhull_cmd);
00142     if (qh DELAUNAY)
00143       qh PROJECTdelaunay= True;
00144     if (qh HALFspace) {
00145       /* points is an array of halfspaces, 
00146          the last coordinate of each halfspace is its offset */
00147       hulldim= dim-1;
00148       qh_setfeasible (hulldim); 
00149       new_points= qh_sethalfspace_all (dim, numpoints, points, qh feasible_point);
00150       new_ismalloc= True;
00151       if (ismalloc)
00152         free (points);
00153     }else {
00154       hulldim= dim;
00155       new_points= points;
00156       new_ismalloc= ismalloc;
00157     }
00158     qh_init_B (new_points, numpoints, hulldim, new_ismalloc);
00159     qh_qhull();
00160     qh_check_output();
00161     if (outfile)
00162       qh_produce_output(); 
00163     if (qh VERIFYoutput && !qh STOPpoint && !qh STOPcone)
00164       qh_check_points();
00165   }
00166   qh NOerrexit = True;
00167   return exitcode;
00168 } /* new_qhull */

void qh_printfacetlist facetT   facetlist,
setT   facets,
boolT    printall
 

Definition at line 302 of file user.c.

References boolT, FORALLfacet_, FOREACHfacet_, qh, qh_printafacet(), qh_printbegin(), qh_printend(), and qh_PRINTfacets.

Referenced by qh_addpoint(), qh_findhorizon(), qh_makenewfacets(), qh_matchnewfacets(), and qh_partitionall().

00302                                                                         {
00303   facetT *facet, **facetp;
00304 
00305   qh_printbegin (qh ferr, qh_PRINTfacets, facetlist, facets, printall);
00306   FORALLfacet_(facetlist)
00307     qh_printafacet(qh ferr, qh_PRINTfacets, facet, printall);
00308   FOREACHfacet_(facets)
00309     qh_printafacet(qh ferr, qh_PRINTfacets, facet, printall);
00310   qh_printend (qh ferr, qh_PRINTfacets, facetlist, facets, printall);
00311 } /* printfacetlist */

void qh_user_memsizes void   
 

Definition at line 323 of file user.c.

Referenced by qh_initqhull_mem().

00323                              {
00324 
00325   /* qh_memsize (size); */
00326 } /* user_memsizes */
 

Powered by Plone

This site conforms to the following standards: