Salome HOME
CMake: minimal set of changes so that ParaViS configures and compiles.
[modules/paravis.git] / src / PVGUI / PVGUI_Module.h
index dad5800a96f646fbd797c995acd760ac49d99af3..90c331469d2c7504017045ad88a388b2e37eb4fc 100644 (file)
@@ -1,7 +1,6 @@
 // PARAVIS : ParaView wrapper SALOME module
 //
-// Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2010-2013  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -30,6 +29,9 @@
 #include <SalomeApp_Module.h>
 
 #include <ostream>
+#include <vtkType.h>
+
+#include <pqVariableType.h>
 
 class QMenu;
 class QDockWidget;
@@ -37,8 +39,14 @@ class QToolBar;
 class vtkPVMain;
 class pqOptions;
 class pqServer;
-class pqViewManager;
+class pqTabbedMultiViewWidget;
 class pqMainWindowCore;
+class vtkEventQtSlotConnect;
+class pqPythonScriptEditor;
+class pqPVApplicationCore;
+class pqDataRepresentation;
+class pqRepresentation;
+
 
 class PVGUI_Module : public SalomeApp_Module
 {
@@ -68,53 +76,17 @@ class PVGUI_Module : public SalomeApp_Module
         CameraUndoId,
         CameraRedoId,
 
+   FindDataId,   
         ChangeInputId,
    IgnoreTimeId, 
         DeleteId,
         DeleteAllId,
 
-        //InteractId,
-        //SelectCellsOnId,
-        //SelectPointsOnId,
-        //SelectCellsThroughId,
-        //SelectPointsThroughId,
-        //SelectBlockId,
-
         SettingsId,
         ViewSettingsId,
 
         // Menu "View"
    FullScreenId, 
-//      ResetCameraId,
-//      PositiveXId,
-//      NegativeXId,
-//      PositiveYId,
-//      NegativeYId,
-//      PositiveZId,
-//      NegativeZId,
-// 
-//      ShowCenterId,
-//      ResetCenterId,
-//      PickCenterId,
-//      ShowColorLegendId,
-//      EditColorMapId,
-//      ResetRangeId,
-// 
-//      AnimationInspectorId,
-//      AnimationViewId,
-//      ComparativeViewInspectorId,
-//      SelectionInspectorId,
-//      LookmarkBrowserId,
-//      LookmarkInspectorId,
-//      ObjectInspectorId,
-//      PipelineBrowserId,
-//      StatisticsViewId,
-
-        // Menu "Sources"
-        // TODO...
-
-        // Menu "Filters"
-        // TODO...
 
         // Menu "Animation"
         FirstFrameId,
@@ -136,14 +108,31 @@ class PVGUI_Module : public SalomeApp_Module
         RecordTestScreenshotId,
         PlayTestId,
         MaxWindowSizeId,
+        CustomWindowSizeId,
         TimerLogId,
         OutputWindowId,
         PythonShellId,
+        ShowTraceId,
+        RestartTraceId,
 
         // Menu "Help" 
         AboutParaViewId,
         ParaViewHelpId,
-        EnableTooltipsId
+        EnableTooltipsId,
+
+        // Menu "Window" - "New Window"
+        ParaViewNewWindowId,
+
+        // "Save state" ParaVis module root object popup
+        SaveStatePopupId,
+
+        // "Add state" and "Reload state" popups
+        AddStatePopupId,
+        CleanAndAddStatePopupId,
+
+        // "Rename" and "Delete" popups (Object Browser)
+        ParaVisRenameId,
+        ParaVisDeleteId
   };
 
 public:
@@ -153,19 +142,15 @@ public:
   virtual void           initialize( CAM_Application* );
   virtual void           windows( QMap<int, int>& ) const;
 
-  pqViewManager*         getMultiViewManager() const;
+  pqTabbedMultiViewWidget*         getMultiViewManager() const;
 
   virtual QString engineIOR() const;
 
-  /*! Compares the contents of the window with the given reference image,
-   * returns true if they "match" within some tolerance
-   */
-  /*bool                   compareView( const QString& ReferenceImage, double Threshold,
-    std::ostream& Output, const QString& TempDirectory );*/
-
   void openFile(const char* theName);
+  void executeScript(const char *script);
   void saveParaviewState(const char* theFileName);
   void loadParaviewState(const char* theFileName);
+  void clearParaviewState();
 
   QString getTraceString();
   void saveTrace(const char* theName);
@@ -174,6 +159,8 @@ public:
 
   virtual void createPreferences();
 
+  virtual void contextMenuPopup(const QString& theClient, QMenu* theMenu, QString& theTitle);
+
 public slots:
   void onImportFromVisu(QString theEntry);
 
@@ -204,30 +191,70 @@ private:
 
   //! Returns QMenu object for a given menu id
   QMenu*                 getMenu( const int );
+  
+  //! Discover help project files from the resources.
+  QString getHelpFileName();
 
   void                   deleteTemporaryFiles();
   
-  QList<QToolBar*>       getParaViewToolbars();
+  //QList<QToolBar*>       getParaViewToolbars();
+
+  //! Create actions for ParaViS
+  void createActions();
+
+  //! Create menus for ParaViS
+  void createMenus();
+
+  //! Load selected state
+  void loadSelectedState(bool toClear);
+
+  //! update macros state
+  void updateMacros();
 
 private slots:
 
-  void showHelpForProxy( const QString& proxy );
+  void showHelpForProxy( const QString&, const QString& );
   
   void onPreAccept();
   void onPostAccept();
   void endWaitCursor();
 
-  void activateTrace();
+  //  void buildToolbarsMenu();
 
-  void buildToolbarsMenu();
+  //void showParaViewHelp();
+  //void showHelp(const QString& url);
 
-  void showParaViewHelp();
-  void showHelp(const QString& url);
+  void onFinishedAddingServer(pqServer*);
+  void onDataRepresentationCreated(pqDataRepresentation*);
+  void onDataRepresentationUpdated();
+  void onVariableChanged(pqVariableType, const QString);
+  void onRepresentationChanged(pqRepresentation*);
+
+  void onStartProgress();
+  void onEndProgress();
+  void onShowTrace();
+  void onRestartTrace();
+
+  void onNewParaViewWindow();
+
+  void onSaveMultiState();
+  void onAddState();
+  void onCleanAddState();
+
+  void onRename();
+  void onDelete();
 
 public slots:
   virtual bool           activateModule( SUIT_Study* );
   virtual bool           deactivateModule( SUIT_Study* );
   virtual void           onApplicationClosed( SUIT_Application* );
+  virtual void           studyClosed( SUIT_Study* );
+
+protected slots:
+  virtual void           onModelOpened();
+
+protected:
+  void timerEvent(QTimerEvent *event);
 
 private:
   class pqImplementation;
@@ -238,14 +265,25 @@ private:
   int                    myFiltersMenuId;
   int                    myToolbarsMenuId;
   int                    myMacrosMenuId;
-
-  QList<QDockWidget*>    myDockWidgets;
+  int                    myRecentMenuId;
+  
+  typedef QMap<QWidget*, bool> WgMap;
+  WgMap                  myDockWidgets;
+  WgMap                  myToolbars;
+  WgMap                  myToolbarBreaks;
+  QList<QMenu*>          myMenus;
 
   QStringList            myTemporaryFiles;
 
-  QMap<QToolBar*, bool>  myToolbarState;
-
   QtMsgHandler           myOldMsgHandler;
+
+  vtkEventQtSlotConnect *VTKConnect;
+
+  pqPythonScriptEditor* myTraceWindow;
+
+  int myStateCounter;
+
+  static pqPVApplicationCore* MyCoreApp;
 };
 
 #endif // PVGUI_Module_H