1 // PARAVIS : ParaView wrapper SALOME module
3 // Copyright (C) 2010-2015 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
125 void saveParaviewState( const char* ); // not used inside PARAVIS
126 void loadParaviewState( const char* ); // not used inside PARAVIS
127 void clearParaviewState();
129 QString getTraceString();
132 void saveTrace( const char* );
134 pqServer* getActiveServer();
136 virtual void createPreferences();
138 inline static PVServer_ServiceWrapper* GetEngine();
139 inline static pqPVApplicationCore* GetPVApplication(); // not used inside PARAVIS
141 virtual CAM_DataModel* createDataModel();
144 //! Create actions for ParaView GUI operations
145 void pvCreateActions();
147 //! Create menus for ParaView GUI operations duplicating menus in pqMainWindow ParaView class
148 void pvCreateMenus();
150 //! Create toolbars for ParaView GUI operations duplicating toolbars in pqMainWindow ParaView class
151 void pvCreateToolBars();
153 //! Create dock widgets for ParaView widgets
154 void setupDockWidgets();
156 //! Save states of dockable ParaView widgets
157 void saveDockWidgetsState( bool = true );
159 //! Restore states of dockable ParaView widgets
160 void restoreDockWidgetsState();
162 //! Shows or hides ParaView view window
163 void showView( bool );
165 //! Get list of embedded macros files
166 QStringList getEmbeddedMacrosList();
168 //! update macros state
171 //! store visibility of the common dockable windows (OB, PyConsole, ... etc.)
172 void storeCommonWindowsState();
174 //! restore visibility of the common dockable windows (OB, PyConsole, ... etc.)
175 void restoreCommonWindowsState();
178 void showHelpForProxy( const QString&, const QString& );
180 void onPreAccept(); // not used inside PARAVIS
181 void onPostAccept(); // not used inside PARAVIS
182 void endWaitCursor(); // not used inside PARAVIS
184 void onDataRepresentationUpdated();
186 void onStartProgress();
187 void onEndProgress();
189 void onRestartTrace();
192 virtual bool activateModule( SUIT_Study* );
193 virtual bool deactivateModule( SUIT_Study* );
194 virtual void onApplicationClosed( SUIT_Application* );
195 virtual void studyClosed( SUIT_Study* );
198 virtual void onInitTimer();
199 virtual void onViewManagerAdded( SUIT_ViewManager* );
200 virtual void onViewManagerRemoved( SUIT_ViewManager* );
201 virtual void onPVViewCreated( SUIT_ViewWindow* );
202 virtual void onPVViewDelete( SUIT_ViewWindow* );
210 typedef QMap<QWidget*, bool> WgMap;
213 WgMap myToolbarBreaks;
214 QList<QMenu*> myMenus;
216 typedef QMap<int, bool> DockWindowMap;
217 DockWindowMap myCommonMap;
219 QtMsgHandler myOldMsgHandler;
221 vtkEventQtSlotConnect* VTKConnect;
223 pqPythonScriptEditor* myTraceWindow;
225 //! Single shot timer used to connect to the PVServer, and start the trace.
228 PVViewer_GUIElements* myGuiElements;
231 #endif // PVGUI_Module_H