Gui: expose claimChildren to Python
This commit is contained in:
@@ -85,6 +85,11 @@
|
||||
<UserDocu>Set a transformation on the Inventor node</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="claimChildren" Const="true">
|
||||
<Documentation>
|
||||
<UserDocu>Returns list of objects that are to be grouped in tree under this object.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Attribute Name="Annotation" ReadOnly="false">
|
||||
<Documentation>
|
||||
<UserDocu>A pivy Separator to add a custom scene graph to this ViewProvider</UserDocu>
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
#include <Base/MatrixPy.h>
|
||||
#include <Base/Placement.h>
|
||||
#include <Base/PlacementPy.h>
|
||||
#include <App/DocumentObject.h>
|
||||
|
||||
using namespace Gui;
|
||||
|
||||
@@ -245,6 +246,22 @@ PyObject* ViewProviderPy::setTransformation(PyObject *args)
|
||||
return 0;
|
||||
}
|
||||
|
||||
PyObject* ViewProviderPy::claimChildren(PyObject* args)
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
return NULL; // NULL triggers exception
|
||||
|
||||
std::vector<App::DocumentObject*> children = this->getViewProviderPtr()->claimChildren();
|
||||
Py::List ret;
|
||||
for(App::DocumentObject* child: children){
|
||||
if (child)
|
||||
ret.append(Py::asObject(child->getPyObject()));
|
||||
else
|
||||
ret.append(Py::None());
|
||||
}
|
||||
return Py::new_reference_to(ret);
|
||||
}
|
||||
|
||||
PyObject *ViewProviderPy::getCustomAttributes(const char* attr) const
|
||||
{
|
||||
// search for dynamic property
|
||||
|
||||
Reference in New Issue
Block a user