From c43729a4d2a2a91fe5f7582cc0a9efeefbd8bc1a Mon Sep 17 00:00:00 2001 From: anv Date: Thu, 29 Mar 2018 12:36:09 +0300 Subject: [PATCH] 0029662: Allow replacement of Compounds via BRepTools_ReShape Adding possibility for ReShape to look for Compounds for replacement among sub-shapes and not only the top shape. --- src/BRepTools/BRepTools_ReShape.cxx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/BRepTools/BRepTools_ReShape.cxx b/src/BRepTools/BRepTools_ReShape.cxx index fbfa18a8b8..a89f8bbf00 100644 --- a/src/BRepTools/BRepTools_ReShape.cxx +++ b/src/BRepTools/BRepTools_ReShape.cxx @@ -363,8 +363,19 @@ TopoDS_Shape BRepTools_ReShape::Apply (const TopoDS_Shape& shape, return res; } + // For cases when one Compound should be + // replaced with another, subshapes of + // an initial Compound should be checked. + Standard_Boolean isCheckSubShapes = Standard_False; + if (until == TopAbs_COMPOUND) + { + TopExp_Explorer anExp(shape, TopAbs_COMPOUND); + if (anExp.More()) + isCheckSubShapes = Standard_True; + } + TopAbs_ShapeEnum st = shape.ShapeType(); //, subt; - if ( st >= until ) return newsh; // critere d arret + if (st >= until && !isCheckSubShapes) return newsh; // critere d arret if(st == TopAbs_VERTEX || st == TopAbs_SHAPE) return shape; // define allowed types of components -- 2.39.5