Salome HOME
Merge from V6_main_20120808 08Aug12
[modules/smesh.git] / src / SMESHGUI / SMESHGUI.h
index 230bc3162a7f79c4aa712c76258c64cc71d7dc68..6f5237ce3adbdec3627dfbeff7e797b754037cbc 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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
 //
+
 // SMESH SMESHGUI : GUI for SMESH component
 // File   : SMESHGUI.h
 // Author : Nicolas REJNERI, Open CASCADE S.A.S.
 
 // SALOME GUI includes
 #include <SalomeApp_Module.h>
+#include <VTKViewer_MarkerDef.h>
 #include <SALOME_InteractiveObject.hxx>
 
 // IDL includes
 #include <SALOMEconfig.h>
 #include CORBA_SERVER_HEADER(SMESH_Gen)
 
+// VTK includes
+#include <vtkSmartPointer.h>
+#include <vtkType.h>
+
+class vtkActor;
+class vtkCallbackCommand;
+class vtkObject;
+
 class QDialog;
 
 class SUIT_Desktop;
@@ -50,8 +60,24 @@ class SalomeApp_Study;
 class LightApp_Selection;
 class LightApp_SelectionMgr;
 
+class SMESH_Actor;
 class SMESHGUI_FilterLibraryDlg;
 
+typedef std::map<int, VTK::MarkerMap> SMESHGUI_StudyId2MarkerMap;
+
+namespace SMESH
+{
+  class OrientedPlane;
+  struct ClippingPlaneInfo
+  {
+    OrientedPlane*       Plane;
+    std::list<vtkActor*> ActorList;
+  };
+}
+
+typedef std::list<SMESH::ClippingPlaneInfo>                         SMESHGUI_ClippingPlaneInfoList;
+typedef std::map<SUIT_ViewManager*, SMESHGUI_ClippingPlaneInfoList> SMESHGUI_ClippingPlaneInfoMap;
+
 //=================================================================================
 // class    : SMESHGUI
 // purpose  :
@@ -70,11 +96,12 @@ public :
   static SUIT_ResourceMgr*        resourceMgr();
   static SUIT_Desktop*            desktop();
   static SalomeApp_Study*         activeStudy();
-  static char*                    JoinObjectParameters(const QStringList& theParametersList);
   
   bool                            isActiveStudyLocked();
 
-  static bool                     automaticUpdate();
+  static bool                     automaticUpdate(unsigned int requestedSize = 0, bool* limitExceeded = 0);
+
+  static void                     Modified( bool = true );
 
   virtual LightApp_Displayer*     displayer();
   virtual QString                 engineIOR() const;
@@ -104,11 +131,14 @@ public :
   void                            EmitSignalDeactivateDialog();
   void                            EmitSignalStudyFrameChanged();
   void                            EmitSignalCloseAllDialogs();
+  void                            EmitSignalVisibilityChanged();
 
   virtual void                    contextMenuPopup( const QString&, QMenu*, QString& );
   virtual void                    createPreferences();
   virtual void                    preferencesChanged( const QString&, const QString& );
 
+  virtual void                    message( const QString& );
+
   virtual void                    update( const int );
 
   static SALOMEDS::Color          getUniqueColor( const QList<SALOMEDS::Color>& );
@@ -116,29 +146,41 @@ public :
   virtual void                    storeVisualParameters  (int savePoint);
   virtual void                    restoreVisualParameters(int savePoint);
 
+  virtual void                    addActorAsObserver( SMESH_Actor* theActor );
+  
+  virtual bool                    renameAllowed( const QString& ) const;
+  virtual bool                    renameObject( const QString&, const QString& );
+
+
+  SMESHGUI_ClippingPlaneInfoMap&  getClippingPlaneInfoMap() { return myClippingPlaneInfoMap; }
+
 public slots:
   virtual bool                    deactivateModule( SUIT_Study* );
   virtual bool                    activateModule( SUIT_Study* );
   virtual void                    studyClosed( SUIT_Study* );
+  void                            onViewClosed( SUIT_ViewWindow* );
 
 private slots:
   void                            OnGUIEvent();
   void                            onViewManagerActivated( SUIT_ViewManager* );
+  void                            onViewManagerRemoved( SUIT_ViewManager* );
   void                            onOperationCommited( SUIT_Operation* );
   void                            onOperationAborted( SUIT_Operation* );
-
+  void                            onHypothesisEdit( int result );
 
 signals:
   void                            SignalDeactivateActiveDialog();
   void                            SignalStudyFrameChanged();
   void                            SignalCloseAllDialogs();
+  void                            SignalVisibilityChanged();
 
 protected:
   void                            createSMESHAction( const int,
                                                      const QString&,
                                                      const QString& = QString(),
                                                      const int = 0,
-                                                     const bool = false );
+                                                     const bool = false,
+                                                     const QString& = QString() );
   void                            createPopupItem( const int,
                                                    const QString&,
                                                    const QString&,
@@ -149,12 +191,22 @@ protected:
 
   virtual bool                    isSelectionCompatible();
 
+  virtual bool                    reusableOperation( const int id ); 
+
+  static void                     ProcessEvents( vtkObject* theObject, 
+                                                 unsigned long theEvent,
+                                                 void* theClientData, 
+                                                 void* theCallData );
+
 private:
   void                            OnEditDelete();
   int                             addVtkFontPref( const QString& label, 
                                                   const int pId, 
                                                   const QString& param );
 
+  void                            connectView( const SUIT_ViewWindow* );
+
 private :
   static SMESH::SMESH_Gen_var     myComponentSMESH;
   QDialog*                        myActiveDialogBox;
@@ -163,6 +215,12 @@ private :
   LightApp_Displayer*             myDisplayer;
 
   SMESHGUI_FilterLibraryDlg*      myFilterLibraryDlg;
+
+  SMESHGUI_StudyId2MarkerMap      myMarkerMap;
+  SMESHGUI_ClippingPlaneInfoMap   myClippingPlaneInfoMap;
+
+  vtkSmartPointer<vtkCallbackCommand> myEventCallbackCommand;
+  vtkFloatingPointType            myPriority;
 };
 
 #endif // SMESHGUI_H