22 using std::ostringstream;
65 QVERIFY(ps.isEmpty());
66 QCOMPARE(ps.count(), 0);
67 QCOMPARE(ps.size(), 0u);
69 QVERIFY(!ps2.isEmpty());
70 coplanarCount += ps2.
count();
71 QCOMPARE(ps2.count(), (int)ps2.size());
73 QVERIFY(!ps3.isEmpty());
74 QCOMPARE(ps3.count(), ps2.count());
80 QCOMPARE(coplanarCount, 1000);
90 QVERIFY(ps.
count()>=1);
92 QCOMPARE(vs.size(), ps.
size());
96 QList<QhullPoint> qs= ps.toQList();
97 QCOMPARE(qs.size(),
static_cast<int>(ps.
size()));
112 QVERIFY(ps.
count()>=3);
116 QCOMPARE(ps.
at(1), ps[1]);
117 QCOMPARE(ps.
second(), ps[1]);
118 QCOMPARE(ps.
first(), p);
120 QCOMPARE(ps.
last(), p2);
123 QCOMPARE(ps.
value(2), ps[2]);
124 QCOMPARE(ps.
value(-1), p8);
127 QVERIFY(ps.
value(1, p)!=p);
143 QVERIFY(ps.
count()>=3);
145 QhullPointSet::iterator i2= ps.
begin();
159 QCOMPARE(p2, ps.
last());
166 QCOMPARE((*i3)[0], ps[1][0]);
167 QCOMPARE((*i3).dimension(), 3);
204 QCOMPARE(*i2, ps[1]);
207 QCOMPARE(i2, ps.
begin());
211 QCOMPARE(i2+0, ps.
begin());
217 QCOMPARE(i, ps.
begin());
218 QCOMPARE(i2-i, ps.
count());
232 QVERIFY(ps.
count()>=3);
234 QhullPointSet::const_iterator i2= ps.
begin();
251 QCOMPARE(p2, ps.
last());
278 QVERIFY(ps.
count()>=3);
305 QVERIFY(ps2.
count()==0);
307 QCOMPARE(i2.countRemaining(), 0);
308 QVERIFY(!i2.hasNext());
309 QVERIFY(!i2.hasPrevious());
311 QVERIFY(!i2.hasNext());
312 QVERIFY(!i2.hasPrevious());
315 QVERIFY(ps.count()>=3);
318 QCOMPARE(i2.countRemaining(), ps.count());
319 QVERIFY(i2.hasNext());
320 QVERIFY(!i2.hasPrevious());
321 QVERIFY(i.hasNext());
322 QVERIFY(!i.hasPrevious());
324 QCOMPARE(i2.countRemaining(), 0);
326 QCOMPARE(i.countRemaining(), ps.count());
327 QCOMPARE(i2.countRemaining(), 0);
328 QVERIFY(!i2.hasNext());
329 QVERIFY(i2.hasPrevious());
330 QVERIFY(i.hasNext());
331 QVERIFY(!i.hasPrevious());
340 QCOMPARE(i2.peekPrevious(), p3);
341 QCOMPARE(i2.previous(), p3);
342 QCOMPARE(i2.previous(), ps[ps.count()-2]);
343 QVERIFY(i2.hasPrevious());
344 QCOMPARE(i.peekNext(), p);
346 QCOMPARE(i.next(), p);
347 QCOMPARE(i.countRemaining(), ps.count()-1);
350 QCOMPARE(i.next(), p4);
351 QVERIFY(i.hasNext());
353 QCOMPARE(i.next(), p);
364 QVERIFY(ps.
count()>=3);
365 os <<
"QhullPointSet from coplanarPoints\n" << ps << endl;
366 os << ps.
print(
"\nWith message\n");
368 os <<
"\nAs a point set:\n";
371 QString s= QString::fromStdString(os.str());
372 QCOMPARE(s.count(
" 0.5\n"), 3*ps.count());
373 QCOMPARE(s.count(
"p"), ps.count()+4);
378 #include "moc/QhullPointSet_test.moc" countT indexOf(const T &t) const
std::vector< T > toStdVector() const
countT lastIndexOf(const T &t) const
QhullRidge – Qhull's ridge structure, ridgeT, as a C++ class.
A QhullFacet is the C++ equivalent to Qhull's facetT*.
T value(countT idx) const
QhullSet< QhullPoint >::const_iterator ConstIterator
QhullPointSet coplanarPoints() const
Faster then interator/const_iterator due to T::base_type.
QhullFacet firstFacet() const
facetT * getFacetT() const
bool contains(const T &t) const
QhullFacetList facetList() const
const_iterator constEnd() const
void t_pointset_iterator()
Interface to Qhull from C++.
PrintPointSet print(const char *message) const
QhullSet< QhullPoint >::iterator Iterator
PrintIdentifiers printIdentifiers(const char *message) const
const_iterator constBegin() const
QhullPointSet outsidePoints() const
void cleanup()
Executed after each test.
void add_QhullPointSet_test()
const T at(countT idx) const
int dimension() const
Dimension of input and result.
countT count(const T &t) const