Salome HOME
Angle presentation from NewGEOM_2.0.0. It is moved here to prepare a patch for OCCT...
[modules/shaper.git] / src / XGUI / XGUI_SelectionMgr.cpp
index 6136e93f80f3550866ef9e587f4f19c4713e7715..ad92b420b0568a91ebf1e53bfbf049e71a6a6231 100644 (file)
@@ -107,11 +107,10 @@ void XGUI_SelectionMgr::onViewerSelection()
   QObjectPtrList aFeatures;
   Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext();
   if (!aContext.IsNull()) {
-    for (aContext->InitSelected(); aContext->MoreSelected(); aContext->NextSelected()) {
-      Handle(AIS_InteractiveObject) anIO = aContext->SelectedInteractive();
-      ObjectPtr aResult = myWorkshop->displayer()->getObject(anIO);
-      if (aResult)
-        aFeatures.append(aResult);
+    QList<ModuleBase_ViewerPrs> aPresentations = selection()->getSelected(ModuleBase_ISelection::Viewer);
+    foreach(ModuleBase_ViewerPrs aPrs, aPresentations) {
+      if (aPrs.object().get())
+        aFeatures.append(aPrs.object());
     }
   }
   bool aBlocked = myWorkshop->objectBrowser()->blockSignals(true);
@@ -121,6 +120,17 @@ void XGUI_SelectionMgr::onViewerSelection()
   emit selectionChanged();
 }
 
+//**************************************************************
+void XGUI_SelectionMgr::updateSelectionBy(const ModuleBase_ISelection::SelectionPlace& thePlace)
+{
+  QList<ModuleBase_ViewerPrs> aSelectedPrs =
+               myWorkshop->selector()->selection()->getSelected(thePlace);
+  if (thePlace == ModuleBase_ISelection::Browser) {
+    XGUI_Displayer* aDisplayer = myWorkshop->displayer();
+    aDisplayer->setSelected(aSelectedPrs);
+  }
+
+}
 //**************************************************************
 void XGUI_SelectionMgr::clearSelection()
 {