1 // PARAVIS : ParaView wrapper SALOME module
3 // Copyright (C) 2010-2023 CEA, EDF
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
79 SettingsId, // not used
80 ViewSettingsId, // not used
83 FullScreenId, // not used
86 FirstFrameId, // not used
87 PreviousFrameId, // not used
89 NextFrameId, // not used
90 LastFrameId, // not used
95 ManageCustomFiltersId,
96 CreateLookmarkId, // not used
99 ManagePluginsExtensionsId,
100 DumpWidgetNamesId, // not used
102 RecordTestScreenshotId, // not used
114 EnableTooltipsId, // not used
121 virtual void initialize( CAM_Application* );
122 virtual void windows( QMap<int, int>& ) const;
124 void openFile( const char* ); // not used inside PARAVIS
125 void executeScript( const char* ); // not used inside PARAVIS
127 void saveParaviewState( const QString& );
128 void loadParaviewState( const QString& );
129 void clearParaviewState();
131 QString getTraceString();
134 void saveTrace( const char* );
136 pqServer* getActiveServer();
138 virtual void createPreferences();
140 inline static PVServer_ServiceWrapper* GetEngine();
141 inline static pqPVApplicationCore* GetPVApplication(); // not used inside PARAVIS
143 virtual CAM_DataModel* createDataModel();
146 //! Create actions for ParaView GUI operations
147 void pvCreateActions();
149 //! Create menus for ParaView GUI operations duplicating menus in pqMainWindow ParaView class
150 void pvCreateMenus();
152 //! Create toolbars for ParaView GUI operations duplicating toolbars in pqMainWindow ParaView class
153 void pvCreateToolBars();
155 //! Create dock widgets for ParaView widgets
156 void setupDockWidgets();
158 //! Save states of dockable ParaView widgets
159 void saveDockWidgetsState( bool = true );
161 //! Restore states of dockable ParaView widgets
162 void restoreDockWidgetsState();
164 //! Shows or hides ParaView view window
165 void showView( bool );
167 //! Get list of embedded macros files
168 QStringList getEmbeddedMacrosList();
170 //! update macros state
173 //! store visibility of the common dockable windows (OB, PyConsole, ... etc.)
174 void storeCommonWindowsState();
176 //! restore visibility of the common dockable windows (OB, PyConsole, ... etc.)
177 void restoreCommonWindowsState();
180 void showHelpForProxy( const QString&, const QString& );
182 void onPreAccept(); // not used inside PARAVIS
183 void onPostAccept(); // not used inside PARAVIS
184 void endWaitCursor(); // not used inside PARAVIS
186 void onDataRepresentationUpdated();
188 void onStartProgress();
189 void onEndProgress();
191 void onRestartTrace();
195 virtual bool activateModule( SUIT_Study* );
196 virtual bool deactivateModule( SUIT_Study* );
197 virtual void onApplicationClosed( SUIT_Application* );
198 virtual void studyClosed( SUIT_Study* );
201 virtual void onInitTimer();
202 virtual void onViewManagerAdded( SUIT_ViewManager* );
203 virtual void onViewManagerRemoved( SUIT_ViewManager* );
204 virtual void onPVViewCreated( SUIT_ViewWindow* );
205 virtual void onPVViewDelete( SUIT_ViewWindow* );
212 int myCatalystMenuId;
214 typedef QMap<QWidget*, bool> WgMap;
217 WgMap myToolbarBreaks;
218 QList<QMenu*> myMenus;
220 typedef QMap<int, bool> DockWindowMap;
221 DockWindowMap myCommonMap;
222 QtMessageHandler myOldMsgHandler;
224 vtkEventQtSlotConnect* VTKConnect;
226 pqPythonScriptEditor* myTraceWindow;
228 //! Single shot timer used to connect to the PVServer, and start the trace.
231 PVViewer_GUIElements* myGuiElements;
234 #endif // PVGUI_Module_H