9 #include <boost/test/data/test_case.hpp>
10 #include <boost/test/unit_test.hpp>
27 BOOST_AUTO_TEST_SUITE(Geometry)
33 auto recBounds = std::make_shared<RectangleBounds>(3., 6.);
43 std::vector<std::shared_ptr<const Surface>> surfaceStore;
44 surfaceStore.reserve(100);
48 auto atNegX = Surface::makeShared<PlaneSurface>(
52 auto atPosX = Surface::makeShared<PlaneSurface>(
56 auto atNegY = Surface::makeShared<PlaneSurface>(
60 auto atPosY = Surface::makeShared<PlaneSurface>(
64 std::vector<std::shared_ptr<const Surface>> sharedSurfaces = {
65 atNegX, atNegY, atPosX, atPosY};
66 surfaceStore.insert(surfaceStore.begin(), sharedSurfaces.begin(),
67 sharedSurfaces.end());
69 std::vector<const Surface*> surfaces = {atNegX.get(), atNegY.get(),
70 atPosX.get(), atPosY.get()};
78 auto pLayerSf = createProtoLayer(Transform3D::Identity());
79 auto pLayerSfShared = createProtoLayer(Transform3D::Identity());
81 BOOST_CHECK(pLayerSf.extent.ranges == pLayerSfShared.extent.ranges);
82 BOOST_CHECK(pLayerSf.envelope == pLayerSfShared.envelope);
85 BOOST_CHECK(pLayerSf.surfaces().size() == 4);
87 auto rB = std::make_shared<RectangleBounds>(30., 60.);
91 Surface::makeShared<PlaneSurface>(Transform3D::Identity(), rB);
93 pLayerSf.add(tgContext, *addSurface.get());
95 BOOST_CHECK(pLayerSf.surfaces().size() == 5);
98 BOOST_CHECK(pLayerSf.extent.ranges != pLayerSfShared.extent.ranges);
101 auto protoLayer = createProtoLayer(Transform3D::Identity());
122 auto protoLayerRot = createProtoLayer(
AngleAxis3D(-0.345, Vector3D::UnitZ()) *
123 Transform3D::Identity());
125 BOOST_CHECK_NE(protoLayer.min(
binX), -6.);
135 std::stringstream sstream;
136 protoLayerRot.toStream(sstream);
137 std::string oString = R
"(ProtoLayer with dimensions (min/max)
Extent in space :
- value : binX | range = [-6.66104, 6.66104]
- value : binY | range = [-4.85241, 4.85241]
- value : binZ | range = [-6, 6]
- value : binR | range = [3, 6.7082]
- value : binPhi | range = [-3.02295, 2.33295]
- value : binRPhi | range = [-20.2785, 15.6499]
- value : binH | range = [0.61548, 2.52611]
- value : binEta | range = [-1.14622, 1.14622]
- value : binMag | range = [7.34847, 7.34847]
)";
138 BOOST_CHECK_EQUAL(sstream.str(), oString);
141 BOOST_AUTO_TEST_SUITE_END()