1 /*<html><pre>  -<a                             href="qh-qhull.htm"
2   >-------------------------------</a><a name="TOP">-</a>
3 
4    qhull_a.h
5    all header files for compiling qhull with non-reentrant code
6    included before C++ headers for user_r.h:QHULL_CRTDBG
7 
8    see qh-qhull.htm
9 
10    see libqhull.h for user-level definitions
11 
12    see user.h for user-definable constants
13 
14    defines internal functions for libqhull.c global.c
15 
16    Copyright (c) 1993-2015 The Geometry Center.
17    $Id: //main/2015/qhull/src/libqhull/qhull_a.h#4 $$Change: 2064 $
18    $DateTime: 2016/01/18 12:36:08 $$Author: bbarber $
19 
20    Notes:  grep for ((" and (" to catch fprintf("lkasdjf");
21            full parens around (x?y:z)
22            use '#include "libqhull/qhull_a.h"' to avoid name clashes
23 */
24 
25 #ifndef qhDEFqhulla
26 #define qhDEFqhulla 1
27 
28 #include "libqhull.h"  /* Includes user_r.h and data types */
29 
30 #include "stat.h"
31 #include "random.h"
32 #include "mem.h"
33 #include "qset.h"
34 #include "geom.h"
35 #include "merge.h"
36 #include "poly.h"
37 #include "io.h"
38 
39 #include <setjmp.h>
40 #include <string.h>
41 #include <math.h>
42 #include <float.h>    /* some compilers will not need float.h */
43 #include <limits.h>
44 #include <time.h>
45 #include <ctype.h>
46 #include <stdio.h>
47 #include <stdlib.h>
48 /*** uncomment here and qset.c
49      if string.h does not define memcpy()
50 #include <memory.h>
51 */
52 
53 #if qh_CLOCKtype == 2  /* defined in user.h from libqhull.h */
54 #include <sys/types.h>
55 #include <sys/times.h>
56 #include <unistd.h>
57 #endif
58 
59 #ifdef _MSC_VER  /* Microsoft Visual C++ -- warning level 4 */
60 #pragma warning( disable : 4100)  /* unreferenced formal parameter */
61 #pragma warning( disable : 4127)  /* conditional expression is constant */
62 #pragma warning( disable : 4706)  /* assignment within conditional function */
63 #pragma warning( disable : 4996)  /* function was declared deprecated(strcpy, localtime, etc.) */
64 #endif
65 
66 /* ======= -macros- =========== */
67 
68 /*-<a                             href="qh-qhull.htm#TOC"
69   >--------------------------------</a><a name="traceN">-</a>
70 
71   traceN((qh ferr, 0Nnnn, "format\n", vars));
72     calls qh_fprintf if qh.IStracing >= N
73 
74     Add debugging traps to the end of qh_fprintf
75 
76   notes:
77     removing tracing reduces code size but doesn't change execution speed
78 */
79 #ifndef qh_NOtrace
80 #define trace0(args) {if (qh IStracing) qh_fprintf args;}
81 #define trace1(args) {if (qh IStracing >= 1) qh_fprintf args;}
82 #define trace2(args) {if (qh IStracing >= 2) qh_fprintf args;}
83 #define trace3(args) {if (qh IStracing >= 3) qh_fprintf args;}
84 #define trace4(args) {if (qh IStracing >= 4) qh_fprintf args;}
85 #define trace5(args) {if (qh IStracing >= 5) qh_fprintf args;}
86 #else /* qh_NOtrace */
87 #define trace0(args) {}
88 #define trace1(args) {}
89 #define trace2(args) {}
90 #define trace3(args) {}
91 #define trace4(args) {}
92 #define trace5(args) {}
93 #endif /* qh_NOtrace */
94 
95 /*-<a                             href="qh-qhull.htm#TOC"
96   >--------------------------------</a><a name="QHULL_UNUSED">-</a>
97 
98   Define an unused variable to avoid compiler warnings
99 
100   Derived from Qt's corelib/global/qglobal.h
101 
102 */
103 
104 #if defined(__cplusplus) && defined(__INTEL_COMPILER) && !defined(QHULL_OS_WIN)
105 template <typename T>
qhullUnused(T & x)106 inline void qhullUnused(T &x) { (void)x; }
107 #  define QHULL_UNUSED(x) qhullUnused(x);
108 #else
109 #  define QHULL_UNUSED(x) (void)x;
110 #endif
111 
112 /***** -libqhull.c prototypes (alphabetical after qhull) ********************/
113 
114 void    qh_qhull(void);
115 boolT   qh_addpoint(pointT *furthest, facetT *facet, boolT checkdist);
116 void    qh_buildhull(void);
117 void    qh_buildtracing(pointT *furthest, facetT *facet);
118 void    qh_build_withrestart(void);
119 void    qh_errexit2(int exitcode, facetT *facet, facetT *otherfacet);
120 void    qh_findhorizon(pointT *point, facetT *facet, int *goodvisible,int *goodhorizon);
121 pointT *qh_nextfurthest(facetT **visible);
122 void    qh_partitionall(setT *vertices, pointT *points,int npoints);
123 void    qh_partitioncoplanar(pointT *point, facetT *facet, realT *dist);
124 void    qh_partitionpoint(pointT *point, facetT *facet);
125 void    qh_partitionvisible(boolT allpoints, int *numpoints);
126 void    qh_precision(const char *reason);
127 void    qh_printsummary(FILE *fp);
128 
129 /***** -global.c internal prototypes (alphabetical) ***********************/
130 
131 void    qh_appendprint(qh_PRINT format);
132 void    qh_freebuild(boolT allmem);
133 void    qh_freebuffers(void);
134 void    qh_initbuffers(coordT *points, int numpoints, int dim, boolT ismalloc);
135 
136 /***** -stat.c internal prototypes (alphabetical) ***********************/
137 
138 void    qh_allstatA(void);
139 void    qh_allstatB(void);
140 void    qh_allstatC(void);
141 void    qh_allstatD(void);
142 void    qh_allstatE(void);
143 void    qh_allstatE2(void);
144 void    qh_allstatF(void);
145 void    qh_allstatG(void);
146 void    qh_allstatH(void);
147 void    qh_freebuffers(void);
148 void    qh_initbuffers(coordT *points, int numpoints, int dim, boolT ismalloc);
149 
150 #endif /* qhDEFqhulla */
151