Salome HOME
Completing French translation.
[modules/paravis.git] / src / PVGUI / PVGUI_Module.h
index 0b30e767f72741eb8006aa13d4bc198d7a372652..f955a6e1093d9e31123498853d3833d181f5ce51 100644 (file)
@@ -1,6 +1,6 @@
 // PARAVIS : ParaView wrapper SALOME module
 //
-// Copyright (C) 2010-2014  CEA/DEN, EDF R&D
+// Copyright (C) 2010-2015  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
@@ -19,7 +19,7 @@
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File   : PVGUI_Module.h
-// Author : Sergey ANIKIN
+// Author : Sergey ANIKIN, Adrien BRUNETON
 //
 
 
 #define PVGUI_Module_H
 
 #include <SalomeApp_Module.h>
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(PVSERVER_Gen)
 
 #include <ostream>
 #include <vtkType.h>
+#include <QTimer>
 
 #include <pqVariableType.h>
 
@@ -39,15 +42,14 @@ class QToolBar;
 class vtkPVMain;
 class pqOptions;
 class pqServer;
-class pqTabbedMultiViewWidget;
 class pqMainWindowCore;
 class vtkEventQtSlotConnect;
 class pqPythonScriptEditor;
 class pqPVApplicationCore;
 class pqDataRepresentation;
 class pqRepresentation;
-
-class PyConsole_Interp;
+class PVViewer_GUIElements;
+class PVViewer_EngineWrapper;
 
 class PVGUI_Module : public SalomeApp_Module
 {
@@ -143,9 +145,7 @@ public:
   virtual void           initialize( CAM_Application* );
   virtual void           windows( QMap<int, int>& ) const;
 
-  pqTabbedMultiViewWidget*         getMultiViewManager() const;
-
-  virtual QString engineIOR() const;
+  virtual QString engineIOR() const;  // to be removed when becoming Light
 
   void openFile(const char* theName);
   void executeScript(const char *script);
@@ -154,6 +154,8 @@ public:
   void clearParaviewState();
 
   QString getTraceString();
+  void startTrace();
+  void stopTrace();
   void saveTrace(const char* theName);
 
   pqServer* getActiveServer();
@@ -162,12 +164,18 @@ public:
 
   virtual void contextMenuPopup(const QString& theClient, QMenu* theMenu, QString& theTitle);
 
+  inline static PVViewer_EngineWrapper * GetEngine();
+  inline static PVSERVER_ORB::PVSERVER_Gen_var GetCPPEngine();  // to be removed once light!
+  inline static pqPVApplicationCore * GetPVApplication();
+
+  virtual CAM_DataModel* createDataModel();
+  void  fixAnimationScene();
+
 public slots:
-  void onImportFromVisu(QString theEntry);
+  //void onImportFromVisu(QString theEntry);
 
 private:
-  //! Initialize ParaView if not yet done (once per session)
-  static bool            pvInit();  
+  void deleteTemporaryFiles();
  
   //! Create actions for ParaView GUI operations
   void                   pvCreateActions();
@@ -196,10 +204,6 @@ private:
   //! Discover help project files from the resources.
   QString getHelpFileName();
 
-  void                   deleteTemporaryFiles();
-  
-  //QList<QToolBar*>       getParaViewToolbars();
-
   //! Create actions for ParaViS
   void createActions();
 
@@ -221,9 +225,6 @@ private:
   //! restore visibility of the common dockable windows (OB, PyConsole, ... etc.)
   void restoreCommonWindowsState();
 
-  //! run Python command (either in SALOME's Python interpreter, or in ParaView's Python's interpreter)
-  void execPythonCommand(const QString& cmd, bool inSalomeConsole=false);
-
 private slots:
 
   void showHelpForProxy( const QString&, const QString& );
@@ -237,18 +238,14 @@ private slots:
   //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 onNewParaViewWindow();
 
   void onSaveMultiState();
   void onAddState();
@@ -265,14 +262,10 @@ public slots:
 
 protected slots:
   virtual void           onModelOpened();
-
-protected:
-  void timerEvent(QTimerEvent *event);
+  virtual void           onPushTraceTimer();
+  virtual void           onInitTimer();
 
 private:
-  class pqImplementation;
-  pqImplementation*      Implementation;
-
   int                    mySelectionControlsTb;
   int                    mySourcesMenuId;
   int                    myFiltersMenuId;
@@ -299,7 +292,16 @@ private:
 
   int myStateCounter;
 
-  static pqPVApplicationCore* MyCoreApp;
+  //! Single shot timer used to connect to the PVServer, and start the trace.
+  QTimer             * myInitTimer;
+
+  //! Timer used to regularly push the Python trace to the engine.
+  QTimer             * myPushTraceTimer;
+
+  PVViewer_GUIElements * myGuiElements;
+
+  static PVSERVER_ORB::PVSERVER_Gen_var MyEngine;
+
 };
 
 #endif // PVGUI_Module_H