add optional parameters to copy method to copy topology and/or triangulation
This commit is contained in:
@@ -143,7 +143,6 @@ int TopoShapePy::PyInit(PyObject* args, PyObject*)
|
||||
}
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
|
||||
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
|
||||
return -1;
|
||||
}
|
||||
@@ -156,7 +155,9 @@ int TopoShapePy::PyInit(PyObject* args, PyObject*)
|
||||
|
||||
PyObject* TopoShapePy::copy(PyObject *args)
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
PyObject* copyGeom = Py_True;
|
||||
PyObject* copyMesh = Py_False;
|
||||
if (!PyArg_ParseTuple(args, "|O!O!", &PyBool_Type, ©Geom, &PyBool_Type, ©Mesh))
|
||||
return NULL;
|
||||
|
||||
const TopoDS_Shape& shape = this->getTopoShapePtr()->getShape();
|
||||
@@ -171,7 +172,9 @@ PyObject* TopoShapePy::copy(PyObject *args)
|
||||
}
|
||||
|
||||
if (!shape.IsNull()) {
|
||||
BRepBuilderAPI_Copy c(shape);
|
||||
BRepBuilderAPI_Copy c(shape,
|
||||
PyObject_IsTrue(copyGeom) ? Standard_True : Standard_False,
|
||||
PyObject_IsTrue(copyMesh) ? Standard_True : Standard_False);
|
||||
static_cast<TopoShapePy*>(cpy)->getTopoShapePtr()->setShape(c.Shape());
|
||||
}
|
||||
return cpy;
|
||||
|
||||
Reference in New Issue
Block a user