Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:28:08

0001 // This file is part of the actsvg packge.
0002 //
0003 // Copyright (C) 2022 CERN for the benefit of the ACTS project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
0008 
0009 #pragma once
0010 
0011 #include <limits>
0012 #include <map>
0013 #include <optional>
0014 #include <string>
0015 #include <utility>
0016 #include <vector>
0017 
0018 #include "actsvg/core/style.hpp"
0019 #include "actsvg/proto/grid.hpp"
0020 #include "actsvg/proto/surface.hpp"
0021 #include "actsvg/styles/defaults.hpp"
0022 
0023 namespace actsvg {
0024 
0025 namespace proto {
0026 
0027 /** A proto portal class as a simple translation layer
0028  * from a portal description
0029  *
0030  * @tparam point3_container a vertex description of surfaces
0031  **/
0032 
0033 template <typename point3_container>
0034 struct portal {
0035 
0036     // Expose the container type
0037     using container_type = point3_container;
0038 
0039     /// A nested link type
0040     struct link {
0041 
0042         // Expose the point3 type
0043         using point3_type = typename container_type::value_type;
0044 
0045         /// The start of the volume link
0046         point3_type _start;
0047         /// The end of the volume link
0048         point3_type _end;
0049 
0050         /// The stroke style (ideally synchronized with volume)
0051         style::marker _start_marker = style::marker({});
0052         style::marker _end_marker = style::marker({"<<"});
0053         style::stroke _stroke;
0054 
0055         /// @brief  The link index of the volume
0056         unsigned int _link_index = 0u;
0057 
0058         /// The span
0059         std::optional<std::array<scalar, 2>> _span = std::nullopt;
0060         /// Binning type
0061         std::string _binning = "";
0062         /// Auxiliary information as container map
0063         std::map<std::string, std::vector<std::string>> _aux_info = {};
0064     };
0065 
0066     /// Name of the surface
0067     std::string _name = "unnamed";
0068 
0069     /// Auxiliary information as container map
0070     std::map<std::string, std::vector<std::string>> _aux_info = {};
0071 
0072     /// The surface representation of this portal
0073     surface<point3_container> _surface;
0074 
0075     /// The list of volume links
0076     std::vector<link> _volume_links;
0077 };
0078 
0079 }  // namespace proto
0080 
0081 }  // namespace actsvg