File indexing completed on 2025-01-18 09:13:07
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include <boost/test/unit_test.hpp>
0010
0011 #include "Acts/Geometry/GeometryContext.hpp"
0012 #include "Acts/Geometry/GeometryHierarchyMap.hpp"
0013 #include "Acts/Geometry/TrackingGeometry.hpp"
0014 #include "Acts/Plugins/ActSVG/LayerSvgConverter.hpp"
0015 #include "Acts/Plugins/ActSVG/SvgUtils.hpp"
0016 #include "Acts/Plugins/ActSVG/TrackingGeometrySvgConverter.hpp"
0017 #include "Acts/Tests/CommonHelpers/CylindricalTrackingGeometry.hpp"
0018
0019 #include <fstream>
0020 #include <memory>
0021 #include <vector>
0022
0023 Acts::GeometryContext tgContext;
0024
0025 BOOST_AUTO_TEST_SUITE(ActSvg)
0026
0027 BOOST_AUTO_TEST_CASE(CylindricalTrackingGeometrySvg) {
0028 Acts::Svg::Style cylinderLayerStyle;
0029 cylinderLayerStyle.fillColor = {51, 153, 255};
0030 cylinderLayerStyle.fillOpacity = 0.75;
0031 cylinderLayerStyle.highlightColor = {255, 153, 51};
0032 cylinderLayerStyle.highlights = {"mouseover", "mouseout"};
0033 cylinderLayerStyle.strokeColor = {25, 25, 25};
0034 cylinderLayerStyle.strokeWidth = 0.5;
0035 cylinderLayerStyle.quarterSegments = 72u;
0036
0037 Acts::GeometryIdentifier geoID{0};
0038
0039 Acts::Test::CylindricalTrackingGeometry cGeometry(tgContext);
0040 auto tGeometry = cGeometry();
0041
0042 Acts::Svg::LayerConverter::Options lOptions;
0043 lOptions.name = "cylinder_layer_";
0044 lOptions.surfaceStyles = Acts::GeometryHierarchyMap<Acts::Svg::Style>(
0045 {{geoID, cylinderLayerStyle}});
0046
0047 Acts::Svg::TrackingGeometryConverter::Options tgOptions;
0048 tgOptions.prefix = "utest_geometry_";
0049 tgOptions.layerOptions =
0050 Acts::GeometryHierarchyMap<Acts::Svg::LayerConverter::Options>(
0051 {{geoID, lOptions}});
0052
0053 auto geometrySheets = Acts::Svg::TrackingGeometryConverter::convert(
0054 tgContext, *tGeometry, tgOptions);
0055
0056 for (const auto& s : geometrySheets) {
0057 Acts::Svg::toFile({s}, s._id + ".svg");
0058 }
0059 }
0060
0061 BOOST_AUTO_TEST_SUITE_END()