File indexing completed on 2025-01-18 10:01:55
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef QHPOINTCOORDINATES_H
0010 #define QHPOINTCOORDINATES_H
0011
0012 #include "libqhull_r/qhull_ra.h"
0013 #include "libqhullcpp/QhullPoints.h"
0014 #include "libqhullcpp/Coordinates.h"
0015
0016 #include <ostream>
0017 #include <string>
0018
0019 #ifndef QHULL_NO_STL
0020 #include <vector>
0021 #endif
0022
0023 namespace orgQhull {
0024
0025 #
0026
0027
0028 class PointCoordinates;
0029
0030
0031
0032
0033
0034 class PointCoordinates : public QhullPoints {
0035
0036 private:
0037 #
0038 Coordinates point_coordinates;
0039
0040 std::string describe_points;
0041
0042 public:
0043 #
0044
0045
0046 PointCoordinates();
0047 explicit PointCoordinates(const std::string &aComment);
0048 PointCoordinates(int pointDimension, const std::string &aComment);
0049
0050 explicit PointCoordinates(const Qhull &q);
0051 PointCoordinates(const Qhull &q, const std::string &aComment);
0052 PointCoordinates(const Qhull &q, int pointDimension, const std::string &aComment);
0053 PointCoordinates(const Qhull &q, int pointDimension, const std::string &aComment, countT coordinatesCount, const coordT *c);
0054
0055 explicit PointCoordinates(QhullQh *qqh);
0056 PointCoordinates(QhullQh *qqh, const std::string &aComment);
0057 PointCoordinates(QhullQh *qqh, int pointDimension, const std::string &aComment);
0058 PointCoordinates(QhullQh *qqh, int pointDimension, const std::string &aComment, countT coordinatesCount, const coordT *c);
0059
0060 PointCoordinates(const PointCoordinates &other);
0061 PointCoordinates & operator=(const PointCoordinates &other);
0062 ~PointCoordinates();
0063
0064 #
0065
0066 #ifndef QHULL_NO_STL
0067 void append(const std::vector<coordT> &otherCoordinates) { if(!otherCoordinates.empty()){ append(static_cast<int>(otherCoordinates.size()), &otherCoordinates[0]); } }
0068 std::vector<coordT> toStdVector() const { return point_coordinates.toStdVector(); }
0069 #endif
0070 #ifdef QHULL_USES_QT
0071 void append(const QList<coordT> &pointCoordinates) { if(!pointCoordinates.isEmpty()){ append(pointCoordinates.count(), &pointCoordinates[0]); } }
0072 QList<coordT> toQList() const { return point_coordinates.toQList(); }
0073 #endif
0074
0075 #
0076
0077 void checkValid() const;
0078 std::string comment() const { return describe_points; }
0079 void makeValid() { defineAs(point_coordinates.count(), point_coordinates.data()); }
0080 const Coordinates & getCoordinates() const { return point_coordinates; }
0081 void setComment(const std::string &s) { describe_points= s; }
0082 void setDimension(int i);
0083
0084 private:
0085
0086 void defineAs(countT coordinatesCount, coordT *c) { QhullPoints::defineAs(coordinatesCount, c); }
0087 public:
0088
0089 #
0090
0091
0092 #
0093
0094 Coordinates::ConstIterator beginCoordinates() const { return point_coordinates.begin(); }
0095 Coordinates::Iterator beginCoordinates() { return point_coordinates.begin(); }
0096 Coordinates::ConstIterator beginCoordinates(countT pointIndex) const;
0097 Coordinates::Iterator beginCoordinates(countT pointIndex);
0098 Coordinates::ConstIterator endCoordinates() const { return point_coordinates.end(); }
0099 Coordinates::Iterator endCoordinates() { return point_coordinates.end(); }
0100
0101 #
0102
0103
0104 #
0105 PointCoordinates operator+(const PointCoordinates &other) const;
0106
0107 #
0108
0109 void append(countT coordinatesCount, const coordT *c);
0110 void append(const coordT &c) { append(1, &c); }
0111 void append(const QhullPoint &p);
0112
0113 void append(const Coordinates &c) { append(c.count(), c.data()); }
0114 void append(const PointCoordinates &other);
0115 void appendComment(const std::string &s);
0116 void appendPoints(std::istream &in);
0117 PointCoordinates & operator+=(const PointCoordinates &other) { append(other); return *this; }
0118 PointCoordinates & operator+=(const coordT &c) { append(c); return *this; }
0119 PointCoordinates & operator+=(const QhullPoint &p) { append(p); return *this; }
0120 PointCoordinates & operator<<(const PointCoordinates &other) { return *this += other; }
0121 PointCoordinates & operator<<(const coordT &c) { return *this += c; }
0122 PointCoordinates & operator<<(const QhullPoint &p) { return *this += p; }
0123
0124 void reserveCoordinates(countT newCoordinates);
0125
0126 #
0127 private:
0128 int indexOffset(int i) const;
0129
0130 };
0131
0132 }
0133
0134 #
0135
0136 std::ostream & operator<<(std::ostream &os, const orgQhull::PointCoordinates &p);
0137
0138 #endif