]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Bug #543: performance is bad when edit sketch
authornds <natalia.donis@opencascade.com>
Wed, 3 Jun 2015 13:59:50 +0000 (16:59 +0300)
committernds <natalia.donis@opencascade.com>
Wed, 3 Jun 2015 13:59:50 +0000 (16:59 +0300)
src/XGUI/XGUI_Displayer.cpp

index 6c0bec4b19c87ad74e150a71d2ec9bcddbca2f1b..a3d8b3f9fd86f34a40a9640bf73479077397a2ac 100644 (file)
@@ -37,6 +37,8 @@
 #include <SelectMgr_ListOfFilter.hxx>
 #include <SelectMgr_ListIteratorOfListOfFilter.hxx>
 
+#include <StdSelect_ViewerSelector3d.hxx>
+
 #include <TColStd_MapOfTransient.hxx>
 #include <TColStd_MapIteratorOfMapOfTransient.hxx>
 
@@ -353,6 +355,14 @@ void XGUI_Displayer::activateObjects(const QIntList& theModes, const QObjectPtrL
   if (!aContext->HasOpenedContext()) 
     return;
 
+  // we need to block the sort of the viewer selector during deactivate/activate because
+  // it takes a lot of time if there are a many objects are processed. It can be performed
+  // manualy after the activation is peformed
+  Handle(StdSelect_ViewerSelector3d) aSelector = aContext->LocalContext()->MainSelector();
+  bool isUpdateSortPossible = !aSelector.IsNull() && aSelector->IsUpdateSortPossible();
+  if (!aSelector.IsNull())
+    aSelector->SetUpdateSortPossible(false);
+
   //aContext->UseDisplayedObjects();
   //myUseExternalObjects = true;
 
@@ -372,6 +382,11 @@ void XGUI_Displayer::activateObjects(const QIntList& theModes, const QObjectPtrL
     anAISIO = aLIt.Value();
     activate(anAISIO, myActiveSelectionModes);
   }
+  // restore the sorting flag and perform the sort of selection
+  if (!aSelector.IsNull()) {
+    aSelector->SetUpdateSortPossible(isUpdateSortPossible);
+    aSelector->UpdateSort();
+  }
 }