9 #include <boost/test/unit_test.hpp>
20 namespace tt = boost::test_tools;
25 BOOST_AUTO_TEST_SUITE(Volumes)
30 TrapezoidVolumeBounds tvb(5, 10, 8, 4);
32 auto bb = tvb.boundingBox();
40 bb = tvb.boundingBox(&trf);
46 bb = tvb.boundingBox(&trf);
55 BOOST_CHECK_EQUAL(tvbOrientedSurfaces.size(), 6);
59 for (
auto& os : tvbOrientedSurfaces) {
60 auto osCenter = os.first->center(geoCtx);
61 auto osNormal = os.first->normal(geoCtx, osCenter);
62 double nDir = (double)os.second;
64 auto insideTvb = osCenter + nDir * osNormal;
65 auto outsideTvb = osCenter - nDir * osNormal;
66 BOOST_CHECK(tvb.
inside(insideTvb));
67 BOOST_CHECK(!tvb.
inside(outsideTvb));
76 tvbOrientedSurfaces[
negativeFaceXY].first->transform(geoCtx).rotation();
77 BOOST_CHECK(nFaceXY.col(0).isApprox(xaxis));
78 BOOST_CHECK(nFaceXY.col(1).isApprox(yaxis));
79 BOOST_CHECK(nFaceXY.col(2).isApprox(zaxis));
82 tvbOrientedSurfaces[
positiveFaceXY].first->transform(geoCtx).rotation();
83 BOOST_CHECK(pFaceXY.col(0).isApprox(xaxis));
84 BOOST_CHECK(pFaceXY.col(1).isApprox(yaxis));
85 BOOST_CHECK(pFaceXY.col(2).isApprox(zaxis));
88 tvbOrientedSurfaces[
negativeFaceZX].first->transform(geoCtx).rotation();
89 BOOST_CHECK(nFaceZX.col(0).isApprox(zaxis));
90 BOOST_CHECK(nFaceZX.col(1).isApprox(xaxis));
91 BOOST_CHECK(nFaceZX.col(2).isApprox(yaxis));
94 tvbOrientedSurfaces[
positiveFaceZX].first->transform(geoCtx).rotation();
95 BOOST_CHECK(pFaceZX.col(0).isApprox(zaxis));
96 BOOST_CHECK(pFaceZX.col(1).isApprox(xaxis));
97 BOOST_CHECK(pFaceZX.col(2).isApprox(yaxis));
100 BOOST_AUTO_TEST_SUITE_END()