From 81097bbaf1d642fac4f3eb194222e52a67fa6ec1 Mon Sep 17 00:00:00 2001 From: Andrea Date: Sun, 18 May 2025 17:46:07 +0200 Subject: [PATCH] Remove oldFuse funcion oldFuse is deprecated since OCC 7.3 --- src/Mod/Part/App/TopoShape.cpp | 9 --------- src/Mod/Part/App/TopoShape.h | 16 +--------------- src/Mod/Part/App/TopoShape.pyi | 8 -------- src/Mod/Part/App/TopoShapePyImp.cpp | 22 ---------------------- 4 files changed, 1 insertion(+), 54 deletions(-) diff --git a/src/Mod/Part/App/TopoShape.cpp b/src/Mod/Part/App/TopoShape.cpp index 67735d914c..20254c7270 100644 --- a/src/Mod/Part/App/TopoShape.cpp +++ b/src/Mod/Part/App/TopoShape.cpp @@ -1781,15 +1781,6 @@ TopoDS_Shape TopoShape::fuse(const std::vector& shapes, Standard_R return makeShell(resShape); } -TopoDS_Shape TopoShape::oldFuse(TopoDS_Shape shape) const -{ - if (this->_Shape.IsNull()) - Standard_Failure::Raise("Base shape is null"); - if (shape.IsNull()) - Standard_Failure::Raise("Tool shape is null"); - - throw Standard_Failure("BRepAlgo_Fuse is deprecated since OCCT 7.3"); -} TopoDS_Shape TopoShape::section(TopoDS_Shape shape, Standard_Boolean approximate) const { diff --git a/src/Mod/Part/App/TopoShape.h b/src/Mod/Part/App/TopoShape.h index f402c08635..92998cae3f 100644 --- a/src/Mod/Part/App/TopoShape.h +++ b/src/Mod/Part/App/TopoShape.h @@ -509,7 +509,6 @@ public: TopoDS_Shape common(const std::vector&, Standard_Real tolerance = -1.0) const; TopoDS_Shape fuse(TopoDS_Shape) const; TopoDS_Shape fuse(const std::vector&, Standard_Real tolerance = -1.0) const; - TopoDS_Shape oldFuse(TopoDS_Shape) const; TopoDS_Shape section(TopoDS_Shape, Standard_Boolean approximate = Standard_False) const; TopoDS_Shape section(const std::vector&, Standard_Real tolerance = -1.0, @@ -2455,20 +2454,7 @@ public: const BRepFillingParams ¶ms, const char *op=nullptr); - /** Make a solid using shells or CompSolid - * - * @param shapes: input shapes of either shells or CompSolid. - * @param op: optional string to be encoded into topo naming for indicating - * the operation - * - * @return The function produces a solid. The original content of this - * TopoShape is discarded and replaced with the new shape. The - * function returns the TopoShape itself as a self reference so - * that multiple operations can be carried out for the same shape - * in the same line of code. - */ - // TODO: This does not appear to be called, and the implementation seems impossible -// TopoShape &makeElementSolid(const std::vector &shapes, const char *op=nullptr); + /** Make a solid using shells or CompSolid * * @param shape: input shape of either a shell, a compound of shells, or a diff --git a/src/Mod/Part/App/TopoShape.pyi b/src/Mod/Part/App/TopoShape.pyi index 9a2f7c11b3..c44772ab8b 100644 --- a/src/Mod/Part/App/TopoShape.pyi +++ b/src/Mod/Part/App/TopoShape.pyi @@ -272,14 +272,6 @@ class TopoShape(ComplexGeoData): """ ... - @constmethod - def oldFuse(self, tool: TopoShape) -> TopoShape: - """ - Union of this and a given topo shape (old algorithm). - oldFuse(tool) -> Shape - """ - ... - @constmethod def common(self, tools: Tuple[TopoShape, ...], tolerance: float = 0.0) -> TopoShape: """ diff --git a/src/Mod/Part/App/TopoShapePyImp.cpp b/src/Mod/Part/App/TopoShapePyImp.cpp index 32ed00a274..5f567ae3da 100644 --- a/src/Mod/Part/App/TopoShapePyImp.cpp +++ b/src/Mod/Part/App/TopoShapePyImp.cpp @@ -699,28 +699,6 @@ PyObject* TopoShapePy::multiFuse(PyObject *args) const return makeShape(Part::OpCodes::Fuse, *getTopoShapePtr(), args); } -PyObject* TopoShapePy::oldFuse(PyObject *args) const -{ - PyObject *pcObj; - if (!PyArg_ParseTuple(args, "O!", &(TopoShapePy::Type), &pcObj)) - return nullptr; - - TopoDS_Shape shape = static_cast(pcObj)->getTopoShapePtr()->getShape(); - try { - // Let's call algorithm computing a fuse operation: - TopoDS_Shape fusShape = this->getTopoShapePtr()->oldFuse(shape); - return new TopoShapePy(new TopoShape(fusShape)); - } - catch (Standard_Failure& e) { - PyErr_SetString(PartExceptionOCCError, e.GetMessageString()); - return nullptr; - } - catch (const std::exception& e) { - PyErr_SetString(PartExceptionOCCError, e.what()); - return nullptr; - } -} - PyObject* TopoShapePy::common(PyObject *args) const { return makeShape(Part::OpCodes::Common, *getTopoShapePtr(), args);