1 // PARAVIS : ParaView wrapper SALOME module
3 // Copyright (C) 2010-2016 CEA/DEN, EDF R&D
5 // This library is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation; either
8 // version 2.1 of the License, or (at your option) any later version.
10 // This library is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // Lesser General Public License for more details.
15 // You should have received a copy of the GNU Lesser General Public
16 // License along with this library; if not, write to the Free Software
17 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 // File : PVGUI_Module.h
22 // Author : Sergey ANIKIN, Adrien BRUNETON
26 #ifndef PVGUI_Module_H
27 #define PVGUI_Module_H
29 #include <LightApp_Module.h>
33 class vtkEventQtSlotConnect;
35 class pqPythonScriptEditor;
36 class pqPVApplicationCore;
37 class PVViewer_GUIElements;
38 class PVServer_ServiceWrapper;
39 class SUIT_ViewWindow;
41 class PVGUI_Module: public LightApp_Module
77 SettingsId, // not used
78 ViewSettingsId, // not used
81 FullScreenId, // not used
84 FirstFrameId, // not used
85 PreviousFrameId, // not used
87 NextFrameId, // not used
88 LastFrameId, // not used
93 ManageCustomFiltersId,
94 CreateLookmarkId, // not used
97 ManagePluginsExtensionsId,
98 DumpWidgetNamesId, // not used
100 RecordTestScreenshotId, // not used
113 EnableTooltipsId, // not used
120 virtual void initialize( CAM_Application* );
121 virtual void windows( QMap<int, int>& ) const;
123 void openFile( const char* ); // not used inside PARAVIS
124 void executeScript( const char* ); // not used inside PARAVIS
126 void saveParaviewState( const QString& );
127 void loadParaviewState( const QString& );
128 void clearParaviewState();
130 QString getTraceString();
133 void saveTrace( const char* );
135 pqServer* getActiveServer();
137 virtual void createPreferences();
139 inline static PVServer_ServiceWrapper* GetEngine();
140 inline static pqPVApplicationCore* GetPVApplication(); // not used inside PARAVIS
142 virtual CAM_DataModel* createDataModel();
145 //! Create actions for ParaView GUI operations
146 void pvCreateActions();
148 //! Create menus for ParaView GUI operations duplicating menus in pqMainWindow ParaView class
149 void pvCreateMenus();
151 //! Create toolbars for ParaView GUI operations duplicating toolbars in pqMainWindow ParaView class
152 void pvCreateToolBars();
154 //! Create dock widgets for ParaView widgets
155 void setupDockWidgets();
157 //! Save states of dockable ParaView widgets
158 void saveDockWidgetsState( bool = true );
160 //! Restore states of dockable ParaView widgets
161 void restoreDockWidgetsState();
163 //! Shows or hides ParaView view window
164 void showView( bool );
166 //! Get list of embedded macros files
167 QStringList getEmbeddedMacrosList();
169 //! update macros state
172 //! store visibility of the common dockable windows (OB, PyConsole, ... etc.)
173 void storeCommonWindowsState();
175 //! restore visibility of the common dockable windows (OB, PyConsole, ... etc.)
176 void restoreCommonWindowsState();
179 void showHelpForProxy( const QString&, const QString& );
181 void onPreAccept(); // not used inside PARAVIS
182 void onPostAccept(); // not used inside PARAVIS
183 void endWaitCursor(); // not used inside PARAVIS
185 void onDataRepresentationUpdated();
187 void onStartProgress();
188 void onEndProgress();
190 void onRestartTrace();
194 virtual bool activateModule( SUIT_Study* );
195 virtual bool deactivateModule( SUIT_Study* );
196 virtual void onApplicationClosed( SUIT_Application* );
197 virtual void studyClosed( SUIT_Study* );
200 virtual void onInitTimer();
201 virtual void onViewManagerAdded( SUIT_ViewManager* );
202 virtual void onViewManagerRemoved( SUIT_ViewManager* );
203 virtual void onPVViewCreated( SUIT_ViewWindow* );
204 virtual void onPVViewDelete( SUIT_ViewWindow* );
209 #ifdef PVCATALYST_ENABLED
210 int myCatalystMenuId;
215 typedef QMap<QWidget*, bool> WgMap;
218 WgMap myToolbarBreaks;
219 QList<QMenu*> myMenus;
221 typedef QMap<int, bool> DockWindowMap;
222 DockWindowMap myCommonMap;
223 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
224 QtMsgHandler myOldMsgHandler;
226 QtMessageHandler myOldMsgHandler;
228 vtkEventQtSlotConnect* VTKConnect;
230 pqPythonScriptEditor* myTraceWindow;
232 //! Single shot timer used to connect to the PVServer, and start the trace.
235 PVViewer_GUIElements* myGuiElements;
238 #endif // PVGUI_Module_H