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 <gtest/gtest.h>
0025
0026 GTEST_TEST(svgtools, grids) {
0027
0028
0029
0030
0031
0032
0033
0034 vecmem::host_memory_resource host_mr;
0035 const auto [det, names] =
0036 detray::build_toy_detector<detray::test::algebra>(host_mr);
0037
0038
0039 const actsvg::views::x_y view;
0040
0041
0042 detray::svgtools::illustrator il{det, names};
0043
0044
0045
0046 std::vector<detray::dindex> indices = {3u, 5u, 7u, 9u};
0047
0048 for (const detray::dindex i : indices) {
0049
0050 il.hide_grids(false);
0051 const auto [volume_svg, grid] = il.draw_volume(i, view);
0052
0053
0054 detray::svgtools::write_svg("test_svgtools_" + volume_svg._id, volume_svg);
0055 detray::svgtools::write_svg("test_svgtools_" + grid._id, grid);
0056 }
0057 }