+ QtxAction* aParallelAction = dynamic_cast<QtxAction*>( toolMgr()->action( ParallelModeId ) );
+ QtxAction* aProjectionAction = dynamic_cast<QtxAction*>( toolMgr()->action( ProjectionModeId ) );
+ QtxAction* aStereoAction = dynamic_cast<QtxAction*>( toolMgr()->action( StereoModeId ) );
+
+ switch ( theMode ) {
+ case Parallel:
+ onProjectionMode( aParallelAction );
+ break;
+ case Projection:
+ onProjectionMode( aProjectionAction );
+ break;
+ case Stereo:
+ onStereoMode( true );
+ break;
+ }
+
+ // update action state if method is called outside
+ SVTK_Viewer* aViewer = dynamic_cast<SVTK_Viewer*>(myModel);
+ QtxAction* aSwitchZoomingStyle = dynamic_cast<QtxAction*>( toolMgr()->action( SwitchZoomingStyleId ) );
+ if ( theMode == Parallel && !aParallelAction->isChecked() ) {
+ aParallelAction->setChecked( true );
+ aSwitchZoomingStyle->setEnabled(true);
+ aStereoAction->setChecked( false );
+ }
+ if ( theMode == Projection && !aProjectionAction->isChecked() ) {
+ aProjectionAction->setChecked( true );
+ aSwitchZoomingStyle->setEnabled(false);
+ }
+ if ( theMode == Stereo ) {
+ aStereoAction->setChecked( true );
+ if ( aParallelAction->isEnabled() ) {
+ aParallelAction->setEnabled( false );
+ aParallelAction->setChecked( false );
+ aStereoAction->setChecked( false );
+ }
+ else {
+ aParallelAction->setEnabled( true );
+ aStereoAction->setChecked( false );
+ aParallelAction->setChecked( aViewer->projectionMode() == Parallel );
+ }
+ if ( aProjectionAction->isEnabled() ) {
+ aProjectionAction->setEnabled( false );
+ aProjectionAction->setChecked( true );
+ if ( getRenderWindow()->GetStereoCapableWindow() == 1 && !isOpenGlStereoSupport() &&
+ strcmp( "CrystalEyes", getRenderWindow()->GetStereoTypeAsString() ) == 0 &&
+ toolMgr()->action( StereoModeId )->isChecked() ) {
+ SUIT_MessageBox::warning( 0, tr( "WRN_WARNING" ), tr( "WRN_SUPPORT_QUAD_BUFFER" ) );
+ }
+ }
+ else {
+ aProjectionAction->setEnabled( true );
+ aStereoAction->setChecked( false );
+ aProjectionAction->setChecked( aViewer->projectionMode() == Projection );
+ onProjectionMode();
+ }
+ }
+ else {
+ if ( !aParallelAction->isEnabled() )
+ aParallelAction->setEnabled( true );
+ if ( !aProjectionAction->isEnabled() )
+ aProjectionAction->setEnabled( true );
+ }
+}
+
+/*!
+ Sets stereo type
+ \param theType - stereo type
+*/
+void SVTK_ViewWindow::SetStereoType(const int theType)
+{
+ vtkRenderWindow* aWindow = getRenderWindow();
+ switch (theType ) {
+ case CrystalEyes:
+ aWindow->SetStereoTypeToCrystalEyes();
+ break;
+ case RedBlue:
+ aWindow->SetStereoTypeToRedBlue();
+ break;
+ case Interlaced:
+ aWindow->SetStereoTypeToInterlaced();
+ break;
+ case Left:
+ aWindow->SetStereoTypeToLeft();
+ break;
+ case Right:
+ aWindow->SetStereoTypeToRight();
+ break;
+ case Dresden:
+ aWindow->SetStereoTypeToDresden();
+ break;
+ case Anaglyph:
+ aWindow->SetStereoTypeToAnaglyph();
+ break;
+ case Checkerboard:
+ aWindow->SetStereoTypeToCheckerboard();
+ break;
+ case SplitViewPortHorizontal:
+ aWindow->SetStereoTypeToSplitViewportHorizontal();
+ break;
+ }
+}
+
+/*!
+ Sets anaglyph filter
+ \param theFilter - anaglyph filter
+*/
+void SVTK_ViewWindow::SetAnaglyphFilter(const int theFilter)
+{
+ vtkRenderWindow* aWindow = getRenderWindow();
+ switch (theFilter ) {
+ case RedCyan:
+ aWindow->SetAnaglyphColorMask(4,3);
+ break;
+ case YellowBlue:
+ aWindow->SetAnaglyphColorMask(6,1);
+ break;
+ case GreenMagenta:
+ aWindow->SetAnaglyphColorMask(2,5);
+ break;
+ }
+}
+
+/*!
+ Set support quad-buffered stereo
+ \param theEnable - enable/disable support quad-buffered stereo
+*/
+void SVTK_ViewWindow::SetQuadBufferSupport(const bool theEnable)
+{
+ vtkRenderWindow* aWindow = getRenderWindow();
+ aWindow->SetStereoCapableWindow((int)theEnable);