qhull_ra.h 5.3 KB

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