Salome HOME
Corrections for
[modules/paravis.git] / src / PVGUI / PVGUI_Module_actions.cxx
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_MenuActions.cxx
23 // Author : Margarita KARPUNINA
24 //
25
26 #include "PVGUI_Module_impl.h"
27
28 #include <QtxAction.h>
29 #include <QtxActionMenuMgr.h>
30 #include <QtxActionToolMgr.h>
31 #include <SUIT_Desktop.h>
32 #include <SUIT_ResourceMgr.h>
33 #include <SUIT_Session.h>
34 #include <LightApp_Application.h>
35
36 #include <QAction>
37 #include <QMenu>
38 #include <QToolBar>
39
40 #include <pqApplicationCore.h>
41 #include <pqColorScaleToolbar.h>
42 #include <pqMainWindowCore.h>
43 #include <pqObjectInspectorDriver.h>
44 #include <pqPipelineBrowser.h>
45 #include <pqProgressManager.h>
46 #include <pqRubberBandHelper.h>
47 #include <pqScalarBarVisibilityAdaptor.h>
48 #include <pqUndoStack.h>
49 #include <pqVCRController.h>
50
51 /*!
52   \brief Create actions for ParaView GUI operations
53   duplicating menus and toolbars in MainWindow class of
54   the standard ParaView GUI client application.
55 */
56 void PVGUI_Module::pvCreateActions()
57 {
58   SUIT_Desktop* desk = application()->desktop();
59   SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
60
61   QPixmap aPixmap;
62   QAction* anAction;
63   QtxAction* aQtxAction;
64   
65   // --- Menu "File"
66
67   // Open File
68   aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_OPEN_FILE"), false );
69   createAction( OpenFileId, tr("TOP_OPEN_FILE"), QIcon(aPixmap),
70                 tr("MEN_OPEN"), tr("STB_OPEN_FILE"), 
71                 0, desk, false, &Implementation->Core, SLOT( onFileOpen() ) );
72
73   // Load State
74   anAction = createAction( LoadStateId, tr("TOP_LOAD_STATE"), QIcon(),
75                            tr("MEN_LOAD_STATE"), tr("STB_LOAD_STATE"), 
76                            0, desk, false, &Implementation->Core, SLOT( onFileLoadServerState() ) );
77   connect( &Implementation->Core, SIGNAL( enableFileLoadServerState(bool) ),
78            anAction,              SLOT( setEnabled(bool) ) );
79
80   // Save State
81   anAction = createAction( SaveStateId, tr("TOP_SAVE_STATE"), QIcon(),
82                            tr("MEN_SAVE_STATE"), tr("STB_SAVE_STATE"), 
83                            0, desk, false, &Implementation->Core, SLOT( onFileSaveServerState() ) );
84   connect( &Implementation->Core, SIGNAL( enableFileSaveServerState(bool) ),
85            anAction,              SLOT( setEnabled(bool) ) );
86
87   // Save Data
88   aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_SAVE_DATA"), false );
89   anAction = createAction( SaveDataId, tr("TOP_SAVE_DATA"), QIcon(aPixmap),
90                            tr("MEN_SAVE_DATA"), tr("STB_SAVE_DATA"), 
91                            0, desk, false, &Implementation->Core, SLOT( onFileSaveData() ) );
92   connect( &Implementation->Core, SIGNAL( enableFileSaveData(bool) ),
93            anAction,              SLOT( setEnabled(bool) ) );
94
95   // Save Screenshot
96   aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_SAVE_SCREENSHOT"), false );
97   anAction = createAction( SaveScreenshotId, tr("TOP_SAVE_SCREENSHOT"), QIcon(aPixmap),
98                            tr("MEN_SAVE_SCREENSHOT"), tr("STB_SAVE_SCREENSHOT"), 
99                            0, desk, false, &Implementation->Core, SLOT( onFileSaveScreenshot() ) );
100   connect( &Implementation->Core, SIGNAL( enableFileSaveScreenshot(bool) ),
101            anAction,              SLOT( setEnabled(bool) ) );
102
103   // Export
104   anAction = createAction( ExportId, tr("TOP_EXPORT"), QIcon(),
105                            tr("MEN_EXPORT"), tr("STB_EXPORT"), 
106                            0, desk, false, &Implementation->Core, SLOT( onFileExport() ) );
107   connect( &Implementation->Core, SIGNAL( enableExport(bool) ),
108            anAction,              SLOT( setEnabled(bool) ) );
109
110   // Save Animation
111   aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_SAVE_ANIMATION"), false );
112   anAction = createAction( SaveAnimationId, tr("TOP_SAVE_ANIMATION"), QIcon(aPixmap),
113                            tr("MEN_SAVE_ANIMATION"), tr("STB_SAVE_ANIMATION"), 
114                            0, desk, false, &Implementation->Core, SLOT( onFileSaveAnimation() ) );
115   connect( &Implementation->Core, SIGNAL( enableFileSaveAnimation(bool) ),
116            anAction,              SLOT( setEnabled(bool) ) );
117
118   // Save Geometry
119   aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_SAVE_GEOMETRY"), false );
120   anAction = createAction( SaveGeometryId, tr("TOP_SAVE_GEOMETRY"), QIcon(aPixmap),
121                            tr("MEN_SAVE_GEOMETRY"), tr("STB_SAVE_GEOMETRY"), 
122                            0, desk, false, &Implementation->Core, SLOT( onSaveGeometry() ) );
123   connect( &Implementation->Core, SIGNAL( enableFileSaveGeometry(bool) ),
124            anAction,              SLOT( setEnabled(bool) ) );
125
126   // Connect
127   aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_CONNECT"), false );
128   anAction = createAction( ConnectId, tr("TOP_CONNECT"), QIcon(aPixmap),
129                            tr("MEN_CONNECT"), tr("STB_CONNECT"), 
130                            0, desk, false, &Implementation->Core, SLOT( onServerConnect() ) );
131   connect( &Implementation->Core, SIGNAL( enableServerConnect(bool) ),
132            anAction,              SLOT( setEnabled(bool) ) );
133
134   // Disconnect
135   aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_DISCONNECT"), false );
136   anAction = createAction( DisconnectId, tr("TOP_DISCONNECT"), QIcon(aPixmap),
137                            tr("MEN_DISCONNECT"), tr("STB_DISCONNECT"), 
138                            0, desk, false, &Implementation->Core, SLOT( onServerDisconnect() ) );
139   connect( &Implementation->Core, SIGNAL( enableServerDisconnect(bool) ),
140            anAction,              SLOT( setEnabled(bool) ) );
141
142   // --- Menu "Edit"
143
144   pqUndoStack* undoStack = Implementation->Core.getApplicationUndoStack();
145
146   // Undo
147   aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_UNDO"), false );
148   anAction = createAction( UndoId, tr("TOP_UNDO"), QIcon(aPixmap),
149                            tr("MEN_UNDO"), tr("STB_UNDO"), Qt::CTRL+Qt::Key_Z,
150                            desk, false, undoStack, SLOT( undo() ) );
151   connect( undoStack, SIGNAL( canUndoChanged(bool) ),
152            anAction,  SLOT( setEnabled(bool) ) );
153   connect( undoStack, SIGNAL( undoLabelChanged(const QString&) ),
154            this,      SLOT( onUndoLabel(const QString&) ) );
155   anAction->setEnabled( undoStack->canUndo() );
156   onUndoLabel(undoStack->undoLabel());
157
158   // Redo
159   aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_REDO"), false );
160   anAction = createAction( RedoId, tr("TOP_REDO"), QIcon(aPixmap),
161                            tr("MEN_REDO"), tr("STB_REDO"), Qt::CTRL+Qt::Key_Y,
162                            desk, false, undoStack, SLOT( redo() ) );
163   connect( undoStack, SIGNAL( canRedoChanged(bool) ),   
164            anAction,  SLOT( setEnabled(bool) ) );
165   connect( undoStack, SIGNAL( redoLabelChanged(const QString&) ),
166            this,      SLOT( onRedoLabel(const QString&) ) );
167   anAction->setEnabled( undoStack->canRedo() );
168   onRedoLabel(undoStack->redoLabel());
169
170   // Camera Undo
171   aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_CAMERA_UNDO"), false );
172   anAction = createAction( CameraUndoId, tr("TOP_CAMERA_UNDO"), QIcon(aPixmap),
173                            tr("MEN_CAMERA_UNDO"), tr("STB_CAMERA_UNDO"), Qt::CTRL+Qt::Key_C+Qt::Key_B,
174                            desk, false, &Implementation->Core, SLOT( onEditCameraUndo() ) );
175   connect( &Implementation->Core, SIGNAL( enableCameraUndo(bool) ),
176            anAction,              SLOT( setEnabled(bool) ) );
177   connect( &Implementation->Core, SIGNAL( cameraUndoLabel(const QString&) ),
178            this,                  SLOT( onCameraUndoLabel(const QString&) ) );
179   
180   // Camera Redo
181   aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_CAMERA_REDO"), false );
182   anAction = createAction( CameraRedoId, tr("TOP_CAMERA_REDO"), QIcon(aPixmap),
183                            tr("MEN_CAMERA_REDO"), tr("STB_CAMERA_REDO"), Qt::CTRL+Qt::Key_C+Qt::Key_F,
184                            desk, false, &Implementation->Core, SLOT( onEditCameraRedo() ) );
185   connect( &Implementation->Core, SIGNAL( enableCameraRedo(bool) ),
186            anAction,              SLOT( setEnabled(bool) ) );
187   connect( &Implementation->Core, SIGNAL( cameraRedoLabel(const QString&) ),
188            this,                  SLOT( onCameraRedoLabel(const QString&) ) );
189
190   pqPipelineBrowser* browser = Implementation->Core.pipelineBrowser();
191
192   // Change Input
193   createAction( ChangeInputId, tr("TOP_CHANGE_INPUT"), QIcon(),
194                 tr("MEN_CHANGE_INPUT"), tr("STB_CHANGE_INPUT"), 
195                 0, desk, false, browser, SLOT( changeInput() ) );
196
197   // Delete
198   createAction( DeleteId, tr("TOP_DELETE"), QIcon(),
199                 tr("MEN_DELETE"), tr("STB_DELETE"),
200                 0, desk, false, browser, SLOT( deleteSelected() ) );
201
202   // Delet All
203   createAction( DeleteAllId, tr("TOP_DELETE_ALL"), QIcon(),
204                 tr("MEN_DELETE_ALL"), tr("STB_DELETE_ALL"),
205                 0, desk, false, this, SLOT( onDeleteAll() ) );
206
207   // Interact
208   aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_INTERACT"), false );
209   anAction = createAction( InteractId, tr("TOP_INTERACT"), QIcon(aPixmap),
210                            tr("MEN_INTERACT"), tr("STB_INTERACT"), 0, desk, true,
211                            Implementation->Core.renderViewSelectionHelper(), SLOT( endSelection() ) );
212   anAction->setChecked( true ); ///!!!
213   connect( Implementation->Core.renderViewSelectionHelper(), SIGNAL( interactionModeChanged(bool) ),
214            anAction,                                         SLOT( setChecked(bool) ) );
215
216   // Select Cells On
217   aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_SELECT_CELLS_ON"), false );
218   anAction = createAction( SelectCellsOnId, tr("TOP_SELECT_CELLS_ON"), QIcon(aPixmap), 
219                            tr("MEN_SELECT_CELLS_ON"), tr("STB_SELECT_CELLS_ON"), Qt::Key_S, desk, true,
220                            Implementation->Core.renderViewSelectionHelper(), SLOT( beginSurfaceSelection() ) );
221   connect( Implementation->Core.renderViewSelectionHelper(), SIGNAL( enableSurfaceSelection(bool) ),
222            anAction,                                         SLOT( setEnabled(bool) ) );
223
224   // Select Points On
225   aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_SELECT_POINTS_ON"), false );
226   anAction = createAction( SelectPointsOnId, tr("TOP_SELECT_POINTS_ON"), QIcon(aPixmap), 
227                            tr("MEN_SELECT_POINTS_ON"), tr("STB_SELECT_POINTS_ON"), 0, desk, true,
228                            Implementation->Core.renderViewSelectionHelper(), SLOT( beginSurfacePointsSelection() ) );
229   connect( Implementation->Core.renderViewSelectionHelper(), SIGNAL( enableSurfacePointsSelection(bool) ),
230            anAction,                                         SLOT( setEnabled(bool) ) );
231   
232   // Select Cells Through
233   aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_SELECT_CELLS_THROUGH"), false );
234   anAction = createAction( SelectCellsThroughId, tr("TOP_SELECT_CELLS_THROUGH"), QIcon(aPixmap), 
235                            tr("MEN_SELECT_CELLS_THROUGH"), tr("STB_SELECT_CELLS_THROUGH"), 0, desk, true,
236                            Implementation->Core.renderViewSelectionHelper(), SLOT( beginFrustumSelection() ) );
237   connect( Implementation->Core.renderViewSelectionHelper(), SIGNAL( enableFrustumSelection(bool) ),
238            anAction,                                         SLOT( setEnabled(bool) ) );
239
240   // Select Points Through
241   aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_SELECT_POINTS_THROUGH"), false );
242   anAction = createAction( SelectPointsThroughId, tr("TOP_SELECT_POINTS_THROUGH"), QIcon(aPixmap), 
243                            tr("MEN_SELECT_POINTS_THROUGH"), tr("STB_SELECT_POINTS_THROUGH"), 0, desk, true,
244                            Implementation->Core.renderViewSelectionHelper(), SLOT( beginFrustumPointsSelection() ) );
245   connect( Implementation->Core.renderViewSelectionHelper(), SIGNAL( enableFrustumPointSelection(bool) ),
246            anAction,                                         SLOT( setEnabled(bool) ) );
247
248   // Select Block
249   aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_SELECT_BLOCK"), false );
250   anAction = createAction( SelectBlockId, tr("TOP_SELECT_BLOCK"), QIcon(aPixmap), 
251                            tr("MEN_SELECT_BLOCK"), tr("STB_SELECT_BLOCK"), Qt::Key_B, desk, true,
252                            Implementation->Core.renderViewSelectionHelper(), SLOT( beginBlockSelection() ) );
253   connect( Implementation->Core.renderViewSelectionHelper(), SIGNAL( enableBlockSelection(bool) ),
254            anAction,                                         SLOT( setEnabled(bool) ) );
255
256   // Create action group for exclusively selected modes
257   QActionGroup* aModeGroup = new QActionGroup( desk );
258   aModeGroup->addAction( action(InteractId) );
259   aModeGroup->addAction( action(SelectCellsOnId) );
260   aModeGroup->addAction( action(SelectPointsOnId) );
261   aModeGroup->addAction( action(SelectCellsThroughId) );
262   aModeGroup->addAction( action(SelectPointsThroughId) );
263   aModeGroup->addAction( action(SelectBlockId) );
264   
265   connect( Implementation->Core.renderViewSelectionHelper(), SIGNAL( selectionModeChanged(int) ),
266            this,                                             SLOT( onSelectionModeChanged(int) ) );
267   // When a selection is marked, we revert to interaction mode.
268   connect( Implementation->Core.renderViewSelectionHelper(), SIGNAL( selectionFinished(int, int, int, int) ),
269            Implementation->Core.renderViewSelectionHelper(), SLOT( endSelection() ) );
270
271   // Setting
272   createAction( SettingsId, tr("TOP_SETTINGS"), QIcon(),
273                 tr("MEN_SETTINGS"), tr("STB_SETTINGS"),
274                 0, desk, false, &Implementation->Core, SLOT( onEditSettings() ) );
275   
276   // View Settings
277   createAction( ViewSettingsId, tr("TOP_VIEW_SETTINGS"), QIcon(),
278                 tr("MEN_VIEW_SETTINGS"), tr("STB_VIEW_SETTINGS"),
279                 0, desk, false, &Implementation->Core, SLOT( onEditViewSettings() ) );
280
281   // --- Menu "View"
282
283   // Camera submenu -> Reset
284   aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_RESET_CAMERA"), false );
285   anAction = createAction( ResetCameraId, tr("TOP_RESET_CAMERA"), QIcon(aPixmap), 
286                            tr("MEN_RESET_CAMERA"), tr("STB_RESET_CAMERA"),
287                            0, desk, false, &Implementation->Core, SLOT( resetCamera() ) );
288   connect( &Implementation->Core, SIGNAL( enableFileSaveScreenshot(bool) ),
289            anAction,              SLOT( setEnabled(bool) ) );
290
291   // Camera submenu -> +X
292   aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_+X"), false );
293   anAction = createAction( PositiveXId, tr("TOP_+X"), QIcon(aPixmap), 
294                            tr("MEN_+X"), tr("STB_+X"),
295                            0, desk, false, &Implementation->Core, SLOT( resetViewDirectionPosX() ) );
296   connect( &Implementation->Core, SIGNAL( enableFileSaveScreenshot(bool) ),
297            anAction,              SLOT( setEnabled(bool) ) );
298
299   // Camera submenu -> -X
300   aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_-X"), false );
301   anAction = createAction( NegativeXId, tr("TOP_-X"), QIcon(aPixmap), 
302                            tr("MEN_-X"), tr("STB_-X"),
303                            0, desk, false, &Implementation->Core, SLOT( resetViewDirectionNegX() ) );
304   connect( &Implementation->Core, SIGNAL( enableFileSaveScreenshot(bool) ),
305            anAction,              SLOT( setEnabled(bool) ) );
306
307   // Camera submenu -> +Y
308   aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_+Y"), false );
309   anAction = createAction( PositiveYId, tr("TOP_+Y"), QIcon(aPixmap), 
310                            tr("MEN_+Y"), tr("STB_+Y"),
311                            0, desk, false, &Implementation->Core, SLOT( resetViewDirectionPosY() ) );
312   connect( &Implementation->Core, SIGNAL( enableFileSaveScreenshot(bool) ),
313            anAction,              SLOT( setEnabled(bool) ) );
314
315   // Camera submenu -> -Y
316   aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_-Y"), false );
317   anAction = createAction( NegativeYId, tr("TOP_-Y"), QIcon(aPixmap), 
318                            tr("MEN_-Y"), tr("STB_-Y"),
319                            0, desk, false, &Implementation->Core, SLOT( resetViewDirectionNegY() ) );
320   connect( &Implementation->Core, SIGNAL( enableFileSaveScreenshot(bool) ),
321            anAction,              SLOT( setEnabled(bool) ) );
322
323   // Camera submenu -> +Z
324   aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_+Z"), false );
325   anAction = createAction( PositiveZId, tr("TOP_+Z"), QIcon(aPixmap), 
326                            tr("MEN_+Z"), tr("STB_+Z"),
327                            0, desk, false, &Implementation->Core, SLOT( resetViewDirectionPosZ() ) );
328   connect( &Implementation->Core, SIGNAL( enableFileSaveScreenshot(bool) ),
329            anAction,              SLOT( setEnabled(bool) ) );
330
331   // Camera submenu -> -Z
332   aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_-Z"), false );
333   anAction = createAction( NegativeZId, tr("TOP_-Z"), QIcon(aPixmap), 
334                            tr("MEN_-Z"), tr("STB_-Z"),
335                            0, desk, false, &Implementation->Core, SLOT( resetViewDirectionNegZ() ) );
336   connect( &Implementation->Core, SIGNAL( enableFileSaveScreenshot(bool) ),
337            anAction,              SLOT( setEnabled(bool) ) );
338
339   // Show Center
340   aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_SHOW_CENTER"), false );
341   aQtxAction = new QtxAction( tr("TOP_SHOW_CENTER"), QIcon(aPixmap), 
342                               tr("MEN_SHOW_CENTER"), 0, desk );
343   aQtxAction->setStatusTip( tr( "PRP_APP_SHOW_CENTER" ) );
344   aQtxAction->setCheckable( true );
345   registerAction( ShowCenterId, aQtxAction );
346   connect( aQtxAction,            SIGNAL( toggled(bool) ),
347            &Implementation->Core, SLOT( setCenterAxesVisibility(bool) ) );
348   connect( &Implementation->Core, SIGNAL( enableShowCenterAxis(bool) ),
349            this,                  SLOT( onShowCenterAxisChanged(bool) ), Qt::QueuedConnection );
350
351   // Reset Center
352   aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_RESET_CENTER"), false );
353   anAction = createAction( ResetCenterId, tr("TOP_RESET_CENTER"), QIcon(aPixmap), 
354                            tr("MEN_RESET_CENTER"), tr("STB_RESET_CENTER"), 0, desk, false,
355                            &Implementation->Core, SLOT( resetCenterOfRotationToCenterOfCurrentData() ) );
356   connect( &Implementation->Core, SIGNAL( enableResetCenter(bool) ),
357            anAction,              SLOT( setEnabled(bool) ) );
358
359   // Pick Center
360   aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_PICK_CENTER"), false );
361   aQtxAction = new QtxAction( tr("TOP_PICK_CENTER"), QIcon(aPixmap), 
362                               tr("MEN_PICK_CENTER"), 0, desk );
363   aQtxAction->setStatusTip( tr( "PRP_APP_PICK_CENTER" ) );
364   aQtxAction->setCheckable( true );
365   registerAction( PickCenterId, aQtxAction );
366   connect( aQtxAction,            SIGNAL( toggled(bool) ),
367            &Implementation->Core, SLOT( pickCenterOfRotation(bool) ) );
368   connect( &Implementation->Core, SIGNAL( enablePickCenter(bool) ),
369            aQtxAction,            SLOT( setEnabled(bool) ) );
370   connect( &Implementation->Core, SIGNAL( pickingCenter(bool) ),
371            aQtxAction,            SLOT( setChecked(bool) ) );
372
373   // Show Color Legend
374   aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_SHOW_COLOR_LEGEND"), false );
375   aQtxAction = new QtxAction( tr("TOP_SHOW_COLOR_LEGEND"), QIcon(aPixmap), 
376                               tr("MEN_SHOW_COLOR_LEGEND"), 0, desk );
377   aQtxAction->setStatusTip( tr( "PRP_APP_SHOW_COLOR_LEGEND" ) );
378   aQtxAction->setCheckable( true );
379   aQtxAction->setEnabled(false);
380   registerAction( ShowColorLegendId, aQtxAction );
381   pqScalarBarVisibilityAdaptor* sbva = new pqScalarBarVisibilityAdaptor( aQtxAction );
382   connect( Implementation->Core.getObjectInspectorDriver(),
383            SIGNAL( representationChanged(pqDataRepresentation*, pqView*) ),
384            sbva,
385            SLOT( setActiveRepresentation(pqDataRepresentation*) ) );
386
387   // --- Menu "Sources" and "Filters"
388   // As ParaView is responsible for updating "Sources" and "Filters" menus,
389   // actions for these menus are created inside the pqMainWindowCore.
390   // So, the creation of corresponding QMenu object is in the PVGUI_Module::pvCreateMenus().
391
392   // --- Menu "Animation"
393
394   pqVCRController* vcrcontroller = &Implementation->Core.VCRController();
395
396   // First Frame
397   aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_FIRST_FRAME"), false );
398   anAction = createAction( FirstFrameId, tr("TOP_FIRST_FRAME"), QIcon(aPixmap), 
399                            tr("MEN_FIRST_FRAME"), tr("STB_FIRST_FRAME"),
400                            0, desk, false, vcrcontroller, SLOT( onFirstFrame() ) );
401   connect( vcrcontroller, SIGNAL( enabled(bool) ), anAction, SLOT( setEnabled(bool) ) );
402
403   // Previous Frame
404   aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_PREVIOUS_FRAME"), false );
405   anAction = createAction( PreviousFrameId, tr("TOP_PREVIOUS_FRAME"), QIcon(aPixmap), 
406                            tr("MEN_PREVIOUS_FRAME"), tr("STB_PREVIOUS_FRAME"),
407                            0, desk, false, vcrcontroller, SLOT( onPreviousFrame() ) );
408   connect( vcrcontroller, SIGNAL( enabled(bool) ), anAction, SLOT( setEnabled(bool) ) );
409
410   // Play
411   aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_PLAY"), false );
412   anAction = createAction( PlayId, tr("TOP_PLAY"), QIcon(aPixmap), 
413                            tr("MEN_PLAY"), tr("STB_PLAY"),
414                            0, desk, false, vcrcontroller, SLOT( onPlay() ) );
415   connect( vcrcontroller, SIGNAL( enabled(bool) ), anAction, SLOT( setEnabled(bool) ) );
416
417   // Next Frame
418   aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_NEXT_FRAME"), false );
419   anAction = createAction( NextFrameId, tr("TOP_NEXT_FRAME"), QIcon(aPixmap), 
420                            tr("MEN_NEXT_FRAME"), tr("STB_NEXT_FRAME"),
421                            0, desk, false, vcrcontroller, SLOT( onNextFrame() ) );
422   connect( vcrcontroller, SIGNAL( enabled(bool) ), anAction, SLOT( setEnabled(bool) ) );
423
424   // Last Frame
425   aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_LAST_FRAME"), false );
426   anAction = createAction( LastFrameId, tr("TOP_LAST_FRAME"), QIcon(aPixmap), 
427                            tr("MEN_LAST_FRAME"), tr("STB_LAST_FRAME"),
428                            0, desk, false, vcrcontroller, SLOT( onLastFrame() ) );
429   connect( vcrcontroller, SIGNAL( enabled(bool) ), anAction, SLOT( setEnabled(bool) ) );
430
431   // Loop
432   aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_LOOP"), false );
433   aQtxAction = new QtxAction( tr("TOP_LOOP"), QIcon(aPixmap), 
434                               tr("MEN_LOOP"), 0, desk );
435   aQtxAction->setStatusTip( tr( "PRP_APP_LOOP" ) );
436   aQtxAction->setCheckable(true);
437   registerAction( LoopId, aQtxAction );
438   connect( aQtxAction,    SIGNAL( toggled(bool) ), vcrcontroller, SLOT( onLoop(bool) ) );
439   connect( vcrcontroller, SIGNAL( enabled(bool) ), aQtxAction,    SLOT( setEnabled(bool) ) );
440   connect( vcrcontroller, SIGNAL( loop(bool) ),    aQtxAction,    SLOT( setChecked(bool) ) );
441
442   connect( vcrcontroller, SIGNAL( playing(bool) ), this, SLOT( onPlaying(bool) ) );
443   connect( vcrcontroller, SIGNAL( timeRanges(double, double) ),
444            this,          SLOT( setTimeRanges(double, double) ) );
445
446   // --- Menu "Tools"
447
448   // Create Custom Filter
449   createAction( CreateCustomFilterId, tr("TOP_CREATE_CUSTOM_FILTER"), QIcon(), 
450                 tr("MEN_CREATE_CUSTOM_FILTER"), tr("STB_CREATE_CUSTOM_FILTER"),
451                 0, desk, false, &Implementation->Core, SLOT( onToolsCreateCustomFilter() ) );
452   
453   // Manage Custom Filters
454   createAction( ManageCustomFiltersId, tr("TOP_MANAGE_CUSTOM_FILTERS"), QIcon(), 
455                 tr("MEN_MANAGE_CUSTOM_FILTERS"), tr("STB_MANAGE_CUSTOM_FILTERS"),
456                 0, desk, false, &Implementation->Core, SLOT( onToolsManageCustomFilters() ) );
457
458   // Create Lookmark
459   createAction( CreateLookmarkId, tr("TOP_CREATE_LOOKMARK"), QIcon(), 
460                 tr("MEN_CREATE_LOOKMARK"), tr("STB_CREATE_LOOKMARK"),
461                 0, desk, false, &Implementation->Core, SLOT( onToolsCreateLookmark() ) );
462
463   // Manage Links
464   createAction( ManageLinksId, tr("TOP_MANAGE_LINKS"), QIcon(), 
465                 tr("MEN_MANAGE_LINKS"), tr("STB_MANAGE_LINKS"),
466                 0, desk, false, &Implementation->Core, SLOT( onToolsManageLinks() ) );
467
468   // Add Camera Link
469   createAction( AddCameraLinkId, tr("TOP_ADD_CAMERA_LINK"), QIcon(), 
470                 tr("MEN_ADD_CAMERA_LINK"), tr("STB_ADD_CAMERA_LINK"),
471                 0, desk, false, this, SLOT( onAddCameraLink() ) );
472
473   // Manage Plugins/Extensions
474   createAction( ManagePluginsExtensionsId, tr( "TOP_MANAGE_PLUGINS" ), QIcon(),
475                 tr( "MEN_MANAGE_PLUGINS" ), tr( "STB_MANAGE_PLUGINS" ),
476                 0, desk, false, &Implementation->Core, SLOT( onManagePlugins() ) );
477
478   // Dump Widget Names
479   createAction( DumpWidgetNamesId, tr( "TOP_DUMP_WIDGET_NAMES" ), QIcon(),
480                 tr( "MEN_DUMP_WIDGET_NAMES" ), tr( "STB_DUMP_WIDGET_NAMES" ),
481                 0, desk, false, &Implementation->Core, SLOT( onToolsDumpWidgetNames() ) );
482
483   // Record Test
484   createAction( RecordTestId, tr( "TOP_RECORD_TEST" ), QIcon(),
485                 tr( "MEN_RECORD_TEST" ), tr( "STB_RECORD_TEST" ),
486                 0, desk, false, &Implementation->Core, SLOT( onToolsRecordTest() ) );
487
488   // Record Test Screenshot
489   createAction( RecordTestScreenshotId, tr( "TOP_RECORD_TEST_SCREENSHOT" ), QIcon(),
490                 tr( "MEN_RECORD_TEST_SCREENSHOT" ), tr( "STB_RECORD_TEST_SCREENSHOT" ),
491                 0, desk, false, &Implementation->Core, SLOT( onToolsRecordTestScreenshot() ) );
492   
493   // Play Test
494   createAction( PlayTestId, tr( "TOP_PLAY_TEST" ), QIcon(),
495                 tr( "MEN_PLAY_TEST" ), tr( "STB_PLAY_TEST" ),
496                 0, desk, false, &Implementation->Core, SLOT( onToolsPlayTest() ) );
497
498   // Max Window Size
499   aQtxAction = new QtxAction( tr("TOP_MAX_WINDOW_SIZE"), QIcon(), 
500                               tr("MEN_MAX_WINDOW_SIZE"), 0, desk );
501   aQtxAction->setStatusTip( tr( "PRP_APP_MAX_WINDOW_SIZE" ) );
502   aQtxAction->setCheckable(true);
503   registerAction( MaxWindowSizeId, aQtxAction );
504   connect( aQtxAction, SIGNAL( toggled(bool) ), &Implementation->Core, SLOT( enableTestingRenderWindowSize(bool) ) );
505
506   // Timer Log
507   createAction( TimerLogId, tr( "TOP_TIMER_LOG" ), QIcon(),
508                 tr( "MEN_TIMER_LOG" ), tr( "STB_TIMER_LOG" ),
509                 0, desk, false, &Implementation->Core, SLOT( onToolsTimerLog() ) );
510
511   // Output Window
512   createAction( OutputWindowId, tr( "TOP_OUTPUT_WINDOW" ), QIcon(),
513                 tr( "MEN_OUTPUT_WINDOW" ), tr( "STB_OUTPUT_WINDOW" ),
514                 0, desk, false, &Implementation->Core, SLOT( onToolsOutputWindow() ) );
515   
516   // Python Shell
517   createAction( PythonShellId, tr( "TOP_PYTHON_SHELL" ), QIcon(),
518                 tr( "MEN_PYTHON_SHELL" ), tr( "STB_PYTHON_SHELL" ),
519                 0, desk, false, &Implementation->Core, SLOT( onToolsPythonShell() ) );
520
521   // --- Menu "Help"
522
523   // About
524   createAction( AboutParaViewId, tr( "TOP_ABOUT" ), QIcon(),
525                 tr( "MEN_ABOUT" ), tr( "STB_ABOUT" ),
526                 0, desk, false, this, SLOT( onHelpAbout() ) );
527
528   // Native ParaView user documentation
529   aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_PARAVIEW_HELP"), false );
530   createAction( ParaViewHelpId, tr( "TOP_PARAVIEW_HELP" ), QIcon(aPixmap),
531                 tr( "MEN_PARAVIEW_HELP" ), tr( "STB_PARAVIEW_HELP" ),
532                 0, desk, false, this, SLOT( onParaViewHelp() ) );
533
534   // Enable Tooltips
535   aQtxAction = new QtxAction( tr("TOP_ENABLE_TOOLTIPS"), QIcon(), 
536                               tr("MEN_ENABLE_TOOLTIPS"), 0, desk );
537   aQtxAction->setStatusTip( tr( "PRP_APP_ENABLE_TOOLTIPS" ) );
538   aQtxAction->setCheckable(true);
539   aQtxAction->setChecked(true);
540   registerAction( EnableTooltipsId, aQtxAction );
541 }
542
543 /*!
544   \brief Create menus for ParaView GUI operations
545   duplicating menus in pqMainWindow ParaView class
546
547   In particular, ParaView is responsible for updating "Sources" and "Filters" menus. 
548   For this, specific menu managers created by pqMainWindowCore class are used, and PVGUI_Module
549   is responsible for creation of corresponding QMenu objects only.
550 */
551 void PVGUI_Module::pvCreateMenus()
552 {
553   // --- Menu "File"
554   int aPVMnu = createMenu( tr( "MEN_DESK_FILE" ), -1, -1 );
555
556   createMenu( OpenFileId, aPVMnu, 5 );
557
558   // Recent Files
559   int aMenuId = createMenu( tr( "MEN_RECENT_FILES" ), aPVMnu, -1, 5 );
560   QMenu* aMenu = menuMgr()->findMenu( aMenuId );
561   Implementation->RecentFilesMenu = new pqRecentFilesMenu( *aMenu, getApp()->desktop() );
562   connect( Implementation->RecentFilesMenu, SIGNAL( serverConnectFailed() ),
563            &Implementation->Core,           SLOT( makeDefaultConnectionIfNoneExists() ) );
564   QList<QAction*> anActns = aMenu->actions();
565   for (int i = 0; i < anActns.size(); ++i)
566     createMenu( anActns.at(i), aMenuId );
567
568
569   createMenu( separator(), aPVMnu, -1, 5 );
570
571   createMenu( LoadStateId, aPVMnu, 15 );
572   createMenu( SaveStateId, aPVMnu, 15 );
573   createMenu( separator(), aPVMnu, -1, 15 );
574
575   createMenu( SaveDataId, aPVMnu, 25 );
576   createMenu( SaveScreenshotId, aPVMnu, 25 );
577   createMenu( ExportId, aPVMnu, 25 );
578   createMenu( separator(), aPVMnu, -1, 25 );
579
580   createMenu( SaveAnimationId, aPVMnu, 35 );
581   createMenu( SaveGeometryId, aPVMnu, 35 );
582   createMenu( separator(), aPVMnu, -1, 35 );
583
584   createMenu( ConnectId, aPVMnu, 45 );
585   createMenu( DisconnectId, aPVMnu, 45 );
586   createMenu( separator(), aPVMnu, -1, 45 );
587
588   // --- Menu "Edit"
589   aPVMnu = createMenu( tr( "MEN_DESK_EDIT" ), -1, -1 );
590
591   createMenu( UndoId, aPVMnu );
592   createMenu( RedoId, aPVMnu );
593   createMenu( separator(), aPVMnu );
594
595   createMenu( CameraUndoId, aPVMnu );
596   createMenu( CameraRedoId, aPVMnu );
597   createMenu( separator(), aPVMnu );
598
599   createMenu( ChangeInputId, aPVMnu );
600   createMenu( DeleteId, aPVMnu );
601   createMenu( DeleteAllId, aPVMnu );
602   createMenu( separator(), aPVMnu );
603
604   createMenu( InteractId, aPVMnu );
605   createMenu( SelectCellsOnId, aPVMnu );
606   createMenu( SelectPointsOnId, aPVMnu );
607   createMenu( SelectCellsThroughId, aPVMnu );
608   createMenu( SelectPointsThroughId, aPVMnu );
609   createMenu( SelectBlockId, aPVMnu );
610   createMenu( separator(), aPVMnu );
611
612   createMenu( SettingsId, aPVMnu );
613   createMenu( ViewSettingsId, aPVMnu );
614   createMenu( separator(), aPVMnu );
615
616   // --- Menu "View"
617   aPVMnu = createMenu( tr( "MEN_DESK_VIEW" ), -1, -1 );
618
619   int aCameraMnu = createMenu( tr( "MEN_CAMERA" ), aPVMnu );
620   createMenu( ResetCameraId, aCameraMnu );
621   createMenu( PositiveXId, aCameraMnu );
622   createMenu( NegativeXId, aCameraMnu );
623   createMenu( PositiveYId, aCameraMnu );
624   createMenu( NegativeYId, aCameraMnu );
625   createMenu( PositiveZId, aCameraMnu );
626   createMenu( NegativeZId, aCameraMnu );
627   createMenu( separator(), aPVMnu );
628
629   createMenu( ShowCenterId, aPVMnu );
630   createMenu( ResetCenterId, aPVMnu );
631   createMenu( PickCenterId, aPVMnu );
632   createMenu( ShowColorLegendId, aPVMnu );
633   createMenu( separator(), aPVMnu );
634
635   // --- Menu "Sources"
636
637   // Install ParaView managers for "Sources" menu
638   QMenu* aRes = 0;
639   mySourcesMenuId = createMenu( tr( "MEN_DESK_SOURCES" ), -1, -1, 60 );
640   if ( (aRes = getMenu( mySourcesMenuId )) ) {
641     Implementation->Core.setSourceMenu( aRes );
642     connect( &Implementation->Core, SIGNAL( enableSourceCreate(bool) ),
643              aRes,                  SLOT( setEnabled(bool) ) );
644   }
645   
646   // --- Menu "Filters"
647
648   // Install ParaView managers for "Filters" menu
649   myFiltersMenuId = createMenu( tr( "MEN_DESK_FILTERS" ), -1, -1, 70 );
650   if ( (aRes = getMenu( myFiltersMenuId )) ) {
651     Implementation->Core.setFilterMenu( aRes );
652     connect( &Implementation->Core, SIGNAL( enableFilterCreate(bool) ),
653              aRes,                  SLOT( setEnabled(bool) ) );
654   }
655   
656   // --- Menu "Animation"
657   int anAnimationMnu = createMenu( tr( "MEN_DESK_ANIMATION" ), -1, -1, 80 );
658
659   createMenu( FirstFrameId, anAnimationMnu );
660   createMenu( PreviousFrameId, anAnimationMnu );
661   createMenu( PlayId, anAnimationMnu );
662   createMenu( NextFrameId, anAnimationMnu );
663   createMenu( LastFrameId, anAnimationMnu );
664   createMenu( LoopId, anAnimationMnu );
665
666   // --- Menu "Tools"
667
668   int aToolsMnu = createMenu( tr( "MEN_DESK_TOOLS" ), -1, -1, 90 );
669
670   createMenu( CreateCustomFilterId, aToolsMnu );
671   createMenu( ManageCustomFiltersId, aToolsMnu );
672   createMenu( CreateLookmarkId, aToolsMnu );
673   createMenu( ManageLinksId, aToolsMnu );
674   createMenu( AddCameraLinkId, aToolsMnu );
675   createMenu( ManagePluginsExtensionsId, aToolsMnu );
676   createMenu( separator(), aToolsMnu );
677
678   createMenu( DumpWidgetNamesId, aToolsMnu );
679   createMenu( RecordTestId, aToolsMnu );
680   createMenu( RecordTestScreenshotId, aToolsMnu );
681   createMenu( PlayTestId, aToolsMnu );
682   createMenu( MaxWindowSizeId, aToolsMnu );
683   createMenu( separator(), aToolsMnu );
684
685   createMenu( TimerLogId, aToolsMnu );
686   createMenu( OutputWindowId, aToolsMnu );
687   createMenu( separator(), aToolsMnu );
688   
689   createMenu( PythonShellId, aToolsMnu );
690
691   // --- Menu "Help"
692
693   int aHelpMnu = createMenu( tr( "MEN_DESK_HELP" ), -1, -1 );
694
695   createMenu( AboutParaViewId, aHelpMnu );
696   createMenu( ParaViewHelpId, aHelpMnu );
697   createMenu( separator(), aHelpMnu );
698   createMenu( EnableTooltipsId, aHelpMnu );
699
700 }
701
702 /*!
703   \brief Create toolbars for ParaView GUI operations
704   duplicating toolbars in pqMainWindow ParaView class
705 */
706 void PVGUI_Module::pvCreateToolBars()
707 {
708   SUIT_Desktop* desk = application()->desktop();
709   SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
710
711   QPixmap aPixmap;
712   QtxAction* aQtxAction;
713
714   // --- Toolbar "Main Controls"
715
716   int aToolId = createTool( tr("TOOL_MAIN_CONTROLS") );
717
718   createTool( OpenFileId, aToolId );
719   createTool( SaveDataId, aToolId );
720   createTool( separator(), aToolId );
721   createTool( ConnectId, aToolId );
722   createTool( DisconnectId, aToolId );
723   createTool( separator(), aToolId );
724   createTool( ParaViewHelpId, aToolId );
725
726   // --- Toolbar "Selection Controls"
727
728   mySelectionControlsTb = createTool( tr("TOOL_SELECTION_CONTROLS") );
729
730   createTool( InteractId, mySelectionControlsTb );
731   createTool( SelectCellsOnId, mySelectionControlsTb );
732   createTool( SelectPointsOnId, mySelectionControlsTb );
733   createTool( SelectCellsThroughId, mySelectionControlsTb );
734   createTool( SelectPointsThroughId, mySelectionControlsTb );
735   createTool( SelectBlockId, mySelectionControlsTb );
736
737   // --- Toolbar "Undo/Redo Controls"
738
739   aToolId = createTool( tr("TOOL_UNDOREDO_CONTROLS") );
740
741   createTool( UndoId, aToolId );
742   createTool( RedoId, aToolId );
743
744   // --- Toolbar "VCR Controls"
745
746   aToolId = createTool( tr("TOOL_VCR_CONTROLS") );
747
748   createTool( FirstFrameId, aToolId );
749   createTool( PreviousFrameId, aToolId );
750   createTool( PlayId, aToolId );
751   createTool( NextFrameId, aToolId );
752   createTool( LastFrameId, aToolId );
753   createTool( LoopId, aToolId );
754
755   pqProgressManager* progress_manager = pqApplicationCore::instance()->getProgressManager();
756   progress_manager->addNonBlockableObject( toolMgr()->toolBar( aToolId ) );
757
758   // --- Toolbar "Active Variable Controls"
759
760   aToolId = createTool( tr("TOOL_ACTIVE_VARIABLE_CONTROLS") );
761   QToolBar* aTB = toolMgr()->toolBar( aToolId );
762   
763   createTool( ShowColorLegendId, aToolId );
764
765   // To set up the color map tool buttons.
766   pqColorScaleToolbar* colorScale = Implementation->Core.getColorScaleEditorManager();
767
768   // Edit Color Map
769   aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_EDIT_COLOR_MAP"), false );
770   aQtxAction = new QtxAction( tr("TOP_EDIT_COLOR_MAP"), QIcon(aPixmap), 
771                               tr("MEN_EDIT_COLOR_MAP"), 0, desk );
772   aQtxAction->setStatusTip( tr( "PRP_APP_EDIT_COLOR_MAP" ) );
773   registerAction( EditColorMapId, aQtxAction );
774   connect( &Implementation->Core, SIGNAL( enableVariableToolbar(bool) ),
775            aQtxAction,            SLOT( setEnabled(bool) ) );
776   colorScale->setColorAction( aQtxAction ); /// !!!
777   createTool( EditColorMapId, aToolId );
778
779   // Reset Range
780   aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_RESET_RANGE"), false );
781   aQtxAction = new QtxAction( tr("TOP_RESET_RANGE"), QIcon(aPixmap), 
782                               tr("MEN_RESET_RANGE"), 0, desk );
783   aQtxAction->setStatusTip( tr( "PRP_APP_RESET_RANGE" ) );
784   registerAction( ResetRangeId, aQtxAction );
785   connect( &Implementation->Core, SIGNAL( enableVariableToolbar(bool) ),
786            aQtxAction,            SLOT( setEnabled(bool) ) );
787   colorScale->setRescaleAction( aQtxAction ); /// !!!
788   createTool( ResetRangeId, aToolId );
789
790   Implementation->Core.setupVariableToolbar(aTB);
791   QList<QAction*> anActns = aTB->actions();
792   for (int i = 0; i < anActns.size(); ++i)
793     if ( anActns.at(i) != action(ShowColorLegendId) ) {
794       createTool( anActns.at(i), aToolId );
795       connect( &Implementation->Core, SIGNAL( enableVariableToolbar(bool) ),
796                anActns.at(i),         SLOT( setEnabled(bool) ) );
797     }
798   
799   // --- Toolbar "Representation"
800
801   aToolId = createTool( tr("TOOL_REPRESENTATION") );
802   aTB = toolMgr()->toolBar( aToolId );
803
804   Implementation->Core.setupRepresentationToolbar(aTB);
805   anActns = aTB->actions();
806   for (int i = 0; i < anActns.size(); ++i) {
807     createTool( anActns.at(i), aToolId );
808     connect( &Implementation->Core, SIGNAL( enableVariableToolbar(bool) ),
809              anActns.at(i),         SLOT( setEnabled(bool) ) );
810   }
811
812   // --- Toolbar "Camera Controls"
813
814   aToolId = createTool( tr("TOOL_CAMERA_CONTROLS") );
815   
816   createTool( ResetCameraId, aToolId );
817   createTool( PositiveXId, aToolId );
818   createTool( NegativeXId, aToolId );
819   createTool( PositiveYId, aToolId );
820   createTool( NegativeYId, aToolId );
821   createTool( PositiveZId, aToolId );
822   createTool( NegativeZId, aToolId );
823
824   // --- Toolbar "Center Axes Controls"
825
826   aToolId = createTool( tr("TOOL_CENTER_AXES_CONTROLS") );
827
828   createTool( ShowCenterId, aToolId );
829   createTool( ResetCenterId, aToolId );
830   createTool( PickCenterId, aToolId );
831
832   // --- Toolbar "Common Filters"
833
834   aToolId = createTool( tr("TOOL_COMMON_FILTERS") );
835   aTB = toolMgr()->toolBar( aToolId );
836
837   Implementation->Core.setupCommonFiltersToolbar(aTB);
838   anActns = aTB->actions();
839   for (int i = 0; i < anActns.size(); ++i)
840     createTool( anActns.at(i), aToolId );
841  
842   // --- Toolbar "Lookmarks"
843
844   aToolId = createTool( tr("TOOL_LOOKMARKS") );
845   aTB = toolMgr()->toolBar(aToolId);
846
847   aTB->setContextMenuPolicy(Qt::CustomContextMenu);
848   aTB->setOrientation(Qt::Vertical);
849   aTB->setAllowedAreas(Qt::RightToolBarArea);
850   toolMgr()->mainWindow()->addToolBar(Qt::RightToolBarArea,aTB);
851   Implementation->Core.setupLookmarkToolbar(aTB);
852 }
853
854 /*!
855   \brief Returns QMenu by its id.
856 */
857 QMenu* PVGUI_Module::getMenu( const int id )
858 {
859   QMenu* res = 0;
860   LightApp_Application* anApp = getApp();
861   SUIT_Desktop* desk = anApp->desktop();
862   if ( desk ){
863     QtxActionMenuMgr* menuMgr = desk->menuMgr();
864     res = menuMgr->findMenu( id );
865   }
866   return res;
867 }