25 using std::ostringstream;
80 QCOMPARE(f2.dimension(),3);
83 QCOMPARE(f.dimension(),3);
105 cout << f.
id() << endl;
107 QVERIFY(f.
id()>0 && f.
id()<=39);
110 QCOMPARE(f.
next(), i.peekNext());
111 QVERIFY(f.
next()!=f);
113 QVERIFY(i.hasPrevious());
114 QCOMPARE(f, i.peekPrevious());
120 int tricoplanarCount= 0;
128 QCOMPARE(tricoplanarCount, 2);
129 int tricoplanarCount2= 0;
132 cout <<
"Hyperplane: " << h;
133 QCOMPARE(h.count(), 3);
134 QCOMPARE(h.offset(), -0.5);
138 QCOMPARE(hi.
count(), 3);
139 double innerOffset= hi.
offset()+0.5;
140 cout <<
"InnerPlane: " << hi <<
" innerOffset+0.5 " << innerOffset << endl;
143 QCOMPARE(ho.
count(), 3);
144 double outerOffset= ho.
offset()+0.5;
145 cout <<
"OuterPlane: " << ho <<
" outerOffset+0.5 " << outerOffset << endl;
147 QVERIFY(outerOffset-innerOffset < 1e-7);
148 for(
int k= 0; k<3; k++){
149 QVERIFY(ho[k]==hi[k]);
150 QVERIFY(ho[k]==h[k]);
153 cout <<
"Center: " << center;
155 QVERIFY(d < innerOffset-outerOffset);
157 QCOMPARE(center, center2);
163 QCOMPARE(tricoplanarCount2, 2);
170 QCOMPARE(center4.dimension(), 4);
171 for(
int k= 0; k<3; k++){
172 QVERIFY(center4[k]==center3[k]);
174 Qhull q3(rcube,
"v Qz QR0");
184 cout << p.
print(
"Voronoi vertex: ")
189 QCOMPARE(voronoiCount, 1);
206 QCOMPARE(facetArea, 1.0);
209 QVERIFY(maxoutside<1e-7);
221 int coplanarCount= 0;
224 coplanarCount += coplanars.
count();
226 QCOMPARE(neighbors.
count(), 4);
228 QCOMPARE(outsides.count(), 0);
230 QCOMPARE(ridges.count(), 4);
232 QCOMPARE(vertices.count(), 4);
238 QFAIL(
"Unexpected simplicial facet. They only have ridges to non-simplicial neighbors.");
241 QCOMPARE(ridgeCount, 4);
243 QCOMPARE(coplanarCount, 300);
256 os << f.
print(
"\nWith a message\n");
257 os <<
"\nPrint header for the same facet\n";
258 os << f.printHeader();
259 os <<
"\nPrint each component\n";
260 os << f.printFlags(
" - flags:");
262 os << f.printRidges();
266 QString facetString2= QString::fromStdString(os2.str());
267 facetString2.replace(QRegExp(
"\\s\\s+"),
" ");
271 QString facetsString= QString::fromStdString(os3.str());
272 QString facetString3= facetsString.mid(facetsString.indexOf(
"- f1\n"));
273 facetString3= facetString3.left(facetString3.indexOf(
"\n- f")+1);
274 facetString3.replace(QRegExp(
"\\s\\s+"),
" ");
275 QCOMPARE(facetString2, facetString3);
283 #include "moc/QhullFacet_test.moc" QhullRidgeSet ridges() const
QhullHyperplane hyperplane() const
QhullHyperplane innerplane() const
QhullPoint inputOrigin()
Return origin point for qh.input_dim.
QhullRidge – Qhull's ridge structure, ridgeT, as a C++ class.
POD type equivalent to qhT. No virtual members.
A QhullFacet is the C++ equivalent to Qhull's facetT*.
QhullPointSet coplanarPoints() const
QhullFacet firstFacet() const
QhullPoint voronoiVertex()
double facetArea()
Disables tricoplanarOwner()
facetT * getFacetT() const
QhullVertexSet vertices() const
void t_constructConvert()
QhullFacetList facetList() const
QhullRidge nextRidge3d(const QhullFacet &f) const
countT vertexCount() const
QhullFacet beginFacet() const
countT count() const
Filtered by facet.isGood(). May be 0 when !isEmpty().
QhullFacetSet neighborFacets() const
Interface to Qhull from C++.
int rotateRandom() const
Return QRn for repeating QR0 runs.
bool hasNextRidge3d(const QhullFacet &f) const
QhullHyperplane outerplane() const
QhullPoint origin()
non-const due to QhullPoint
double distance(const Coordinates &c) const
Undefined if c.size() != dimension()
void setFactorEpsilon(double a)
void add_QhullFacet_test()
void setOutputStream(std::ostream *os)
Updates use_output_stream.
PrintPoint print(const char *message) const
PrintFacet print(const char *message)
QhullPointSet outsidePoints() const
void cleanup()
Executed after each test.
countT count(const T &t) const
double distanceEpsilon() const
Epsilon for distance to hyperplane.
countT facetCount() const
QhullFacet tricoplanarOwner() const
double factorEpsilon() const
Factor for angleEpsilon and distanceEpsilon.