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; }
85  void setFeasiblePoint(const Coordinates &c) { feasible_point= c; }
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); }
106  QhullVertex endVertex() const { return QhullVertex(qh_qh, qh_qh->vertex_tail); }
107  QhullFacetList facetList() const;
108  QhullFacet firstFacet() const { return beginFacet(); }
109  QhullVertex firstVertex() const { return beginVertex(); }
110  QhullPoints points() const;
113  coordT * pointCoordinateBegin() const { return qh_qh->first_point; }
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
qhT::facet_tail
facetT * facet_tail
Definition: libqhull.h:678
QhullFacet.h
orgQhull::Qhull::pointCoordinateEnd
coordT * pointCoordinateEnd() const
Definition: Qhull.h:120
coordT
#define coordT
Definition: libqhull.h:80
orgQhull::Qhull::endVertex
QhullVertex endVertex() const
Definition: Qhull.h:112
countT
int countT
Definition: user_r.h:182
orgQhull::Qhull::rboxCommand
const char * rboxCommand() const
Definition: Qhull.h:89
orgQhull::Coordinates::data
coordT * data()
Definition: Coordinates.h:79
orgQhull::Qhull::otherPoints
QhullPointSet otherPoints() const
Definition: Qhull.cpp:197
orgQhull::QhullQh::setFactorEpsilon
void setFactorEpsilon(double a)
Definition: QhullQh.h:87
orgQhull::Qhull::inputOrigin
QhullPoint inputOrigin()
Return origin point for qh.input_dim.
Definition: Qhull.cpp:133
orgQhull::Qhull::hasOutputStream
bool hasOutputStream() const
Definition: Qhull.h:81
orgQhull
QhullRidge – Qhull's ridge structure, ridgeT, as a C++ class.
Definition: Coordinates.cpp:21
qhT::vertex_tail
vertexT * vertex_tail
Definition: libqhull.h:691
qhT::hull_dim
int hull_dim
Definition: libqhull.h:591
orgQhull::Qhull::runQhull
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
orgQhull::QhullPoints
Java-style iterator.
Definition: QhullPoints.h:34
orgQhull::Qhull::outputQhull
void outputQhull()
Definition: Qhull.cpp:211
orgQhull::QhullPoint
Definition: QhullPoint.h:39
realT
#define realT
Definition: user.h:154
qhT::rbox_command
char rbox_command[256]
Definition: libqhull.h:600
orgQhull::QhullPointSet
Definition: QhullPointSet.h:37
orgQhull::Qhull::pointCoordinateBegin
coordT * pointCoordinateBegin() const
Same as points().coordinates()
Definition: Qhull.h:119
orgQhull::QhullQh::factorEpsilon
double factorEpsilon() const
Definition: QhullQh.h:86
orgQhull::Qhull::qh
QhullQh * qh() const
Definition: Qhull.h:87
orgQhull::Qhull::endFacet
QhullFacet endFacet() const
Definition: Qhull.h:111
orgQhull::QhullVertex
Definition: QhullVertex.h:48
qhT::num_facets
int num_facets
Definition: libqhull.h:694
orgQhull::Qhull::origin_point
Coordinates origin_point
qhT for this instance
Definition: Qhull.h:54
orgQhull::Qhull::volume
double volume()
Definition: Qhull.cpp:156
orgQhull::Qhull::allocateQhullQh
void allocateQhullQh()
Definition: Qhull.cpp:80
orgQhull::QhullQh::qhullStatus
int qhullStatus() const
Definition: QhullQh.cpp:167
orgQhull::QhullQh::hasOutputStream
bool hasOutputStream() const
Definition: QhullQh.h:95
qhT::vertex_list
vertexT * vertex_list
Definition: libqhull.h:690
orgQhull::Qhull::vertexList
QhullVertexList vertexList() const
Return vertices of the convex hull.
Definition: Qhull.cpp:204
qhT::ROTATErandom
int ROTATErandom
Definition: libqhull.h:557
orgQhull::Qhull::qhullMessage
std::string qhullMessage() const
Definition: Qhull.h:100
qhT::num_points
int num_points
Definition: libqhull.h:593
orgQhull::Qhull::firstVertex
QhullVertex firstVertex() const
Definition: Qhull.h:115
orgQhull::Qhull
Interface to Qhull from C++.
Definition: Qhull.h:49
orgQhull::QhullQh::clearQhullMessage
void clearQhullMessage()
clearQhullMessage does not throw errors (~Qhull)
Definition: QhullQh.cpp:102
c
c
orgQhull::Qhull::initialized
bool initialized() const
Definition: Qhull.h:82
orgQhull::Qhull::beginVertex
QhullVertex beginVertex() const
Definition: Qhull.h:109
orgQhull::Qhull::vertexCount
countT vertexCount() const
Definition: Qhull.h:92
orgQhull::Qhull::clearQhullMessage
void clearQhullMessage()
Definition: Qhull.h:97
orgQhull::QhullQh
POD type equivalent to qhT. No virtual members.
Definition: QhullQh.h:58
orgQhull::Qhull::defineVertexNeighborFacets
void defineVertexNeighborFacets()
Automatically called if merging facets or Voronoi diagram.
Definition: Qhull.cpp:174
orgQhull::Qhull::beginFacet
QhullFacet beginFacet() const
Definition: Qhull.h:108
orgQhull::Qhull::disableOutputStream
void disableOutputStream()
Definition: Qhull.h:76
orgQhull::Qhull::Qhull
Qhull()
call runQhull() next
Definition: Qhull.cpp:41
qhT::qhull_command
char qhull_command[256]
Definition: libqhull.h:598
qhT::first_point
pointT * first_point
Definition: libqhull.h:594
orgQhull::Qhull::qh_qh
QhullQh * qh_qh
Definition: Qhull.h:53
orgQhull::Qhull::enableOutputStream
void enableOutputStream()
Definition: Qhull.h:77
qhT::num_vertices
int num_vertices
Definition: libqhull.h:696
orgQhull::QhullQh::enableOutputStream
void enableOutputStream()
Definition: QhullQh.h:89
orgQhull::Qhull::facetList
QhullFacetList facetList() const
Definition: Qhull.cpp:186
orgQhull::Qhull::setOutputStream
void setOutputStream(std::ostream *os)
Definition: Qhull.h:105
orgQhull::QhullQh::setErrorStream
void setErrorStream(std::ostream *os)
Definition: QhullQh.cpp:173
orgQhull::Qhull::points
QhullPoints points() const
Definition: Qhull.cpp:191
orgQhull::Qhull::qhullCommand
const char * qhullCommand() const
Definition: Qhull.h:88
orgQhull::Qhull::feasiblePoint
Coordinates feasiblePoint() const
Definition: Qhull.cpp:120
orgQhull::QhullFacet
A QhullFacet is the C++ equivalent to Qhull's facetT*.
Definition: QhullFacet.h:43
orgQhull::RboxPoints
Definition: RboxPoints.h:37
orgQhull::Qhull::setFactorEpsilon
void setFactorEpsilon(double a)
Definition: Qhull.h:104
QhullPoint.h
orgQhull::Qhull::~Qhull
~Qhull()
Definition: Qhull.cpp:95
orgQhull::QhullQh::qhullMessage
std::string qhullMessage() const
qhullMessage does not throw errors (~Qhull)
Definition: QhullQh.cpp:157
orgQhull::Qhull::facetCount
countT facetCount() const
Definition: Qhull.h:78
orgQhull::QhullQh::setOutputStream
void setOutputStream(std::ostream *os)
Updates use_output_stream.
Definition: QhullQh.cpp:180
orgQhull::QhullLinkedList
Definition: QhullLinkedList.h:50
orgQhull::QhullQh::hasQhullMessage
bool hasQhullMessage() const
hasQhullMessage does not throw errors (~Qhull)
Definition: QhullQh.cpp:111
orgQhull::Qhull::qhullStatus
int qhullStatus() const
Definition: Qhull.h:102
orgQhull::Qhull::initializeFeasiblePoint
void initializeFeasiblePoint(int hulldim)
Definition: Qhull.cpp:323
QHULL_ASSERT
#define QHULL_ASSERT
Definition: QhullError.h:16
qhT::input_dim
int input_dim
Definition: libqhull.h:592
orgQhull::Qhull::inputComment
const char * inputComment() const
Definition: Qhull.h:83
QhullVertex.h
orgQhull::Qhull::feasible_point
Coordinates feasible_point
True at start of runQhull. Errors if call again.
Definition: Qhull.h:56
orgQhull::QhullQh::disableOutputStream
void disableOutputStream()
Definition: QhullQh.h:88
orgQhull::Qhull::setErrorStream
void setErrorStream(std::ostream *os)
Definition: Qhull.h:103
orgQhull::Qhull::hasQhullMessage
bool hasQhullMessage() const
Definition: Qhull.h:101
orgQhull::Qhull::origin
QhullPoint origin()
non-const due to QhullPoint
Definition: Qhull.h:86
orgQhull::Qhull::firstFacet
QhullFacet firstFacet() const
Definition: Qhull.h:114


hpp-fcl
Author(s):
autogenerated on Fri Aug 2 2024 02:45:14