File indexing completed on 2025-01-18 10:01:55
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef QHULLFACETLIST_H
0010 #define QHULLFACETLIST_H
0011
0012 #include "libqhullcpp/QhullLinkedList.h"
0013 #include "libqhullcpp/QhullFacet.h"
0014
0015 #include <ostream>
0016
0017 #ifndef QHULL_NO_STL
0018 #include <vector>
0019 #endif
0020
0021 namespace orgQhull {
0022
0023 #
0024 class Qhull;
0025 class QhullFacet;
0026 class QhullQh;
0027
0028 #
0029
0030
0031 class QhullFacetList;
0032
0033 typedef QhullLinkedListIterator<QhullFacet> QhullFacetListIterator;
0034
0035 class QhullFacetList : public QhullLinkedList<QhullFacet> {
0036
0037 #
0038 private:
0039 bool select_all;
0040
0041 #
0042 public:
0043 QhullFacetList(const Qhull &q, facetT *b, facetT *e);
0044 QhullFacetList(QhullQh *qqh, facetT *b, facetT *e);
0045 QhullFacetList(QhullFacet b, QhullFacet e) : QhullLinkedList<QhullFacet>(b, e), select_all(false) {}
0046
0047 QhullFacetList(const QhullFacetList &other) : QhullLinkedList<QhullFacet>(*other.begin(), *other.end()), select_all(other.select_all) {}
0048 QhullFacetList & operator=(const QhullFacetList &other) { QhullLinkedList<QhullFacet>::operator =(other); select_all= other.select_all; return *this; }
0049 ~QhullFacetList() {}
0050
0051 private:
0052 QhullFacetList();
0053 public:
0054
0055 #
0056 #ifndef QHULL_NO_STL
0057 std::vector<QhullFacet> toStdVector() const;
0058 std::vector<QhullVertex> vertices_toStdVector() const;
0059 #endif
0060 #ifdef QHULL_USES_QT
0061 QList<QhullFacet> toQList() const;
0062 QList<QhullVertex> vertices_toQList() const;
0063 #endif
0064
0065 #
0066
0067 countT count() const;
0068 bool contains(const QhullFacet &f) const;
0069 countT count(const QhullFacet &f) const;
0070 bool isSelectAll() const { return select_all; }
0071 QhullQh * qh() const { return first().qh(); }
0072 void selectAll() { select_all= true; }
0073 void selectGood() { select_all= false; }
0074
0075
0076 #
0077 struct PrintFacetList{
0078 const QhullFacetList *facet_list;
0079 const char * print_message;
0080 PrintFacetList(const QhullFacetList &fl, const char *message) : facet_list(&fl), print_message(message) {}
0081 };
0082 PrintFacetList print(const char *message) const { return PrintFacetList(*this, message); }
0083
0084 struct PrintFacets{
0085 const QhullFacetList *facet_list;
0086 PrintFacets(const QhullFacetList &fl) : facet_list(&fl) {}
0087 };
0088 PrintFacets printFacets() const { return PrintFacets(*this); }
0089
0090 struct PrintVertices{
0091 const QhullFacetList *facet_list;
0092 PrintVertices(const QhullFacetList &fl) : facet_list(&fl) {}
0093 };
0094 PrintVertices printVertices() const { return PrintVertices(*this); }
0095 };
0096
0097 }
0098
0099 #
0100
0101 std::ostream &operator<<(std::ostream &os, const orgQhull::QhullFacetList::PrintFacetList &p);
0102 std::ostream &operator<<(std::ostream &os, const orgQhull::QhullFacetList::PrintFacets &p);
0103 std::ostream &operator<<(std::ostream &os, const orgQhull::QhullFacetList::PrintVertices &p);
0104 std::ostream &operator<<(std::ostream &os, const orgQhull::QhullFacetList &fs);
0105
0106 #endif