Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SurfaceSvgConverter.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file SurfaceSvgConverter.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2022 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 
14 #include <actsvg/core.hpp>
15 #include <actsvg/meta.hpp>
16 
17 namespace Acts {
18 
19 class Surface;
20 
21 namespace Svg {
22 
23 using ProtoSurface = actsvg::proto::surface<std::vector<Vector3>>;
24 
25 namespace SurfaceConverter {
26 
28 struct Options {
32  bool templateSurface = false;
33 };
34 
43  const SurfaceConverter::Options& cOptions);
44 
45 } // namespace SurfaceConverter
46 
47 namespace View {
48 
55 static inline actsvg::svg::object xy(const ProtoSurface& pSurface,
56  const std::string& identification) {
57  actsvg::views::x_y xyView;
58  return actsvg::display::surface(identification, pSurface, xyView, true);
59 }
60 
67 static inline actsvg::svg::object zr(const ProtoSurface& pSurface,
68  const std::string& identification) {
69  actsvg::views::z_r zrView;
70  return actsvg::display::surface(identification, pSurface, zrView, true);
71 }
72 
79 static inline actsvg::svg::object zphi(const ProtoSurface& pSurface,
80  const std::string& identification) {
81  actsvg::views::z_phi zphiView;
82  return actsvg::display::surface(identification, pSurface, zphiView, true);
83 }
84 
93 static inline actsvg::svg::object zrphi(const ProtoSurface& pSurface,
94  const std::string& identification) {
95  actsvg::views::z_rphi zrphiView;
96  zrphiView._fixed_r = pSurface._radii[0u];
97  return actsvg::display::surface(identification, pSurface, zrphiView, true);
98 }
99 
100 } // namespace View
101 
102 namespace Sheet {
103 
110 static inline actsvg::svg::object xy(const ProtoSurface& pSurface,
111  const std::string& identification) {
112  return actsvg::display::surface_sheet_xy(identification, pSurface);
113 }
114 
115 } // namespace Sheet
116 
117 } // namespace Svg
118 
119 } // namespace Acts