00001
00002
00003
00004
00005
00006
00007
00008
00009 #include <QList>
00010 #include "RoadTest.h"
00011
00012 #ifndef QHULL_USES_QT
00013 #define QHULL_USES_QT 1
00014 #endif
00015
00016 #include "Coordinates.h"
00017 #include "QhullFacetList.h"
00018 #include "QhullFacetSet.h"
00019 #include "QhullHyperplane.h"
00020 #include "QhullPoint.h"
00021 #include "QhullPoints.h"
00022 #include "QhullPointSet.h"
00023 #include "QhullVertex.h"
00024 #include "QhullVertexSet.h"
00025
00026 namespace orgQhull {
00027
00028 #//Conversions
00029
00030 QList<coordT> Coordinates::
00031 toQList() const
00032 {
00033 CoordinatesIterator i(*this);
00034 QList<coordT> cs;
00035 while(i.hasNext()){
00036 cs.append(i.next());
00037 }
00038 return cs;
00039 }
00040
00041 QList<QhullFacet> QhullFacetList::
00042 toQList() const
00043 {
00044 QhullLinkedListIterator<QhullFacet> i(*this);
00045 QList<QhullFacet> vs;
00046 while(i.hasNext()){
00047 QhullFacet f= i.next();
00048 if(isSelectAll() || f.isGood()){
00049 vs.append(f);
00050 }
00051 }
00052 return vs;
00053 }
00054
00056 QList<QhullVertex> QhullFacetList::
00057 vertices_toQList(int qhRunId) const
00058 {
00059 QList<QhullVertex> vs;
00060 QhullVertexSet qvs(qhRunId, first().getFacetT(), NULL, isSelectAll());
00061 for(QhullVertexSet::iterator i=qvs.begin(); i!=qvs.end(); ++i){
00062 vs.push_back(*i);
00063 }
00064 return vs;
00065 }
00066
00067 QList<QhullFacet> QhullFacetSet::
00068 toQList() const
00069 {
00070 QhullSetIterator<QhullFacet> i(*this);
00071 QList<QhullFacet> vs;
00072 while(i.hasNext()){
00073 QhullFacet f= i.next();
00074 if(isSelectAll() || f.isGood()){
00075 vs.append(f);
00076 }
00077 }
00078 return vs;
00079 }
00080
00081 #ifdef QHULL_USES_QT
00082 QList<coordT> QhullHyperplane::
00083 toQList() const
00084 {
00085 QhullHyperplaneIterator i(*this);
00086 QList<coordT> fs;
00087 while(i.hasNext()){
00088 fs.append(i.next());
00089 }
00090 fs.append(hyperplane_offset);
00091 return fs;
00092 }
00093 #endif //QHULL_USES_QT
00094
00095 QList<coordT> QhullPoint::
00096 toQList() const
00097 {
00098 QhullPointIterator i(*this);
00099 QList<coordT> vs;
00100 while(i.hasNext()){
00101 vs.append(i.next());
00102 }
00103 return vs;
00104 }
00105
00106 QList<QhullPoint> QhullPoints::
00107 toQList() const
00108 {
00109 QhullPointsIterator i(*this);
00110 QList<QhullPoint> vs;
00111 while(i.hasNext()){
00112 vs.append(i.next());
00113 }
00114 return vs;
00115 }
00116
00117 QList<QhullPoint> QhullPointSet::
00118 toQList() const
00119 {
00120 QhullPointSetIterator i(*this);
00121 QList<QhullPoint> vs;
00122 while(i.hasNext()){
00123 vs.append(i.next());
00124 }
00125 return vs;
00126 }
00127
00128 }
00129