Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
IVisualization3D.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file IVisualization3D.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 
13 
14 #include <array>
15 #include <cstddef>
16 #include <fstream>
17 #include <string>
18 #include <vector>
19 
20 namespace Acts {
21 
26  public:
27  using FaceType = std::vector<size_t>;
28 
33  virtual void vertex(const Vector3& vtx, ColorRGB color = {120, 120, 120}) = 0;
34 
41  virtual void face(const std::vector<Vector3>& vtxs,
42  ColorRGB color = {120, 120, 120}) = 0;
43 
52  virtual void faces(const std::vector<Vector3>& vtxs,
53  const std::vector<FaceType>& faces,
54  ColorRGB color = {120, 120, 120}) = 0;
55 
61  virtual void line(const Vector3& a, const Vector3& b,
62  ColorRGB color = {120, 120, 120}) = 0;
63 
66  virtual void write(std::ostream& os) const = 0;
67 
71  virtual void write(const std::string& path) const = 0;
72 
75  virtual void clear() = 0;
76 
77  protected:
83  bool hasExtension(const std::string& path) const;
84 
91  void replaceExtension(std::string& path, const std::string& suffix) const;
92 };
93 
97 inline std::ostream& operator<<(std::ostream& os, const IVisualization3D& hlp) {
98  hlp.write(os);
99  return os;
100 }
101 } // namespace Acts