1 // PARAVIS : ParaView wrapper SALOME module
3 // Copyright (C) 2010-2012 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>
40 class pqTabbedMultiViewWidget;
41 class pqMainWindowCore;
42 class vtkEventQtSlotConnect;
43 class pqPythonScriptEditor;
44 class pqPVApplicationCore;
47 class PVGUI_Module : public SalomeApp_Module
97 ManageCustomFiltersId,
101 ManagePluginsExtensionsId,
104 RecordTestScreenshotId,
118 // Menu "Window" - "New Window"
121 // "Save state" ParaVis module root object popup
124 // "Add state" and "Reload state" popups
126 CleanAndAddStatePopupId,
128 // "Rename" and "Delete" popups (Object Browser)
137 virtual void initialize( CAM_Application* );
138 virtual void windows( QMap<int, int>& ) const;
140 pqTabbedMultiViewWidget* getMultiViewManager() const;
142 virtual QString engineIOR() const;
144 void openFile(const char* theName);
145 void executeScript(const char *script);
146 void saveParaviewState(const char* theFileName);
147 void loadParaviewState(const char* theFileName);
148 void clearParaviewState();
150 QString getTraceString();
151 void saveTrace(const char* theName);
153 pqServer* getActiveServer();
155 virtual void createPreferences();
157 virtual void contextMenuPopup(const QString& theClient, QMenu* theMenu, QString& theTitle);
160 void onImportFromVisu(QString theEntry);
163 //! Initialize ParaView if not yet done (once per session)
164 static bool pvInit();
166 //! Create actions for ParaView GUI operations
167 void pvCreateActions();
169 //! Create menus for ParaView GUI operations duplicating menus in pqMainWindow ParaView class
170 void pvCreateMenus();
172 //! Create toolbars for ParaView GUI operations duplicating toolbars in pqMainWindow ParaView class
173 void pvCreateToolBars();
175 //! Create dock widgets for ParaView widgets
176 void setupDockWidgets();
178 //! Save states of dockable ParaView widgets
179 void saveDockWidgetsState();
181 //! Restore states of dockable ParaView widgets
182 void restoreDockWidgetsState();
184 //! Shows or hides ParaView view window
185 void showView( bool );
187 //! Returns QMenu object for a given menu id
188 QMenu* getMenu( const int );
190 //! Discover help project files from the resources.
191 QString getHelpFileName();
193 void deleteTemporaryFiles();
195 //QList<QToolBar*> getParaViewToolbars();
197 //! Create actions for ParaViS
198 void createActions();
200 //! Create menus for ParaViS
203 //! Load selected state
204 void loadSelectedState(bool toClear);
206 //! update macros state
211 void showHelpForProxy( const QString&, const QString& );
215 void endWaitCursor();
217 // void buildToolbarsMenu();
219 //void showParaViewHelp();
220 //void showHelp(const QString& url);
222 void onFinishedAddingServer(pqServer*);
224 void onStartProgress();
225 void onEndProgress();
228 void onNewParaViewWindow();
230 void onSaveMultiState();
232 void onCleanAddState();
238 virtual bool activateModule( SUIT_Study* );
239 virtual bool deactivateModule( SUIT_Study* );
240 virtual void onApplicationClosed( SUIT_Application* );
241 virtual void studyClosed( SUIT_Study* );
244 virtual void onModelOpened();
247 void timerEvent(QTimerEvent *event);
250 class pqImplementation;
251 pqImplementation* Implementation;
253 int mySelectionControlsTb;
256 int myToolbarsMenuId;
260 typedef QMap<QWidget*, bool> WgMap;
263 WgMap myToolbarBreaks;
265 QStringList myTemporaryFiles;
267 QtMsgHandler myOldMsgHandler;
269 vtkEventQtSlotConnect *VTKConnect;
271 pqPythonScriptEditor* myTraceWindow;
275 static pqPVApplicationCore* MyCoreApp;
278 #endif // PVGUI_Module_H