QhullFacetSet.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/QhullFacetSet.h#2 $$Change: 2066 $
5 ** $DateTime: 2016/01/18 19:29:17 $$Author: bbarber $
6 **
7 ****************************************************************************/
8 
9 #ifndef QHULLFACETSET_H
10 #define QHULLFACETSET_H
11 
12 #include "libqhullcpp/QhullSet.h"
13 #include "libqhullcpp/QhullFacet.h"
14 
15 #include <ostream>
16 
17 namespace orgQhull {
18 
19 #
20  class Qhull;
21 
22 #
23  class QhullFacetSet;
25  typedef QhullSetIterator<QhullFacet> QhullFacetSetIterator;
26 
27 class QhullFacetSet : public QhullSet<QhullFacet> {
28 
29 #
30 public:
31  typedef facetT * base_type; // for QhullVertexSet
32 
33 private:
34 #
35  bool select_all;
36 
37 public:
38 #
39  //Conversion from setT* is not type-safe. Implicit conversion for void* to T
40  QhullFacetSet(const Qhull &q, setT *s) : QhullSet<QhullFacet>(q, s), select_all(false) {}
41  QhullFacetSet(QhullQh *qqh, setT *s) : QhullSet<QhullFacet>(qqh, s), select_all(false) {}
43  QhullFacetSet(const QhullFacetSet &other) : QhullSet<QhullFacet>(other), select_all(other.select_all) {}
45  QhullFacetSet & operator=(const QhullFacetSet &other) { QhullSet<QhullFacet>::operator=(other); select_all= other.select_all; return *this; }
46 
47 private:
50 public:
51 
52 #
53 #ifndef QHULL_NO_STL
54  std::vector<QhullFacet> toStdVector() const;
55 #endif //QHULL_NO_STL
56 #ifdef QHULL_USES_QT
57  QList<QhullFacet> toQList() const;
58 #endif //QHULL_USES_QT
59 
60 #
61  countT count() const;
63  bool contains(const QhullFacet &f) const;
64  countT count(const QhullFacet &f) const;
65  bool isSelectAll() const { return select_all; }
67  void selectAll() { select_all= true; }
68  void selectGood() { select_all= false; }
69 
70 #
71  // Not same as QhullFacetList#IO. A QhullFacetSet is a component of a QhullFacetList.
72 
73  struct PrintFacetSet{
75  const char * print_message;
76  PrintFacetSet(const char *message, const QhullFacetSet *s) : facet_set(s), print_message(message) {}
77  };//PrintFacetSet
78  const PrintFacetSet print(const char *message) const { return PrintFacetSet(message, this); }
79 
82  const char * print_message;
83  PrintIdentifiers(const char *message, const QhullFacetSet *s) : facet_set(s), print_message(message) {}
84  };//PrintIdentifiers
85  PrintIdentifiers printIdentifiers(const char *message) const { return PrintIdentifiers(message, this); }
86 
87 };//class QhullFacetSet
88 
89 }//namespace orgQhull
90 
91 #
92 
93 std::ostream &operator<<(std::ostream &os, const orgQhull::QhullFacetSet &fs);
94 std::ostream &operator<<(std::ostream &os, const orgQhull::QhullFacetSet::PrintFacetSet &pr);
95 std::ostream &operator<<(std::ostream &os, const orgQhull::QhullFacetSet::PrintIdentifiers &p);
96 
97 #endif // QHULLFACETSET_H
orgQhull::QhullFacetSet::count
countT count() const
Filtered by facet.isGood(). May be 0 when !isEmpty().
Definition: QhullFacetSet.cpp:67
QhullFacet.h
countT
int countT
Definition: user_r.h:182
orgQhull::QhullFacetSet::PrintIdentifiers::PrintIdentifiers
PrintIdentifiers(const char *message, const QhullFacetSet *s)
Definition: QhullFacetSet.h:89
orgQhull::QhullFacetSet::PrintFacetSet::print_message
const char * print_message
non-null message
Definition: QhullFacetSet.h:81
orgQhull::QhullFacetSet
Definition: QhullFacetSet.h:33
orgQhull
QhullRidge – Qhull's ridge structure, ridgeT, as a C++ class.
Definition: Coordinates.cpp:21
orgQhull::QhullFacetSet::select_all
bool select_all
Definition: QhullFacetSet.h:41
orgQhull::QhullFacetSet::contains
bool contains(const QhullFacet &f) const
Definition: QhullFacetSet.cpp:52
orgQhull::QhullFacetSet::print
const PrintFacetSet print(const char *message) const
Definition: QhullFacetSet.h:84
QhullSet.h
orgQhull::QhullFacetSet::PrintFacetSet
Definition: QhullFacetSet.h:79
facetT
Definition: libqhull.h:262
orgQhull::QhullFacetSet::isSelectAll
bool isSelectAll() const
Definition: QhullFacetSet.h:71
orgQhull::QhullFacetSet::printIdentifiers
PrintIdentifiers printIdentifiers(const char *message) const
Definition: QhullFacetSet.h:91
orgQhull::Qhull
Interface to Qhull from C++.
Definition: Qhull.h:49
orgQhull::QhullFacetSetIterator
QhullSetIterator< QhullFacet > QhullFacetSetIterator
Definition: QhullFacetSet.h:30
orgQhull::QhullFacetSet::PrintIdentifiers::print_message
const char * print_message
non-null message
Definition: QhullFacetSet.h:88
setT
Definition: qset.h:83
orgQhull::QhullSet
Definition: QhullSet.h:105
orgQhull::QhullQh
POD type equivalent to qhT. No virtual members.
Definition: QhullQh.h:58
orgQhull::QhullFacetSet::toStdVector
std::vector< QhullFacet > toStdVector() const
Definition: QhullFacetSet.cpp:35
q
q
orgQhull::QhullFacetSet::PrintFacetSet::facet_set
const QhullFacetSet * facet_set
Definition: QhullFacetSet.h:80
orgQhull::QhullFacet
A QhullFacet is the C++ equivalent to Qhull's facetT*.
Definition: QhullFacet.h:43
orgQhull::QhullFacetSet::QhullFacetSet
QhullFacetSet(const QhullFacetSet &other)
Copy constructor copies pointers but not contents. Needed for return by value and parameter passing.
Definition: QhullFacetSet.h:49
orgQhull::QhullFacetSet::selectGood
void selectGood()
Definition: QhullFacetSet.h:74
orgQhull::QhullFacetSet::PrintIdentifiers::facet_set
const QhullFacetSet * facet_set
Definition: QhullFacetSet.h:87
operator<<
std::ostream & operator<<(std::ostream &os, const orgQhull::QhullFacetSet &fs)
orgQhull::QhullFacetSet::selectAll
void selectAll()
operator==() does not depend on isGood()
Definition: QhullFacetSet.h:73
orgQhull::QhullFacetSet::PrintFacetSet::PrintFacetSet
PrintFacetSet(const char *message, const QhullFacetSet *s)
Definition: QhullFacetSet.h:82
orgQhull::QhullFacetSet::operator=
QhullFacetSet & operator=(const QhullFacetSet &other)
Assignment copies pointers but not contents.
Definition: QhullFacetSet.h:51
orgQhull::QhullFacetSet::base_type
facetT * base_type
Definition: QhullFacetSet.h:37
orgQhull::QhullFacetSet::QhullFacetSet
QhullFacetSet()
Disable default constructor. See QhullSetBase.
orgQhull::QhullSet::operator=
QhullSet< T > & operator=(const QhullSet< T > &other)
Definition: QhullSet.h:126
orgQhull::QhullFacetSet::PrintIdentifiers
Definition: QhullFacetSet.h:86


hpp-fcl
Author(s):
autogenerated on Sat Nov 23 2024 03:44:58