Salome HOME
Redisplay sketch features only for the active sketch (on appearance of the "Fully...
authorazv <azv@opencascade.com>
Wed, 31 Oct 2018 06:28:08 +0000 (09:28 +0300)
committermpv <mpv@opencascade.com>
Mon, 19 Nov 2018 08:45:52 +0000 (11:45 +0300)
src/PartSet/PartSet_OverconstraintListener.cpp

index f532eab0472c5739e7dfb7e01a21017c2de37749..a7480b35a8a1078888d5397ea677861cf6f6a477 100755 (executable)
@@ -161,6 +161,18 @@ void PartSet_OverconstraintListener::processEvent(
       std::set<ObjectPtr> aModifiedObjects;
       PartSet_Module* aModule = dynamic_cast<PartSet_Module*>(myWorkshop->module());
       CompositeFeaturePtr aSketch = aModule->sketchMgr()->activeSketch();
+
+      // check the sketch in the message and the active sketch are the same
+      std::shared_ptr<ModelAPI_SolverFailedMessage> anErrorMsg =
+          std::dynamic_pointer_cast<ModelAPI_SolverFailedMessage>(theMessage);
+      if (aSketch && anErrorMsg && !anErrorMsg->objects().empty()) {
+        ObjectPtr anObject = *anErrorMsg->objects().begin();
+        CompositeFeaturePtr aSketchFromMsg =
+            std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(anObject);
+        if (!aSketchFromMsg || aSketchFromMsg != aSketch)
+          aSketch = CompositeFeaturePtr();
+      }
+
       if (aSketch.get()) {
         int aNumberOfSubs = aSketch->numberOfSubs();
         for (int i = 0; i < aNumberOfSubs; i++) {