]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Preserve selection on setDisplay mode
authorvsv <vitaly.smetannikov@opencascade.com>
Sat, 27 Dec 2014 08:04:29 +0000 (11:04 +0300)
committervsv <vitaly.smetannikov@opencascade.com>
Sat, 27 Dec 2014 08:04:29 +0000 (11:04 +0300)
src/XGUI/XGUI_Displayer.cpp

index 8be3d0bcaac9124868328fe86f6d46c7c3efb81f..9d3ce8fb8febd4bc77796be0e1016f9b91449c5a 100644 (file)
@@ -614,12 +614,16 @@ void XGUI_Displayer::setDisplayMode(ObjectPtr theObject, DisplayMode theMode, bo
   Handle(AIS_InteractiveObject) aAISIO = aAISObj->impl<Handle(AIS_InteractiveObject)>();
   bool aCanBeShaded = ::canBeShaded(aAISIO);
   // In order to avoid extra closing/opening context
-  if (aCanBeShaded)
+  SelectMgr_IndexedMapOfOwner aSelectedOwners;
+  if (aCanBeShaded) {
+    myWorkshop->selector()->selection()->selectedOwners(aSelectedOwners);
     closeLocalContexts(false);
+  }
   aContext->SetDisplayMode(aAISIO, theMode, toUpdate);
   if (aCanBeShaded) {
     openLocalContext();
     activateObjects(myActiveSelectionModes);
+    myWorkshop->selector()->setSelectedOwners(aSelectedOwners);
   }
 }