File indexing completed on 2025-01-18 10:01:55
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef QHULLCPP_H
0010 #define QHULLCPP_H
0011
0012 #include "libqhullcpp/QhullPoint.h"
0013 #include "libqhullcpp/QhullVertex.h"
0014 #include "libqhullcpp/QhullFacet.h"
0015
0016 namespace orgQhull {
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033 #
0034 class QhullFacetList;
0035 class QhullPoints;
0036 class QhullQh;
0037 class RboxPoints;
0038
0039 #
0040 class Qhull;
0041
0042
0043 class Qhull {
0044
0045 private:
0046 #
0047 QhullQh * qh_qh;
0048 Coordinates origin_point;
0049 bool run_called;
0050 Coordinates feasible_point;
0051
0052 public:
0053 #
0054 Qhull();
0055 Qhull(const RboxPoints &rboxPoints, const char *qhullCommand2);
0056 Qhull(const char *inputComment2, int pointDimension, int pointCount, const realT *pointCoordinates, const char *qhullCommand2);
0057 ~Qhull() throw();
0058 private:
0059 Qhull(const Qhull &);
0060 Qhull & operator=(const Qhull &);
0061
0062 private:
0063 void allocateQhullQh();
0064
0065 public:
0066
0067 #
0068 void checkIfQhullInitialized();
0069 int dimension() const { return qh_qh->input_dim; }
0070 void disableOutputStream() { qh_qh->disableOutputStream(); }
0071 void enableOutputStream() { qh_qh->enableOutputStream(); }
0072 countT facetCount() const { return qh_qh->num_facets; }
0073 Coordinates feasiblePoint() const;
0074 int hullDimension() const { return qh_qh->hull_dim; }
0075 bool hasOutputStream() const { return qh_qh->hasOutputStream(); }
0076 bool initialized() const { return (qh_qh->hull_dim>0); }
0077 const char * inputComment() const { return qh_qh->rbox_command; }
0078 QhullPoint inputOrigin();
0079 bool isDelaunay() const { return qh_qh->DELAUNAY; }
0080
0081 QhullPoint origin() { QHULL_ASSERT(initialized()); return QhullPoint(qh_qh, origin_point.data()); }
0082 QhullQh * qh() const { return qh_qh; }
0083 const char * qhullCommand() const { return qh_qh->qhull_command; }
0084 const char * rboxCommand() const { return qh_qh->rbox_command; }
0085 int rotateRandom() const { return qh_qh->ROTATErandom; }
0086 void setFeasiblePoint(const Coordinates &c) { feasible_point= c; }
0087 countT vertexCount() const { return qh_qh->num_vertices; }
0088
0089 #
0090 double angleEpsilon() const { return qh_qh->angleEpsilon(); }
0091 void appendQhullMessage(const std::string &s) { qh_qh->appendQhullMessage(s); }
0092 void clearQhullMessage() { qh_qh->clearQhullMessage(); }
0093 double distanceEpsilon() const { return qh_qh->distanceEpsilon(); }
0094 double factorEpsilon() const { return qh_qh->factorEpsilon(); }
0095 std::string qhullMessage() const { return qh_qh->qhullMessage(); }
0096 bool hasQhullMessage() const { return qh_qh->hasQhullMessage(); }
0097 int qhullStatus() const { return qh_qh->qhullStatus(); }
0098 void setErrorStream(std::ostream *os) { qh_qh->setErrorStream(os); }
0099 void setFactorEpsilon(double a) { qh_qh->setFactorEpsilon(a); }
0100 void setOutputStream(std::ostream *os) { qh_qh->setOutputStream(os); }
0101
0102 #
0103 QhullFacet beginFacet() const { return QhullFacet(qh_qh, qh_qh->facet_list); }
0104 QhullVertex beginVertex() const { return QhullVertex(qh_qh, qh_qh->vertex_list); }
0105 void defineVertexNeighborFacets();
0106 QhullFacet endFacet() const { return QhullFacet(qh_qh, qh_qh->facet_tail); }
0107 QhullVertex endVertex() const { return QhullVertex(qh_qh, qh_qh->vertex_tail); }
0108 QhullFacetList facetList() const;
0109 QhullFacet firstFacet() const { return beginFacet(); }
0110 QhullVertex firstVertex() const { return beginVertex(); }
0111 QhullPoints points() const;
0112 QhullPointSet otherPoints() const;
0113
0114 coordT * pointCoordinateBegin() const { return qh_qh->first_point; }
0115 coordT * pointCoordinateEnd() const { return qh_qh->first_point + qh_qh->num_points*qh_qh->hull_dim; }
0116 QhullVertexList vertexList() const;
0117
0118 #
0119 double area();
0120 void outputQhull();
0121 void outputQhull(const char * outputflags);
0122 void prepareVoronoi(bool *isLower, int *voronoiVertexCount);
0123 void runQhull(const RboxPoints &rboxPoints, const char *qhullCommand2);
0124 void runQhull(const char *inputComment2, int pointDimension, int pointCount, const realT *pointCoordinates, const char *qhullCommand2);
0125 double volume();
0126
0127 #
0128 private:
0129 void initializeFeasiblePoint(int hulldim);
0130 };
0131
0132 }
0133
0134 #endif