1 /*<html><pre>  -<a                             href="qh-qhull_r.htm"
2   >-------------------------------</a><a name="TOP">-</a>
3 
4    qhull_ra.h
5    all header files for compiling qhull with reentrant code
6    included before C++ headers for user_r.h:QHULL_CRTDBG
7 
8    see qh-qhull.htm
9 
10    see libqhull_r.h for user-level definitions
11 
12    see user_r.h for user-definable constants
13 
14    defines internal functions for libqhull_r.c global_r.c
15 
16    Copyright (c) 1993-2019 The Geometry Center.
17    $Id: //main/2019/qhull/src/libqhull_r/qhull_ra.h#1 $$Change: 2661 $
18    $DateTime: 2019/05/24 20:09:58 $$Author: bbarber $
19 
20    Notes:  grep for ((" and (" to catch fprintf("lkasdjf");
21            full parens around (x?y:z)
22            use '#include "libqhull_r/qhull_ra.h"' to avoid name clashes
23 */
24 
25 #ifndef qhDEFqhulla
26 #define qhDEFqhulla 1
27 
28 #include "libqhull_r.h"  /* Includes user_r.h and data types */
29 
30 #include "stat_r.h"
31 #include "random_r.h"
32 #include "mem_r.h"
33 #include "qset_r.h"
34 #include "geom_r.h"
35 #include "merge_r.h"
36 #include "poly_r.h"
37 #include "io_r.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_r.c
49      if string.h does not define memcpy()
50 #include <memory.h>
51 */
52 
53 #if qh_CLOCKtype == 2  /* defined in user_r.h from libqhull_r.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_r.htm#TOC"
69   >--------------------------------</a><a name="traceN">-</a>
70 
71   traceN((qh, 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_r.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 #ifdef __cplusplus
113 extern "C" {
114 #endif
115 
116 /***** -libqhull_r.c prototypes (alphabetical after qhull) ********************/
117 
118 void    qh_qhull(qhT *qh);
119 boolT   qh_addpoint(qhT *qh, pointT *furthest, facetT *facet, boolT checkdist);
120 void    qh_build_withrestart(qhT *qh);
121 vertexT *qh_buildcone(qhT *qh, pointT *furthest, facetT *facet, int goodhorizon, facetT **retryfacet);
122 boolT   qh_buildcone_mergepinched(qhT *qh, vertexT *apex, facetT *facet, facetT **retryfacet);
123 boolT   qh_buildcone_onlygood(qhT *qh, vertexT *apex, int goodhorizon);
124 void    qh_buildhull(qhT *qh);
125 void    qh_buildtracing(qhT *qh, pointT *furthest, facetT *facet);
126 void    qh_errexit2(qhT *qh, int exitcode, facetT *facet, facetT *otherfacet);
127 void    qh_findhorizon(qhT *qh, pointT *point, facetT *facet, int *goodvisible,int *goodhorizon);
128 pointT *qh_nextfurthest(qhT *qh, facetT **visible);
129 void    qh_partitionall(qhT *qh, setT *vertices, pointT *points,int npoints);
130 void    qh_partitioncoplanar(qhT *qh, pointT *point, facetT *facet, realT *dist, boolT allnew);
131 void    qh_partitionpoint(qhT *qh, pointT *point, facetT *facet);
132 void    qh_partitionvisible(qhT *qh, boolT allpoints, int *numpoints);
133 void    qh_joggle_restart(qhT *qh, const char *reason);
134 void    qh_printsummary(qhT *qh, FILE *fp);
135 
136 /***** -global_r.c internal prototypes (alphabetical) ***********************/
137 
138 void    qh_appendprint(qhT *qh, qh_PRINT format);
139 void    qh_freebuild(qhT *qh, boolT allmem);
140 void    qh_freebuffers(qhT *qh);
141 void    qh_initbuffers(qhT *qh, coordT *points, int numpoints, int dim, boolT ismalloc);
142 
143 /***** -stat_r.c internal prototypes (alphabetical) ***********************/
144 
145 void    qh_allstatA(qhT *qh);
146 void    qh_allstatB(qhT *qh);
147 void    qh_allstatC(qhT *qh);
148 void    qh_allstatD(qhT *qh);
149 void    qh_allstatE(qhT *qh);
150 void    qh_allstatE2(qhT *qh);
151 void    qh_allstatF(qhT *qh);
152 void    qh_allstatG(qhT *qh);
153 void    qh_allstatH(qhT *qh);
154 void    qh_freebuffers(qhT *qh);
155 void    qh_initbuffers(qhT *qh, coordT *points, int numpoints, int dim, boolT ismalloc);
156 
157 #ifdef __cplusplus
158 } /* extern "C" */
159 #endif
160 
161 #endif /* qhDEFqhulla */
162