File indexing completed on 2025-07-05 08:11:22
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/Definitions/Algebra.hpp"
0012 #include "Acts/Visualization/IVisualization3D.hpp"
0013 #include "Acts/Visualization/ViewConfig.hpp"
0014
0015 #include <filesystem>
0016 #include <string>
0017 #include <utility>
0018 #include <vector>
0019
0020 namespace Acts {
0021
0022 template <typename T = double>
0023
0024
0025 class PlyVisualization3D : public IVisualization3D {
0026 public:
0027 static_assert(std::is_same_v<T, double> || std::is_same_v<T, float>,
0028 "Use either double or float");
0029
0030
0031 using ValueType = T;
0032
0033
0034 using VertexType = Eigen::Matrix<ValueType, 3, 1>;
0035
0036
0037 void vertex(const Vector3& vtx, Color color = {120, 120, 120}) final;
0038
0039
0040 void face(const std::vector<Vector3>& vtxs,
0041 Color color = {120, 120, 120}) final;
0042
0043
0044 void faces(const std::vector<Vector3>& vtxs,
0045 const std::vector<FaceType>& faces,
0046 Color color = {120, 120, 120}) final;
0047
0048
0049 void line(const Vector3& a, const Vector3& b,
0050 Color color = {120, 120, 120}) final;
0051
0052
0053 void write(const std::filesystem::path& path) const final;
0054
0055
0056 void write(std::ostream& os) const final;
0057
0058
0059 void clear() final;
0060
0061 void object(const std::string& ) final {
0062
0063 }
0064
0065 private:
0066 std::vector<std::pair<VertexType, Color>> m_vertices;
0067 std::vector<FaceType> m_faces;
0068 std::vector<std::pair<std::pair<std::size_t, std::size_t>, Color>> m_edges;
0069 };
0070
0071 }
0072
0073 #ifndef DOXYGEN
0074 #include "PlyVisualization3D.ipp"
0075 #endif