Salome HOME
0014047: EDF PAL 334 : Problem to select merged face with Create group window
[modules/geom.git] / src / DisplayGUI / DisplayGUI.cxx
index 7ce28c1842e6687a6b4a6a5bdd23c9645fb35c50..e35c95e41b434e9067acf8bf24e31139ee183b46 100644 (file)
@@ -1,44 +1,41 @@
-//  GEOM GEOMGUI : GUI for Geometry component
+// GEOM GEOMGUI : GUI for Geometry component
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+// Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
 // 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
+// This library is free software; you can redistribute it and/or 
+// modify it under the terms of the GNU Lesser General Public 
+// License as published by the Free Software Foundation; either 
+// version 2.1 of the License. 
 // 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
+// This library is distributed in the hope that it will be useful, 
+// but WITHOUT ANY WARRANTY; without even the implied warranty of 
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+// Lesser General Public License for more details. 
 // 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
+// You should have received a copy of the GNU Lesser General Public 
+// License along with this library; if not, write to the Free Software 
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
 // 
-//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+// File   : DisplayGUI.cxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
-//
-//  File   : DisplayGUI.cxx
-//  Author : Vadim SANDLER
-//  Module : GEOM
-//  $Header$
 
 #include "DisplayGUI.h"
-#include "GeometryGUI.h"
-#include "GEOM_Displayer.h"
+#include <GeometryGUI.h>
+#include <GEOM_Displayer.h>
+#include <GEOM_AISShape.hxx>
 
 #include <SUIT_Desktop.h>
-#include <SUIT_Session.h>
 #include <SUIT_ViewWindow.h>
 #include <SUIT_OverrideCursor.h>
 
 #include <OCCViewer_ViewManager.h>
 #include <OCCViewer_ViewModel.h>
-#include <OCCViewer_ViewWindow.h>
 
+#include <SALOME_ListIO.hxx>
 #include <SALOME_ListIteratorOfListIO.hxx>
 
 #include <SVTK_ViewWindow.h>
@@ -56,8 +53,7 @@
 
 #include <AIS_ListIteratorOfListOfInteractive.hxx>
 
-#include <qmenubar.h>
-
+#include <QAction>
 
 //=======================================================================
 // function : DisplayGUI::DisplayGUI()
@@ -94,7 +90,7 @@ bool DisplayGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
     {
       InvertDisplayMode();
       int newMode = GetDisplayMode();
-      getGeometryGUI()->action( 211 )->setMenuText
+      getGeometryGUI()->action( 211 )->setText
         ( newMode == 1 ? tr( "GEOM_MEN_WIREFRAME" ) : tr("GEOM_MEN_SHADING") );
       getGeometryGUI()->menuMgr()->update();
       break;
@@ -327,7 +323,13 @@ void DisplayGUI::Erase()
       listIO.Append( anIObject );
     }
   }
-  GEOM_Displayer(anActiveStudy).Erase( listIO, true );
+
+  SUIT_ViewWindow* viewWindow = app->desktop()->activeWindow();
+  bool aIsForced = true;
+  if(viewWindow->getViewManager()->getType() == SVTK_Viewer::Type())
+    aIsForced = false;
+
+  GEOM_Displayer(anActiveStudy).Erase( listIO, aIsForced);
   getGeometryGUI()->getApp()->selectionMgr()->clearSelected();
 }
 
@@ -470,7 +472,9 @@ void DisplayGUI::ChangeDisplayMode( const int mode, SUIT_ViewWindow* viewWindow
 //=====================================================================================
 extern "C"
 {
- GEOM_DISPLAYGUI_EXPORT
+#ifdef WIN32
+  __declspec( dllexport )
+#endif
   GEOMGUI* GetLibGUI( GeometryGUI* parent )
   {
     return new DisplayGUI( parent );