]> SALOME platform Git repositories - modules/paravis.git/blob - src/PVGUI/PVGUI_Module.h
Salome HOME
A sample of how to insert links into the main doc page to files, classes, functions...
[modules/paravis.git] / src / PVGUI / PVGUI_Module.h
1 // PARAVIS : ParaView wrapper SALOME module
2 //
3 // Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 // File   : PVGUI_Module.h
23 // Author : Sergey ANIKIN
24 //
25
26 /*!
27   \mainpage
28
29   Insert the content of introduction page here.
30
31   A link to the file documentation PVGUI_Module_actions.cxx
32
33   A link to the file documentation PVGUI_Module_impl.h
34
35   A link to the class documentation PVGUI_Module
36
37   The class name as a text (not a link to its documentation) %PVGUI_Module
38
39   A link to the constructor of the class PVGUI_ViewWindow#PVGUI_ViewWindow or PVGUI_Module::PVGUI_Module()
40
41   A link to the destructor of the class PVGUI_ViewWindow#~PVGUI_ViewWindow
42
43   A link to the member function PVGUI_ViewWindow::getVisualParameters or PVGUI_ViewWindow#getVisualParameters
44
45   Arguments of a function should be specified only for the overloaded functions PVGUI_Module::initialize(CAM_Application*)
46
47   A link to some enumeration values PVGUI_Module::OpenFileId and PVGUI_Module::CreateLookmarkId
48
49   A link to a protected member variable of the class PVGUI_ViewWindow#myModel
50
51   A link to a variable \link PVGUI_ViewWindow#myModel using another text\endlink as a link
52
53 */
54
55 #ifndef PVGUI_Module_H
56 #define PVGUI_Module_H
57
58 #include <LightApp_Module.h>
59
60 #include <ostream.h>
61
62 class QMenu;
63 class QDockWidget;
64 class LightApp_Selection;
65 class LightApp_SelectionMgr;
66 class PVGUI_ProcessModuleHelper;
67 class vtkPVMain;
68 class pqOptions;
69 class pqServer;
70 class pqActiveServer;
71 class pqViewManager;
72
73 class PVGUI_Module : public LightApp_Module
74 {
75   Q_OBJECT
76    
77   //! Menu actions
78   enum { // Menu "File"
79          OpenFileId,
80
81          LoadStateId,
82          SaveStateId,
83
84          SaveDataId,
85          SaveScreenshotId,
86          ExportId,
87
88          SaveAnimationId,
89          SaveGeometryId,
90
91          ConnectId,
92          DisconnectId,
93
94          // Menu "Edit"
95          UndoId,
96          RedoId,
97
98          CameraUndoId,
99          CameraRedoId,
100
101          ChangeInputId,
102          DeleteId,
103          DeleteAllId,
104
105          InteractId,
106          SelectCellsOnId,
107          SelectPointsOnId,
108          SelectCellsThroughId,
109          SelectPointsThroughId,
110          SelectBlockId,
111
112          SettingsId,
113          ViewSettingsId,
114
115          // Menu "View"
116          ResetCameraId,
117          PositiveXId,
118          NegativeXId,
119          PositiveYId,
120          NegativeYId,
121          PositiveZId,
122          NegativeZId,
123
124          ShowCenterId,
125          ResetCenterId,
126          PickCenterId,
127          ShowColorLegendId,
128          EditColorMapId,
129          ResetRangeId,
130
131          AnimationInspectorId,
132          AnimationViewId,
133          ComparativeViewInspectorId,
134          SelectionInspectorId,
135          LookmarkBrowserId,
136          LookmarkInspectorId,
137          ObjectInspectorId,
138          PipelineBrowserId,
139          StatisticsViewId,
140
141          // Menu "Sources"
142          // TODO...
143
144          // Menu "Filters"
145          // TODO...
146
147          // Menu "Animation"
148          FirstFrameId,
149          PreviousFrameId,
150          PlayId,
151          NextFrameId,
152          LastFrameId,
153          LoopId,
154
155          // Menu "Tools" 
156          CreateCustomFilterId,
157          ManageCustomFiltersId,
158          CreateLookmarkId,
159          ManageLinksId,
160          AddCameraLinkId,
161          ManagePluginsExtensionsId,
162          DumpWidgetNamesId,
163          RecordTestId,
164          RecordTestScreenshotId,
165          PlayTestId,
166          MaxWindowSizeId,
167          TimerLogId,
168          OutputWindowId,
169          PythonShellId,
170
171          // Menu "Help" 
172          AboutParaViewId,
173          ParaViewHelpId,
174          EnableTooltipsId
175
176          /*
177          lgLoadFile = 931,   //!< load text file
178          lgSaveFile,         //!< save text file
179          lgDisplayLine,      //!< display selected line
180          lgEraseLine,        //!< erase selected line
181          lgEditLine,         //!< edit selected line
182          lgAddLine,          //!< insert new line
183          lgDelLine,          //!< delete selected line
184          lgClear             //!< clear all contents
185          */
186   };
187
188 public:
189   PVGUI_Module();
190   ~PVGUI_Module();
191
192   virtual void           initialize( CAM_Application* );
193   virtual void           windows( QMap<int, int>& ) const;
194
195   //virtual LightApp_Selection* createSelection() const;
196
197   pqViewManager*         getMultiViewManager() const;
198
199   virtual bool           eventFilter( QObject*, QEvent* );
200
201   //! Compares the contents of the window with the given reference image, returns true if they "match" within some tolerance
202   bool                   compareView( const QString& ReferenceImage, double Threshold,
203                                       ostream& Output, const QString& TempDirectory );
204
205 protected:
206   //virtual CAM_DataModel* createDataModel();
207
208 private:
209   //! Initialize ParaView if not yet done (once per session)
210   static bool            pvInit();  
211   //! Shutdown ParaView, should be called on application exit
212   static void            pvShutdown();   
213  
214   //! Create actions for ParaView GUI operations
215   void                   pvCreateActions();
216
217   //! Create menus for ParaView GUI operations
218   //! duplicating menus in pqMainWindow ParaView class
219   void                   pvCreateMenus();
220
221   //! Create toolbars for ParaView GUI operations
222   //! duplicating toolbars in pqMainWindow ParaView class
223   void                   pvCreateToolBars();
224
225   //! Create dock widgets for ParaView widgets
226   void                   setupDockWidgets();
227
228   //! Create dock widgets context menus
229   void                   setupDockWidgetsContextMenu();
230
231   //! Save states of dockable ParaView widgets
232   void                   saveDockWidgetsState();
233
234   //! Restore states of dockable ParaView widgets
235   void                   restoreDockWidgetsState();
236
237   //! Shows or hides ParaView view window
238   void                   showView( bool );    
239
240   //! Returns QMenu object for a given menu id
241   QMenu*                 getMenu( const int );
242
243 private slots:
244   void onUndoLabel( const QString& );
245   void onRedoLabel( const QString& );
246   
247   void onCameraUndoLabel( const QString& );
248   void onCameraRedoLabel( const QString& );
249
250   void onDeleteAll();
251
252   void onSelectionModeChanged( int mode );
253
254   void onShowCenterAxisChanged( bool );
255
256   void setTimeRanges( double, double );
257
258   void onPlaying( bool );
259   
260   void onAddCameraLink();
261   
262   void onHelpAbout();
263
264   void showHelpForProxy( const QString& proxy );
265   void makeAssistant();
266   void assistantError( const QString& err );
267   
268   void onPreAccept();
269   void onPostAccept();
270   void endWaitCursor();
271
272 public slots:
273   virtual bool           activateModule( SUIT_Study* );
274   virtual bool           deactivateModule( SUIT_Study* );
275
276 private:
277   class pqImplementation;
278   pqImplementation*      Implementation;
279
280   int                    mySelectionControlsTb;
281   int                    mySourcesMenuId;
282   int                    myFiltersMenuId;
283
284   QList<QDockWidget*>    myDockWidgets;
285 };
286
287 #endif // PVGUI_Module_H