Salome HOME
Debug the sketcher update and projections behavior basin on Test1816
authormpv <mpv@opencascade.com>
Mon, 22 Oct 2018 11:39:09 +0000 (14:39 +0300)
committermpv <mpv@opencascade.com>
Mon, 19 Nov 2018 08:45:52 +0000 (11:45 +0300)
src/Model/Model_Document.cpp
src/Selector/Selector_Selector.cpp

index d71b770c78c9c06fc6b516595fafb20c5b500245..6fc16f5cfbf48c6fa435d55f73fa067cc434b2bd 100755 (executable)
@@ -1493,8 +1493,13 @@ bool Model_Document::isLaterByDep(FeaturePtr theThis, FeaturePtr theOther) {
         if (!aRefFeat.get()) { // take feature of the result
           aRefFeat = feature(std::dynamic_pointer_cast<ModelAPI_Result>(aRefObj));
         }
-        if (aRefFeat.get() && aRefFeat == theThis) {
-          return false; // other references to this, so other later than this
+        if (aRefFeat.get()) {
+          if (aRefFeat == theThis)
+            return false; // other references to this, so other later than this
+          if (std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(aRefFeat)) {
+            if (!isLaterByDep(theThis, aRefFeat)) // nested composites: recursion
+              return false;
+          }
         }
       }
     }
index 8036f9d1d7eb5e09068b12d4ef9c5ebb146b3fed..54c8aca55a28d04a582d2d0837c04b20ff12fab6 100644 (file)
@@ -251,7 +251,22 @@ bool Selector_Selector::select(const TopoDS_Shape theContext, const TopoDS_Shape
     return false;
   // check the value shape can be named as it is, or it is needed to construct it from the
   // higher level shapes (like a box vertex by faces that form this vertex)
-  if (!TNaming_Tool::HasLabel(myLab, theValue)) {
+  bool aIsFound = TNaming_Tool::HasLabel(myLab, theValue);
+  if (aIsFound) { // additional check for selection and delete evolution only: also could not be used
+    aIsFound = false;
+    for(TNaming_SameShapeIterator aShapes(theValue, myLab); aShapes.More(); aShapes.Next())
+    {
+      Handle(TNaming_NamedShape) aNS;
+      if (aShapes.Label().FindAttribute(TNaming_NamedShape::GetID(), aNS)) {
+        if (aNS->Evolution() == TNaming_MODIFY || aNS->Evolution() == TNaming_GENERATED ||
+            aNS->Evolution() == TNaming_PRIMITIVE) {
+          aIsFound = true;
+          break;
+        }
+      }
+    }
+  }
+  if (!aIsFound) {
     TopAbs_ShapeEnum aSelectionType = theValue.ShapeType();
     myShapeType = aSelectionType;
     if (aSelectionType == TopAbs_COMPOUND || aSelectionType == TopAbs_COMPSOLID ||