]> OCCT Git - occt-copy.git/commitdiff
0029662: Allow replacement of Compounds via BRepTools_ReShape CR29662-720
authoranv <anv@opencascade.com>
Thu, 29 Mar 2018 09:36:09 +0000 (12:36 +0300)
committerbugmaster <bugmaster@opencascade.com>
Tue, 3 Apr 2018 13:08:43 +0000 (16:08 +0300)
Adding possibility for ReShape to look for Compounds for replacement among sub-shapes and not only the top shape.

src/BRepTools/BRepTools_ReShape.cxx

index fbfa18a8b871d202cd42288d6def2f437a892ed0..a89f8bbf0083ed584a1dfface3611bc6ba35a93f 100644 (file)
@@ -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