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;
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) {}
64  QhullVertex(QhullQh *qqh, vertexT *v) : qh_vertex(v ? v : &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; }
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{
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
bool operator!=(const QhullVertex &other) const
Definition: QhullVertex.h:81
vertexT * previous
Definition: libqhull.h:398
std::ostream & operator<<(std::ostream &os, const orgQhull::QhullVertex::PrintVertex &pr)
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
vertexT * getVertexT() const
Definition: QhullVertex.h:74
QhullFacetSet neighborFacets() const
Definition: QhullVertex.cpp:50
static vertexT s_empty_vertex
Definition: QhullVertex.h:54
QhullVertex & operator=(const QhullVertex &other)
Definition: QhullVertex.h:68
QhullLinkedListIterator< QhullVertex > QhullVertexListIterator
Definition: QhullVertex.h:30
list v
Definition: obb.py:45
setT * neighbors
Definition: libqhull.h:400
const char * print_message
non-null message
Definition: QhullVertex.h:93
PrintVertex print(const char *message) const
Definition: QhullVertex.h:96
QhullPoint point() const
Definition: QhullVertex.h:82
QhullVertex(const QhullVertex &other)
Definition: QhullVertex.h:66
pointT * point
Definition: libqhull.h:399
Interface to Qhull from C++.
Definition: Qhull.h:43
vertexT * qh_vertex
Corresponding vertexT, never 0.
Definition: QhullVertex.h:50
unsigned id
Definition: libqhull.h:402
PrintVertex(const char *message, const QhullVertex &v)
Definition: QhullVertex.h:94
bool isValid() const
Definition: QhullVertex.h:76
QhullVertex next() const
Definition: QhullVertex.h:79
QhullVertex(QhullQh *qqh)
Definition: QhullVertex.h:63
QhullVertex previous() const
Definition: QhullVertex.h:83
bool neighborFacetsDefined() const
True if defineVertexNeighborFacets() already called. Auotomatically set for facet merging...
Definition: QhullVertex.h:78
vertexT * getBaseT() const
For QhullSet<QhullVertex>
Definition: QhullVertex.h:73
QhullQh * qh() const
Definition: QhullVertex.h:84
bool operator==(const QhullVertex &other) const
Definition: QhullVertex.h:80
QhullVertex(QhullQh *qqh, vertexT *v)
Definition: QhullVertex.h:64
int countT
Definition: user_r.h:182
vertexT * next
Definition: libqhull.h:397
QhullLinkedList< QhullVertex > QhullVertexList
Definition: QhullVertex.h:28
QhullQh * qh_qh
QhullQh/qhT for vertexT, may be 0.
Definition: QhullVertex.h:51
countT id() const
Definition: QhullVertex.h:75


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