Salome HOME
CMake: minimal set of changes so that ParaViS configures and compiles.
[modules/paravis.git] / src / PVGUI / PVGUI_Module.h
index 5afdb556bf2dd48f77a0fa298531ef0c066225d4..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
 // Author : Sergey ANIKIN
 //
 
-/*!
-  \mainpage
-
-  Insert the content of introduction page here.
-
-*/
 
 #ifndef PVGUI_Module_H
 #define PVGUI_Module_H
 
-#include <LightApp_Module.h>
+#include <SalomeApp_Module.h>
+
+#include <ostream>
+#include <vtkType.h>
 
-#include <ostream.h>
+#include <pqVariableType.h>
 
 class QMenu;
 class QDockWidget;
-class LightApp_Selection;
-class LightApp_SelectionMgr;
-class PVGUI_ProcessModuleHelper;
+class QToolBar;
 class vtkPVMain;
 class pqOptions;
 class pqServer;
-class pqActiveServer;
-class pqViewManager;
+class pqTabbedMultiViewWidget;
+class pqMainWindowCore;
+class vtkEventQtSlotConnect;
+class pqPythonScriptEditor;
+class pqPVApplicationCore;
+class pqDataRepresentation;
+class pqRepresentation;
 
-class PVGUI_Module : public LightApp_Module
+
+class PVGUI_Module : public SalomeApp_Module
 {
   Q_OBJECT
    
@@ -76,51 +76,17 @@ class PVGUI_Module : public LightApp_Module
         CameraUndoId,
         CameraRedoId,
 
+   FindDataId,   
         ChangeInputId,
+   IgnoreTimeId, 
         DeleteId,
         DeleteAllId,
 
-        InteractId,
-        SelectCellsOnId,
-        SelectPointsOnId,
-        SelectCellsThroughId,
-        SelectPointsThroughId,
-        SelectBlockId,
-
         SettingsId,
         ViewSettingsId,
 
         // Menu "View"
-        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...
+   FullScreenId, 
 
         // Menu "Animation"
         FirstFrameId,
@@ -142,25 +108,31 @@ class PVGUI_Module : public LightApp_Module
         RecordTestScreenshotId,
         PlayTestId,
         MaxWindowSizeId,
+        CustomWindowSizeId,
         TimerLogId,
         OutputWindowId,
         PythonShellId,
+        ShowTraceId,
+        RestartTraceId,
 
         // Menu "Help" 
         AboutParaViewId,
         ParaViewHelpId,
-        EnableTooltipsId
-
-         /*
-         lgLoadFile = 931,   //!< load text file
-        lgSaveFile,         //!< save text file
-        lgDisplayLine,      //!< display selected line
-        lgEraseLine,        //!< erase selected line
-        lgEditLine,         //!< edit selected line
-        lgAddLine,          //!< insert new line
-        lgDelLine,          //!< delete selected line
-        lgClear             //!< clear all contents
-        */
+        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:
@@ -170,42 +142,44 @@ public:
   virtual void           initialize( CAM_Application* );
   virtual void           windows( QMap<int, int>& ) const;
 
-  //virtual LightApp_Selection* createSelection() const;
+  pqTabbedMultiViewWidget*         getMultiViewManager() const;
 
-  pqViewManager*         getMultiViewManager() const;
+  virtual QString engineIOR() const;
 
-  virtual bool           eventFilter( QObject*, QEvent* );
+  void openFile(const char* theName);
+  void executeScript(const char *script);
+  void saveParaviewState(const char* theFileName);
+  void loadParaviewState(const char* theFileName);
+  void clearParaviewState();
 
-  //! 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,
-                                     ostream& Output, const QString& TempDirectory );
+  QString getTraceString();
+  void saveTrace(const char* theName);
 
-protected:
-  //virtual CAM_DataModel* createDataModel();
+  pqServer* getActiveServer();
+
+  virtual void createPreferences();
+
+  virtual void contextMenuPopup(const QString& theClient, QMenu* theMenu, QString& theTitle);
+
+public slots:
+  void onImportFromVisu(QString theEntry);
 
 private:
   //! Initialize ParaView if not yet done (once per session)
   static bool            pvInit();  
-  //! Shutdown ParaView, should be called on application exit
-  static void            pvShutdown();   
  
   //! Create actions for ParaView GUI operations
   void                   pvCreateActions();
 
-  //! Create menus for ParaView GUI operations
-  //! duplicating menus in pqMainWindow ParaView class
+  //! Create menus for ParaView GUI operations duplicating menus in pqMainWindow ParaView class
   void                   pvCreateMenus();
 
-  //! Create toolbars for ParaView GUI operations
-  //! duplicating toolbars in pqMainWindow ParaView class
+  //! Create toolbars for ParaView GUI operations duplicating toolbars in pqMainWindow ParaView class
   void                   pvCreateToolBars();
 
   //! Create dock widgets for ParaView widgets
   void                   setupDockWidgets();
 
-  //! Create dock widgets context menus
-  void                   setupDockWidgetsContextMenu();
-
   //! Save states of dockable ParaView widgets
   void                   saveDockWidgetsState();
 
@@ -217,39 +191,70 @@ private:
 
   //! Returns QMenu object for a given menu id
   QMenu*                 getMenu( const int );
+  
+  //! Discover help project files from the resources.
+  QString getHelpFileName();
 
-private slots:
-  void onUndoLabel( const QString& );
-  void onRedoLabel( const QString& );
+  void                   deleteTemporaryFiles();
   
-  void onCameraUndoLabel( const QString& );
-  void onCameraRedoLabel( const QString& );
+  //QList<QToolBar*>       getParaViewToolbars();
 
-  void onDeleteAll();
+  //! Create actions for ParaViS
+  void createActions();
 
-  void onSelectionModeChanged( int mode );
+  //! Create menus for ParaViS
+  void createMenus();
 
-  void onShowCenterAxisChanged( bool );
+  //! Load selected state
+  void loadSelectedState(bool toClear);
 
-  void setTimeRanges( double, double );
+  //! update macros state
+  void updateMacros();
 
-  void onPlaying( bool );
-  
-  void onAddCameraLink();
-  
-  void onHelpAbout();
+private slots:
 
-  void showHelpForProxy( const QString& proxy );
-  void makeAssistant();
-  void assistantError( const QString& err );
+  void showHelpForProxy( const QString&, const QString& );
   
   void onPreAccept();
   void onPostAccept();
   void endWaitCursor();
 
+  //  void buildToolbarsMenu();
+
+  //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;
@@ -258,8 +263,27 @@ private:
   int                    mySelectionControlsTb;
   int                    mySourcesMenuId;
   int                    myFiltersMenuId;
+  int                    myToolbarsMenuId;
+  int                    myMacrosMenuId;
+  int                    myRecentMenuId;
+  
+  typedef QMap<QWidget*, bool> WgMap;
+  WgMap                  myDockWidgets;
+  WgMap                  myToolbars;
+  WgMap                  myToolbarBreaks;
+  QList<QMenu*>          myMenus;
+
+  QStringList            myTemporaryFiles;
+
+  QtMsgHandler           myOldMsgHandler;
+
+  vtkEventQtSlotConnect *VTKConnect;
+
+  pqPythonScriptEditor* myTraceWindow;
+
+  int myStateCounter;
 
-  QList<QDockWidget*>    myDockWidgets;
+  static pqPVApplicationCore* MyCoreApp;
 };
 
 #endif // PVGUI_Module_H