File indexing completed on 2026-05-27 07:24:25
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #include "detray/core/detector.hpp"
0011
0012
0013 #include "detray/plugins/svgtools/illustrator.hpp"
0014 #include "detray/plugins/svgtools/writer.hpp"
0015
0016
0017 #include "detray/test/common/build_toy_detector.hpp"
0018 #include "detray/test/framework/types.hpp"
0019
0020
0021 #include <vecmem/memory/host_memory_resource.hpp>
0022
0023
0024 #include <actsvg/core.hpp>
0025
0026
0027 #include <gtest/gtest.h>
0028
0029
0030 #include <array>
0031 #include <string>
0032
0033 GTEST_TEST(svgtools, detector) {
0034 actsvg::style::stroke stroke_black = actsvg::style::stroke();
0035
0036 auto xy_axis = actsvg::draw::x_y_axes("axes", {-250, 250}, {-250, 250},
0037 stroke_black, "x", "y");
0038
0039 auto zr_axis = actsvg::draw::x_y_axes("axes", {-250, 250}, {-250, 250},
0040 stroke_black, "z", "r");
0041
0042
0043 const actsvg::views::x_y xy;
0044 const actsvg::views::z_r zr;
0045
0046
0047 vecmem::host_memory_resource host_mr;
0048 const auto [det, names] =
0049 detray::build_toy_detector<detray::test::algebra>(host_mr);
0050
0051
0052 detray::svgtools::illustrator il{det, names};
0053 il.show_info(true);
0054
0055
0056 const auto svg_xy = il.draw_detector(xy);
0057
0058 detray::svgtools::write_svg("test_svgtools_detector_xy", {xy_axis, svg_xy});
0059
0060
0061 const auto svg_zr = il.draw_detector(zr);
0062
0063 detray::svgtools::write_svg("test_svgtools_detector_zr", {zr_axis, svg_zr});
0064 }