ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
IVisualization.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file IVisualization.cpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2020 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 
10 
12  Vector3D vtxd = vtx.template cast<double>();
13  vertex(vtxd, color);
14 }
15 
16 void Acts::IVisualization::face(const std::vector<Vector3F>& vtxs,
17  ColorType color) {
18  std::vector<Vector3D> vtxsd;
19  std::transform(vtxs.begin(), vtxs.end(), std::back_inserter(vtxsd),
20  [](auto& v) { return v.template cast<double>(); });
21  face(vtxsd, color);
22 }
23 
25  ColorType color) {
26  Vector3D ad = a.template cast<double>();
27  Vector3D bd = b.template cast<double>();
28  line(ad, bd, color);
29 }
30 
31 bool Acts::IVisualization::hasExtension(const std::string& path) const {
32  return (path.find(".") != std::string::npos);
33 }
34 
36  const std::string& suffix) const {
37  auto ppoint = path.find_last_of(".");
38  if (ppoint != std::string::npos) {
39  path.replace(ppoint, path.length(), suffix);
40  } else {
41  path += suffix;
42  }
43 }