Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PortalSvgConverter.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PortalSvgConverter.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2023 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 http://mozilla.org/MPL/2.0/.
8 
9 #pragma once
10 
16 #include "actsvg/core.hpp"
17 #include "actsvg/meta.hpp"
18 
19 #include <map>
20 #include <memory>
21 #include <tuple>
22 
23 namespace Acts {
24 
25 class Surface;
26 
27 namespace Experimental {
28 class Portal;
29 class DetectorVolume;
30 } // namespace Experimental
31 
32 namespace Svg {
33 
34 using ProtoPortal = actsvg::proto::portal<std::vector<Vector3>>;
35 using ProtoLink = ProtoPortal::link;
36 
37 namespace PortalConverter {
38 
40 struct Options {
46  std::map<const Experimental::DetectorVolume*, unsigned int> volumeIndices;
47 };
48 
57  const Experimental::Portal& portal,
58  const PortalConverter::Options& portalOptions);
59 
60 } // namespace PortalConverter
61 
62 namespace View {
63 
70 static inline actsvg::svg::object xy(const ProtoPortal& portal,
71  const std::string& identification) {
72  actsvg::views::x_y xyView;
73  return actsvg::display::portal(identification, portal, xyView);
74 }
75 
82 static inline actsvg::svg::object zr(const ProtoPortal& portal,
83  const std::string& identification) {
84  actsvg::views::z_r zrView;
85  return actsvg::display::portal(identification, portal, zrView);
86 }
87 
88 } // namespace View
89 
90 } // namespace Svg
91 
92 } // namespace Acts