Expose method to Python to get property name of main geometry

fix inheritance of MeshFeaturePy
fix inheritance of PartFeaturePy
remove useless test() method
implement getPyObject in GeoFeature in case a sub-class doesn't implement it
This commit is contained in:
wmayer
2017-05-10 10:36:22 +02:00
parent 19b14520e9
commit 03bf3ac606
7 changed files with 41 additions and 23 deletions

View File

@@ -27,6 +27,7 @@
#endif
#include "GeoFeature.h"
#include <App/GeoFeaturePy.h>
using namespace App;
@@ -58,3 +59,12 @@ const PropertyComplexGeoData* GeoFeature::getPropertyOfGeometry() const
{
return nullptr;
}
PyObject* GeoFeature::getPyObject(void)
{
if (PythonObject.is(Py::_None())) {
// ref counter is set to 1
PythonObject = Py::Object(new GeoFeaturePy(this),true);
}
return Py::new_reference_to(PythonObject);
}