File indexing completed on 2026-09-05 08:17:49
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/Definitions/Algebra.hpp"
0012 #include "Acts/Visualization/EventDataView3D.hpp"
0013 #include "Acts/Visualization/IVisualization3D.hpp"
0014 #include "Acts/Visualization/ViewConfig.hpp"
0015
0016 #include <array>
0017 #include <filesystem>
0018 #include <iostream>
0019 #include <map>
0020 #include <string>
0021 #include <vector>
0022
0023 namespace Acts {
0024
0025
0026
0027
0028 class VisualizationBuffer : public IVisualization3D {
0029 public:
0030
0031 using ValueType = double;
0032
0033
0034 using VertexType = Eigen::Matrix<ValueType, 3, 1>;
0035
0036
0037 using LineType = std::pair<std::size_t, std::size_t>;
0038
0039
0040 explicit VisualizationBuffer(unsigned int , double ) {}
0041
0042
0043 void vertex(const Vector3& vtx, Color color = s_defaultColor) override;
0044
0045
0046 void line(const Vector3& a, const Vector3& b,
0047 Color color = s_defaultColor) override;
0048
0049
0050
0051
0052 void line(const Vector3& a, const Vector3& b, const double lineThickness,
0053 Color color = s_defaultColor);
0054
0055
0056 void face(const std::vector<Vector3>& , Color ) override {
0057 throw std::logic_error("face() is not supported for this type");
0058 }
0059
0060
0061
0062 void faces(const std::vector<Vector3>& vtxs,
0063 const std::vector<FaceType>& ,
0064 Color color = s_defaultColor) override;
0065
0066
0067 void write(const std::filesystem::path& ) const override {
0068 throw std::logic_error("write() is not supported for this type");
0069 }
0070
0071
0072 void write(std::ostream& ) const override {
0073 throw std::logic_error("write() is not supported for this type");
0074 }
0075
0076
0077
0078 void write(std::ostream& , std::ostream& ) const {
0079 throw std::logic_error("write() is not supported for this type");
0080 }
0081
0082
0083 void clear() override {}
0084
0085
0086 void object(const std::string& ) override {}
0087
0088
0089 const std::vector<Vector3>& vertices3D() const { return m_vertices; }
0090
0091
0092
0093
0094
0095 const std::vector<std::vector<Vector3>>& surfaces() const {
0096 return m_surfaces;
0097 }
0098
0099
0100
0101
0102
0103 const std::vector<std::vector<Vector3>>& segments() const {
0104 return m_segments;
0105 }
0106
0107
0108
0109 const std::vector<Color>& faceColors() const { return m_facecolors; }
0110
0111
0112
0113 const std::vector<Color>& lineColors() const { return m_linecolors; }
0114
0115
0116
0117
0118 const std::vector<double>& lineThickness() const { return m_linethickness; }
0119
0120
0121
0122 const std::vector<Color>& vertexColors() const { return m_vertexcolors; }
0123
0124 private:
0125 std::vector<Vector3> m_vertices;
0126 std::vector<std::vector<Vector3>> m_surfaces;
0127 std::vector<std::vector<Vector3>> m_segments;
0128 std::vector<Color> m_facecolors;
0129 std::vector<Color> m_vertexcolors;
0130 std::vector<Color> m_linecolors;
0131 std::vector<double> m_linethickness;
0132 };
0133
0134 }