9 #include <boost/test/unit_test.hpp>
25 BOOST_AUTO_TEST_SUITE(ActSvg)
40 SurfaceOptions sOptions;
41 sOptions.
style = style;
42 sOptions.templateSurface =
true;
51 sOptions.templateSurface =
false;
57 static_cast<Acts::ActsScalar>(xyObject._x_range[1]),
58 static_cast<Acts::ActsScalar>(xyObject._y_range[0]),
59 static_cast<Acts::ActsScalar>(xyObject._y_range[1]));
75 planarStyle.
highlights = {
"mouseover",
"mouseout"};
80 auto rectangleBounds = std::make_shared<Acts::RectangleBounds>(36., 64.);
81 auto transform = Acts::Transform3::Identity();
84 Acts::Surface::makeShared<Acts::PlaneSurface>(
transform, rectangleBounds);
85 runPlanarTests(*rectanglePlane, planarStyle,
"rectangle");
88 auto trapezoidBounds =
89 std::make_shared<Acts::TrapezoidBounds>(36., 64., 105.);
91 Acts::Surface::makeShared<Acts::PlaneSurface>(
transform, trapezoidBounds);
92 runPlanarTests(*trapeozidPlane, planarStyle,
"trapezoid");
97 Acts::Vector3 center(radius * std::cos(phi), radius * std::sin(phi), 0.);
103 rotation.col(0) = localX;
104 rotation.col(1) = localY;
105 rotation.col(2) = localZ;
108 auto trapeozidPlaneTransformed =
109 Acts::Surface::makeShared<Acts::PlaneSurface>(
transform, trapezoidBounds);
111 runPlanarTests(*trapeozidPlaneTransformed, planarStyle,
"trapezoid_rotated");
114 actsvg::proto::surface<std::vector<Acts::Vector3>> reference;
115 reference._vertices =
116 trapeozidPlaneTransformed->polyhedronRepresentation(geoCtx, 1
u).vertices;
120 "trapezoid_reference.svg");
126 frotation.col(0) = flocalX;
127 frotation.col(1) = localY;
128 frotation.col(2) = flocalZ;
131 auto ftrapeozidPlaneTransformed =
132 Acts::Surface::makeShared<Acts::PlaneSurface>(ftransform,
135 runPlanarTests(*ftrapeozidPlaneTransformed, planarStyle,
136 "flipped_trapezoid_rotated");
137 actsvg::proto::surface<std::vector<Acts::Vector3>> freference;
138 freference._vertices =
139 ftrapeozidPlaneTransformed->polyhedronRepresentation(geoCtx, 1
u).vertices;
141 auto freferenceTrapezoid =
144 "flipped_trapezoid_reference.svg");
148 std::make_shared<Acts::DiamondBounds>(36., 64., 14., 40., 30.);
149 transform = Acts::Transform3::Identity();
151 Acts::Surface::makeShared<Acts::PlaneSurface>(
transform, diamondBounds);
152 runPlanarTests(*diamond, planarStyle,
"diamond");
155 std::vector<Acts::Vector2>
vertices = {
156 {-10., -10.}, {10., -15.}, {20., 5.}, {-5., 15.}, {-12, 0.}};
158 std::make_shared<Acts::ConvexPolygonBounds<5u>>(
vertices);
160 Acts::Surface::makeShared<Acts::PlaneSurface>(
transform, polygonBounds);
161 runPlanarTests(*polygon, planarStyle,
"polygon");
170 discStyle.
highlights = {
"mouseover",
"mouseout"};
174 auto transform = Acts::Transform3::Identity();
178 auto fullDiscBounds = std::make_shared<Acts::RadialBounds>(0., 64.);
180 Acts::Surface::makeShared<Acts::DiscSurface>(
transform, fullDiscBounds);
181 runPlanarTests(*fullDisc, discStyle,
"full_disc");
184 auto fullRingBounds = std::make_shared<Acts::RadialBounds>(36., 64.);
186 Acts::Surface::makeShared<Acts::DiscSurface>(
transform, fullRingBounds);
187 runPlanarTests(*fullRing, discStyle,
"full_ring");
190 auto sectoralDiscBounds =
191 std::make_shared<Acts::RadialBounds>(0., 64., 0.25 * M_PI, 0.5 * M_PI);
192 auto sectoralDisc = Acts::Surface::makeShared<Acts::DiscSurface>(
194 runPlanarTests(*sectoralDisc, discStyle,
"full_disc");
204 auto annulusDiscBounds = std::make_shared<Acts::AnnulusBounds>(
206 auto annulusDisc = Acts::Surface::makeShared<Acts::DiscSurface>(
208 runPlanarTests(*annulusDisc, discStyle,
"annulus_disc");
211 BOOST_AUTO_TEST_SUITE_END()