Add Mod/TechDraw/App

This commit is contained in:
WandererFan
2016-01-14 15:59:03 -05:00
committed by wmayer
parent 96ba139f70
commit 189839e93d
58 changed files with 9062 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
#include "PreCompiled.h"
#include "Mod/Drawing/App/DrawSVGTemplate.h"
// inclusion of the generated files (generated out of DrawSVGTemplatePy.xml)
#include "DrawSVGTemplatePy.h"
#include "DrawSVGTemplatePy.cpp"
using namespace TechDraw;
// returns a string which represents the object e.g. when printed in python
std::string DrawSVGTemplatePy::representation(void) const
{
return std::string("<DrawSVGTemplate object>");
}
PyObject *DrawSVGTemplatePy::getCustomAttributes(const char* attr) const
{
return 0;
}
int DrawSVGTemplatePy::setCustomAttributes(const char* attr, PyObject* obj)
{
// search in PropertyList
App::Property *prop = getDrawSVGTemplatePtr()->getPropertyByName(attr);
if (prop) {
// Read-only attributes must not be set over its Python interface
short Type = getDrawSVGTemplatePtr()->getPropertyType(prop);
if (Type & App::Prop_ReadOnly) {
std::stringstream s;
s << "Object attribute '" << attr << "' is read-only";
throw Py::AttributeError(s.str());
}
prop->setPyObject(obj);
return 1;
}
return 0;
}