]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix regression in Partition feature
authorazv <azv@opencascade.com>
Wed, 15 May 2019 05:17:42 +0000 (08:17 +0300)
committervsv <vsv@opencascade.com>
Mon, 3 Jun 2019 10:32:06 +0000 (13:32 +0300)
src/FeaturesPlugin/FeaturesPlugin_Partition.cpp

index 83a87047e5e809af4e0ee14d817b16ea5588a684..514fbdf83ce8e69109a0ce63d6023f266330d08f 100644 (file)
@@ -258,12 +258,15 @@ bool FeaturesPlugin_Partition::cutSubs(
 
   // cut subs
   bool isOk = true;
-  for (; anIt != theHierarchy.End() && isOk; ++anIt) {
+  for (++anIt; anIt != theHierarchy.End() && isOk; ++anIt) {
     ListOfShape aUsed, aNotUsed;
 
     GeomShapePtr aParent = theHierarchy.Parent(*anIt);
-    if (aParent && aParent->shapeType() == GeomAPI_Shape::COMPSOLID)
+    if (aParent && aParent->shapeType() <= GeomAPI_Shape::COMPSOLID) {
       theHierarchy.SplitCompound(aParent, aUsed, aNotUsed);
+      if (aParent->shapeType() == GeomAPI_Shape::COMPOUND)
+        aNotUsed.clear(); // do not cut unused subshapes of compound
+    }
     else
       aUsed.push_back(*anIt);