Salome HOME
Pipeline Browser popups, ACtive Variable Controls toolbar, Loomarl toolbar, QtAssista...
[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 #ifndef PVGUI_Module_H
27 #define PVGUI_Module_H
28
29 #include <LightApp_Module.h>
30
31 class QMenu;
32 class LightApp_Selection;
33 class LightApp_SelectionMgr;
34 class PVGUI_ProcessModuleHelper;
35 class vtkPVMain;
36 class pqOptions;
37 class pqServer;
38 class pqActiveServer;
39 class pqViewManager;
40
41 class PVGUI_Module : public LightApp_Module
42 {
43   Q_OBJECT
44    
45   //! Menu actions
46   enum { // Menu "File"
47          OpenFileId,
48
49          LoadStateId,
50          SaveStateId,
51
52          SaveDataId,
53          SaveScreenshotId,
54          ExportId,
55
56          SaveAnimationId,
57          SaveGeometryId,
58
59          ConnectId,
60          DisconnectId,
61
62          // Menu "Edit"
63          UndoId,
64          RedoId,
65
66          CameraUndoId,
67          CameraRedoId,
68
69          ChangeInputId,
70          DeleteId,
71          DeleteAllId,
72
73          InteractId,
74          SelectCellsOnId,
75          SelectPointsOnId,
76          SelectCellsThroughId,
77          SelectPointsThroughId,
78          SelectBlockId,
79
80          SettingsId,
81          ViewSettingsId,
82
83          // Menu "View"
84          ResetCameraId,
85          PositiveXId,
86          NegativeXId,
87          PositiveYId,
88          NegativeYId,
89          PositiveZId,
90          NegativeZId,
91
92          ShowCenterId,
93          ResetCenterId,
94          PickCenterId,
95          ShowColorLegendId,
96          EditColorMapId,
97          ResetRangeId,
98
99          AnimationInspectorId,
100          AnimationViewId,
101          ComparativeViewInspectorId,
102          SelectionInspectorId,
103          LookmarkBrowserId,
104          LookmarkInspectorId,
105          ObjectInspectorId,
106          PipelineBrowserId,
107          StatisticsViewId,
108
109          // Menu "Sources"
110          // TODO...
111
112          // Menu "Filters"
113          // TODO...
114
115          // Menu "Animation"
116          FirstFrameId,
117          PreviousFrameId,
118          PlayId,
119          NextFrameId,
120          LastFrameId,
121          LoopId,
122
123          // Menu "Tools" 
124          CreateCustomFilterId,
125          ManageCustomFiltersId,
126          CreateLookmarkId,
127          ManageLinksId,
128          AddCameraLinkId,
129          ManagePluginsExtensionsId,
130          DumpWidgetNamesId,
131          RecordTestId,
132          RecordTestScreenshotId,
133          PlayTestId,
134          MaxWindowSizeId,
135          TimerLogId,
136          OutputWindowId,
137          PythonShellId,
138
139          // Menu "Help" 
140          AboutParaViewId,
141          ParaViewHelpId,
142          EnableTooltipsId
143
144          /*
145          lgLoadFile = 931,   //!< load text file
146          lgSaveFile,         //!< save text file
147          lgDisplayLine,      //!< display selected line
148          lgEraseLine,        //!< erase selected line
149          lgEditLine,         //!< edit selected line
150          lgAddLine,          //!< insert new line
151          lgDelLine,          //!< delete selected line
152          lgClear             //!< clear all contents
153          */
154   };
155
156 public:
157   PVGUI_Module();
158   ~PVGUI_Module();
159
160   virtual void           initialize( CAM_Application* );
161   virtual void           windows( QMap<int, int>& ) const;
162
163   //virtual LightApp_Selection* createSelection() const;
164
165   pqViewManager*         getMultiViewManager() const;
166
167 protected:
168   //virtual CAM_DataModel* createDataModel();
169
170 private:
171   //! Initialize ParaView if not yet done (once per session)
172   static bool            pvInit();  
173   //! Shutdown ParaView, should be called on application exit
174   static void            pvShutdown();   
175  
176   //! Create actions for ParaView GUI operations
177   //! duplicating menus and toolbars in pqMainWindow ParaView class
178   void                   pvCreateActions();
179
180   //! Create menus for ParaView GUI operations
181   //! duplicating menus in pqMainWindow ParaView class
182   void                   pvCreateMenus();
183
184   //! Create toolbars for ParaView GUI operations
185   //! duplicating toolbars in pqMainWindow ParaView class
186   void                   pvCreateToolBars();
187
188   //! Create dock widgets for ParaView widgets
189   void                   setupDockWidgets();
190
191   //! Create dock widgets context menus
192   void                   setupDockWidgetsContextMenu();
193
194   //! Shows or hides ParaView view window
195   void                   showView( bool );    
196
197   //! Returns QMenu object for a given menu id
198   QMenu*                 getMenu( const int );
199
200 private slots:
201   void onUndoLabel( const QString& );
202   void onRedoLabel( const QString& );
203   
204   void onCameraUndoLabel( const QString& );
205   void onCameraRedoLabel( const QString& );
206
207   void onDeleteAll();
208
209   void onSelectionModeChanged( int mode );
210
211   void onShowCenterAxisChanged( bool );
212
213   void setTimeRanges( double, double );
214
215   void onPlaying( bool );
216   
217   void onAddCameraLink();
218   
219   void onHelpAbout();
220
221   void showHelpForProxy( const QString& proxy );
222   void makeAssistant();
223   void assistantError( const QString& err );
224   
225   void onPreAccept();
226   void onPostAccept();
227   void endWaitCursor();
228
229 public slots:
230   virtual bool           activateModule( SUIT_Study* );
231   virtual bool           deactivateModule( SUIT_Study* );
232
233 private:
234   class pqImplementation;
235   pqImplementation*      Implementation;
236
237   int                    mySelectionControlsTb;
238 };
239
240 #endif // PVGUI_Module_H