9 #include <boost/test/unit_test.hpp>
31 BOOST_AUTO_TEST_SUITE(Geometry)
39 BOOST_CHECK_EQUAL(ccvb, copied);
43 BOOST_CHECK_EQUAL(ccvb, assigned);
48 std::array<double, CutoutCylinderVolumeBounds::eSize>
values{};
49 std::vector<double> valvector = original.
values();
53 BOOST_CHECK_EQUAL(original, recreated);
57 double rmin{5}, rmed{10}, rmax{15},
hz{30}, hzc{25};
93 double rmin{5}, rmed{10}, rmax{15},
hz{30}, hzc{25};
107 BOOST_CHECK(!ccvb.
inside({0, 0, 0}));
108 BOOST_CHECK(!ccvb.inside({0, 3, 0}));
109 BOOST_CHECK(!ccvb.inside({3, 0, 0}));
110 BOOST_CHECK(!ccvb.inside({0, 7, 0}));
111 BOOST_CHECK(!ccvb.inside({7, 0, 0}));
112 BOOST_CHECK(ccvb.inside({0, 13, 0}));
113 BOOST_CHECK(ccvb.inside({13, 0, 0}));
114 BOOST_CHECK(!ccvb.inside({0, 17, 0}));
115 BOOST_CHECK(!ccvb.inside({17, 0, 0}));
118 BOOST_CHECK(!ccvb.inside({0, 0, 35}));
119 BOOST_CHECK(!ccvb.inside({0, 0, -35}));
120 BOOST_CHECK(!ccvb.inside({0, 3, 35}));
121 BOOST_CHECK(!ccvb.inside({0, 3, -35}));
122 BOOST_CHECK(!ccvb.inside({3, 0, 35}));
123 BOOST_CHECK(!ccvb.inside({3, 0, -35}));
124 BOOST_CHECK(!ccvb.inside({0, 10, 35}));
125 BOOST_CHECK(!ccvb.inside({0, 10, -35}));
126 BOOST_CHECK(!ccvb.inside({10, 0, 35}));
127 BOOST_CHECK(!ccvb.inside({10, 0, -35}));
128 BOOST_CHECK(!ccvb.inside({0, 20, 35}));
129 BOOST_CHECK(!ccvb.inside({0, 20, -35}));
130 BOOST_CHECK(!ccvb.inside({20, 0, 35}));
131 BOOST_CHECK(!ccvb.inside({20, 0, -35}));
134 BOOST_CHECK(!ccvb.inside({0, 0, 27}));
135 BOOST_CHECK(!ccvb.inside({0, 0, -27}));
136 BOOST_CHECK(!ccvb.inside({0, 3, 27}));
137 BOOST_CHECK(!ccvb.inside({0, 3, -27}));
138 BOOST_CHECK(!ccvb.inside({3, 0, 27}));
139 BOOST_CHECK(!ccvb.inside({3, 0, -27}));
140 BOOST_CHECK(ccvb.inside({0, 7, 27}));
141 BOOST_CHECK(ccvb.inside({0, 7, -27}));
142 BOOST_CHECK(ccvb.inside({7, 0, 27}));
143 BOOST_CHECK(ccvb.inside({7, 0, -27}));
144 BOOST_CHECK(ccvb.inside({0, 13, 27}));
145 BOOST_CHECK(ccvb.inside({0, 13, -27}));
146 BOOST_CHECK(ccvb.inside({13, 0, 27}));
147 BOOST_CHECK(ccvb.inside({13, 0, -27}));
148 BOOST_CHECK(!ccvb.inside({0, 17, 27}));
149 BOOST_CHECK(!ccvb.inside({0, 17, -27}));
150 BOOST_CHECK(!ccvb.inside({17, 0, 27}));
151 BOOST_CHECK(!ccvb.inside({17, 0, -27}));
154 BOOST_CHECK(!ccvb.inside({0, 0, 23}));
155 BOOST_CHECK(!ccvb.inside({0, 0, -23}));
156 BOOST_CHECK(!ccvb.inside({0, 3, 23}));
157 BOOST_CHECK(!ccvb.inside({0, 3, -23}));
158 BOOST_CHECK(!ccvb.inside({3, 0, 23}));
159 BOOST_CHECK(!ccvb.inside({3, 0, -23}));
160 BOOST_CHECK(!ccvb.inside({0, 7, 23}));
161 BOOST_CHECK(!ccvb.inside({0, 7, -23}));
162 BOOST_CHECK(!ccvb.inside({7, 0, 23}));
163 BOOST_CHECK(!ccvb.inside({7, 0, -23}));
164 BOOST_CHECK(ccvb.inside({0, 13, 23}));
165 BOOST_CHECK(ccvb.inside({0, 13, -23}));
166 BOOST_CHECK(ccvb.inside({13, 0, 23}));
167 BOOST_CHECK(ccvb.inside({13, 0, -23}));
168 BOOST_CHECK(!ccvb.inside({0, 17, 23}));
169 BOOST_CHECK(!ccvb.inside({0, 17, -23}));
170 BOOST_CHECK(!ccvb.inside({17, 0, 23}));
171 BOOST_CHECK(!ccvb.inside({17, 0, -23}));
190 BOOST_CHECK_EQUAL(ccvbOrientedSurfaces.size(), 8);
197 for (
auto&
os : ccvbOrientedSurfaces) {
198 auto onSurface =
os.first->binningPosition(geoCtx,
binR);
199 auto osNormal =
os.first->normal(geoCtx, onSurface);
201 Vector3 insideCcvb = onSurface +
os.second * osNormal;
202 Vector3 outsideCCvb = onSurface -
os.second * osNormal;
204 BOOST_CHECK(ccvb.
inside(insideCcvb));
205 BOOST_CHECK(!ccvb.
inside(outsideCCvb));
208 auto rot =
os.first->transform(geoCtx).rotation();
209 BOOST_CHECK(rot.col(0).isApprox(xaxis));
210 BOOST_CHECK(rot.col(1).isApprox(yaxis));
211 BOOST_CHECK(rot.col(2).isApprox(zaxis));
215 BOOST_AUTO_TEST_SUITE_END()