1 // PARAVIS : ParaView wrapper SALOME module
3 // Copyright (C) 2010-2013 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.
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
26 #ifndef PVGUI_Module_H
27 #define PVGUI_Module_H
29 #include <SalomeApp_Module.h>
34 #include <pqVariableType.h>
42 class pqTabbedMultiViewWidget;
43 class pqMainWindowCore;
44 class vtkEventQtSlotConnect;
45 class pqPythonScriptEditor;
46 class pqPVApplicationCore;
47 class pqDataRepresentation;
48 class pqRepresentation;
51 class PVGUI_Module : public SalomeApp_Module
100 CreateCustomFilterId,
101 ManageCustomFiltersId,
105 ManagePluginsExtensionsId,
108 RecordTestScreenshotId,
123 // Menu "Window" - "New Window"
126 // "Save state" ParaVis module root object popup
129 // "Add state" and "Reload state" popups
131 CleanAndAddStatePopupId,
133 // "Rename" and "Delete" popups (Object Browser)
142 virtual void initialize( CAM_Application* );
143 virtual void windows( QMap<int, int>& ) const;
145 pqTabbedMultiViewWidget* getMultiViewManager() const;
147 virtual QString engineIOR() const;
149 void openFile(const char* theName);
150 void executeScript(const char *script);
151 void saveParaviewState(const char* theFileName);
152 void loadParaviewState(const char* theFileName);
153 void clearParaviewState();
155 QString getTraceString();
156 void saveTrace(const char* theName);
158 pqServer* getActiveServer();
160 virtual void createPreferences();
162 virtual void contextMenuPopup(const QString& theClient, QMenu* theMenu, QString& theTitle);
165 void onImportFromVisu(QString theEntry);
168 //! Initialize ParaView if not yet done (once per session)
169 static bool pvInit();
171 //! Create actions for ParaView GUI operations
172 void pvCreateActions();
174 //! Create menus for ParaView GUI operations duplicating menus in pqMainWindow ParaView class
175 void pvCreateMenus();
177 //! Create toolbars for ParaView GUI operations duplicating toolbars in pqMainWindow ParaView class
178 void pvCreateToolBars();
180 //! Create dock widgets for ParaView widgets
181 void setupDockWidgets();
183 //! Save states of dockable ParaView widgets
184 void saveDockWidgetsState();
186 //! Restore states of dockable ParaView widgets
187 void restoreDockWidgetsState();
189 //! Shows or hides ParaView view window
190 void showView( bool );
192 //! Returns QMenu object for a given menu id
193 QMenu* getMenu( const int );
195 //! Discover help project files from the resources.
196 QString getHelpFileName();
198 void deleteTemporaryFiles();
200 //QList<QToolBar*> getParaViewToolbars();
202 //! Create actions for ParaViS
203 void createActions();
205 //! Create menus for ParaViS
208 //! Load selected state
209 void loadSelectedState(bool toClear);
211 //! update macros state
216 void showHelpForProxy( const QString&, const QString& );
220 void endWaitCursor();
222 // void buildToolbarsMenu();
224 //void showParaViewHelp();
225 //void showHelp(const QString& url);
227 void onFinishedAddingServer(pqServer*);
228 void onDataRepresentationCreated(pqDataRepresentation*);
229 void onDataRepresentationUpdated();
230 void onVariableChanged(pqVariableType, const QString);
231 void onRepresentationChanged(pqRepresentation*);
233 void onStartProgress();
234 void onEndProgress();
236 void onRestartTrace();
238 void onNewParaViewWindow();
240 void onSaveMultiState();
242 void onCleanAddState();
248 virtual bool activateModule( SUIT_Study* );
249 virtual bool deactivateModule( SUIT_Study* );
250 virtual void onApplicationClosed( SUIT_Application* );
251 virtual void studyClosed( SUIT_Study* );
254 virtual void onModelOpened();
257 void timerEvent(QTimerEvent *event);
260 class pqImplementation;
261 pqImplementation* Implementation;
263 int mySelectionControlsTb;
266 int myToolbarsMenuId;
270 typedef QMap<QWidget*, bool> WgMap;
273 WgMap myToolbarBreaks;
274 QList<QMenu*> myMenus;
276 QStringList myTemporaryFiles;
278 QtMsgHandler myOldMsgHandler;
280 vtkEventQtSlotConnect *VTKConnect;
282 pqPythonScriptEditor* myTraceWindow;
286 static pqPVApplicationCore* MyCoreApp;
289 #endif // PVGUI_Module_H