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 <string>
0031
0032 GTEST_TEST(svgtools, landmarks) {
0033
0034 const auto axes =
0035 actsvg::draw::x_y_axes("axes", {-250, 250}, {-250, 250},
0036 actsvg::style::stroke(), "axis1", "axis2");
0037
0038
0039 const actsvg::views::x_y xy;
0040 const actsvg::views::z_r zr;
0041
0042
0043 vecmem::host_memory_resource host_mr;
0044 const auto [det, names] =
0045 detray::build_toy_detector<detray::test::algebra>(host_mr);
0046 using detector_t = decltype(det);
0047
0048 using point = typename detector_t::point3_type;
0049
0050
0051 const detray::svgtools::illustrator il{det, names};
0052
0053
0054
0055 const point test_point{100, 50, 20};
0056
0057 const auto svg_xy = il.draw_landmark("landmark", test_point, xy);
0058 const auto svg_zr = il.draw_landmark("landmark", test_point, zr);
0059 detray::svgtools::write_svg("test_svgtools_landmark.svg",
0060 {svg_xy, svg_zr, axes});
0061 }