ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
detector.hpp
1// This file is part of the ACTS project.
2//
3// Copyright (C) 2016 CERN for the benefit of the ACTS project
4//
5// This Source Code Form is subject to the terms of the Mozilla Public
6// License, v. 2.0. If a copy of the MPL was not distributed with this
7// file, You can obtain one at https://mozilla.org/MPL/2.0/.
8
9#pragma once
10
11// Project include(s)
12#include "detray/core/concepts.hpp"
13#include "detray/geometry/tracking_volume.hpp"
14#include "detray/plugins/svgtools/conversion/volume.hpp"
15#include "detray/plugins/svgtools/styling/styling.hpp"
16
17// Actsvg include(s)
18#include "actsvg/proto/detector.hpp"
19
20namespace detray::svgtools::conversion {
21
34template <concepts::detector detector_t, typename view_t>
35auto detector(const typename detector_t::geometry_context& context,
36 const detector_t& detector, const view_t& view,
37 const styling::detector_style& style =
39 bool hide_portals = false, bool hide_passives = false,
40 bool hide_grids = false) {
41 using point3_container_t = std::vector<typename detector_t::point3_type>;
42 actsvg::proto::detector<point3_container_t> p_detector;
43
44 for (const auto& vol_desc : detector.volumes()) {
45 auto [p_volume, gr_type] = svgtools::conversion::volume(
46 context, detector, tracking_volume{detector, vol_desc}, view,
47 style._volume_style, hide_portals, hide_passives, hide_grids);
48
49 p_detector._volumes.push_back(p_volume);
50 }
51
52 return p_detector;
53}
54
55} // namespace detray::svgtools::conversion
const styling::style style
Complete default SVG style configuration.
Definition styling.hpp:263
const styling::detector_style detector_style
Detector style using the Tableau colorblind palette.
Definition styling.hpp:312