+
+void PartSet_SketcherMgr::storeSelection()
+{
+ //qDebug(" storeSelection");
+ ModuleBase_IWorkshop* aWorkshop = myModule->workshop();
+ // 1. it is necessary to save current selection in order to restore it after the features moving
+ //FeatureToSelectionMap aCurrentSelection;
+ myCurrentSelection.clear();
+ getCurrentSelection(myFeature2AttributeMap, myCurrentSketch, aWorkshop, myCurrentSelection);
+
+ XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(aWorkshop);
+ XGUI_Displayer* aDisplayer = aConnector->workshop()->displayer();
+ // 3. the flag to disable the update viewer should be set in order to avoid blinking in the
+ // viewer happens by deselect/select the modified objects. The flag should be restored after
+ // the selection processing. The update viewer should be also called.
+ myPreviousUpdateViewerEnabled = aDisplayer->enableUpdateViewer(false);
+}
+
+void PartSet_SketcherMgr::restoreSelection()
+{
+ //qDebug("restoreSelection");
+ ModuleBase_IWorkshop* aWorkshop = myModule->workshop();
+ XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(aWorkshop);
+ // 5. it is necessary to save current selection in order to restore it after the features moving
+ FeatureToSelectionMap::const_iterator aSIt = myCurrentSelection.begin(),
+ aSLast = myCurrentSelection.end();
+ SelectMgr_IndexedMapOfOwner anOwnersToSelect;
+ for (; aSIt != aSLast; aSIt++) {
+ anOwnersToSelect.Clear();
+ getSelectionOwners(aSIt->first, myCurrentSketch, aWorkshop, myCurrentSelection,
+ anOwnersToSelect);
+ aConnector->workshop()->selector()->setSelectedOwners(anOwnersToSelect, false);
+ }
+ XGUI_Displayer* aDisplayer = aConnector->workshop()->displayer();
+ // 3. the flag to disable the update viewer should be set in order to avoid blinking in the
+ // viewer happens by deselect/select the modified objects. The flag should be restored after
+ // the selection processing. The update viewer should be also called.
+ aDisplayer->enableUpdateViewer(myPreviousUpdateViewerEnabled);
+ //if (myPreviousUpdateViewerEnabled)
+ aDisplayer->updateViewer();
+}