Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-05 08:18:11

0001 // This file is part of the ACTS project.
0002 //
0003 // Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
0008 
0009 #include "Acts/Visualization/VisualizationBuffer.hpp"
0010 
0011 namespace Acts {
0012 
0013 void VisualizationBuffer::vertex(const Vector3& vtx, Color color) {
0014   /// vertex in 2D, either rz- or xy-projection
0015   m_vertexcolors.push_back(color);
0016   m_vertices.push_back(Vector3{vtx[0], vtx[1], vtx[2]});
0017 }
0018 
0019 void VisualizationBuffer::line(const Vector3& a, const Vector3& b,
0020                                Color color) {
0021   m_linecolors.push_back(color);
0022   std::vector<Vector3> segment;
0023   segment.push_back(Vector3{a[0], a[1], a[2]});
0024   segment.push_back(Vector3{b[0], b[1], b[2]});
0025   m_segments.push_back(segment);
0026 }
0027 
0028 // overload to allow for lineThickness argument to be accepted
0029 void VisualizationBuffer::line(const Vector3& a, const Vector3& b,
0030                                const double lineThickness, Color color) {
0031   m_linecolors.push_back(color);
0032   m_linethickness.push_back(lineThickness);
0033   std::vector<Vector3> segment;
0034   segment.push_back(Vector3{a[0], a[1], a[2]});
0035   segment.push_back(Vector3{b[0], b[1], b[2]});
0036   m_segments.push_back(segment);
0037 }
0038 
0039 /// @copydoc Acts::IVisualization3D::faces()
0040 void VisualizationBuffer::faces(const std::vector<Vector3>& vtxs,
0041                                 const std::vector<FaceType>& /*faces*/,
0042                                 Color color) {
0043   m_facecolors.push_back(color);
0044   std::vector<Vector3> surface;
0045   for (const auto& v : vtxs) {
0046     surface.push_back(Vector3{v[0], v[1], v[2]});
0047   }
0048   m_surfaces.push_back(surface);
0049 }
0050 
0051 }  // namespace Acts