From 5d1ad29ab99aa901364016d1f54e06c9f874d886 Mon Sep 17 00:00:00 2001 From: nds Date: Wed, 3 Jun 2015 16:59:50 +0300 Subject: [PATCH] Bug #543: performance is bad when edit sketch --- src/XGUI/XGUI_Displayer.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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(); + } } -- 2.39.2