File indexing completed on 2025-01-19 09:23:43
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 <array>
0016 #include <fstream>
0017 #include <string>
0018 #include <utility>
0019 #include <vector>
0020
0021 namespace Acts {
0022
0023 template <typename T = double>
0024
0025
0026 class PlyVisualization3D : public IVisualization3D {
0027 public:
0028 static_assert(std::is_same_v<T, double> || std::is_same_v<T, float>,
0029 "Use either double or float");
0030
0031
0032 using ValueType = T;
0033
0034
0035 using VertexType = Eigen::Matrix<ValueType, 3, 1>;
0036
0037
0038 void vertex(const Vector3& vtx, ColorRGB color = {120, 120, 120}) final;
0039
0040
0041 void face(const std::vector<Vector3>& vtxs,
0042 ColorRGB color = {120, 120, 120}) final;
0043
0044
0045 void faces(const std::vector<Vector3>& vtxs,
0046 const std::vector<FaceType>& faces,
0047 ColorRGB color = {120, 120, 120}) final;
0048
0049
0050 void line(const Vector3& a, const Vector3& b,
0051 ColorRGB color = {120, 120, 120}) final;
0052
0053
0054 void write(const std::string& path) const final;
0055
0056
0057 void write(std::ostream& os) const final;
0058
0059
0060 void clear() final;
0061
0062 private:
0063 std::vector<std::pair<VertexType, ColorRGB>> m_vertices;
0064 std::vector<FaceType> m_faces;
0065 std::vector<std::pair<std::pair<std::size_t, std::size_t>, ColorRGB>> m_edges;
0066 };
0067
0068 #ifndef DOXYGEN
0069 #include "detail/PlyVisualization3D.ipp"
0070 #endif
0071
0072 }