+ QtxAction* anAction;
+ QtxActionToolMgr* mgr = toolMgr();
+
+ // Dump view
+ anAction = new QtxAction(tr("MNU_DUMP_VIEW"),
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_DUMP" ) ),
+ tr( "MNU_DUMP_VIEW" ), 0, this);
+ anAction->setStatusTip(tr("DSC_DUMP_VIEW"));
+ connect(anAction, SIGNAL(triggered()), this, SLOT(onDumpView()));
+ mgr->registerAction( anAction, DumpId );
+
+ // FitAll
+ anAction = new QtxAction(tr("MNU_FITALL"),
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_FITALL" ) ),
+ tr( "MNU_FITALL" ), 0, this);
+ anAction->setStatusTip(tr("DSC_FITALL"));
+ connect(anAction, SIGNAL(triggered()), this, SLOT(onFitAll()));
+ mgr->registerAction( anAction, FitAllId );
+
+ // FitRect
+ anAction = new QtxAction(tr("MNU_FITRECT"),
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_FITAREA" ) ),
+ tr( "MNU_FITRECT" ), 0, this);
+ anAction->setStatusTip(tr("DSC_FITRECT"));
+ connect(anAction, SIGNAL(triggered()), this, SLOT(activateWindowFit()));
+ mgr->registerAction( anAction, FitRectId );
+
+ // FitSelection
+ anAction = new QtxAction(tr("MNU_FITSELECTION"),
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_FITSELECTION" ) ),
+ tr( "MNU_FITSELECTION" ), 0, this);
+ anAction->setStatusTip(tr("DSC_FITSELECTION"));
+ connect(anAction, SIGNAL(triggered()), this, SLOT(onFitSelection()));
+ mgr->registerAction( anAction, FitSelectionId );
+
+ // Zoom
+ anAction = new QtxAction(tr("MNU_ZOOM_VIEW"),
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_ZOOM" ) ),
+ tr( "MNU_ZOOM_VIEW" ), 0, this);
+ anAction->setStatusTip(tr("DSC_ZOOM_VIEW"));
+ connect(anAction, SIGNAL(triggered()), this, SLOT(activateZoom()));
+ mgr->registerAction( anAction, ZoomId );
+
+ // Panning
+ anAction = new QtxAction(tr("MNU_PAN_VIEW"),
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_PAN" ) ),
+ tr( "MNU_PAN_VIEW" ), 0, this);
+ anAction->setStatusTip(tr("DSC_PAN_VIEW"));
+ connect(anAction, SIGNAL(triggered()), this, SLOT(activatePanning()));
+ mgr->registerAction( anAction, PanId );
+
+ // Global Panning
+ anAction = new QtxAction(tr("MNU_GLOBALPAN_VIEW"),
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_GLOBALPAN" ) ),
+ tr( "MNU_GLOBALPAN_VIEW" ), 0, this);
+ anAction->setStatusTip(tr("DSC_GLOBALPAN_VIEW"));
+ connect(anAction, SIGNAL(triggered()), this, SLOT(activateGlobalPanning()));
+ mgr->registerAction( anAction, GlobalPanId );
+
+ // Change rotation point
+ anAction = new QtxAction(tr("MNU_CHANGINGROTATIONPOINT_VIEW"),
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_ROTATION_POINT" ) ),
+ tr( "MNU_CHANGINGROTATIONPOINT_VIEW" ), 0, this);
+ anAction->setStatusTip(tr("DSC_CHANGINGROTATIONPOINT_VIEW"));
+ anAction->setCheckable(true);
+ connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onChangeRotationPoint(bool)));
+ mgr->registerAction( anAction, ChangeRotationPointId );
+
+ // Rotation
+ anAction = new QtxAction(tr("MNU_ROTATE_VIEW"),
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_ROTATE" ) ),
+ tr( "MNU_ROTATE_VIEW" ), 0, this);
+ anAction->setStatusTip(tr("DSC_ROTATE_VIEW"));
+ connect(anAction, SIGNAL(triggered()), this, SLOT(activateRotation()));
+ mgr->registerAction( anAction, RotationId );
+
+ // Projections
+ anAction = new QtxAction(tr("MNU_FRONT_VIEW"),
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_FRONT" ) ),
+ tr( "MNU_FRONT_VIEW" ), 0, this, false, "Viewers:Front view");
+ anAction->setStatusTip(tr("DSC_FRONT_VIEW"));
+ connect(anAction, SIGNAL(triggered()), this, SLOT(onFrontView()));
+ this->addAction(anAction);
+ mgr->registerAction( anAction, FrontId );
+
+ anAction = new QtxAction(tr("MNU_BACK_VIEW"),
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_BACK" ) ),
+ tr( "MNU_BACK_VIEW" ), 0, this, false, "Viewers:Back view");
+ anAction->setStatusTip(tr("DSC_BACK_VIEW"));
+ connect(anAction, SIGNAL(triggered()), this, SLOT(onBackView()));
+ this->addAction(anAction);
+ mgr->registerAction( anAction, BackId );
+
+ anAction = new QtxAction(tr("MNU_TOP_VIEW"),
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_TOP" ) ),
+ tr( "MNU_TOP_VIEW" ), 0, this, false, "Viewers:Top view");
+ anAction->setStatusTip(tr("DSC_TOP_VIEW"));
+ connect(anAction, SIGNAL(triggered()), this, SLOT(onTopView()));
+ this->addAction(anAction);
+ mgr->registerAction( anAction, TopId );
+
+ anAction = new QtxAction(tr("MNU_BOTTOM_VIEW"),
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_BOTTOM" ) ),
+ tr( "MNU_BOTTOM_VIEW" ), 0, this, false, "Viewers:Bottom view");
+ anAction->setStatusTip(tr("DSC_BOTTOM_VIEW"));
+ connect(anAction, SIGNAL(triggered()), this, SLOT(onBottomView()));
+ this->addAction(anAction);
+ mgr->registerAction( anAction, BottomId );
+
+ anAction = new QtxAction(tr("MNU_LEFT_VIEW"),
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_LEFT" ) ),
+ tr( "MNU_LEFT_VIEW" ), 0, this, false, "Viewers:Left view");
+ anAction->setStatusTip(tr("DSC_LEFT_VIEW"));
+ connect(anAction, SIGNAL(triggered()), this, SLOT(onLeftView()));
+ this->addAction(anAction);
+ mgr->registerAction( anAction, LeftId );
+
+ anAction = new QtxAction(tr("MNU_RIGHT_VIEW"),
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_RIGHT" ) ),
+ tr( "MNU_RIGHT_VIEW" ), 0, this, false, "Viewers:Right view");
+ anAction->setStatusTip(tr("DSC_RIGHT_VIEW"));
+ connect(anAction, SIGNAL(triggered()), this, SLOT(onRightView()));
+ this->addAction(anAction);
+ mgr->registerAction( anAction, RightId );
+
+ // rotate anticlockwise
+ anAction = new QtxAction(tr("MNU_ANTICLOCKWISE_VIEW"),
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_ANTICLOCKWISE" ) ),
+ tr( "MNU_ANTICLOCKWISE_VIEW" ), 0, this, false, "Viewers:Rotate anticlockwise");
+ anAction->setStatusTip(tr("DSC_ANTICLOCKWISE_VIEW"));
+ connect(anAction, SIGNAL(triggered()), this, SLOT(onAntiClockWiseView()));
+ this->addAction(anAction);
+ mgr->registerAction( anAction, AntiClockWiseId );
+
+ // rotate clockwise
+ anAction = new QtxAction(tr("MNU_CLOCKWISE_VIEW"),
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_CLOCKWISE" ) ),
+ tr( "MNU_CLOCKWISE_VIEW" ), 0, this, false, "Viewers:Rotate clockwise");
+ anAction->setStatusTip(tr("DSC_CLOCKWISE_VIEW"));
+ connect(anAction, SIGNAL(triggered()), this, SLOT(onClockWiseView()));
+ this->addAction(anAction);
+ mgr->registerAction( anAction, ClockWiseId );
+
+ // Reset
+ anAction = new QtxAction(tr("MNU_RESET_VIEW"),
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_RESET" ) ),
+ tr( "MNU_RESET_VIEW" ), 0, this, false, "Viewers:Reset view");
+ anAction->setStatusTip(tr("DSC_RESET_VIEW"));
+ connect(anAction, SIGNAL(triggered()), this, SLOT(onResetView()));
+ this->addAction(anAction);
+ mgr->registerAction( anAction, ResetId );
+
+ // onViewTrihedron: Shows - Hides Trihedron
+ anAction = new QtxAction(tr("MNU_SHOW_TRIHEDRON"),
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_TRIHEDRON" ) ),
+ tr( "MNU_SHOW_TRIHEDRON" ), 0, this);
+ anAction->setCheckable( true );
+ anAction->setChecked( true );
+
+ anAction->setStatusTip(tr("DSC_SHOW_TRIHEDRON"));
+ connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onViewTrihedron(bool)));
+ mgr->registerAction( anAction, ViewTrihedronId );
+
+ // onNonIsometric: Manage non-isometric params
+ anAction = new QtxAction(tr("MNU_SVTK_SCALING"),
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_SCALING" ) ),
+ tr( "MNU_SVTK_SCALING" ), 0, this);
+ anAction->setStatusTip(tr("DSC_SVTK_SCALING"));
+ anAction->setCheckable(true);
+ connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onNonIsometric(bool)));
+ mgr->registerAction( anAction, NonIsometric );
+
+ // onGraduatedAxes: Manage graduated axes params
+ anAction = new QtxAction(tr("MNU_SVTK_GRADUATED_AXES"),
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_GRADUATED_AXES" ) ),
+ tr( "MNU_SVTK_GRADUATED_AXES" ), 0, this);
+ anAction->setStatusTip(tr("DSC_SVTK_GRADUATED_AXES"));
+ anAction->setCheckable(true);
+ connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onGraduatedAxes(bool)));
+ mgr->registerAction( anAction, GraduatedAxes );
+
+ // onGraduatedAxes: Manage graduated axes params
+ anAction = new QtxAction(tr("MNU_SVTK_UPDATE_RATE"),
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_UPDATE_RATE" ) ),
+ tr( "MNU_SVTK_UPDATE_RATE" ), 0, this);
+ anAction->setStatusTip(tr("DSC_SVTK_UPDATE_RATE"));
+ anAction->setCheckable(true);
+ connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onUpdateRate(bool)));
+ mgr->registerAction( anAction, UpdateRate );
+
+ // Set perspective mode group
+ anAction = new QtxAction(tr("MNU_SVTK_PARALLEL_MODE"),
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_VIEW_PARALLEL" ) ),
+ tr( "MNU_SVTK_PARALLEL_MODE" ), 0, this);
+ anAction->setStatusTip(tr("DSC_SVTK_PARALLEL_MODE"));
+ anAction->setCheckable(true);
+ mgr->registerAction( anAction, ParallelModeId );
+
+ anAction = new QtxAction(tr("MNU_SVTK_PERSPECTIVE_MODE"),
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_VIEW_PERSPECTIVE" ) ),
+ tr( "MNU_SVTK_PERSPECTIVE_MODE" ), 0, this);
+ anAction->setStatusTip(tr("DSC_SVTK_PERSPECTIVE_MODE"));
+ anAction->setCheckable(true);
+ mgr->registerAction( anAction, ProjectionModeId );
+
+ anAction = new QtxAction(tr("MNU_SVTK_STEREO_MODE"),
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_VIEW_STEREO" ) ),
+ tr( "MNU_SVTK_STEREO_MODE" ), 0, this);
+ anAction->setStatusTip(tr("DSC_SVTK_STEREO_MODE"));
+ anAction->setCheckable(true);
+ connect(anAction, SIGNAL(triggered(bool)), this, SLOT(onStereoMode(bool)));
+ mgr->registerAction( anAction, StereoModeId );
+
+ QActionGroup* aPerspectiveGroup = new QActionGroup( this );
+ aPerspectiveGroup->addAction( mgr->action( ParallelModeId ) );
+ aPerspectiveGroup->addAction( mgr->action( ProjectionModeId ) );
+ connect(aPerspectiveGroup, SIGNAL(triggered(QAction*)), this, SLOT(onProjectionMode(QAction*)));
+
+ // View Parameters
+ anAction = new QtxAction(tr("MNU_VIEWPARAMETERS_VIEW"),
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_VIEW_PARAMETERS" ) ),
+ tr( "MNU_VIEWPARAMETERS_VIEW" ), 0, this);
+ anAction->setStatusTip(tr("DSC_VIEWPARAMETERS_VIEW"));
+ anAction->setCheckable(true);
+ connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onViewParameters(bool)));
+ mgr->registerAction( anAction, ViewParametersId );
+
+ // Synchronize View
+ mgr->registerAction( synchronizeAction(), SynchronizeId );
+
+ // Switch between interaction styles
+ anAction = new QtxAction(tr("MNU_SVTK_STYLE_SWITCH"),
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_STYLE_SWITCH" ) ),
+ tr( "MNU_SVTK_STYLE_SWITCH" ), 0, this);
+ anAction->setStatusTip(tr("DSC_SVTK_STYLE_SWITCH"));
+ anAction->setCheckable(true);
+ connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onSwitchInteractionStyle(bool)));
+ mgr->registerAction( anAction, SwitchInteractionStyleId );
+
+ // Switch between zooming styles
+ anAction = new QtxAction(tr("MNU_SVTK_ZOOMING_STYLE_SWITCH"),
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_ZOOMING_STYLE_SWITCH" ) ),
+ tr( "MNU_SVTK_ZOOMING_STYLE_SWITCH" ), 0, this);
+ anAction->setStatusTip(tr("DSC_SVTK_ZOOMING_STYLE_SWITCH"));
+ anAction->setCheckable(true);
+ connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onSwitchZoomingStyle(bool)));
+ mgr->registerAction( anAction, SwitchZoomingStyleId );
+
+ // Pre-selection
+ QSignalMapper* aSignalMapper = new QSignalMapper( this );
+ connect(aSignalMapper, SIGNAL(mapped(int)), this, SLOT(onSwitchPreSelectionMode(int)));
+
+ anAction = new QtxAction(tr("MNU_SVTK_PRESELECTION_STANDARD"),
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_PRESELECTION_STANDARD" ) ),
+ tr( "MNU_SVTK_PRESELECTION_STANDARD" ), 0, this);
+ anAction->setStatusTip(tr("DSC_SVTK_PRESELECTION_STANDARD"));
+ anAction->setCheckable(true);
+ connect(anAction, SIGNAL(triggered()), aSignalMapper, SLOT(map()));
+ aSignalMapper->setMapping( anAction, Standard_Preselection );
+ mgr->registerAction( anAction, StandardPreselectionId );
+
+ anAction = new QtxAction(tr("MNU_SVTK_PRESELECTION_DYNAMIC"),
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_PRESELECTION_DYNAMIC" ) ),
+ tr( "MNU_SVTK_PRESELECTION_DYNAMIC" ), 0, this);
+ anAction->setStatusTip(tr("DSC_SVTK_PRESELECTION_DYNAMIC"));
+ anAction->setCheckable(true);
+ connect(anAction, SIGNAL(triggered()), aSignalMapper, SLOT(map()));
+ aSignalMapper->setMapping( anAction, Dynamic_Preselection );
+ mgr->registerAction( anAction, DynamicPreselectionId );
+
+ anAction = new QtxAction(tr("MNU_SVTK_PRESELECTION_DISABLED"),
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_PRESELECTION_DISABLED" ) ),
+ tr( "MNU_SVTK_PRESELECTION_DISABLED" ), 0, this);
+ anAction->setStatusTip(tr("DSC_SVTK_PRESELECTION_DISABLED"));
+ anAction->setCheckable(true);
+ connect(anAction, SIGNAL(triggered()), aSignalMapper, SLOT(map()));
+ aSignalMapper->setMapping( anAction, Preselection_Disabled );
+ mgr->registerAction( anAction, DisablePreselectionId );
+
+ QtxActionGroup* aPreselectionAction = new QtxActionGroup( this, true );
+ aPreselectionAction->add( getAction( StandardPreselectionId ) );
+ aPreselectionAction->add( getAction( DynamicPreselectionId ) );
+ aPreselectionAction->add( getAction( DisablePreselectionId ) );
+ mgr->registerAction( aPreselectionAction, PreselectionId );
+
+ // Selection
+ anAction = new QtxAction(tr("MNU_SVTK_ENABLE_SELECTION"),
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_SELECTION" ) ),
+ tr( "MNU_SVTK_ENABLE_SELECTION" ), 0, this);
+ anAction->setStatusTip(tr("DSC_SVTK_ENABLE_SELECTION"));
+ anAction->setCheckable(true);
+ connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onEnableSelection(bool)));
+ mgr->registerAction( anAction, EnableSelectionId );
+
+ // Start recording
+ myStartAction = new QtxAction(tr("MNU_SVTK_RECORDING_START"),
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_RECORDING_START" ) ),
+ tr( "MNU_SVTK_RECORDING_START" ), 0, this);
+ myStartAction->setStatusTip(tr("DSC_SVTK_RECORDING_START"));
+ connect( myStartAction, SIGNAL( triggered ( bool ) ), this, SLOT( onStartRecording() ) );
+ mgr->registerAction( myStartAction, StartRecordingId );
+
+ // Play recording
+ myPlayAction = new QtxAction(tr("MNU_SVTK_RECORDING_PLAY"),
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_RECORDING_PLAY" ) ),
+ tr( "MNU_SVTK_RECORDING_PLAY" ), 0, this);
+ myPlayAction->setStatusTip(tr("DSC_SVTK_RECORDING_PLAY"));
+ myPlayAction->setEnabled( false );
+ connect( myPlayAction, SIGNAL( triggered ( bool ) ), this, SLOT( onPlayRecording() ) );
+ mgr->registerAction( myPlayAction, PlayRecordingId );
+
+ // Pause recording
+ myPauseAction = new QtxAction(tr("MNU_SVTK_RECORDING_PAUSE"),
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_RECORDING_PAUSE" ) ),
+ tr( "MNU_SVTK_RECORDING_PAUSE" ), 0, this);
+ myPauseAction->setStatusTip(tr("DSC_SVTK_RECORDING_PAUSE"));
+ myPauseAction->setEnabled( false );
+ connect( myPauseAction, SIGNAL( triggered ( bool ) ), this, SLOT( onPauseRecording() ) );
+ mgr->registerAction( myPauseAction, PauseRecordingId );
+
+ // Stop recording
+ myStopAction = new QtxAction(tr("MNU_SVTK_RECORDING_STOP"),
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_RECORDING_STOP" ) ),
+ tr( "MNU_SVTK_RECORDING_STOP" ), 0, this);
+ myStopAction->setStatusTip(tr("DSC_SVTK_RECORDING_STOP"));
+ myStopAction->setEnabled( false );
+ connect( myStopAction, SIGNAL( triggered ( bool ) ), this, SLOT( onStopRecording() ) );
+ mgr->registerAction( myStopAction, StopRecordingId );