25 using std::ostringstream;
71 QCOMPARE(p12.
id(), -3);
87 QVERIFY(p2.isValid());
88 QCOMPARE(p2.dimension(),3);
103 c << 0.0 << 0.0 << 0.0;
107 QCOMPARE(p11, q.
origin());
121 QCOMPARE(vs.size(), 3u);
123 QCOMPARE(vs[k], p[k]);
125 QList<double> qs= p.toQList();
126 QCOMPARE(qs.size(), 3);
128 QCOMPARE(qs[k], p[k]);
139 cout <<
"Point ids in 'rbox c'\n";
144 cout <<
"p" <<
id << endl;
147 QCOMPARE(
id, p.
id());
148 QVERIFY(p.
id()>=0 && p.
id()<9);
153 QCOMPARE(q.
qh(), p.
qh());
175 QVERIFY(idx>-8 && idx<8);
209 QCOMPARE(c[k], p[k]);
214 QCOMPARE(p2[0], 10.0);
245 QCOMPARE((*i3), p[1]);
280 QCOMPARE(i2, p.begin());
282 QCOMPARE(i2 += 3, p.end());
283 QCOMPARE(i2 -= 3, p.begin());
284 QCOMPARE(i2+0, p.begin());
285 QCOMPARE(i2+3, p.end());
290 QCOMPARE(i, p.begin());
324 QCOMPARE((*i3), p[1]);
364 QhullPointIterator i= p2;
366 QVERIFY(!i.hasNext());
367 QVERIFY(!i.hasPrevious());
369 QVERIFY(!i.hasNext());
370 QVERIFY(!i.hasPrevious());
373 QhullPointIterator i2(p);
374 QCOMPARE(p.dimension(), 3);
376 QVERIFY(i2.hasNext());
377 QVERIFY(!i2.hasPrevious());
378 QVERIFY(i.hasNext());
379 QVERIFY(!i.hasPrevious());
382 QVERIFY(!i2.hasNext());
383 QVERIFY(i2.hasPrevious());
384 QVERIFY(i.hasNext());
385 QVERIFY(!i.hasPrevious());
388 QCOMPARE(i.peekNext(), p[0]);
389 QCOMPARE(i2.peekPrevious(), p[2]);
390 QCOMPARE(i2.previous(), p[2]);
391 QCOMPARE(i2.previous(), p[1]);
392 QCOMPARE(i2.previous(), p[0]);
393 QVERIFY(!i2.hasPrevious());
394 QCOMPARE(i.peekNext(), p[0]);
396 QCOMPARE(i.next(), p[0]);
397 QCOMPARE(i.peekNext(), p[1]);
398 QCOMPARE(i.next(), p[1]);
399 QCOMPARE(i.next(), p[2]);
400 QVERIFY(!i.hasNext());
402 QCOMPARE(i.next(), p[0]);
413 QCOMPARE(dist, sqrt(
double(2.0+1.0))/2);
426 os <<
"Point w/ print:\n";
427 os << p.
print(
" message ");
428 os << p.printWithIdentifier(
" Point with id and a message ");
430 QString s= QString::fromStdString(os.str());
431 QCOMPARE(s.count(
"p"), 2);
437 #include "moc/QhullPoint_test.moc" QhullRidge – Qhull's ridge structure, ridgeT, as a C++ class.
POD type equivalent to qhT. No virtual members.
void t_qhullpoint_iterator()
const_iterator constBegin() const
QhullVertexList vertexList() const
Return vertices of the convex hull.
QhullPoint::iterator Iterator
QhullVertex beginVertex() const
void add_QhullPoint_test()
QhullVertex firstVertex() const
void setDimension(int pointDimension)
void advancePoint(countT idx)
Interface to Qhull from C++.
QhullPoint::const_iterator ConstIterator
const coordT * const_iterator
QhullPoint origin()
non-const due to QhullPoint
std::vector< coordT > toStdVector() const
const_iterator constEnd() const
PrintPoint print(const char *message) const
void setCoordinates(coordT *c)
void cleanup()
Executed after each test.
int dimension() const
Dimension of input and result.
const coordT * coordinates() const
0 if undefined
double distance(const QhullPoint &p) const
Return distance between two points.