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>
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,
122 // Menu "Window" - "New Window"
125 // "Save state" ParaVis module root object popup
128 // "Add state" and "Reload state" popups
130 CleanAndAddStatePopupId,
132 // "Rename" and "Delete" popups (Object Browser)
141 virtual void initialize( CAM_Application* );
142 virtual void windows( QMap<int, int>& ) const;
144 pqTabbedMultiViewWidget* getMultiViewManager() const;
146 virtual QString engineIOR() const;
148 void openFile(const char* theName);
149 void executeScript(const char *script);
150 void saveParaviewState(const char* theFileName);
151 void loadParaviewState(const char* theFileName);
152 void clearParaviewState();
154 QString getTraceString();
155 void saveTrace(const char* theName);
157 pqServer* getActiveServer();
159 virtual void createPreferences();
161 virtual void contextMenuPopup(const QString& theClient, QMenu* theMenu, QString& theTitle);
164 void onImportFromVisu(QString theEntry);
167 //! Initialize ParaView if not yet done (once per session)
168 static bool pvInit();
170 //! Create actions for ParaView GUI operations
171 void pvCreateActions();
173 //! Create menus for ParaView GUI operations duplicating menus in pqMainWindow ParaView class
174 void pvCreateMenus();
176 //! Create toolbars for ParaView GUI operations duplicating toolbars in pqMainWindow ParaView class
177 void pvCreateToolBars();
179 //! Create dock widgets for ParaView widgets
180 void setupDockWidgets();
182 //! Save states of dockable ParaView widgets
183 void saveDockWidgetsState();
185 //! Restore states of dockable ParaView widgets
186 void restoreDockWidgetsState();
188 //! Shows or hides ParaView view window
189 void showView( bool );
191 //! Returns QMenu object for a given menu id
192 QMenu* getMenu( const int );
194 //! Discover help project files from the resources.
195 QString getHelpFileName();
197 void deleteTemporaryFiles();
199 //QList<QToolBar*> getParaViewToolbars();
201 //! Create actions for ParaViS
202 void createActions();
204 //! Create menus for ParaViS
207 //! Load selected state
208 void loadSelectedState(bool toClear);
210 //! update macros state
215 void showHelpForProxy( const QString&, const QString& );
219 void endWaitCursor();
221 // void buildToolbarsMenu();
223 //void showParaViewHelp();
224 //void showHelp(const QString& url);
226 void onFinishedAddingServer(pqServer*);
227 void onDataRepresentationCreated(pqDataRepresentation*);
228 void onVariableChanged(pqVariableType, const QString);
229 void onRepresentationChanged(pqRepresentation*);
231 void onStartProgress();
232 void onEndProgress();
235 void onNewParaViewWindow();
237 void onSaveMultiState();
239 void onCleanAddState();
245 virtual bool activateModule( SUIT_Study* );
246 virtual bool deactivateModule( SUIT_Study* );
247 virtual void onApplicationClosed( SUIT_Application* );
248 virtual void studyClosed( SUIT_Study* );
251 virtual void onModelOpened();
254 void timerEvent(QTimerEvent *event);
257 class pqImplementation;
258 pqImplementation* Implementation;
260 int mySelectionControlsTb;
263 int myToolbarsMenuId;
267 typedef QMap<QWidget*, bool> WgMap;
270 WgMap myToolbarBreaks;
272 QStringList myTemporaryFiles;
274 QtMsgHandler myOldMsgHandler;
276 vtkEventQtSlotConnect *VTKConnect;
278 pqPythonScriptEditor* myTraceWindow;
282 static pqPVApplicationCore* MyCoreApp;
285 #endif // PVGUI_Module_H