QhullVertex.cpp
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.cpp#3 $$Change: 2066 $
5 ** $DateTime: 2016/01/18 19:29:17 $$Author: bbarber $
6 **
7 ****************************************************************************/
8 
9 #
10 
12 
13 #include "libqhullcpp/Qhull.h"
14 #include "libqhullcpp/QhullPoint.h"
16 #include "libqhullcpp/QhullFacet.h"
17 
18 #ifdef _MSC_VER // Microsoft Visual C++ -- warning level 4
19 #pragma warning( disable : 4611) // interaction between '_setjmp' and C++ object destruction is non-portable
20 #pragma warning( disable : 4996) // function was declared deprecated(strcpy, localtime, etc.)
21 #endif
22 
23 namespace orgQhull {
24 
25 #
26 vertexT QhullVertex::
27 s_empty_vertex= {0,0,0,0,0,
28  0,0,0,0,0,
29  0};
30 
31 #
32 
33 QhullVertex::QhullVertex(const Qhull &q)
34 : qh_vertex(&s_empty_vertex)
35 , qh_qh(q.qh())
36 {
37 }//Default
38 
39 QhullVertex::QhullVertex(const Qhull &q, vertexT *v)
40 : qh_vertex(v ? v : &s_empty_vertex)
41 , qh_qh(q.qh())
42 {
43 }//vertexT
44 
45 #
46 
50 neighborFacets() const
51 {
52  if(!neighborFacetsDefined()){
53  throw QhullError(10034, "Qhull error: neighboring facets of vertex %d not defined. Please call Qhull::defineVertexNeighborFacets() beforehand.", id());
54  }
56 }//neighborFacets
57 
58 }//namespace orgQhull
59 
60 #
61 
62 using std::endl;
63 using std::ostream;
64 using std::string;
65 using std::vector;
71 
73 ostream &
74 operator<<(ostream &os, const QhullVertex::PrintVertex &pr)
75 {
76  QhullVertex v= *pr.vertex;
77  QhullPoint p= v.point();
78  if(*pr.print_message){
79  os << pr.print_message << " ";
80  }else{
81  os << "- ";
82  }
83  os << "p" << p.id() << " (v" << v.id() << "): ";
84  const realT *c= p.coordinates();
85  for(int k= p.dimension(); k--; ){
86  os << " " << *c++; // FIXUP QH11010 %5.2g
87  }
88  if(v.getVertexT()->deleted){
89  os << " deleted";
90  }
91  if(v.getVertexT()->delridge){
92  os << " ridgedeleted";
93  }
94  os << endl;
95  if(v.neighborFacetsDefined()){
96  QhullFacetSetIterator i= v.neighborFacets();
97  if(i.hasNext()){
98  os << " neighborFacets:";
99  countT count= 0;
100  while(i.hasNext()){
101  if(++count % 100 == 0){
102  os << endl << " ";
103  }
104  QhullFacet f= i.next();
105  os << " f" << f.id();
106  }
107  os << endl;
108  }
109  }
110  return os;
111 }//<< PrintVertex
112 
QhullFacet.h
orgQhull::QhullPoint::id
countT id() const
Definition: QhullPoint.h:97
countT
int countT
Definition: user_r.h:182
orgQhull::QhullFacetSet
Definition: QhullFacetSet.h:33
orgQhull
QhullRidge – Qhull's ridge structure, ridgeT, as a C++ class.
Definition: Coordinates.cpp:21
QhullFacetSet.h
orgQhull::QhullPoint
Definition: QhullPoint.h:39
realT
#define realT
Definition: user.h:154
Qhull.h
orgQhull::QhullVertex::QhullVertex
QhullVertex()
Definition: QhullVertex.h:73
orgQhull::QhullVertex
Definition: QhullVertex.h:48
qh_qh
qhT qh_qh
Definition: global.c:26
orgQhull::Qhull
Interface to Qhull from C++.
Definition: Qhull.h:49
orgQhull::QhullFacetSetIterator
QhullSetIterator< QhullFacet > QhullFacetSetIterator
Definition: QhullFacetSet.h:30
c
c
orgQhull::QhullFacet::next
QhullFacet next() const
Definition: QhullFacet.h:87
orgQhull::QhullVertex::neighborFacets
QhullFacetSet neighborFacets() const
Definition: QhullVertex.cpp:56
qh
#define qh
Definition: libqhull.h:457
orgQhull::QhullFacet::id
countT id() const
Definition: QhullFacet.h:79
orgQhull::QhullVertex::qh_qh
QhullQh * qh_qh
QhullQh/qhT for vertexT, may be 0.
Definition: QhullVertex.h:64
q
q
orgQhull::QhullVertex::qh_vertex
vertexT * qh_vertex
Corresponding vertexT, never 0.
Definition: QhullVertex.h:63
orgQhull::QhullPoint::dimension
int dimension() const
Definition: QhullPoint.h:95
orgQhull::QhullVertex::neighborFacetsDefined
bool neighborFacetsDefined() const
True if defineVertexNeighborFacets() already called. Auotomatically set for facet merging,...
Definition: QhullVertex.h:91
operator<<
ostream & operator<<(ostream &os, const QhullVertex::PrintVertex &pr)
Duplicate of qh_printvertex [io_r.c].
Definition: QhullVertex.cpp:74
orgQhull::QhullFacet
A QhullFacet is the C++ equivalent to Qhull's facetT*.
Definition: QhullFacet.h:43
QhullPoint.h
vertexT
Definition: libqhull.h:396
orgQhull::QhullError
Definition: QhullError.h:26
QhullVertex.h
vertexT::neighbors
setT * neighbors
Definition: libqhull.h:400
obb.v
list v
Definition: obb.py:48


hpp-fcl
Author(s):
autogenerated on Fri Jan 26 2024 03:46:15