1 | /****************************************************************************
|
---|
2 | **
|
---|
3 | ** Copyright (c) 2009-2012 C.B. Barber. All rights reserved.
|
---|
4 | ** $Id: //main/2011/qhull/src/libqhullcpp/qt-qhull.cpp#4 $$Change: 1490 $
|
---|
5 | ** $DateTime: 2012/02/19 20:27:01 $$Author: bbarber $
|
---|
6 | **
|
---|
7 | ****************************************************************************/
|
---|
8 |
|
---|
9 | #include <QList>
|
---|
10 | #include "RoadTest.h"
|
---|
11 |
|
---|
12 | #ifndef QHULL_USES_QT
|
---|
13 | #define QHULL_USES_QT 1
|
---|
14 | #endif
|
---|
15 |
|
---|
16 | #include "Coordinates.h"
|
---|
17 | #include "QhullFacetList.h"
|
---|
18 | #include "QhullFacetSet.h"
|
---|
19 | #include "QhullHyperplane.h"
|
---|
20 | #include "QhullPoint.h"
|
---|
21 | #include "QhullPoints.h"
|
---|
22 | #include "QhullPointSet.h"
|
---|
23 | #include "QhullVertex.h"
|
---|
24 | #include "QhullVertexSet.h"
|
---|
25 |
|
---|
26 | namespace orgQhull {
|
---|
27 |
|
---|
28 | #//Conversions
|
---|
29 |
|
---|
30 | QList<coordT> Coordinates::
|
---|
31 | toQList() const
|
---|
32 | {
|
---|
33 | CoordinatesIterator i(*this);
|
---|
34 | QList<coordT> cs;
|
---|
35 | while(i.hasNext()){
|
---|
36 | cs.append(i.next());
|
---|
37 | }
|
---|
38 | return cs;
|
---|
39 | }//toQList
|
---|
40 |
|
---|
41 | QList<QhullFacet> QhullFacetList::
|
---|
42 | toQList() const
|
---|
43 | {
|
---|
44 | QhullLinkedListIterator<QhullFacet> i(*this);
|
---|
45 | QList<QhullFacet> vs;
|
---|
46 | while(i.hasNext()){
|
---|
47 | QhullFacet f= i.next();
|
---|
48 | if(isSelectAll() || f.isGood()){
|
---|
49 | vs.append(f);
|
---|
50 | }
|
---|
51 | }
|
---|
52 | return vs;
|
---|
53 | }//toQList
|
---|
54 |
|
---|
55 | //! Same as PrintVertices
|
---|
56 | QList<QhullVertex> QhullFacetList::
|
---|
57 | vertices_toQList(int qhRunId) const
|
---|
58 | {
|
---|
59 | QList<QhullVertex> vs;
|
---|
60 | QhullVertexSet qvs(qhRunId, first().getFacetT(), NULL, isSelectAll());
|
---|
61 | for(QhullVertexSet::iterator i=qvs.begin(); i!=qvs.end(); ++i){
|
---|
62 | vs.push_back(*i);
|
---|
63 | }
|
---|
64 | return vs;
|
---|
65 | }//vertices_toQList
|
---|
66 |
|
---|
67 | QList<QhullFacet> QhullFacetSet::
|
---|
68 | toQList() const
|
---|
69 | {
|
---|
70 | QhullSetIterator<QhullFacet> i(*this);
|
---|
71 | QList<QhullFacet> vs;
|
---|
72 | while(i.hasNext()){
|
---|
73 | QhullFacet f= i.next();
|
---|
74 | if(isSelectAll() || f.isGood()){
|
---|
75 | vs.append(f);
|
---|
76 | }
|
---|
77 | }
|
---|
78 | return vs;
|
---|
79 | }//toQList
|
---|
80 |
|
---|
81 | #ifdef QHULL_USES_QT
|
---|
82 | QList<coordT> QhullHyperplane::
|
---|
83 | toQList() const
|
---|
84 | {
|
---|
85 | QhullHyperplaneIterator i(*this);
|
---|
86 | QList<coordT> fs;
|
---|
87 | while(i.hasNext()){
|
---|
88 | fs.append(i.next());
|
---|
89 | }
|
---|
90 | fs.append(hyperplane_offset);
|
---|
91 | return fs;
|
---|
92 | }//toQList
|
---|
93 | #endif //QHULL_USES_QT
|
---|
94 |
|
---|
95 | QList<coordT> QhullPoint::
|
---|
96 | toQList() const
|
---|
97 | {
|
---|
98 | QhullPointIterator i(*this);
|
---|
99 | QList<coordT> vs;
|
---|
100 | while(i.hasNext()){
|
---|
101 | vs.append(i.next());
|
---|
102 | }
|
---|
103 | return vs;
|
---|
104 | }//toQList
|
---|
105 |
|
---|
106 | QList<QhullPoint> QhullPoints::
|
---|
107 | toQList() const
|
---|
108 | {
|
---|
109 | QhullPointsIterator i(*this);
|
---|
110 | QList<QhullPoint> vs;
|
---|
111 | while(i.hasNext()){
|
---|
112 | vs.append(i.next());
|
---|
113 | }
|
---|
114 | return vs;
|
---|
115 | }//toQList
|
---|
116 |
|
---|
117 | QList<QhullPoint> QhullPointSet::
|
---|
118 | toQList() const
|
---|
119 | {
|
---|
120 | QhullPointSetIterator i(*this);
|
---|
121 | QList<QhullPoint> vs;
|
---|
122 | while(i.hasNext()){
|
---|
123 | vs.append(i.next());
|
---|
124 | }
|
---|
125 | return vs;
|
---|
126 | }//toQList
|
---|
127 |
|
---|
128 | }//orgQhull
|
---|
129 |
|
---|