Salome HOME
refs #30 - Sketch base GUI: create, draw lines
[modules/shaper.git] / src / XGUI / XGUI_SelectionMgr.cpp
index d117c1dea114bf86de617a1aee1bc4dfab7d0e30..f949c782a5a4b4a7ca17f5440ef2a7513a1cc441 100644 (file)
@@ -4,7 +4,7 @@
 #include "XGUI_ObjectsBrowser.h"
 #include "XGUI_Viewer.h"
 #include "XGUI_SalomeConnector.h"
-#include "XGUI_SalomeViewer.h"
+#include "XGUI_ViewerProxy.h"
 
 #include <ModelAPI_Feature.h>
 #include <ModelAPI_PluginManager.h>
@@ -63,36 +63,26 @@ QFeatureList XGUI_SelectionMgr::selectedFeatures() const
 //**************************************************************
 QModelIndexList XGUI_SelectionMgr::selectedIndexes() const 
 { 
-  return myWorkshop->objectBrowser()->selectionModel()->selectedIndexes();
+  return myWorkshop->objectBrowser()->selectedIndexes();
 }
 
 //**************************************************************
 void XGUI_SelectionMgr::selectedAISObjects(AIS_ListOfInteractive& theList) const
 {
-  if (myWorkshop->isSalomeMode()) {
-    Handle(AIS_InteractiveContext) aContext = myWorkshop->salomeViewer()->AISContext();
-    theList.Clear();
-    for (aContext->InitSelected(); aContext->MoreSelected(); aContext->NextSelected())
-      theList.Append(aContext->SelectedInteractive());
-  } else {
-    XGUI_Viewer* aViewer = myWorkshop->mainWindow()->viewer();
-    aViewer->getSelectedObjects(theList);
-  }
+  Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext();
+  theList.Clear();
+  for (aContext->InitSelected(); aContext->MoreSelected(); aContext->NextSelected())
+    theList.Append(aContext->SelectedInteractive());
 }
 
 //**************************************************************
 void XGUI_SelectionMgr::selectedShapes(NCollection_List<TopoDS_Shape>& theList) const
 {
-  if (myWorkshop->isSalomeMode()) {
-    theList.Clear();
-    Handle(AIS_InteractiveContext) aContext = myWorkshop->salomeViewer()->AISContext();
-    for (aContext->InitSelected(); aContext->MoreSelected(); aContext->NextSelected()) {
-      TopoDS_Shape aShape = aContext->SelectedShape();
-      if (!aShape.IsNull())
-        theList.Append(aShape);
-    }
-  } else {
-    XGUI_Viewer* aViewer = myWorkshop->mainWindow()->viewer();
-    aViewer->getSelectedShapes(theList);
+  theList.Clear();
+  Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext();
+  for (aContext->InitSelected(); aContext->MoreSelected(); aContext->NextSelected()) {
+    TopoDS_Shape aShape = aContext->SelectedShape();
+    if (!aShape.IsNull())
+      theList.Append(aShape);
   }
 }