|
| 1 | +/****************************************************************************** |
| 2 | +* SofaPython3 plugin * |
| 3 | +* (c) 2021 CNRS, University of Lille, INRIA * |
| 4 | +* * |
| 5 | +* This program is free software; you can redistribute it and/or modify it * |
| 6 | +* under the terms of the GNU Lesser General Public License as published by * |
| 7 | +* the Free Software Foundation; either version 2.1 of the License, or (at * |
| 8 | +* your option) any later version. * |
| 9 | +* * |
| 10 | +* This program is distributed in the hope that it will be useful, but WITHOUT * |
| 11 | +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * |
| 12 | +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * |
| 13 | +* for more details. * |
| 14 | +* * |
| 15 | +* You should have received a copy of the GNU Lesser General Public License * |
| 16 | +* along with this program. If not, see <http://www.gnu.org/licenses/>. * |
| 17 | +******************************************************************************* |
| 18 | +* Contact information: contact@sofa-framework.org * |
| 19 | +******************************************************************************/ |
| 20 | + |
| 21 | +#include <SofaPython3/Sofa/Core/Binding_Base.h> |
| 22 | +#include <SofaExporter/Binding_OBJExporter.h> |
| 23 | +#include <SofaExporter/Binding_OBJExporter_doc.h> |
| 24 | + |
| 25 | +#include <SofaPython3/PythonFactory.h> |
| 26 | +#include <SofaPython3/Sofa/Core/Binding_BaseObject.h> |
| 27 | +#include <SofaExporter/OBJExporter.h> |
| 28 | + |
| 29 | +using sofa::component::exporter::OBJExporter; |
| 30 | + |
| 31 | +namespace py { using namespace pybind11; } |
| 32 | + |
| 33 | +namespace sofapython3 { |
| 34 | + |
| 35 | +void moduleAddOBJExporter(py::module &m) |
| 36 | +{ |
| 37 | + PythonFactory::registerType<OBJExporter>([](sofa::core::objectmodel::Base* object) |
| 38 | + { |
| 39 | + return py::cast(dynamic_cast<OBJExporter*>(object)); |
| 40 | + }); |
| 41 | + |
| 42 | + py::class_<OBJExporter, sofa::core::objectmodel::BaseObject, py_shared_ptr<OBJExporter>> p(m, "OBJExporter"); |
| 43 | + |
| 44 | + p.def("write", &OBJExporter::write, sofapython3::doc::SofaExporter::OBJExporter::write::docstring); |
| 45 | +} |
| 46 | + |
| 47 | +} // namespace sofapython3 |
0 commit comments