QhullVertex.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/QhullVertex.h#3 $$Change: 2066 $
5 ** $DateTime: 2016/01/18 19:29:17 $$Author: bbarber $
6 **
7 ****************************************************************************/
8 
9 #ifndef QHULLVERTEX_H
10 #define QHULLVERTEX_H
11 
12 extern "C" {
13  #include "libqhull_r/qhull_ra.h"
14 }
15 #include "libqhullcpp/QhullPoint.h"
17 #include "libqhullcpp/QhullSet.h"
18 
19 #include <ostream>
20 
21 namespace orgQhull {
22 
23 #
24  class QhullFacetSet;
25 
26 #
27  class QhullVertex;
29  typedef QhullLinkedList<QhullVertex> QhullVertexList;
30  typedef QhullLinkedListIterator<QhullVertex> QhullVertexListIterator;
31 
32 
33 /*********************
34  topological information:
35  next,previous doubly-linked list of all vertices
36  neighborFacets set of adjacent facets (only if qh.VERTEXneighbors)
37 
38  geometric information:
39  point array of DIM coordinates
40 */
41 
42 class QhullVertex {
43 
44 #
45 public:
46  typedef vertexT * base_type; // for QhullVertexSet
47 
48 private:
49 #
50  vertexT * qh_vertex;
51  QhullQh * qh_qh;
52 
53 #
54  static vertexT s_empty_vertex; // needed for shallow copy
55 
56 public:
57 #
58 
59 #
60  QhullVertex() : qh_vertex(&s_empty_vertex), qh_qh(0) {}
61  explicit QhullVertex(const Qhull &q);
62  QhullVertex(const Qhull &q, vertexT *v);
63  explicit QhullVertex(QhullQh *qqh) : qh_vertex(&s_empty_vertex), qh_qh(qqh) {}
65  // Creates an alias. Does not copy QhullVertex. Needed for return by value and parameter passing
66  QhullVertex(const QhullVertex &other) : qh_vertex(other.qh_vertex), qh_qh(other.qh_qh) {}
67  // Creates an alias. Does not copy QhullVertex. Needed for vector<QhullVertex>
68  QhullVertex & operator=(const QhullVertex &other) { qh_vertex= other.qh_vertex; qh_qh= other.qh_qh; return *this; }
69  ~QhullVertex() {}
70 
71 #
72  int dimension() const { return (qh_qh ? qh_qh->hull_dim : 0); }
73  vertexT * getBaseT() const { return getVertexT(); }
74  vertexT * getVertexT() const { return qh_vertex; }
75  countT id() const { return qh_vertex->id; }
76  bool isValid() const { return (qh_qh && qh_vertex != &s_empty_vertex); }
78  bool neighborFacetsDefined() const { return qh_vertex->neighbors != 0; }
80  bool operator==(const QhullVertex &other) const { return qh_vertex==other.qh_vertex; }
81  bool operator!=(const QhullVertex &other) const { return !operator==(other); }
84  QhullQh * qh() const { return qh_qh; }
85 
86 #
87  //See also QhullVertexList
89 
90 #
91  struct PrintVertex{
92  const QhullVertex *vertex;
93  const char * print_message;
94  PrintVertex(const char *message, const QhullVertex &v) : vertex(&v), print_message(message) {}
95  };//PrintVertex
96  PrintVertex print(const char *message) const { return PrintVertex(message, *this); }
97 };//class QhullVertex
98 
99 }//namespace orgQhull
100 
101 #
102 
103 std::ostream &operator<<(std::ostream &os, const orgQhull::QhullVertex::PrintVertex &pr);
104 inline std::ostream &operator<<(std::ostream &os, const orgQhull::QhullVertex &v) { os << v.print(""); return os; }
105 
106 #endif // QHULLVERTEX_H
orgQhull::QhullVertex::previous
QhullVertex previous() const
Definition: QhullVertex.h:96
countT
int countT
Definition: user_r.h:182
print
void print(const Eigen::SparseMatrix< Scalar, Options > &mat)
vertexT::next
vertexT * next
Definition: libqhull.h:397
orgQhull::QhullFacetSet
Definition: QhullFacetSet.h:33
orgQhull
QhullRidge – Qhull's ridge structure, ridgeT, as a C++ class.
Definition: Coordinates.cpp:21
orgQhull::QhullVertexList
QhullLinkedList< QhullVertex > QhullVertexList
Definition: QhullVertex.h:34
orgQhull::QhullVertex::operator!=
bool operator!=(const QhullVertex &other) const
Definition: QhullVertex.h:94
orgQhull::QhullPoint
Definition: QhullPoint.h:39
vertexT::point
pointT * point
Definition: libqhull.h:399
orgQhull::QhullVertex::QhullVertex
QhullVertex()
Definition: QhullVertex.h:73
orgQhull::QhullVertex::base_type
vertexT * base_type
Definition: QhullVertex.h:59
orgQhull::QhullVertex
Definition: QhullVertex.h:48
QhullSet.h
orgQhull::QhullVertex::id
countT id() const
Definition: QhullVertex.h:88
orgQhull::QhullVertex::QhullVertex
QhullVertex(const QhullVertex &other)
Definition: QhullVertex.h:79
orgQhull::Qhull
Interface to Qhull from C++.
Definition: Qhull.h:49
orgQhull::QhullVertex::operator==
bool operator==(const QhullVertex &other) const
Definition: QhullVertex.h:93
operator<<
std::ostream & operator<<(std::ostream &os, const orgQhull::QhullVertex::PrintVertex &pr)
orgQhull::QhullVertex::neighborFacets
QhullFacetSet neighborFacets() const
Definition: QhullVertex.cpp:56
orgQhull::QhullVertex::operator=
QhullVertex & operator=(const QhullVertex &other)
Definition: QhullVertex.h:81
vertexT::previous
vertexT * previous
Definition: libqhull.h:398
orgQhull::QhullQh
POD type equivalent to qhT. No virtual members.
Definition: QhullQh.h:58
orgQhull::QhullVertex::~QhullVertex
~QhullVertex()
Definition: QhullVertex.h:82
orgQhull::QhullVertex::s_empty_vertex
static vertexT s_empty_vertex
Definition: QhullVertex.h:67
qhull_ra.h
orgQhull::QhullVertex::qh_qh
QhullQh * qh_qh
QhullQh/qhT for vertexT, may be 0.
Definition: QhullVertex.h:64
orgQhull::QhullVertex::qh_vertex
vertexT * qh_vertex
Corresponding vertexT, never 0.
Definition: QhullVertex.h:63
orgQhull::QhullVertexListIterator
QhullLinkedListIterator< QhullVertex > QhullVertexListIterator
Definition: QhullVertex.h:36
orgQhull::QhullVertex::neighborFacetsDefined
bool neighborFacetsDefined() const
True if defineVertexNeighborFacets() already called. Auotomatically set for facet merging,...
Definition: QhullVertex.h:91
orgQhull::QhullVertex::getVertexT
vertexT * getVertexT() const
Definition: QhullVertex.h:87
orgQhull::QhullVertex::isValid
bool isValid() const
Definition: QhullVertex.h:89
QhullPoint.h
orgQhull::QhullVertex::qh
QhullQh * qh() const
Definition: QhullVertex.h:97
orgQhull::QhullVertex::point
QhullPoint point() const
Definition: QhullVertex.h:95
vertexT
Definition: libqhull.h:396
orgQhull::QhullVertex::next
QhullVertex next() const
Definition: QhullVertex.h:92
vertexT::neighbors
setT * neighbors
Definition: libqhull.h:400
vertexT::id
unsigned id
Definition: libqhull.h:402
obb.v
list v
Definition: obb.py:48
orgQhull::QhullVertex::PrintVertex
Definition: QhullVertex.h:104
QhullLinkedList.h


hpp-fcl
Author(s):
autogenerated on Fri Aug 2 2024 02:45:15