From 1ede6a3b93beca094f931e2f4aae0bb91be978bc Mon Sep 17 00:00:00 2001 From: wmayer Date: Sat, 10 Aug 2013 11:36:26 +0200 Subject: [PATCH] 0001207: Expose Standard_Boolean TopoDS_Shape::IsPartner(const TopoDS_Shape& other) const; to python --- src/Mod/Part/App/TopoShapePy.xml | 15 +++++++++++++-- src/Mod/Part/App/TopoShapePyImp.cpp | 13 ++++++++++++- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/Mod/Part/App/TopoShapePy.xml b/src/Mod/Part/App/TopoShapePy.xml index bf4dffa9c..b78fe5737 100644 --- a/src/Mod/Part/App/TopoShapePy.xml +++ b/src/Mod/Part/App/TopoShapePy.xml @@ -222,14 +222,25 @@ As a result, this shape becomes null. Checks if the shape is closed. + + + Checks if both shapes share the same geometry. + Placement and orientation may differ. + + + - Checks if both shapes share the same geometry. + Checks if both shapes share the same geometry + and placement. Orientation may differ. + - Checks if both shapes are equal. + Checks if both shapes are equal. + This means geometry, placement and orientation are equal. + diff --git a/src/Mod/Part/App/TopoShapePyImp.cpp b/src/Mod/Part/App/TopoShapePyImp.cpp index 24f26d832..4c5779c8f 100644 --- a/src/Mod/Part/App/TopoShapePyImp.cpp +++ b/src/Mod/Part/App/TopoShapePyImp.cpp @@ -1142,7 +1142,7 @@ PyObject* TopoShapePy::isEqual(PyObject *args) return NULL; TopoDS_Shape shape = static_cast(pcObj)->getTopoShapePtr()->_Shape; - Standard_Boolean test = (getTopoShapePtr()->_Shape == shape); + Standard_Boolean test = (getTopoShapePtr()->_Shape.IsEqual(shape)); return Py_BuildValue("O", (test ? Py_True : Py_False)); } @@ -1157,6 +1157,17 @@ PyObject* TopoShapePy::isSame(PyObject *args) return Py_BuildValue("O", (test ? Py_True : Py_False)); } +PyObject* TopoShapePy::isPartner(PyObject *args) +{ + PyObject *pcObj; + if (!PyArg_ParseTuple(args, "O!", &(TopoShapePy::Type), &pcObj)) + return NULL; + + TopoDS_Shape shape = static_cast(pcObj)->getTopoShapePtr()->_Shape; + Standard_Boolean test = getTopoShapePtr()->_Shape.IsPartner(shape); + return Py_BuildValue("O", (test ? Py_True : Py_False)); +} + PyObject* TopoShapePy::isValid(PyObject *args) { if (!PyArg_ParseTuple(args, ""))