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 
34 : qh_vertex(&s_empty_vertex)
35 , qh_qh(q.qh())
36 {
37 }//Default
38 
40 : qh_vertex(v ? v : &s_empty_vertex)
41 , qh_qh(q.qh())
42 {
43 }//vertexT
44 
45 #
46 
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()){
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 
QhullRidge – Qhull&#39;s ridge structure, ridgeT, as a C++ class.
Definition: Coordinates.cpp:21
vertexT * getVertexT() const
Definition: QhullVertex.h:74
flagT deleted
Definition: libqhull.h:407
int dimension() const
Definition: QhullPoint.h:89
A QhullFacet is the C++ equivalent to Qhull&#39;s facetT*.
Definition: QhullFacet.h:37
countT id() const
Definition: QhullFacet.h:73
qhT qh_qh
Definition: global.c:26
QhullFacetSet neighborFacets() const
Definition: QhullVertex.cpp:50
static vertexT s_empty_vertex
Definition: QhullVertex.h:54
c
list v
Definition: obb.py:45
setT * neighbors
Definition: libqhull.h:400
#define qh
Definition: libqhull.h:457
QhullPoint point() const
Definition: QhullVertex.h:82
countT id() const
Definition: QhullPoint.h:91
QhullSetIterator< QhullFacet > QhullFacetSetIterator
Definition: QhullFacetSet.h:24
ostream & operator<<(ostream &os, const QhullVertex::PrintVertex &pr)
Duplicate of qh_printvertex [io_r.c].
Definition: QhullVertex.cpp:74
Interface to Qhull from C++.
Definition: Qhull.h:43
vertexT * qh_vertex
Corresponding vertexT, never 0.
Definition: QhullVertex.h:50
bool neighborFacetsDefined() const
True if defineVertexNeighborFacets() already called. Auotomatically set for facet merging...
Definition: QhullVertex.h:78
QhullFacet next() const
Definition: QhullFacet.h:81
QhullQh * qh() const
Definition: QhullVertex.h:84
int countT
Definition: user_r.h:182
flagT delridge
Definition: libqhull.h:406
#define realT
Definition: user.h:154
QhullQh * qh_qh
QhullQh/qhT for vertexT, may be 0.
Definition: QhullVertex.h:51
const coordT * coordinates() const
0 if undefined
Definition: QhullPoint.h:84
countT id() const
Definition: QhullVertex.h:75


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