From: anv Date: Thu, 29 Mar 2018 09:36:09 +0000 (+0300) Subject: 0029662: Allow replacement of Compounds via BRepTools_ReShape X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2FCR29662-720;p=occt-copy.git 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. --- 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