From d87cf0f183f8e92d99a060fe5ef2a06f607a4e11 Mon Sep 17 00:00:00 2001 From: nds Date: Thu, 4 Jun 2015 08:02:40 +0300 Subject: [PATCH] Do not update OCCT viewer until the current feature in the tree is set. --- src/PartSet/PartSet_PartDataModel.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/PartSet/PartSet_PartDataModel.cpp b/src/PartSet/PartSet_PartDataModel.cpp index d124d80fc..9265e983e 100644 --- a/src/PartSet/PartSet_PartDataModel.cpp +++ b/src/PartSet/PartSet_PartDataModel.cpp @@ -17,6 +17,9 @@ #include #include #include +#include + +#include #include #include @@ -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 aMsg = std::shared_ptr( + 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( + new Events_Message(Events_Loop::eventByName(EVENT_UPDATE_VIEWER_UNBLOCKED))); + + Events_Loop::loop()->send(aMsg); } QModelIndex PartSet_PartDataModel::lastHistoryItem() const -- 2.39.2