io_r.h 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. /*<html><pre> -<a href="qh-io_r.htm"
  2. >-------------------------------</a><a name="TOP">-</a>
  3. io_r.h
  4. declarations of Input/Output functions
  5. see README, libqhull_r.h and io_r.c
  6. Copyright (c) 1993-2020 The Geometry Center.
  7. $Id: //main/2019/qhull/src/libqhull_r/io_r.h#3 $$Change: 2953 $
  8. $DateTime: 2020/05/21 22:05:32 $$Author: bbarber $
  9. */
  10. #ifndef qhDEFio
  11. #define qhDEFio 1
  12. #include "libqhull_r.h"
  13. /*============ constants and flags ==================*/
  14. /*-<a href="qh-io_r.htm#TOC"
  15. >--------------------------------</a><a name="qh_MAXfirst">-</a>
  16. qh_MAXfirst
  17. maximum length of first two lines of stdin
  18. */
  19. #define qh_MAXfirst 200
  20. /*-<a href="qh-io_r.htm#TOC"
  21. >--------------------------------</a><a name="qh_MINradius">-</a>
  22. qh_MINradius
  23. min radius for Gp and Gv, fraction of maxcoord
  24. */
  25. #define qh_MINradius 0.02
  26. /*-<a href="qh-io_r.htm#TOC"
  27. >--------------------------------</a><a name="qh_GEOMepsilon">-</a>
  28. qh_GEOMepsilon
  29. adjust outer planes for 'lines closer' and geomview roundoff.
  30. This prevents bleed through.
  31. */
  32. #define qh_GEOMepsilon 2e-3
  33. /*-<a href="qh-io_r.htm#TOC"
  34. >--------------------------------</a><a name="qh_WHITESPACE">-</a>
  35. qh_WHITESPACE
  36. possible values of white space
  37. */
  38. #define qh_WHITESPACE " \n\t\v\r\f"
  39. /*-<a href="qh-io_r.htm#TOC"
  40. >--------------------------------</a><a name="RIDGE">-</a>
  41. qh_RIDGE
  42. to select which ridges to print in qh_eachvoronoi
  43. */
  44. typedef enum
  45. {
  46. qh_RIDGEall= 0, qh_RIDGEinner, qh_RIDGEouter
  47. }
  48. qh_RIDGE;
  49. /*-<a href="qh-io_r.htm#TOC"
  50. >--------------------------------</a><a name="printvridgeT">-</a>
  51. printvridgeT
  52. prints results of qh_printvdiagram
  53. see:
  54. <a href="io_r.c#printvridge">qh_printvridge</a> for an example
  55. */
  56. typedef void (*printvridgeT)(qhT *qh, FILE *fp, vertexT *vertex, vertexT *vertexA, setT *centers, boolT unbounded);
  57. /*============== -prototypes in alphabetical order =========*/
  58. #ifdef __cplusplus
  59. extern "C" {
  60. #endif
  61. void qh_dfacet(qhT *qh, unsigned int id);
  62. void qh_dvertex(qhT *qh, unsigned int id);
  63. int qh_compare_facetarea(const void *p1, const void *p2);
  64. int qh_compare_facetvisit(const void *p1, const void *p2);
  65. int qh_compare_nummerge(const void *p1, const void *p2);
  66. void qh_copyfilename(qhT *qh, char *filename, int size, const char* source, int length);
  67. void qh_countfacets(qhT *qh, facetT *facetlist, setT *facets, boolT printall,
  68. int *numfacetsp, int *numsimplicialp, int *totneighborsp,
  69. int *numridgesp, int *numcoplanarsp, int *numnumtricoplanarsp);
  70. pointT *qh_detvnorm(qhT *qh, vertexT *vertex, vertexT *vertexA, setT *centers, realT *offsetp);
  71. setT *qh_detvridge(qhT *qh, vertexT *vertex);
  72. setT *qh_detvridge3(qhT *qh, vertexT *atvertex, vertexT *vertex);
  73. int qh_eachvoronoi(qhT *qh, FILE *fp, printvridgeT printvridge, vertexT *atvertex, boolT visitall, qh_RIDGE innerouter, boolT inorder);
  74. int qh_eachvoronoi_all(qhT *qh, FILE *fp, printvridgeT printvridge, boolT isUpper, qh_RIDGE innerouter, boolT inorder);
  75. void qh_facet2point(qhT *qh, facetT *facet, pointT **point0, pointT **point1, realT *mindist);
  76. setT *qh_facetvertices(qhT *qh, facetT *facetlist, setT *facets, boolT allfacets);
  77. void qh_geomplanes(qhT *qh, facetT *facet, realT *outerplane, realT *innerplane);
  78. void qh_markkeep(qhT *qh, facetT *facetlist);
  79. setT *qh_markvoronoi(qhT *qh, facetT *facetlist, setT *facets, boolT printall, boolT *isLowerp, int *numcentersp);
  80. void qh_order_vertexneighbors(qhT *qh, vertexT *vertex);
  81. void qh_prepare_output(qhT *qh);
  82. void qh_printafacet(qhT *qh, FILE *fp, qh_PRINT format, facetT *facet, boolT printall);
  83. void qh_printbegin(qhT *qh, FILE *fp, qh_PRINT format, facetT *facetlist, setT *facets, boolT printall);
  84. void qh_printcenter(qhT *qh, FILE *fp, qh_PRINT format, const char *string, facetT *facet);
  85. void qh_printcentrum(qhT *qh, FILE *fp, facetT *facet, realT radius);
  86. void qh_printend(qhT *qh, FILE *fp, qh_PRINT format, facetT *facetlist, setT *facets, boolT printall);
  87. void qh_printend4geom(qhT *qh, FILE *fp, facetT *facet, int *num, boolT printall);
  88. void qh_printextremes(qhT *qh, FILE *fp, facetT *facetlist, setT *facets, boolT printall);
  89. void qh_printextremes_2d(qhT *qh, FILE *fp, facetT *facetlist, setT *facets, boolT printall);
  90. void qh_printextremes_d(qhT *qh, FILE *fp, facetT *facetlist, setT *facets, boolT printall);
  91. void qh_printfacet(qhT *qh, FILE *fp, facetT *facet);
  92. void qh_printfacet2math(qhT *qh, FILE *fp, facetT *facet, qh_PRINT format, int notfirst);
  93. void qh_printfacet2geom(qhT *qh, FILE *fp, facetT *facet, realT color[3]);
  94. void qh_printfacet2geom_points(qhT *qh, FILE *fp, pointT *point1, pointT *point2,
  95. facetT *facet, realT offset, realT color[3]);
  96. void qh_printfacet3math(qhT *qh, FILE *fp, facetT *facet, qh_PRINT format, int notfirst);
  97. void qh_printfacet3geom_nonsimplicial(qhT *qh, FILE *fp, facetT *facet, realT color[3]);
  98. void qh_printfacet3geom_points(qhT *qh, FILE *fp, setT *points, facetT *facet, realT offset, realT color[3]);
  99. void qh_printfacet3geom_simplicial(qhT *qh, FILE *fp, facetT *facet, realT color[3]);
  100. void qh_printfacet3vertex(qhT *qh, FILE *fp, facetT *facet, qh_PRINT format);
  101. void qh_printfacet4geom_nonsimplicial(qhT *qh, FILE *fp, facetT *facet, realT color[3]);
  102. void qh_printfacet4geom_simplicial(qhT *qh, FILE *fp, facetT *facet, realT color[3]);
  103. void qh_printfacetNvertex_nonsimplicial(qhT *qh, FILE *fp, facetT *facet, int id, qh_PRINT format);
  104. void qh_printfacetNvertex_simplicial(qhT *qh, FILE *fp, facetT *facet, qh_PRINT format);
  105. void qh_printfacetheader(qhT *qh, FILE *fp, facetT *facet);
  106. void qh_printfacetridges(qhT *qh, FILE *fp, facetT *facet);
  107. void qh_printfacets(qhT *qh, FILE *fp, qh_PRINT format, facetT *facetlist, setT *facets, boolT printall);
  108. void qh_printhyperplaneintersection(qhT *qh, FILE *fp, facetT *facet1, facetT *facet2,
  109. setT *vertices, realT color[3]);
  110. void qh_printline3geom(qhT *qh, FILE *fp, pointT *pointA, pointT *pointB, realT color[3]);
  111. void qh_printneighborhood(qhT *qh, FILE *fp, qh_PRINT format, facetT *facetA, facetT *facetB, boolT printall);
  112. void qh_printpoint(qhT *qh, FILE *fp, const char *string, pointT *point);
  113. void qh_printpointid(qhT *qh, FILE *fp, const char *string, int dim, pointT *point, int id);
  114. void qh_printpoint3(qhT *qh, FILE *fp, pointT *point);
  115. void qh_printpoints_out(qhT *qh, FILE *fp, facetT *facetlist, setT *facets, boolT printall);
  116. void qh_printpointvect(qhT *qh, FILE *fp, pointT *point, coordT *normal, pointT *center, realT radius, realT color[3]);
  117. void qh_printpointvect2(qhT *qh, FILE *fp, pointT *point, coordT *normal, pointT *center, realT radius);
  118. void qh_printridge(qhT *qh, FILE *fp, ridgeT *ridge);
  119. void qh_printspheres(qhT *qh, FILE *fp, setT *vertices, realT radius);
  120. void qh_printvdiagram(qhT *qh, FILE *fp, qh_PRINT format, facetT *facetlist, setT *facets, boolT printall);
  121. int qh_printvdiagram2(qhT *qh, FILE *fp, printvridgeT printvridge, setT *vertices, qh_RIDGE innerouter, boolT inorder);
  122. void qh_printvertex(qhT *qh, FILE *fp, vertexT *vertex);
  123. void qh_printvertexlist(qhT *qh, FILE *fp, const char* string, facetT *facetlist,
  124. setT *facets, boolT printall);
  125. void qh_printvertices(qhT *qh, FILE *fp, const char* string, setT *vertices);
  126. void qh_printvneighbors(qhT *qh, FILE *fp, facetT* facetlist, setT *facets, boolT printall);
  127. void qh_printvoronoi(qhT *qh, FILE *fp, qh_PRINT format, facetT *facetlist, setT *facets, boolT printall);
  128. void qh_printvnorm(qhT *qh, FILE *fp, vertexT *vertex, vertexT *vertexA, setT *centers, boolT unbounded);
  129. void qh_printvridge(qhT *qh, FILE *fp, vertexT *vertex, vertexT *vertexA, setT *centers, boolT unbounded);
  130. void qh_produce_output(qhT *qh);
  131. void qh_produce_output2(qhT *qh);
  132. void qh_projectdim3(qhT *qh, pointT *source, pointT *destination);
  133. int qh_readfeasible(qhT *qh, int dim, const char *curline);
  134. coordT *qh_readpoints(qhT *qh, int *numpoints, int *dimension, boolT *ismalloc);
  135. void qh_setfeasible(qhT *qh, int dim);
  136. boolT qh_skipfacet(qhT *qh, facetT *facet);
  137. char *qh_skipfilename(qhT *qh, char *filename);
  138. #ifdef __cplusplus
  139. } /* extern "C" */
  140. #endif
  141. #endif /* qhDEFio */