0001221: Add a function that can apply a Placement to a Shape like sh.transformGeometry(sh.Placement.toMatrix())

This commit is contained in:
wmayer
2013-08-25 11:32:03 +02:00
parent 47fd378f3f
commit 1da39d014d
4 changed files with 8 additions and 6 deletions

View File

@@ -787,12 +787,13 @@ PyObject* TopoShapePy::transformGeometry(PyObject *args)
PyObject* TopoShapePy::transformShape(PyObject *args)
{
PyObject *obj;
if (!PyArg_ParseTuple(args, "O!", &(Base::MatrixPy::Type),&obj))
PyObject *copy = Py_False;
if (!PyArg_ParseTuple(args, "O!|O!", &(Base::MatrixPy::Type),&obj,&(PyBool_Type), &copy))
return NULL;
Base::Matrix4D mat = static_cast<Base::MatrixPy*>(obj)->value();
try {
this->getTopoShapePtr()->transformShape(mat);
this->getTopoShapePtr()->transformShape(mat, PyObject_IsTrue(copy) ? true : false);
Py_Return;
}
catch (Standard_Failure) {