Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Analysis.AlgorithmBehavior/qhull-2012.1/src/libqhullcpp/qt-qhull.cpp @ 10207

Last change on this file since 10207 was 10207, checked in by ascheibe, 11 years ago

#1886 added a unit test for volume calculation and the qhull library

File size: 2.8 KB
Line 
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
26namespace orgQhull {
27
28#//Conversions
29
30QList<coordT> Coordinates::
31toQList() 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
41QList<QhullFacet> QhullFacetList::
42toQList() 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
56QList<QhullVertex> QhullFacetList::
57vertices_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
67QList<QhullFacet> QhullFacetSet::
68toQList() 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
82QList<coordT> QhullHyperplane::
83toQList() 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
95QList<coordT> QhullPoint::
96toQList() 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
106QList<QhullPoint> QhullPoints::
107toQList() 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
117QList<QhullPoint> QhullPointSet::
118toQList() 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
Note: See TracBrowser for help on using the repository browser.