// This file is part of the ACTS project. // // Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. #include "Acts/Visualization/IVisualization3D.hpp" #include "Acts/Visualization/ObjVisualization3D.hpp" #include "Acts/Visualization/ViewConfig.hpp" #include "ActsPython/Utilities/Helpers.hpp" #include "ActsPython/Utilities/Macros.hpp" #include #include #include namespace py = pybind11; using namespace Acts; namespace ActsPython { /// @brief Add visualization bindings to the given module. /// @param m The module to add the bindings to. void addVisualization(py::module& m) { { auto c = py::class_(m, "ViewConfig").def(py::init<>()); ACTS_PYTHON_STRUCT(c, visible, color, offset, lineThickness, surfaceThickness, quarterSegments, triangulate, outputName); patchKwargsConstructor(c); py::class_(m, "Color") .def(py::init<>()) .def(py::init()) .def(py::init()) .def(py::init()) .def_readonly("rgb", &Color::rgb); } py::class_(m, "IVisualization3D") .def("write", py::overload_cast( &IVisualization3D::write, py::const_)); py::class_(m, "ObjVisualization3D") .def(py::init(), py::arg("prec") = 4u, py::arg("scale") = 1.) .def("write", py::overload_cast( &ObjVisualization3D::write, py::const_), py::arg("path")) .def("clear", &ObjVisualization3D::clear) .def( "object", [](ObjVisualization3D& self, const std::string& name) { self.object(name); }, py::arg("name")); } } // namespace ActsPython