From bd27e7a355be0c48cbaf2034b625477b28232973 Mon Sep 17 00:00:00 2001 From: Alex Bilger Date: Thu, 14 Dec 2023 21:24:06 +0100 Subject: [PATCH] Fix BaseMeshTopology inheritance --- .../SofaPython3/Sofa/Core/Binding_BaseMeshTopology.cpp | 2 +- .../Sofa/src/SofaPython3/Sofa/Core/Binding_Topology.cpp | 2 +- bindings/Sofa/tests/Core/BaseObject.py | 8 ++++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_BaseMeshTopology.cpp b/bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_BaseMeshTopology.cpp index b75c70e4d..23d381829 100644 --- a/bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_BaseMeshTopology.cpp +++ b/bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_BaseMeshTopology.cpp @@ -37,7 +37,7 @@ using namespace sofa::core::topology; namespace sofapython3 { void moduleAddBaseMeshTopology(py::module& m) { - py::class_> c (m, "BaseMeshTopology"); + py::class_> c (m, "BaseMeshTopology"); /// register the BaseMeshTopology binding in the downcasting subsystem PythonFactory::registerType([](sofa::core::objectmodel::Base* object) diff --git a/bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_Topology.cpp b/bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_Topology.cpp index 984d7932f..ed57ba113 100644 --- a/bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_Topology.cpp +++ b/bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_Topology.cpp @@ -36,7 +36,7 @@ using namespace sofa::core::topology; namespace sofapython3 { void moduleAddTopology(py::module& m) { - py::class_> c (m, "Topology"); + py::class_> c (m, "Topology"); } } // namespace sofapython3 diff --git a/bindings/Sofa/tests/Core/BaseObject.py b/bindings/Sofa/tests/Core/BaseObject.py index a344a0537..dad7191f1 100644 --- a/bindings/Sofa/tests/Core/BaseObject.py +++ b/bindings/Sofa/tests/Core/BaseObject.py @@ -64,8 +64,12 @@ def test_getName(self): def test_getCategories(self): root = create_scene("rootNode") - c = root.addObject("MechanicalObject", name="t") - self.assertEqual(c.getCategories(), ["MechanicalState"]) + + mecha = root.addObject("MechanicalObject", name="t") + self.assertEqual(mecha.getCategories(), ["MechanicalState"]) + + topo = root.addObject("MeshTopology", name="topology") + self.assertEqual(topo.getCategories(), ["Topology"]) def test_getPathName(self): root = create_scene("rootNode")