Skip to content

Commit 84b6767

Browse files
committed
Fix constructor build issue.
1 parent db072c9 commit 84b6767

File tree

3 files changed

+15
-18
lines changed

3 files changed

+15
-18
lines changed

Plugin/src/SofaPython3/PythonFactory.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include <SofaPython3/PythonFactory.h>
2323
#include <SofaPython3/DataHelper.h>
2424

25-
#include <sofa/simulation/graph/DAGNode.h>
25+
#include <sofa/simulation/Node.h>
2626

2727
#include "sofa/simulation/AnimateBeginEvent.h"
2828
using sofa::simulation::AnimateBeginEvent;

bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_Base.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ bool BindingBase::SetLink(BaseLink* link, py::object value)
133133
return true;
134134
}
135135

136-
137136
void BindingBase::SetAttr(py::object self, const std::string& s, py::object value)
138137
{
139138
Base* self_d = py::cast<Base*>(self);

bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_Node.cpp

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ using sofa::helper::logging::Message;
3737
#include <sofa/helper/DiffLib.h>
3838
using sofa::helper::getClosestMatch;
3939

40-
#include <sofa/simulation/graph/DAGNode.h>
40+
#include <sofa/simulation/Node.h>
4141
using sofa::core::ExecParams;
4242

4343
#include <SofaPython3/LinkPath.h>
@@ -163,22 +163,20 @@ std::string getLinkPath(Node* node){
163163
return ("@"+node->getPathName()).c_str();
164164
}
165165

166-
py_shared_ptr<Node> __init__noname() {
167-
auto dag_node = sofa::core::objectmodel::New<sofa::simulation::Node>("unnamed");
168-
return std::move(dag_node);
166+
py_shared_ptr<Node> __init_noname__() {
167+
auto node = sofa::core::objectmodel::New<sofa::simulation::Node>("unnamed");
168+
return std::move(node);
169169
}
170170

171-
py_shared_ptr<Node> __init__(const std::string& name) {
172-
auto dag_node = sofa::core::objectmodel::New<sofa::simulation::Node>(name);
173-
return std::move(dag_node);
171+
py_shared_ptr<Node> __init_named__(const std::string& name) {
172+
auto node = sofa::core::objectmodel::New<sofa::simulation::Node>(name);
173+
return std::move(node);
174174
}
175175

176-
py_shared_ptr<Node> __init__(const std::string& name, const py::kwargs& kwargs) {
177-
auto dag_node = sofa::core::objectmodel::New<sofa::simulation::graph::DAGNode>(name);
178-
179-
setDataFromKwargs(dag_node.get(), kwargs);
180-
181-
return std::move(dag_node);
176+
py_shared_ptr<Node> __init_kwarged__(const std::string& name, const py::kwargs& kwargs) {
177+
auto node = sofa::core::objectmodel::New<sofa::simulation::Node>(name);
178+
setDataFromKwargs(node.get(), kwargs);
179+
return std::move(node);
182180
}
183181

184182
/// Method: init (beware this is not the python __init__, this is sofa's init())
@@ -687,9 +685,9 @@ void moduleAddNode(py::module &m) {
687685
return py::cast(dynamic_cast<Node*>(object->toBaseNode()));
688686
});
689687

690-
p.def(py::init(&__init__noname), sofapython3::doc::sofa::core::Node::init);
691-
p.def(py::init(&__init__no_kwargs__), sofapython3::doc::sofa::core::Node::init1Arg, py::arg("name"));
692-
p.def(py::init(&__init__), sofapython3::doc::sofa::core::Node::init1Arg);
688+
p.def(py::init(&__init_noname__), sofapython3::doc::sofa::core::Node::init);
689+
p.def(py::init(&__init_named__), sofapython3::doc::sofa::core::Node::init1Arg, py::arg("name"));
690+
p.def(py::init(&__init_kwarged__), sofapython3::doc::sofa::core::Node::init1Arg, py::arg("name"));
693691
p.def("init", &init, sofapython3::doc::sofa::core::Node::initSofa );
694692
p.def("add", &addKwargs, sofapython3::doc::sofa::core::Node::addKwargs);
695693
p.def("addObject", &addObjectKwargs, sofapython3::doc::sofa::core::Node::addObjectKwargs);

0 commit comments

Comments
 (0)