spend own type for Python wrappers of FeaturePrimitive and BodyBase
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
#ifndef _PreComp_
|
||||
#endif
|
||||
|
||||
#include <Mod/Part/App/BodyBasePy.h>
|
||||
#include <App/Application.h>
|
||||
#include <App/Document.h>
|
||||
#include <Base/Placement.h>
|
||||
@@ -98,4 +99,13 @@ void BodyBase::onChanged (const App::Property* prop) {
|
||||
Part::Feature::onChanged ( prop );
|
||||
}
|
||||
|
||||
PyObject* BodyBase::getPyObject()
|
||||
{
|
||||
if (PythonObject.is(Py::_None())){
|
||||
// ref counter is set to 1
|
||||
PythonObject = Py::Object(new BodyBasePy(this),true);
|
||||
}
|
||||
return Py::new_reference_to(PythonObject);
|
||||
}
|
||||
|
||||
} /* Part */
|
||||
|
||||
@@ -78,6 +78,7 @@ public:
|
||||
* TODO introduce a findBodiesOf() if needed (2015-08-04, Fat-Zer)
|
||||
*/
|
||||
static BodyBase* findBodyOf(const App::DocumentObject* f);
|
||||
virtual PyObject* getPyObject();
|
||||
|
||||
protected:
|
||||
/// If BaseFeature is getting changed and Tip points to it resets the Tip
|
||||
|
||||
Reference in New Issue
Block a user