Qhull.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (c) 2008-2015 C.B. Barber. All rights reserved.
4 ** $Id: //main/2015/qhull/src/libqhullcpp/Qhull.h#3 $$Change: 2066 $
5 ** $DateTime: 2016/01/18 19:29:17 $$Author: bbarber $
6 **
7 ****************************************************************************/
8 
9 #ifndef QHULLCPP_H
10 #define QHULLCPP_H
11 
12 #include "libqhullcpp/QhullPoint.h"
14 #include "libqhullcpp/QhullFacet.h"
15 
16 namespace orgQhull {
17 
18 /***
19  Compile qhullcpp and libqhull with the same compiler. setjmp() and longjmp() must be the same.
20 
21  #define QHULL_NO_STL
22  Do not supply conversions to STL
23  Coordinates.h requires <vector>. It could be rewritten for another vector class such as QList
24  #define QHULL_USES_QT
25  Supply conversions to QT
26  qhulltest requires QT. It is defined in RoadTest.h
27 
28  #define QHULL_ASSERT
29  Defined by QhullError.h
30  It invokes assert()
31 */
32 
33 #
34  class QhullFacetList;
35  class QhullPoints;
36  class QhullQh;
37  class RboxPoints;
38 
39 #
40  class Qhull;
41 
43 class Qhull {
44 
45 private:
46 #
47  QhullQh * qh_qh;
48  Coordinates origin_point;
49  bool run_called;
50  Coordinates feasible_point;
51 
52 public:
53 #
54  Qhull();
55  Qhull(const RboxPoints &rboxPoints, const char *qhullCommand2);
56  Qhull(const char *inputComment2, int pointDimension, int pointCount, const realT *pointCoordinates, const char *qhullCommand2);
57  ~Qhull() throw();
58 private:
59  Qhull(const Qhull &);
60  Qhull & operator=(const Qhull &);
61 
62 private:
63  void allocateQhullQh();
64 
65 public:
66 
67 #
68  void checkIfQhullInitialized();
69  int dimension() const { return qh_qh->input_dim; }
72  countT facetCount() const { return qh_qh->num_facets; }
73  Coordinates feasiblePoint() const;
74  int hullDimension() const { return qh_qh->hull_dim; }
75  bool hasOutputStream() const { return qh_qh->hasOutputStream(); }
76  bool initialized() const { return (qh_qh->hull_dim>0); }
77  const char * inputComment() const { return qh_qh->rbox_command; }
81  QhullQh * qh() const { return qh_qh; };
82  const char * qhullCommand() const { return qh_qh->qhull_command; }
83  const char * rboxCommand() const { return qh_qh->rbox_command; }
84  int rotateRandom() const { return qh_qh->ROTATErandom; }
86  countT vertexCount() const { return qh_qh->num_vertices; }
87 
88 #
89  double angleEpsilon() const { return qh_qh->angleEpsilon(); }
90  void appendQhullMessage(const std::string &s) { qh_qh->appendQhullMessage(s); }
92  double distanceEpsilon() const { return qh_qh->distanceEpsilon(); }
93  double factorEpsilon() const { return qh_qh->factorEpsilon(); }
94  std::string qhullMessage() const { return qh_qh->qhullMessage(); }
95  bool hasQhullMessage() const { return qh_qh->hasQhullMessage(); }
96  int qhullStatus() const { return qh_qh->qhullStatus(); }
97  void setErrorStream(std::ostream *os) { qh_qh->setErrorStream(os); }
98  void setFactorEpsilon(double a) { qh_qh->setFactorEpsilon(a); }
99  void setOutputStream(std::ostream *os) { qh_qh->setOutputStream(os); }
100 
101 #
102  QhullFacet beginFacet() const { return QhullFacet(qh_qh, qh_qh->facet_list); }
107  QhullFacetList facetList() const;
108  QhullFacet firstFacet() const { return beginFacet(); }
109  QhullVertex firstVertex() const { return beginVertex(); }
110  QhullPoints points() const;
111  QhullPointSet otherPoints() const;
115  QhullVertexList vertexList() const;
116 
117 #
118  double area();
119  void outputQhull();
120  void outputQhull(const char * outputflags);
121  void runQhull(const RboxPoints &rboxPoints, const char *qhullCommand2);
122  void runQhull(const char *inputComment2, int pointDimension, int pointCount, const realT *pointCoordinates, const char *qhullCommand2);
123  double volume();
124 
125 #
126 private:
127  void initializeFeasiblePoint(int hulldim);
128 };//Qhull
129 
130 }//namespace orgQhull
131 
132 #endif // QHULLCPP_H
int qhullStatus() const
Definition: QhullQh.cpp:167
int hull_dim
Definition: libqhull.h:591
QhullPoint inputOrigin()
Return origin point for qh.input_dim.
Definition: Qhull.cpp:133
void setFactorEpsilon(double a)
Definition: QhullQh.h:87
double distanceEpsilon() const
Epsilon for distance to hyperplane.
Definition: QhullQh.h:106
QhullRidge – Qhull&#39;s ridge structure, ridgeT, as a C++ class.
Definition: Coordinates.cpp:21
QhullQh * qh_qh
Definition: Qhull.h:47
void enableOutputStream()
Definition: QhullQh.h:89
bool hasQhullMessage() const
hasQhullMessage does not throw errors (~Qhull)
Definition: QhullQh.cpp:111
bool initialized() const
Definition: Qhull.h:76
facetT * facet_tail
Definition: libqhull.h:678
POD type equivalent to qhT. No virtual members.
Definition: QhullQh.h:58
QhullPointSet otherPoints() const
Definition: Qhull.cpp:197
double factorEpsilon() const
Definition: QhullQh.h:86
double volume()
Definition: Qhull.cpp:156
Qhull()
call runQhull() next
Definition: Qhull.cpp:41
A QhullFacet is the C++ equivalent to Qhull&#39;s facetT*.
Definition: QhullFacet.h:37
QhullFacet firstFacet() const
Definition: Qhull.h:108
pointT * first_point
Definition: libqhull.h:594
coordT * pointCoordinateEnd() const
Definition: Qhull.h:114
Coordinates origin_point
qhT for this instance
Definition: Qhull.h:48
void outputQhull()
Definition: Qhull.cpp:211
int num_facets
Definition: libqhull.h:694
QhullPoints points() const
Definition: Qhull.cpp:191
bool hasOutputStream() const
Definition: Qhull.h:75
QhullVertexList vertexList() const
Return vertices of the convex hull.
Definition: Qhull.cpp:204
void initializeFeasiblePoint(int hulldim)
Definition: Qhull.cpp:323
Java-style iterator.
Definition: QhullPoints.h:28
void clearQhullMessage()
Definition: Qhull.h:91
void defineVertexNeighborFacets()
Automatically called if merging facets or Voronoi diagram.
Definition: Qhull.cpp:174
vertexT * vertex_tail
Definition: libqhull.h:691
QhullVertex beginVertex() const
Definition: Qhull.h:103
QhullVertex firstVertex() const
Definition: Qhull.h:109
#define coordT
Definition: libqhull.h:80
QhullFacetList facetList() const
Definition: Qhull.cpp:186
const char * inputComment() const
Definition: Qhull.h:77
void setErrorStream(std::ostream *os)
Definition: Qhull.h:97
countT vertexCount() const
Definition: Qhull.h:86
Coordinates feasible_point
True at start of runQhull. Errors if call again.
Definition: Qhull.h:50
#define QHULL_ASSERT
Definition: QhullError.h:16
int num_points
Definition: libqhull.h:593
void clearQhullMessage()
clearQhullMessage does not throw errors (~Qhull)
Definition: QhullQh.cpp:102
QhullFacet beginFacet() const
Definition: Qhull.h:102
void disableOutputStream()
Definition: Qhull.h:70
int qhullStatus() const
Definition: Qhull.h:96
Interface to Qhull from C++.
Definition: Qhull.h:43
int rotateRandom() const
Return QRn for repeating QR0 runs.
Definition: Qhull.h:84
int ROTATErandom
Definition: libqhull.h:557
QhullQh * qh() const
Definition: Qhull.h:81
void enableOutputStream()
Definition: Qhull.h:71
void setFeasiblePoint(const Coordinates &c)
Sets qh.feasible_point via initializeFeasiblePoint.
Definition: Qhull.h:85
void runQhull(const RboxPoints &rboxPoints, const char *qhullCommand2)
For qhull commands, see http://www.qhull.org/html/qhull.htm or html/qhull.htm.
Definition: Qhull.cpp:256
QhullVertex endVertex() const
Definition: Qhull.h:106
int hullDimension() const
Dimension of the computed hull.
Definition: Qhull.h:74
QhullPoint origin()
non-const due to QhullPoint
Definition: Qhull.h:80
void setOutputStream(std::ostream *os)
Definition: Qhull.h:99
void allocateQhullQh()
Definition: Qhull.cpp:80
void setFactorEpsilon(double a)
Definition: Qhull.h:98
int num_vertices
Definition: libqhull.h:696
std::string qhullMessage() const
qhullMessage does not throw errors (~Qhull)
Definition: QhullQh.cpp:157
const char * qhullCommand() const
Definition: Qhull.h:82
bool hasQhullMessage() const
Definition: Qhull.h:95
void setOutputStream(std::ostream *os)
Updates use_output_stream.
Definition: QhullQh.cpp:180
std::string qhullMessage() const
Definition: Qhull.h:94
Coordinates feasiblePoint() const
Definition: Qhull.cpp:120
const char * rboxCommand() const
Definition: Qhull.h:83
void disableOutputStream()
Definition: QhullQh.h:88
int input_dim
Definition: libqhull.h:592
bool hasOutputStream() const
Definition: QhullQh.h:95
void setErrorStream(std::ostream *os)
Definition: QhullQh.cpp:173
int countT
Definition: user_r.h:182
int dimension() const
Dimension of input and result.
Definition: Qhull.h:69
double distanceEpsilon() const
Epsilon for distance to hyperplane.
Definition: Qhull.h:92
char qhull_command[256]
Definition: libqhull.h:598
char rbox_command[256]
Definition: libqhull.h:600
#define realT
Definition: user.h:154
QhullFacet endFacet() const
Definition: Qhull.h:105
coordT * pointCoordinateBegin() const
Same as points().coordinates()
Definition: Qhull.h:113
countT facetCount() const
Definition: Qhull.h:72
double factorEpsilon() const
Factor for angleEpsilon and distanceEpsilon.
Definition: Qhull.h:93
vertexT * vertex_list
Definition: libqhull.h:690


hpp-fcl
Author(s):
autogenerated on Fri Jun 2 2023 02:39:02