Salome HOME
Merge branch 'master' of ssh://git.salome-platform.org/modules/paravis
[modules/paravis.git] / src / PVGUI / PVGUI_Module.h
index 15f87ef9f8ed0568afee66c86442501df0b62e18..0b30e767f72741eb8006aa13d4bc198d7a372652 100644 (file)
@@ -1,11 +1,11 @@
 // PARAVIS : ParaView wrapper SALOME module
 //
-// Copyright (C) 2010-2013  CEA/DEN, EDF R&D
+// Copyright (C) 2010-2014  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
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -47,6 +47,7 @@ class pqPVApplicationCore;
 class pqDataRepresentation;
 class pqRepresentation;
 
+class PyConsole_Interp;
 
 class PVGUI_Module : public SalomeApp_Module
 {
@@ -54,84 +55,85 @@ class PVGUI_Module : public SalomeApp_Module
    
   //! Menu actions
   enum { // Menu "File"
-         OpenFileId,
-
-        LoadStateId,
-        SaveStateId,
-
-        SaveDataId,
-        SaveScreenshotId,
-        ExportId,
-
-        SaveAnimationId,
-        SaveGeometryId,
-
-        ConnectId,
-        DisconnectId,
-
-        // Menu "Edit"
-        UndoId,
-        RedoId,
-
-        CameraUndoId,
-        CameraRedoId,
-
-   FindDataId,   
-        ChangeInputId,
-   IgnoreTimeId, 
-        DeleteId,
-        DeleteAllId,
-
-        SettingsId,
-        ViewSettingsId,
-
-        // Menu "View"
-   FullScreenId, 
-
-        // Menu "Animation"
-        FirstFrameId,
-        PreviousFrameId,
-        PlayId,
-        NextFrameId,
-        LastFrameId,
-        LoopId,
-
-        // Menu "Tools" 
-        CreateCustomFilterId,
-        ManageCustomFiltersId,
-        CreateLookmarkId,
-        ManageLinksId,
-        AddCameraLinkId,
-        ManagePluginsExtensionsId,
-        DumpWidgetNamesId,
-        RecordTestId,
-        RecordTestScreenshotId,
-        PlayTestId,
-        MaxWindowSizeId,
-        CustomWindowSizeId,
-        TimerLogId,
-        OutputWindowId,
-        PythonShellId,
-        ShowTraceId,
-
-        // Menu "Help" 
-        AboutParaViewId,
-        ParaViewHelpId,
-        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
+     OpenFileId,
+
+     LoadStateId,
+     SaveStateId,
+
+     SaveDataId,
+     SaveScreenshotId,
+     ExportId,
+
+     SaveAnimationId,
+     SaveGeometryId,
+
+     ConnectId,
+     DisconnectId,
+
+     // Menu "Edit"
+     UndoId,
+     RedoId,
+
+     CameraUndoId,
+     CameraRedoId,
+
+     FindDataId,
+     ChangeInputId,
+     IgnoreTimeId,
+     DeleteId,
+     DeleteAllId,
+
+     SettingsId,
+     ViewSettingsId,
+
+     // Menu "View"
+     FullScreenId,
+
+     // Menu "Animation"
+     FirstFrameId,
+     PreviousFrameId,
+     PlayId,
+     NextFrameId,
+     LastFrameId,
+     LoopId,
+
+     // Menu "Tools"
+     CreateCustomFilterId,
+     ManageCustomFiltersId,
+     CreateLookmarkId,
+     ManageLinksId,
+     AddCameraLinkId,
+     ManagePluginsExtensionsId,
+     DumpWidgetNamesId,
+     RecordTestId,
+     RecordTestScreenshotId,
+     PlayTestId,
+     MaxWindowSizeId,
+     CustomWindowSizeId,
+     TimerLogId,
+     OutputWindowId,
+     PythonShellId,
+     ShowTraceId,
+     RestartTraceId,
+
+     // Menu "Help"
+     AboutParaViewId,
+     ParaViewHelpId,
+     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:
@@ -207,9 +209,21 @@ private:
   //! Load selected state
   void loadSelectedState(bool toClear);
 
+  //! Get list of embedded macros files
+  QStringList getEmbeddedMacrosList();
+
   //! update macros state
   void updateMacros();
 
+  //! store visibility of the common dockable windows (OB, PyConsole, ... etc.)
+  void storeCommonWindowsState();
+
+  //! 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& );
@@ -232,6 +246,7 @@ private slots:
   void onStartProgress();
   void onEndProgress();
   void onShowTrace();
+  void onRestartTrace();
 
   void onNewParaViewWindow();
 
@@ -271,6 +286,9 @@ private:
   WgMap                  myToolbarBreaks;
   QList<QMenu*>          myMenus;
 
+  typedef QMap<int, bool> DockWindowMap;         
+  DockWindowMap           myCommonMap; 
+
   QStringList            myTemporaryFiles;
 
   QtMsgHandler           myOldMsgHandler;