Salome HOME
PAL10209 - after operation display/erase GEOM objects must be selected in viewer
[modules/geom.git] / src / DisplayGUI / DisplayGUI.cxx
index 6f337597d9fb09b029197ae3df0c1339d16c9863..3be30b5e13dc70f8275597417771ad66c7cbea6d 100644 (file)
 #include <SVTK_Prs.h>
 #include <SOCC_Prs.h>
 
+#include <QtxActionMenuMgr.h>
+
 #include <SalomeApp_Application.h>
-#include <SalomeApp_SelectionMgr.h>
+#include <LightApp_SelectionMgr.h>
 #include <SalomeApp_Study.h>
 
 #include <AIS_ListIteratorOfListOfInteractive.hxx>
@@ -97,6 +99,9 @@ DisplayGUI::~DisplayGUI()
 bool DisplayGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
 {
   DisplayGUI* myDisplayGUI = GetDisplayGUI( getGeometryGUI() );
+  LightApp_SelectionMgr *Sel = getGeometryGUI()->getApp()->selectionMgr();
+  SALOME_ListIO selected;
+  Sel->selectedObjects( selected );
 
   switch (theCommandID) {
   case 211: // MENU VIEW - WIREFRAME/SHADING
@@ -153,6 +158,7 @@ bool DisplayGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
       break;
     }
   }
+  Sel->setSelectedObjects( selected );
   return true;
 }
 
@@ -234,7 +240,7 @@ void DisplayGUI::Display()
   if ( !anActiveStudy ) return;
   
   //get SalomeApp selection manager
-  SalomeApp_SelectionMgr* aSelMgr = app->selectionMgr();
+  LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
   if ( !aSelMgr ) return;
   
   SALOME_ListIO aList;
@@ -290,7 +296,7 @@ void DisplayGUI::Erase()
   if ( !anActiveStudy ) return;
   
   //get SalomeApp selection manager
-  SalomeApp_SelectionMgr* aSelMgr = app->selectionMgr();
+  LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
   if ( !aSelMgr ) return;
   
   SALOME_ListIO aList;
@@ -417,7 +423,7 @@ void DisplayGUI::ChangeDisplayMode( const int mode, SUIT_ViewWindow* viewWindow
   SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
   if ( !app ) return;
 
-  SalomeApp_SelectionMgr* aSelMgr = app->selectionMgr();
+  LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
   if ( !aSelMgr ) return;
   
   SUIT_OverrideCursor();