]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Do not update OCCT viewer until the current feature in the tree is set.
authornds <natalia.donis@opencascade.com>
Thu, 4 Jun 2015 05:02:40 +0000 (08:02 +0300)
committernds <natalia.donis@opencascade.com>
Thu, 4 Jun 2015 05:03:05 +0000 (08:03 +0300)
src/PartSet/PartSet_PartDataModel.cpp

index d124d80fc5272b0b2955a1074a38da7999387e5f..9265e983e874ba641d82964dc7558b253bbf0d04 100644 (file)
@@ -17,6 +17,9 @@
 #include <ModelAPI_ResultBody.h>
 #include <ModelAPI_ResultGroup.h>
 #include <ModelAPI_AttributeDouble.h>
+#include <ModelAPI_Events.h>
+
+#include <Events_Loop.h>
 
 #include <QIcon>
 #include <QBrush>
@@ -574,6 +577,12 @@ int PartSet_PartDataModel::lastHistoryRow() const
 
 void PartSet_PartDataModel::setLastHistoryItem(const QModelIndex& theIndex)
 {
+  // the viewer update should be blocked in order to avoid the features blinking before they are
+  // hidden
+  std::shared_ptr<Events_Message> aMsg = std::shared_ptr<Events_Message>(
+      new Events_Message(Events_Loop::eventByName(EVENT_UPDATE_VIEWER_BLOCKED)));
+  Events_Loop::loop()->send(aMsg);
+
   SessionPtr aMgr = ModelAPI_Session::get();
   DocumentPtr aDoc = partDocument();
   std::string aOpName = tr("History change").toStdString();
@@ -587,6 +596,12 @@ void PartSet_PartDataModel::setLastHistoryItem(const QModelIndex& theIndex)
     aDoc->setCurrentFeature(FeaturePtr(), true);
     aMgr->finishOperation();
   }
+  // the viewer update should be unblocked in order to avoid the features blinking before they are
+  // hidden
+  aMsg = std::shared_ptr<Events_Message>(
+                new Events_Message(Events_Loop::eventByName(EVENT_UPDATE_VIEWER_UNBLOCKED)));
+
+  Events_Loop::loop()->send(aMsg);
 }
 
 QModelIndex PartSet_PartDataModel::lastHistoryItem() const