QhullFacetList.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/QhullFacetList.h#2 $$Change: 2066 $
5 ** $DateTime: 2016/01/18 19:29:17 $$Author: bbarber $
6 **
7 ****************************************************************************/
8 
9 #ifndef QHULLFACETLIST_H
10 #define QHULLFACETLIST_H
11 
13 #include "libqhullcpp/QhullFacet.h"
14 
15 #include <ostream>
16 
17 #ifndef QHULL_NO_STL
18 #include <vector>
19 #endif
20 
21 namespace orgQhull {
22 
23 #
24  class Qhull;
25  class QhullFacet;
26  class QhullQh;
27 
28 #
29  class QhullFacetList;
32  typedef QhullLinkedListIterator<QhullFacet> QhullFacetListIterator;
34 
35 class QhullFacetList : public QhullLinkedList<QhullFacet> {
36 
37 #
38 private:
39  bool select_all;
40 
41 #
42 public:
43  QhullFacetList(const Qhull &q, facetT *b, facetT *e);
44  QhullFacetList(QhullQh *qqh, facetT *b, facetT *e);
45  QhullFacetList(QhullFacet b, QhullFacet e) : QhullLinkedList<QhullFacet>(b, e), select_all(false) {}
46  //Copy constructor copies pointer but not contents. Needed for return by value and parameter passing.
47  QhullFacetList(const QhullFacetList &other) : QhullLinkedList<QhullFacet>(*other.begin(), *other.end()), select_all(other.select_all) {}
48  QhullFacetList & operator=(const QhullFacetList &other) { QhullLinkedList<QhullFacet>::operator =(other); select_all= other.select_all; return *this; }
50 
51 private:
53 public:
54 
55 #
56 #ifndef QHULL_NO_STL
57  std::vector<QhullFacet> toStdVector() const;
58  std::vector<QhullVertex> vertices_toStdVector() const;
59 #endif //QHULL_NO_STL
60 #ifdef QHULL_USES_QT
61  QList<QhullFacet> toQList() const;
62  QList<QhullVertex> vertices_toQList() const;
63 #endif //QHULL_USES_QT
64 
65 #
66  countT count() const;
68  bool contains(const QhullFacet &f) const;
69  countT count(const QhullFacet &f) const;
70  bool isSelectAll() const { return select_all; }
71  QhullQh * qh() const { return first().qh(); }
72  void selectAll() { select_all= true; }
73  void selectGood() { select_all= false; }
75 
76 #
77  struct PrintFacetList{
79  const char * print_message;
80  PrintFacetList(const QhullFacetList &fl, const char *message) : facet_list(&fl), print_message(message) {}
81  };//PrintFacetList
82  PrintFacetList print(const char *message) const { return PrintFacetList(*this, message); }
83 
84  struct PrintFacets{
86  PrintFacets(const QhullFacetList &fl) : facet_list(&fl) {}
87  };//PrintFacets
88  PrintFacets printFacets() const { return PrintFacets(*this); }
89 
90  struct PrintVertices{
92  PrintVertices(const QhullFacetList &fl) : facet_list(&fl) {}
93  };//PrintVertices
94  PrintVertices printVertices() const { return PrintVertices(*this); }
95 };//class QhullFacetList
96 
97 }//namespace orgQhull
98 
99 #
100 
101 std::ostream &operator<<(std::ostream &os, const orgQhull::QhullFacetList::PrintFacetList &p);
102 std::ostream &operator<<(std::ostream &os, const orgQhull::QhullFacetList::PrintFacets &p);
103 std::ostream &operator<<(std::ostream &os, const orgQhull::QhullFacetList::PrintVertices &p);
104 std::ostream &operator<<(std::ostream &os, const orgQhull::QhullFacetList &fs);
105 
106 #endif // QHULLFACETLIST_H
std::vector< QhullFacet > toStdVector() const
void selectGood()
operator==() does not depend on isGood()
PrintVertices(const QhullFacetList &fl)
QhullFacetList()
Disable default constructor. See QhullLinkedList.
QhullRidge – Qhull&#39;s ridge structure, ridgeT, as a C++ class.
Definition: Coordinates.cpp:21
POD type equivalent to qhT. No virtual members.
Definition: QhullQh.h:58
A QhullFacet is the C++ equivalent to Qhull&#39;s facetT*.
Definition: QhullFacet.h:37
std::ostream & operator<<(std::ostream &os, const orgQhull::QhullFacetList::PrintFacetList &p)
PrintFacetList print(const char *message) const
QhullLinkedList< T > & operator=(const QhullLinkedList< T > &other)
Copy assignment copies begin_node and end_node, but not the list elements.
PrintFacets(const QhullFacetList &fl)
QhullFacetList(const QhullFacetList &other)
countT count() const
Filtered by facet.isGood(). May be 0 when !isEmpty().
bool contains(const QhullFacet &f) const
PrintFacets printFacets() const
Interface to Qhull from C++.
Definition: Qhull.h:43
QhullQh * qh() const
Definition: QhullFacet.h:86
QhullQh * qh() const
PrintVertices printVertices() const
QhullFacetList(QhullFacet b, QhullFacet e)
PrintFacetList(const QhullFacetList &fl, const char *message)
QhullFacetList & operator=(const QhullFacetList &other)
std::vector< QhullVertex > vertices_toStdVector() const
Same as PrintVertices.
int countT
Definition: user_r.h:182
QhullLinkedListIterator< QhullFacet > QhullFacetListIterator
QhullFacetListIterator – if(f.isGood()){ ... }.
const char * print_message
non-null message


hpp-fcl
Author(s):
autogenerated on Fri Jun 2 2023 02:39:02