]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Optimization of viewer updates
authorvsv <vsv@opencascade.com>
Mon, 30 Sep 2019 15:33:00 +0000 (18:33 +0300)
committervsv <vsv@opencascade.com>
Mon, 30 Sep 2019 15:33:00 +0000 (18:33 +0300)
src/PartSet/PartSet_Module.cpp
src/XGUI/XGUI_Displayer.cpp
src/XGUI/XGUI_Workshop.cpp

index 71132cf49c48caae867e894bbc408779a10a4566..0ad3ce8f22bf20accb23f184853d37930ddd21ac 100644 (file)
@@ -441,8 +441,8 @@ void PartSet_Module::updatePresentationsOnStart(ModuleBase_Operation* theOperati
   ModuleBase_OperationFeature* aFOperation =
     dynamic_cast<ModuleBase_OperationFeature*>(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<ModuleBase_OperationFeature*>(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<Events_Message>& 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());
index 3dd321c99828d67095517903c4aa754ca8be586e..ccad93e0e2325f4d0a776c4c8a9044ebb5b3af85 100644 (file)
@@ -1055,8 +1055,6 @@ void XGUI_Displayer::displayTrihedron(bool theToDisplay) const
     if (getCallBack()) getCallBack()->Remove(aTrihedron);
     #endif
   }
-
-  updateViewer();
 }
 
 //**************************************************************
index 8755940c10b3dfabc71a875f9d741b194350d70b..affabbd4b90f656ae8cb46d65311f387ae73b843 100644 (file)
@@ -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<Events_InfoMessage>)),
@@ -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();
+  }
 }
 
 //******************************************************