From: vsv Date: Mon, 30 Sep 2019 15:33:00 +0000 (+0300) Subject: Optimization of viewer updates X-Git-Tag: V9_4_0a2~4^2~50 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=17bfa54636745c42708c3b992a3b683a077874b4;p=modules%2Fshaper.git Optimization of viewer updates --- diff --git a/src/PartSet/PartSet_Module.cpp b/src/PartSet/PartSet_Module.cpp index 71132cf49..0ad3ce8f2 100644 --- a/src/PartSet/PartSet_Module.cpp +++ b/src/PartSet/PartSet_Module.cpp @@ -441,8 +441,8 @@ void PartSet_Module::updatePresentationsOnStart(ModuleBase_Operation* theOperati ModuleBase_OperationFeature* aFOperation = dynamic_cast(theOperation); if (aFOperation) { - myCustomPrs->activate(aFOperation->feature(), ModuleBase_IModule::CustomizeArguments, true); - myCustomPrs->activate(aFOperation->feature(), ModuleBase_IModule::CustomizeResults, true); + myCustomPrs->activate(aFOperation->feature(), ModuleBase_IModule::CustomizeArguments, false); + myCustomPrs->activate(aFOperation->feature(), ModuleBase_IModule::CustomizeResults, false); } } @@ -454,8 +454,8 @@ void PartSet_Module::operationResumed(ModuleBase_Operation* theOperation) ModuleBase_OperationFeature* aFOperation = dynamic_cast(theOperation); if (aFOperation) { - myCustomPrs->activate(aFOperation->feature(), ModuleBase_IModule::CustomizeArguments, true); - myCustomPrs->activate(aFOperation->feature(), ModuleBase_IModule::CustomizeResults, true); + myCustomPrs->activate(aFOperation->feature(), ModuleBase_IModule::CustomizeArguments, false); + myCustomPrs->activate(aFOperation->feature(), ModuleBase_IModule::CustomizeResults, false); } } @@ -1446,13 +1446,17 @@ void PartSet_Module::processEvent(const std::shared_ptr& theMess XGUI_Displayer* aDisplayer = aWorkshop->displayer(); QObjectPtrList aObjects = aDisplayer->displayedObjects(); bool aHidden; + bool aUpdateViewer = false; foreach(ObjectPtr aObj, aObjects) { aHidden = !aObj->data() || !aObj->data()->isValid() || aObj->isDisabled() || (!aObj->isDisplayed()); - if (!aHidden) + if (!aHidden) { aDisplayer->redisplay(aObj, false); + aUpdateViewer = true; + } } - aDisplayer->updateViewer(); + if (aUpdateViewer) + aDisplayer->updateViewer(); // Update tree items if they are expanded if (needUpdate) { aTreeView->viewport()->update(aTreeView->viewport()->rect()); diff --git a/src/XGUI/XGUI_Displayer.cpp b/src/XGUI/XGUI_Displayer.cpp index 3dd321c99..ccad93e0e 100644 --- a/src/XGUI/XGUI_Displayer.cpp +++ b/src/XGUI/XGUI_Displayer.cpp @@ -1055,8 +1055,6 @@ void XGUI_Displayer::displayTrihedron(bool theToDisplay) const if (getCallBack()) getCallBack()->Remove(aTrihedron); #endif } - - updateViewer(); } //************************************************************** diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index 8755940c1..affabbd4b 100644 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -268,7 +268,7 @@ XGUI_Workshop::XGUI_Workshop(XGUI_SalomeConnector* theConnector) #ifndef HAVE_SALOME connect(myMainWindow, SIGNAL(exitKeySequence()), SLOT(onExit())); - onTrihedronVisibilityChanged(true); + myDisplayer->displayTrihedron(true); #endif connect(myEventsListener, SIGNAL(errorOccurred(std::shared_ptr)), @@ -1070,8 +1070,10 @@ void XGUI_Workshop::onPreferences() void XGUI_Workshop::onTrihedronVisibilityChanged(bool theState) { XGUI_Displayer* aDisplayer = displayer(); - if (aDisplayer) + if (aDisplayer) { aDisplayer->displayTrihedron(theState); + aDisplayer->updateViewer(); + } } //******************************************************