EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PlyVisualization3D.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PlyVisualization3D.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2019 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 
15 #include <array>
16 #include <fstream>
17 #include <string>
18 #include <utility>
19 #include <vector>
20 
21 namespace Acts {
22 
23 template <typename T = double>
24 
27  public:
28  static_assert(std::is_same_v<T, double> || std::is_same_v<T, float>,
29  "Use either double or float");
30 
32  using ValueType = T;
33 
36 
38  void vertex(const Vector3D& vtx, ColorRGB color = {120, 120, 120}) final;
39 
41  void face(const std::vector<Vector3D>& vtxs,
42  ColorRGB color = {120, 120, 120}) final;
43 
45  void faces(const std::vector<Vector3D>& vtxs, const std::vector<FaceType>&,
46  ColorRGB color = {120, 120, 120}) final;
47 
49  void line(const Vector3D& a, const Vector3D& b,
50  ColorRGB color = {120, 120, 120}) final;
51 
53  void write(const std::string& path) const final;
54 
56  void write(std::ostream& os) const final;
57 
59  void clear() final;
60 
61  private:
62  std::vector<std::pair<VertexType, ColorRGB>> m_vertices;
64  std::vector<std::pair<std::pair<size_t, size_t>, ColorRGB>> m_edges;
65 };
66 
67 #include "detail/PlyVisualization3D.ipp"
68 
69 } // namespace Acts