Part: [skip ci] allow to create empty shapes of each type
This commit is contained in:
@@ -59,6 +59,13 @@ PyObject *TopoShapeCompoundPy::PyMake(struct _typeobject *, PyObject *, PyObject
|
||||
// constructor method
|
||||
int TopoShapeCompoundPy::PyInit(PyObject* args, PyObject* /*kwd*/)
|
||||
{
|
||||
if (PyArg_ParseTuple(args, "")) {
|
||||
// Undefined Compound
|
||||
getTopoShapePtr()->setShape(TopoDS_Compound());
|
||||
return 0;
|
||||
}
|
||||
|
||||
PyErr_Clear();
|
||||
PyObject *pcObj;
|
||||
if (!PyArg_ParseTuple(args, "O", &pcObj))
|
||||
return -1;
|
||||
@@ -79,7 +86,6 @@ int TopoShapeCompoundPy::PyInit(PyObject* args, PyObject* /*kwd*/)
|
||||
}
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
|
||||
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
|
||||
return -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user