11 #include "QhullVertex.h"
12 #include "QhullVertexSet.h"
13 #include "QhullPoint.h"
14 #include "QhullRidge.h"
15 #include "QhullVertex.h"
22 #pragma warning( disable : 4611)
29 QhullVertexSet(
const Qhull &q, facetT *facetlist, setT *facetset,
bool allfacets)
30 : QhullSet<QhullVertex>(q.qh(), 0)
31 , qhsettemp_defined(false)
34 setT *vertices= qh_facetvertices(q.qh(), facetlist, facetset, allfacets);
36 qhsettemp_defined=
true;
38 q.qh()->NOerrexit=
true;
39 q.qh()->maybeThrowQhullMessage(QH_TRY_status);
45 QhullVertexSet(QhullQh *qqh, facetT *facetlist, setT *facetset,
bool allfacets)
46 : QhullSet<QhullVertex>(qqh, 0)
47 , qhsettemp_defined(false)
50 setT *vertices= qh_facetvertices(qh(), facetlist, facetset, allfacets);
52 qhsettemp_defined=
true;
54 qh()->NOerrexit=
true;
55 qh()->maybeThrowQhullMessage(QH_TRY_status);
63 QhullVertexSet(
const QhullVertexSet &other)
64 : QhullSet<QhullVertex>(other)
65 , qhsettemp_defined(false)
67 if(other.qhsettemp_defined){
68 throw QhullError(10077,
"QhullVertexSet: Cannot use copy constructor since qhsettemp_defined (e.g., QhullVertexSet for a set and/or list of QhFacet). Contains %d vertices", other.count());
74 QhullVertexSet & QhullVertexSet::
75 operator=(
const QhullVertexSet &other)
77 QhullSet<QhullVertex>::operator=(other);
78 qhsettemp_defined=
false;
79 if(other.qhsettemp_defined){
80 throw QhullError(10078,
"QhullVertexSet: Cannot use copy constructor since qhsettemp_defined (e.g., QhullVertexSet for a set and/or list of QhFacet). Contains %d vertices", other.count());
88 if(qhsettemp_defined){
89 qhsettemp_defined=
false;
91 qh_settempfree(qh(), referenceSetT());
93 qh()->NOerrexit=
true;
94 qh()->maybeThrowQhullMessage(QH_TRY_status, QhullError::NOthrow);
106 std::vector<QhullVertex> QhullVertexSet::
109 QhullSetIterator<QhullVertex> i(*
this);
110 std::vector<QhullVertex> vs;
112 QhullVertex v= i.next();
125 using orgQhull::QhullPoint;
126 using orgQhull::QhullVertex;
127 using orgQhull::QhullVertexSet;
128 using orgQhull::QhullVertexSetIterator;
132 operator<<(ostream &os,
const QhullVertexSet::PrintIdentifiers &pr)
134 os << pr.print_message;
135 for(QhullVertexSet::const_iterator i= pr.vertex_set->begin(); i!=pr.vertex_set->end(); ++i){
136 const QhullVertex v= *i;
137 os <<
" v" << v.id();
145 operator<<(ostream &os,
const QhullVertexSet::PrintVertexSet &pr){
147 os << pr.print_message;
148 const QhullVertexSet *vs= pr.vertex_set;
149 QhullVertexSetIterator i= *vs;
151 const QhullVertex v= i.next();
152 const QhullPoint p= v.point();
153 os <<
" p" << p.id() <<
"(v" << v.id() <<
")";
ostream & operator<<(ostream &os, const QhullVertexSet::PrintIdentifiers &pr)
Print Vertex identifiers to stream. Space prefix. From qh_printVertexheader [io_r....
QhullRidge – Qhull's ridge structure, ridgeT, as a C++ class.