rename python classes for shapes and

implememnt __getstate__ and __setstate__ to enable pickling
issue #1948
This commit is contained in:
Sebastian Hoogen
2015-02-04 14:43:08 +01:00
parent 79173e37cd
commit 8ec87dbdf2
3 changed files with 35 additions and 0 deletions

View File

@@ -455,6 +455,21 @@ PyObject* TopoShapePy::importBrepFromString(PyObject *args)
Py_Return;
}
PyObject* TopoShapePy::__getstate__(PyObject *args) {
return exportBrepToString(args);
}
PyObject* TopoShapePy::__setstate__(PyObject *args) {
if (! getTopoShapePtr()) {
PyErr_SetString(Base::BaseExceptionFreeCADError,"no c++ object");
return 0;
}
else {
return importBrepFromString(args);
}
}
PyObject* TopoShapePy::exportStl(PyObject *args)
{
double deflection = 0;