From: nds Date: Wed, 3 Jun 2015 13:59:50 +0000 (+0300) Subject: Bug #543: performance is bad when edit sketch X-Git-Tag: V_1.2.1~8 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5d1ad29ab99aa901364016d1f54e06c9f874d886;p=modules%2Fshaper.git Bug #543: performance is bad when edit sketch --- diff --git a/src/XGUI/XGUI_Displayer.cpp b/src/XGUI/XGUI_Displayer.cpp index 6c0bec4b1..a3d8b3f9f 100644 --- a/src/XGUI/XGUI_Displayer.cpp +++ b/src/XGUI/XGUI_Displayer.cpp @@ -37,6 +37,8 @@ #include #include +#include + #include #include @@ -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(); + } }