9 #include <boost/test/unit_test.hpp>
26 BOOST_AUTO_TEST_SUITE(Geometry)
34 BOOST_CHECK_EQUAL(ccvb, copied);
38 BOOST_CHECK_EQUAL(ccvb, assigned);
43 std::array<double, CutoutCylinderVolumeBounds::eSize>
values;
44 std::vector<double> valvector = original.
values();
48 BOOST_CHECK_EQUAL(original, recreated);
52 double rmin{5}, rmed{10},
rmax{15},
hz{30}, hzc{25};
88 double rmin{5}, rmed{10},
rmax{15},
hz{30}, hzc{25};
102 BOOST_CHECK(!ccvb.
inside({0, 0, 0}));
103 BOOST_CHECK(!ccvb.inside({0, 3, 0}));
104 BOOST_CHECK(!ccvb.inside({3, 0, 0}));
105 BOOST_CHECK(!ccvb.inside({0, 7, 0}));
106 BOOST_CHECK(!ccvb.inside({7, 0, 0}));
107 BOOST_CHECK(ccvb.inside({0, 13, 0}));
108 BOOST_CHECK(ccvb.inside({13, 0, 0}));
109 BOOST_CHECK(!ccvb.inside({0, 17, 0}));
110 BOOST_CHECK(!ccvb.inside({17, 0, 0}));
113 BOOST_CHECK(!ccvb.inside({0, 0, 35}));
114 BOOST_CHECK(!ccvb.inside({0, 0, -35}));
115 BOOST_CHECK(!ccvb.inside({0, 3, 35}));
116 BOOST_CHECK(!ccvb.inside({0, 3, -35}));
117 BOOST_CHECK(!ccvb.inside({3, 0, 35}));
118 BOOST_CHECK(!ccvb.inside({3, 0, -35}));
119 BOOST_CHECK(!ccvb.inside({0, 10, 35}));
120 BOOST_CHECK(!ccvb.inside({0, 10, -35}));
121 BOOST_CHECK(!ccvb.inside({10, 0, 35}));
122 BOOST_CHECK(!ccvb.inside({10, 0, -35}));
123 BOOST_CHECK(!ccvb.inside({0, 20, 35}));
124 BOOST_CHECK(!ccvb.inside({0, 20, -35}));
125 BOOST_CHECK(!ccvb.inside({20, 0, 35}));
126 BOOST_CHECK(!ccvb.inside({20, 0, -35}));
129 BOOST_CHECK(!ccvb.inside({0, 0, 27}));
130 BOOST_CHECK(!ccvb.inside({0, 0, -27}));
131 BOOST_CHECK(!ccvb.inside({0, 3, 27}));
132 BOOST_CHECK(!ccvb.inside({0, 3, -27}));
133 BOOST_CHECK(!ccvb.inside({3, 0, 27}));
134 BOOST_CHECK(!ccvb.inside({3, 0, -27}));
135 BOOST_CHECK(ccvb.inside({0, 7, 27}));
136 BOOST_CHECK(ccvb.inside({0, 7, -27}));
137 BOOST_CHECK(ccvb.inside({7, 0, 27}));
138 BOOST_CHECK(ccvb.inside({7, 0, -27}));
139 BOOST_CHECK(ccvb.inside({0, 13, 27}));
140 BOOST_CHECK(ccvb.inside({0, 13, -27}));
141 BOOST_CHECK(ccvb.inside({13, 0, 27}));
142 BOOST_CHECK(ccvb.inside({13, 0, -27}));
143 BOOST_CHECK(!ccvb.inside({0, 17, 27}));
144 BOOST_CHECK(!ccvb.inside({0, 17, -27}));
145 BOOST_CHECK(!ccvb.inside({17, 0, 27}));
146 BOOST_CHECK(!ccvb.inside({17, 0, -27}));
149 BOOST_CHECK(!ccvb.inside({0, 0, 23}));
150 BOOST_CHECK(!ccvb.inside({0, 0, -23}));
151 BOOST_CHECK(!ccvb.inside({0, 3, 23}));
152 BOOST_CHECK(!ccvb.inside({0, 3, -23}));
153 BOOST_CHECK(!ccvb.inside({3, 0, 23}));
154 BOOST_CHECK(!ccvb.inside({3, 0, -23}));
155 BOOST_CHECK(!ccvb.inside({0, 7, 23}));
156 BOOST_CHECK(!ccvb.inside({0, 7, -23}));
157 BOOST_CHECK(!ccvb.inside({7, 0, 23}));
158 BOOST_CHECK(!ccvb.inside({7, 0, -23}));
159 BOOST_CHECK(ccvb.inside({0, 13, 23}));
160 BOOST_CHECK(ccvb.inside({0, 13, -23}));
161 BOOST_CHECK(ccvb.inside({13, 0, 23}));
162 BOOST_CHECK(ccvb.inside({13, 0, -23}));
163 BOOST_CHECK(!ccvb.inside({0, 17, 23}));
164 BOOST_CHECK(!ccvb.inside({0, 17, -23}));
165 BOOST_CHECK(!ccvb.inside({17, 0, 23}));
166 BOOST_CHECK(!ccvb.inside({17, 0, -23}));
185 BOOST_CHECK_EQUAL(ccvbOrientedSurfaces.size(), 8);
192 for (
auto& os : ccvbOrientedSurfaces) {
193 auto onSurface = os.first->binningPosition(geoCtx,
binR);
194 auto osNormal = os.first->normal(geoCtx, onSurface);
195 double nDir = (double)os.second;
197 auto insideCcvb = onSurface + nDir * osNormal;
198 auto outsideCCvb = onSurface - nDir * osNormal;
200 BOOST_CHECK(ccvb.
inside(insideCcvb));
201 BOOST_CHECK(!ccvb.
inside(outsideCCvb));
204 auto rot = os.first->transform(geoCtx).rotation();
205 BOOST_CHECK(rot.col(0).isApprox(xaxis));
206 BOOST_CHECK(rot.col(1).isApprox(yaxis));
207 BOOST_CHECK(rot.col(2).isApprox(zaxis));
211 BOOST_AUTO_TEST_SUITE_END()