25 using std::ostringstream;
99 cout <<
" rbox c | qhull Qt QR0 QR" <<
q.rotateRandom() <<
" distanceEpsilon " <<
q.distanceEpsilon() << endl;
100 QCOMPARE(
q.facetCount(), 12);
101 QCOMPARE(
q.vertexCount(), 8);
105 cout << f.
id() << endl;
107 QVERIFY(f.
id()>0 && f.
id()<=39);
111 QVERIFY(f.
next()!=f);
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;
141 QVERIFY(innerOffset >= 0.0-(2*
q.distanceEpsilon()));
143 QCOMPARE(ho.
count(), 3);
144 double outerOffset= ho.
offset()+0.5;
145 cout <<
"OuterPlane: " << ho <<
" outerOffset+0.5 " << outerOffset << endl;
146 QVERIFY(outerOffset <= 0.0+(2*
q.distanceEpsilon()));
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);
165 cout <<
" rbox c | qhull d Qz Qt QR0 QR" <<
q2.rotateRandom() <<
" distanceEpsilon " <<
q2.distanceEpsilon() << endl;
171 for(
int k= 0; k<3; k++){
172 QVERIFY(center4[k]==center3[k]);
174 Qhull q3(rcube,
"v Qz QR0");
175 cout <<
" rbox c | qhull v Qz QR0 QR" << q3.rotateRandom() <<
" distanceEpsilon " << q3.distanceEpsilon() << endl;
184 cout << p.
print(
"Voronoi vertex: ")
185 <<
" Is it within " << q3.factorEpsilon() <<
" * distanceEpsilon (" << q3.distanceEpsilon() <<
") of the origin?" << endl;
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);
235 for(
int r0=
r.id(); ridgeCount==0 ||
r.id()!=r0;
r=
r.nextRidge3d(f)){
237 if(!
r.hasNextRidge3d(f)){
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+"),
" ");
269 q.qh()->setOutputStream(&os3);
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"