Path: added addObject & removeObject python methods to FeatureCompound - fixes #2607

This commit is contained in:
Yorik van Havre
2016-07-07 19:49:00 -03:00
parent 211a94da4d
commit df5c990066
5 changed files with 183 additions and 0 deletions

View File

@@ -29,6 +29,8 @@
#include "FeaturePathCompound.h"
#include "Command.h"
#include "Path.h"
#include "FeaturePathCompoundPy.h"
#include <App/FeaturePythonPyImp.h>
using namespace Path;
using namespace App;
@@ -103,6 +105,15 @@ void FeatureCompound::removeObject(DocumentObject* obj)
}
}
PyObject *FeatureCompound::getPyObject()
{
if (PythonObject.is(Py::_None())){
// ref counter is set to 1
PythonObject = Py::Object(new FeaturePathCompoundPy(this),true);
}
return Py::new_reference_to(PythonObject);
}
// Python Path Compound feature ---------------------------------------------------------
namespace App {