]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Correction to use only new shapes for the naming name search
authormpv <mpv@opencascade.com>
Mon, 11 Dec 2017 13:43:11 +0000 (16:43 +0300)
committermpv <mpv@opencascade.com>
Mon, 11 Dec 2017 13:43:11 +0000 (16:43 +0300)
src/Model/Model_SelectionNaming.cpp

index 50b64918e1b2b6b5d29e47ae16001c536744d6a2..7d4c36cc0f5c78528c88944066bf402977eeddb5 100644 (file)
@@ -76,7 +76,14 @@ static Handle(TNaming_NamedShape) shapeToNS(const TDF_Label theLabAccess,
     TDF_Label aLabel = aNSIter.Label();
     Handle(TNaming_NamedShape) aNS;
     if (aLabel.FindAttribute(TNaming_NamedShape::GetID(), aNS)) {
-      if (aNS->Evolution() != TNaming_SELECTED) {
+      if (aNS->Evolution() != TNaming_SELECTED && aNS->Evolution() != TNaming_DELETE) {
+        // check this is new shape in this named shape
+        bool aIsNew = false;
+        for(TNaming_Iterator aNSIter(aNS); aNSIter.More(); aNSIter.Next())
+          if (!aNSIter.NewShape().IsNull() && aNSIter.NewShape().IsSame(theShape))
+            aIsNew = true;
+        if (!aIsNew)
+          continue;
         // check this is the context-shape
         while(aLabel.Depth() > aContextLabDepth)
           aLabel = aLabel.Father();