Python functionality for ViewPart and ViewClip
This commit is contained in:
@@ -27,6 +27,7 @@ set(TechDrawLIBS
|
||||
|
||||
generate_from_xml(DrawPagePy)
|
||||
generate_from_xml(DrawViewPy)
|
||||
generate_from_xml(DrawViewPartPy)
|
||||
generate_from_xml(DrawViewSymbolPy)
|
||||
generate_from_xml(DrawTemplatePy)
|
||||
generate_from_xml(DrawParametricTemplatePy)
|
||||
@@ -88,6 +89,8 @@ SET(Python_SRCS
|
||||
DrawPagePyImp.cpp
|
||||
DrawViewPy.xml
|
||||
DrawViewPyImp.cpp
|
||||
DrawViewPartPy.xml
|
||||
DrawViewPartPyImp.cpp
|
||||
DrawViewSymbolPy.xml
|
||||
DrawViewSymbolPyImp.cpp
|
||||
DrawTemplatePy.xml
|
||||
|
||||
@@ -41,6 +41,8 @@
|
||||
#include "DrawViewCollection.h"
|
||||
#include "DrawViewClip.h"
|
||||
|
||||
#include "DrawViewPy.h" // generated from DrawViewPy.xml
|
||||
|
||||
using namespace TechDraw;
|
||||
|
||||
|
||||
@@ -170,6 +172,15 @@ bool DrawView::isInClip()
|
||||
return false;
|
||||
}
|
||||
|
||||
PyObject *DrawView::getPyObject(void)
|
||||
{
|
||||
if (PythonObject.is(Py::_None())) {
|
||||
// ref counter is set to 1
|
||||
PythonObject = Py::Object(new DrawViewPy(this),true);
|
||||
}
|
||||
return Py::new_reference_to(PythonObject);
|
||||
}
|
||||
|
||||
// Python Drawing feature ---------------------------------------------------------
|
||||
|
||||
namespace App {
|
||||
|
||||
@@ -65,6 +65,8 @@ public:
|
||||
virtual const char* getViewProviderName(void) const {
|
||||
return "TechDrawGui::ViewProviderDrawingView";
|
||||
}
|
||||
//return PyObject as DrawViewPy
|
||||
virtual PyObject *getPyObject(void);
|
||||
|
||||
DrawPage* findParentPage() const;
|
||||
|
||||
|
||||
@@ -40,6 +40,8 @@
|
||||
#include "DrawView.h"
|
||||
#include "DrawPage.h"
|
||||
|
||||
#include "DrawViewClipPy.h" // generated from DrawViewClipPy.xml
|
||||
|
||||
using namespace TechDraw;
|
||||
using namespace std;
|
||||
|
||||
@@ -158,6 +160,16 @@ std::vector<std::string> DrawViewClip::getChildViewNames()
|
||||
return childNames;
|
||||
}
|
||||
|
||||
PyObject *DrawViewClip::getPyObject(void)
|
||||
{
|
||||
if (PythonObject.is(Py::_None())) {
|
||||
// ref counter is set to 1
|
||||
PythonObject = Py::Object(new DrawViewClipPy(this),true);
|
||||
}
|
||||
return Py::new_reference_to(PythonObject);
|
||||
}
|
||||
|
||||
|
||||
// Python Drawing feature ---------------------------------------------------------
|
||||
|
||||
namespace App {
|
||||
|
||||
@@ -66,6 +66,9 @@ public:
|
||||
virtual const char* getViewProviderName(void) const {
|
||||
return "TechDrawGui::ViewProviderViewClip";
|
||||
}
|
||||
//return PyObject as DrawViewClipPy
|
||||
virtual PyObject *getPyObject(void);
|
||||
|
||||
std::vector<std::string> getChildViewNames();
|
||||
|
||||
|
||||
|
||||
@@ -66,6 +66,8 @@
|
||||
#include "DrawHatch.h"
|
||||
//#include "DrawViewDimension.h"
|
||||
|
||||
#include "DrawViewPartPy.h" // generated from DrawViewPartPy.xml
|
||||
|
||||
using namespace TechDraw;
|
||||
using namespace std;
|
||||
|
||||
@@ -456,6 +458,15 @@ void DrawViewPart::dumpVertexRefs(char* text) const
|
||||
}
|
||||
}
|
||||
|
||||
PyObject *DrawViewPart::getPyObject(void)
|
||||
{
|
||||
if (PythonObject.is(Py::_None())) {
|
||||
// ref counter is set to 1
|
||||
PythonObject = Py::Object(new DrawViewPartPy(this),true);
|
||||
}
|
||||
return Py::new_reference_to(PythonObject);
|
||||
}
|
||||
|
||||
// Python Drawing feature ---------------------------------------------------------
|
||||
|
||||
namespace App {
|
||||
|
||||
@@ -101,6 +101,8 @@ public:
|
||||
virtual const char* getViewProviderName(void) const {
|
||||
return "TechDrawGui::ViewProviderViewPart";
|
||||
}
|
||||
//return PyObject as DrawViewPartPy
|
||||
virtual PyObject *getPyObject(void);
|
||||
|
||||
void dumpVertexRefs(char* text) const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user