Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef QHULLFACETSET_H
00010 #define QHULLFACETSET_H
00011
00012 #include "QhullSet.h"
00013
00014 #include <ostream>
00015
00016 namespace orgQhull {
00017
00018 #//ClassRef
00019 class QhullFacet;
00020
00021 #//Types
00022
00023 class QhullFacetSet;
00024 typedef QhullSetIterator<QhullFacet>
00025 QhullFacetSetIterator;
00026
00027 class QhullFacetSet : public QhullSet<QhullFacet> {
00028
00029 private:
00030 #//Fields
00031 bool select_all;
00032
00033 public:
00034 #//Constructor
00035
00036 explicit QhullFacetSet(setT *s) : QhullSet<QhullFacet>(s), select_all(false) {}
00037
00038 QhullFacetSet(const QhullFacetSet &o) : QhullSet<QhullFacet>(o), select_all(o.select_all) {}
00039
00040 private:
00042 QhullFacetSet();
00043 QhullFacetSet &operator=(const QhullFacetSet &);
00044 public:
00045
00046 #//Conversion
00047 #ifndef QHULL_NO_STL
00048 std::vector<QhullFacet> toStdVector() const;
00049 #endif //QHULL_NO_STL
00050 #ifdef QHULL_USES_QT
00051 QList<QhullFacet> toQList() const;
00052 #endif //QHULL_USES_QT
00053
00054 #//GetSet
00055 bool isSelectAll() const { return select_all; }
00056 void selectAll() { select_all= true; }
00057 void selectGood() { select_all= false; }
00058
00059 #//Read-only
00060
00061 int count() const;
00062 bool contains(const QhullFacet &f) const;
00063 int count(const QhullFacet &f) const;
00065
00066 #//IO
00067
00068
00069 struct PrintFacetSet{
00070 const QhullFacetSet *facet_set;
00071 const char *print_message;
00072 int run_id;
00073 PrintFacetSet(int qhRunId, const char *message, const QhullFacetSet *s) : facet_set(s), print_message(message), run_id(qhRunId) {}
00074 };
00075 const PrintFacetSet print(int qhRunId, const char *message) const { return PrintFacetSet(qhRunId, message, this); }
00076
00077 struct PrintIdentifiers{
00078 const QhullFacetSet *facet_set;
00079 const char *print_message;
00080 PrintIdentifiers(const char *message, const QhullFacetSet *s) : facet_set(s), print_message(message) {}
00081 };
00082 PrintIdentifiers printIdentifiers(const char *message) const { return PrintIdentifiers(message, this); }
00083
00084 };
00085
00086 }
00087
00088 #//== Global namespace =========================================
00089
00090 std::ostream &operator<<(std::ostream &os, const orgQhull::QhullFacetSet &fs);
00091 std::ostream &operator<<(std::ostream &os, const orgQhull::QhullFacetSet::PrintFacetSet &pr);
00092 std::ostream &operator<<(std::ostream &os, const orgQhull::QhullFacetSet::PrintIdentifiers &p);
00093
00094 #endif // QHULLFACETSET_H