Make FeaturePython Python binding a template class to avoid code duplication
This commit is contained in:
@@ -50,10 +50,10 @@
|
||||
#include <Base/Stream.h>
|
||||
#include <Base/Placement.h>
|
||||
#include <Base/Rotation.h>
|
||||
#include <App/FeaturePythonPyImp.h>
|
||||
|
||||
#include "PartFeature.h"
|
||||
#include "PartFeaturePy.h"
|
||||
#include "FeaturePythonPy.h"
|
||||
|
||||
using namespace Part;
|
||||
|
||||
@@ -274,13 +274,12 @@ PROPERTY_SOURCE_TEMPLATE(Part::FeaturePython, Part::Feature)
|
||||
template<> const char* Part::FeaturePython::getViewProviderName(void) const {
|
||||
return "PartGui::ViewProviderPython";
|
||||
}
|
||||
|
||||
template<> PyObject* Part::FeaturePython::getPyObject(void) {
|
||||
if (PythonObject.is(Py::_None())){
|
||||
if (PythonObject.is(Py::_None())) {
|
||||
// ref counter is set to 1
|
||||
PythonObject = Py::Object(new Part::FeaturePythonPy(this),true);
|
||||
PythonObject = Py::Object(new FeaturePythonPyT<Part::PartFeaturePy>(this),true);
|
||||
}
|
||||
return Py::new_reference_to(PythonObject);
|
||||
return Py::new_reference_to(PythonObject);
|
||||
}
|
||||
/// @endcond
|
||||
|
||||
|
||||
Reference in New Issue
Block a user