Attacher: Py: introduce Py interface of AttachableObject

Small - just the introduction.
Support for Py features based on AttachableObject.
Redirect Part2DObjectPython's father to be AttachableObjectPython.
This commit is contained in:
DeepSOIC
2016-05-06 16:52:42 +03:00
parent e7b6ebeb01
commit c040ee7333
7 changed files with 100 additions and 2 deletions

View File

@@ -30,6 +30,8 @@
#include <Base/Console.h>
#include <App/Application.h>
#include <App/FeaturePythonPyImp.h>
#include "AttachableObjectPy.h"
using namespace Part;
@@ -151,4 +153,22 @@ void AttachableObject::updateAttacherVals()
this->superPlacement.getValue());
}
namespace App {
/// @cond DOXERR
PROPERTY_SOURCE_TEMPLATE(Part::AttachableObjectPython, Part::AttachableObject)
template<> const char* Part::AttachableObjectPython::getViewProviderName(void) const {
return "PartGui::ViewProviderPython";
}
template<> PyObject* Part::AttachableObjectPython::getPyObject(void) {
if (PythonObject.is(Py::_None())) {
// ref counter is set to 1
PythonObject = Py::Object(new FeaturePythonPyT<Part::AttachableObjectPy>(this),true);
}
return Py::new_reference_to(PythonObject);
}
/// @endcond
// explicit template instantiation
template class PartExport FeaturePythonT<Part::AttachableObject>;
}