66 QCOMPARE(q.
area(),0.0);
67 QFAIL(
"area() did not fail.");
68 }
catch (
const std::exception &e) {
69 cout <<
"INFO : Caught " << e.what();
77 QVERIFY(q.
volume() > 0.99);
85 Qhull q(
"triangle", 2, 3, points,
"");
90 QCOMPARE(q.
area(), 2.0+sqrt(2.0));
108 feasible << 0.0 << 0.0;
113 q.
runQhull(
"normals of square", 3, 4, normals,
"H");
116 cout <<
"Expecting summary of halfspace intersection\n";
119 cout <<
"Expecting no output from qh_fprintf() in Qhull.cpp\n";
136 QFAIL(
"runQhull Fd did not fail.");
137 }
catch (
const std::exception &e) {
138 const char *s= e.what();
139 cout <<
"INFO : Caught " << s;
140 QCOMPARE(QString::fromStdString(s).left(6), QString(
"QH6029"));
150 QCOMPARE(QString::fromStdString(q.
qhullMessage()), QString(
"Append 1"));
152 QCOMPARE(QString::fromStdString(q.
qhullMessage()), QString(
"Append 1\nAppend 2\n"));
155 QCOMPARE(QString::fromStdString(q.
qhullMessage()), QString(
""));
158 cout <<
"INFO : Error stream without output stream\n";
164 QFAIL(
"runQhull Fd did not fail.");
166 cout <<
"INFO : Caught " << e;
167 QCOMPARE(e.errorCode(), 6029);
176 cout <<
"INFO : Error output sent to output stream without error stream\n";
182 QFAIL(
"runQhull TZ did not fail.");
183 }
catch (
const std::exception &e) {
184 const char *s= e.what();
185 cout <<
"INFO : Caught " << s;
186 QCOMPARE(QString::fromLatin1(s).left(6), QString(
"QH6023"));
196 cout <<
"INFO : No error stream or output stream\n";
202 QFAIL(
"outputQhull did not fail.");
203 }
catch (
const std::exception &e) {
204 const char *s= e.what();
205 cout <<
"INFO : Caught " << s;
206 QCOMPARE(QString::fromLatin1(s).left(6), QString(
"QH6029"));
228 QCOMPARE(p.dimension(), 3);
229 QCOMPARE(p[0]+p[1]+p[2], 0.0);
248 QCOMPARE(QString(q.
qhullCommand()), QString(
"qhull s"));
249 QCOMPARE(QString(q.
rboxCommand()), QString(
"rbox \"c\""));
274 QCOMPARE(q.
area(), 6.0);
275 QCOMPARE(q.
volume(), 1.0);
293 QCOMPARE(facets.count(), 6);
296 QCOMPARE(vertices.count(), 8);
299 QCOMPARE(ps.count(), 8);
301 QCOMPARE(ps2.count(), 0);
306 QVERIFY(*c==0.5 || *c==-0.5);
308 QVERIFY(c3[-1]==0.5 || c3[-1]==-0.5);
321 cout <<
"Expecting vertexList and facetList of a 3-d diamond.\n";
323 cout <<
"Expecting normals of a 3-d diamond.\n";
332 cout <<
"FAIL! : Qhull called qh_exit(). Qhull's error handling not available.\n.. See the corresponding Qhull:qhull_message or setErrorStream().\n";
340 fprintf(stderr,
"QH%.4d ", msgcode);
341 vfprintf(stderr, fmt, args);
355 QByteArray ba = s.c_str();
356 return qstrdup(ba.data());
360 #include "moc/Qhull_test.moc"
QhullRidge – Qhull's ridge structure, ridgeT, as a C++ class.
QhullPointSet otherPoints() const
void t_message()
No QhullMessage for errors outside of qhull.
QhullFacet firstFacet() const
coordT * pointCoordinateEnd() const
QhullPoints points() const
QhullVertexList vertexList() const
Return vertices of the convex hull.
void qh_exit(int exitcode)
void appendQhullMessage(const std::string &s)
QhullVertex beginVertex() const
QhullVertex firstVertex() const
QhullFacetList facetList() const
void setErrorStream(std::ostream *os)
countT vertexCount() const
countT count() const
Filtered by facet.isGood(). May be 0 when !isEmpty().
QhullFacet beginFacet() const
Interface to Qhull from C++.
void setFeasiblePoint(const Coordinates &c)
Sets qh.feasible_point via initializeFeasiblePoint.
void runQhull(const RboxPoints &rboxPoints, const char *qhullCommand2)
For qhull commands, see http://www.qhull.org/html/qhull.htm or html/qhull.htm.
QhullVertex endVertex() const
QhullPoint origin()
non-const due to QhullPoint
void * qh_malloc(size_t size)
void setOutputStream(std::ostream *os)
const char * qhullCommand() const
bool hasQhullMessage() const
std::string qhullMessage() const
Coordinates feasiblePoint() const
const char * rboxCommand() const
void qh_fprintf_stderr(int msgcode, const char *fmt,...)
void disableOutputStream()
char * toString(const std::string &s)
void cleanup()
Executed after each test.
int dimension() const
Dimension of input and result.
QhullFacet endFacet() const
coordT * pointCoordinateBegin() const
Same as points().coordinates()
countT facetCount() const