add Python functionality for ProjectionGroups

This commit is contained in:
WandererFan
2016-01-29 16:06:47 -05:00
committed by wmayer
parent c47bdf5d9a
commit 12f8181ed2
12 changed files with 255 additions and 6 deletions

View File

@@ -40,6 +40,8 @@
#include "DrawPage.h"
#include "DrawProjGroup.h"
#include "DrawProjGroupPy.h" // generated from DrawProjGroupPy.xml
using namespace TechDraw;
const char* DrawProjGroup::ProjectionTypeEnums[] = {"Document",
@@ -283,7 +285,7 @@ App::DocumentObject * DrawProjGroup::addProjection(const char *viewProjType)
DrawProjGroupItem *view = NULL;
if ( checkViewProjType(viewProjType) && !hasProjection(viewProjType) ) {
std::string FeatName = getDocument()->getUniqueObjectName("ProjGroup");
std::string FeatName = getDocument()->getUniqueObjectName("ProjItem");
App::DocumentObject *docObj = getDocument()->addObject("TechDraw::DrawProjGroupItem",
FeatName.c_str());
@@ -615,3 +617,12 @@ void DrawProjGroup::onDocumentRestored()
{
execute();
}
PyObject *DrawProjGroup::getPyObject(void)
{
if (PythonObject.is(Py::_None())) {
// ref counter is set to 1
PythonObject = Py::Object(new DrawProjGroupPy(this),true);
}
return Py::new_reference_to(PythonObject);
}