DAG: Change object graph handling to be bidirectional

This commit is contained in:
Stefan Tröger
2016-12-25 20:14:58 +01:00
committed by wmayer
parent 93262e98b4
commit 665eb63d4c
11 changed files with 613 additions and 52 deletions

View File

@@ -207,6 +207,22 @@ Py::List DocumentObjectPy::getInList(void) const
return ret;
}
Py::List DocumentObjectPy::getInListRecursive(void) const
{
Py::List ret;
try{
std::vector<DocumentObject*> list = getDocumentObjectPtr()->getInListRecursive();
for (std::vector<DocumentObject*>::iterator It = list.begin(); It != list.end(); ++It)
ret.append(Py::Object((*It)->getPyObject(), true));
}catch (const Base::Exception& e) {
throw Py::IndexError(e.what());
}
return ret;
}
Py::List DocumentObjectPy::getOutList(void) const
{
Py::List ret;
@@ -218,6 +234,24 @@ Py::List DocumentObjectPy::getOutList(void) const
return ret;
}
Py::List DocumentObjectPy::getOutListRecursive(void) const
{
Py::List ret;
try {
std::vector<DocumentObject*> list = getDocumentObjectPtr()->getOutListRecursive();
// creat the python list for the output
for (std::vector<DocumentObject*>::iterator It = list.begin(); It != list.end(); ++It)
ret.append(Py::Object((*It)->getPyObject(), true));
}
catch (const Base::Exception& e) {
throw Py::IndexError(e.what());
}
return ret;
}
PyObject* DocumentObjectPy::setExpression(PyObject * args)
{
char * path = NULL;