diff --git a/Plugin/src/SofaPython3/Prefab.h b/Plugin/src/SofaPython3/Prefab.h index 0b212d0e..e5e4912a 100644 --- a/Plugin/src/SofaPython3/Prefab.h +++ b/Plugin/src/SofaPython3/Prefab.h @@ -19,7 +19,7 @@ ******************************************************************************/ #pragma once -#include +#include #include #include @@ -28,17 +28,17 @@ namespace sofa::core::objectmodel { -class SOFAPYTHON3_API BasePrefab : public sofa::simulation::graph::DAGNode +class SOFAPYTHON3_API BasePrefab : public sofa::simulation::Node { public: - SOFA_CLASS(BasePrefab, sofa::simulation::graph::DAGNode); + SOFA_CLASS(BasePrefab, sofa::simulation::Node); }; } // namespace sofa::core::objectmodel namespace sofapython3 { -using sofa::simulation::graph::DAGNode; +using sofa::simulation::Node; using sofa::core::objectmodel::BasePrefab; using sofa::core::objectmodel::DataCallback; diff --git a/Plugin/src/SofaPython3/PythonFactory.cpp b/Plugin/src/SofaPython3/PythonFactory.cpp index b421ec49..3a9c678b 100644 --- a/Plugin/src/SofaPython3/PythonFactory.cpp +++ b/Plugin/src/SofaPython3/PythonFactory.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include #include "sofa/simulation/AnimateBeginEvent.h" using sofa::simulation::AnimateBeginEvent; diff --git a/Plugin/src/SofaPython3/SceneLoaderPY3.cpp b/Plugin/src/SofaPython3/SceneLoaderPY3.cpp index a5a85109..9185e159 100644 --- a/Plugin/src/SofaPython3/SceneLoaderPY3.cpp +++ b/Plugin/src/SofaPython3/SceneLoaderPY3.cpp @@ -22,9 +22,6 @@ #include #include -#include -using sofa::simulation::graph::DAGNode; - #include #include #include diff --git a/bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_Base.cpp b/bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_Base.cpp index 81365ecf..e7115063 100644 --- a/bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_Base.cpp +++ b/bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_Base.cpp @@ -133,7 +133,6 @@ bool BindingBase::SetLink(BaseLink* link, py::object value) return true; } - void BindingBase::SetAttr(py::object self, const std::string& s, py::object value) { Base* self_d = py::cast(self); diff --git a/bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_Node.cpp b/bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_Node.cpp index f52a6240..df26021d 100644 --- a/bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_Node.cpp +++ b/bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_Node.cpp @@ -37,7 +37,7 @@ using sofa::helper::logging::Message; #include using sofa::helper::getClosestMatch; -#include +#include using sofa::core::ExecParams; #include @@ -163,22 +163,20 @@ std::string getLinkPath(Node* node){ return ("@"+node->getPathName()).c_str(); } -py_shared_ptr __init__noname() { - auto dag_node = sofa::core::objectmodel::New("unnamed"); - return std::move(dag_node); +py_shared_ptr __init_noname__() { + auto node = sofa::core::objectmodel::New("unnamed"); + return std::move(node); } -py_shared_ptr __init__no_kwargs__(const std::string& name) { - auto dag_node = sofa::core::objectmodel::New(name); - return std::move(dag_node); +py_shared_ptr __init_named__(const std::string& name) { + auto node = sofa::core::objectmodel::New(name); + return std::move(node); } -py_shared_ptr __init__(const std::string& name, const py::kwargs& kwargs) { - auto dag_node = sofa::core::objectmodel::New(name); - - setDataFromKwargs(dag_node.get(), kwargs); - - return std::move(dag_node); +py_shared_ptr __init_kwarged__(const std::string& name, const py::kwargs& kwargs) { + auto node = sofa::core::objectmodel::New(name); + setDataFromKwargs(node.get(), kwargs); + return std::move(node); } /// Method: init (beware this is not the python __init__, this is sofa's init()) @@ -681,15 +679,15 @@ void moduleAddNode(py::module &m) { sofa::core::objectmodel::Context, py_shared_ptr> p(m, "Node", sofapython3::doc::sofa::core::Node::Class); - PythonFactory::registerType( + PythonFactory::registerType( [](sofa::core::objectmodel::Base* object) { return py::cast(dynamic_cast(object->toBaseNode())); }); - p.def(py::init(&__init__noname), sofapython3::doc::sofa::core::Node::init); - p.def(py::init(&__init__no_kwargs__), sofapython3::doc::sofa::core::Node::init1Arg, py::arg("name")); - p.def(py::init(&__init__), sofapython3::doc::sofa::core::Node::init1Arg); + p.def(py::init(&__init_noname__), sofapython3::doc::sofa::core::Node::init); + p.def(py::init(&__init_named__), sofapython3::doc::sofa::core::Node::init1Arg, py::arg("name")); + p.def(py::init(&__init_kwarged__), sofapython3::doc::sofa::core::Node::init1Arg, py::arg("name")); p.def("init", &init, sofapython3::doc::sofa::core::Node::initSofa ); p.def("add", &addKwargs, sofapython3::doc::sofa::core::Node::addKwargs); p.def("addObject", &addObjectKwargs, sofapython3::doc::sofa::core::Node::addObjectKwargs); diff --git a/bindings/Sofa/src/SofaPython3/Sofa/Simulation/Submodule_Simulation.cpp b/bindings/Sofa/src/SofaPython3/Sofa/Simulation/Submodule_Simulation.cpp index 384362f3..cf81ad04 100644 --- a/bindings/Sofa/src/SofaPython3/Sofa/Simulation/Submodule_Simulation.cpp +++ b/bindings/Sofa/src/SofaPython3/Sofa/Simulation/Submodule_Simulation.cpp @@ -26,9 +26,6 @@ #include "SofaPython3/DataHelper.h" using sofa::simulation::Simulation; -#include -using sofa::simulation::graph::DAGSimulation; - #include using sofa::simulation::Node; using namespace pybind11::literals; diff --git a/bindings/SofaRuntime/src/SofaPython3/SofaRuntime/Module_SofaRuntime.cpp b/bindings/SofaRuntime/src/SofaPython3/SofaRuntime/Module_SofaRuntime.cpp index c273807a..c501fdb6 100644 --- a/bindings/SofaRuntime/src/SofaPython3/SofaRuntime/Module_SofaRuntime.cpp +++ b/bindings/SofaRuntime/src/SofaPython3/SofaRuntime/Module_SofaRuntime.cpp @@ -22,8 +22,7 @@ #include namespace py = pybind11; -#include -using sofa::simulation::graph::DAGSimulation ; +#include using sofa::simulation::Simulation; #include