Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-10-13 08:18:28

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/IVisualization3D.hpp"
0010 #include "Acts/Visualization/ViewConfig.hpp"
0011 #include "ActsPython/Utilities/Helpers.hpp"
0012 #include "ActsPython/Utilities/Macros.hpp"
0013 
0014 #include <pybind11/pybind11.h>
0015 #include <pybind11/stl.h>
0016 
0017 namespace py = pybind11;
0018 using namespace Acts;
0019 
0020 namespace ActsPython {
0021 
0022 /// @brief Add visualization bindings to the given module.
0023 /// @param m    The module to add the bindings to.
0024 void addVisualization(py::module& m) {
0025   {
0026     auto c = py::class_<ViewConfig>(m, "ViewConfig").def(py::init<>());
0027 
0028     ACTS_PYTHON_STRUCT(c, visible, color, offset, lineThickness,
0029                        surfaceThickness, quarterSegments, triangulate,
0030                        outputName);
0031 
0032     patchKwargsConstructor(c);
0033 
0034     py::class_<Color>(m, "Color")
0035         .def(py::init<>())
0036         .def(py::init<int, int, int>())
0037         .def(py::init<double, double, double>())
0038         .def(py::init<std::string_view>())
0039         .def_readonly("rgb", &Color::rgb);
0040   }
0041 
0042   py::class_<IVisualization3D>(m, "IVisualization3D")
0043       .def("write", py::overload_cast<const std::filesystem::path&>(
0044                         &IVisualization3D::write, py::const_));
0045 }
0046 }  // namespace ActsPython