- \b Short - shows the file name only.
- \b Auto - shows full paths to the files only if some files from
different locations have the same name.
+- <b>Full-screen</b> - options concerned full-screen mode:
+ - <b>Hide object browser and viewers toolbars</b> - switches automatic hiding of
+ Object Browser and OCC viewer toolbar in full-screen mode.
<h2>3D Viewer Preferences</h2>
\image html pref_salome_occviewer.png
+- <b>Projection mode</b> - sets the default projection mode for the viewers: Orthogonal or Perpective.
+- <b>Stereo render</b> - group of stereoscopic view settings:
+ - <b>Stereo type</b> - specifies a stereo pair type:
+ - Shutter glasses (OpenGL quad-buffer)
+ - Anaglyph
+ - Row-interlaced
+ - Column-interlaced
+ - Chess-board stereo for DLP TVs
+ - Horizontal-anamorphic (side-by-side)
+ - Vertical-anamorphic (Half OverUnder)
+ \note The stereo pair type selected in this combobox is applied
+ for all existing OCC 3D views with stereo rendering already turned on
+ within the same SALOME GUI session. It is not possible to use
+ different stereo modes in several OCC 3D views at the same time
+ within the same SALOME GUI session.
+ - <b>Anaglyph filter</b> - specifies format of anaglyph stereo pair:
+ - Red-Cyan (default)
+ - Yellow-Blue
+ - Green-Magenta
+ - <b>Convergence distance type</b>: Absolute or Relative (default).
+ - <b>Stereographic focus value</b> - 1 by default.
+ - <b>IOD type</b> - Absolute or Relative (default).
+ - <b>Interocular distance (IOD) value</b> - 0.05 by default.
+ - <b>Reverse stereo</b> - option to swap left and right frames.
+ - <b>Enable V-Sync</b> - activates vertical synchronization.
+ - <b>Enable quad-buffer support</b> - allows quad-buffered rendering.
+ \note It is neccessary to enable quad-buffered stereoscopic rendering
+ manually in graphic driver settings. SALOME does not do it automatically.
+ \note All existing OCC 3D views should be re-created for quad-buffer support.
+
- <b>Background</b> - specifies the default background for the viewers,
separately for (for more details, refer to the \ref viewer_background
"this page"):
or [-] keyboard buttons.
- <b>Modification Mode</b> - allows choosing between \b Arithmetic
and \b Geometrical progression used for zooming.
+- <b>Stereo render</b> - group of stereoscopic view settings:
+ - <b>Stereo type</b> - specifies a stereo pair type:
+ - Crystal Eyes
+ - Red-Blue
+ - Interlaced
+ - Left
+ - Right
+ - Dresden
+ - Anaglyph
+ - Checkerboard
+ - Split View Port Horizontal
+ \note The stereo pair type selected in this combobox is applied
+ for all existing VTK 3D views with stereo rendering already turned on
+ within the same SALOME GUI session. It is not possible to use
+ different stereo modes in several VTK 3D views at the same time
+ within the same SALOME GUI session.
+ - <b>Anaglyph filter</b> - specifies format of anaglyph stereo pair:
+ - Red-Cyan (default)
+ - Yellow-Blue
+ - Green-Magenta
+ - <b>Enable quad-buffer support</b> - allows quad-buffered rendering.
+ \note It is neccessary to enable quad-buffered stereoscopic rendering
+ manually in graphic driver settings. SALOME does not do it automatically.
+ \note All existing VTK 3D views should be re-created for quad-buffer support.
- <b>Selection</b>
- <b>Preselection</b> - allows to choose among three possible preselection modes:
- <b>Standard</b> - this mode works quickly, by checking only
tr( "MNU_ORTHOGRAPHIC_MODE" ), 0, this);
aAction->setStatusTip(tr("DSC_ORTHOGRAPHIC_MODE"));
aAction->setCheckable(true);
- //connect(aAction, SIGNAL(toggled(bool)), this, SLOT(onProjectionType()));
toolMgr()->registerAction( aAction, OrthographicId );
// - perspective projection
tr( "MNU_PERSPECTIVE_MODE" ), 0, this);
aAction->setStatusTip(tr("DSC_PERSPECTIVE_MODE"));
aAction->setCheckable(true);
- //connect(aAction, SIGNAL(toggled(bool)), this, SLOT(onProjectionType()));
toolMgr()->registerAction( aAction, PerspectiveId );
#if OCC_VERSION_LARGE > 0x06090000
// - stereo projection
aAction->setStatusTip(tr("DSC_STEREO_MODE"));
aAction->setCheckable(true);
toolMgr()->registerAction( aAction, StereoId );
- //connect(aAction, SIGNAL(toggled(bool)), this, SLOT(onProjectionType()));
+ connect(aAction, SIGNAL(triggered(bool)), this, SLOT(onStereoType(bool)));
#endif
// - add exclusive action group
QActionGroup* aProjectionGroup = new QActionGroup( this );
aProjectionGroup->addAction( toolMgr()->action( OrthographicId ) );
aProjectionGroup->addAction( toolMgr()->action( PerspectiveId ) );
-#if OCC_VERSION_LARGE > 0x06090000
- aProjectionGroup->addAction( toolMgr()->action( StereoId ) );
-#endif
- connect(aProjectionGroup, SIGNAL(triggered(QAction*)), this, SLOT(onProjectionType()));
-
+ connect(aProjectionGroup, SIGNAL(triggered(QAction*)), this, SLOT(onProjectionType(QAction*)));
+
// Reset
aAction = new QtxAction(tr("MNU_RESET_VIEW"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_VIEW_RESET" ) ),
tr( "MNU_RESET_VIEW" ), 0, this, false, "Viewers:Reset view");
}
/*!
- \brief Perform "reset view" transformation.
+ \brief Set the given projection mode.
- Sets default orientation of the viewport camera.
+ Set the given projection mode: Orthographic or Perspective.
+*/
+void OCCViewer_ViewWindow::onProjectionType( QAction* theAction )
+{
+ Handle(V3d_View) aView3d = myViewPort->getView();
+ if ( !aView3d.IsNull() ) {
+ Handle(Graphic3d_Camera) aCamera = aView3d->Camera();
+ if (theAction == toolMgr()->action( OrthographicId )) {
+ myModel->setProjectionType(Orthographic);
+ aCamera->SetProjectionType ( Graphic3d_Camera::Projection_Orthographic );
+ }
+ else if (theAction == toolMgr()->action( PerspectiveId )) {
+ myModel->setProjectionType(Perspective);
+ aCamera->SetProjectionType ( Graphic3d_Camera::Projection_Perspective );
+ }
+ if (toolMgr()->action( StereoId )->isChecked())
+ aCamera->SetProjectionType ( Graphic3d_Camera::Projection_Stereo );
+ aView3d->Redraw();
+ onViewFitAll();
+ }
+}
+
+/*!
+ \brief Sets Stereo projection mode.
+
+ Sets Stereo projection mode.
+*/
+void OCCViewer_ViewWindow::onStereoType( bool activate )
+{
+#if OCC_VERSION_LARGE > 0x06090000
+ Handle(V3d_View) aView3d = myViewPort->getView();
+ if ( !aView3d.IsNull() ) {
+ Handle(Graphic3d_Camera) aCamera = aView3d->Camera();
+ if (activate) {
+ toolMgr()->action( PerspectiveId )->setChecked(true);
+ aCamera->SetProjectionType(Graphic3d_Camera::Projection_Perspective);
+ toolMgr()->action( PerspectiveId )->actionGroup()->setEnabled(false);
+
+ aCamera->SetProjectionType ( Graphic3d_Camera::Projection_Stereo );
+ SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
+ setStereoType( aResMgr->integerValue( "OCCViewer", "stereo_type", 0 ) );
+ setAnaglyphFilter( aResMgr->integerValue( "OCCViewer", "anaglyph_filter", 0 ) );
+ setReverseStereo( aResMgr->booleanValue( "OCCViewer", "reverse_stereo", false ) );
+ setVSync( aResMgr->booleanValue( "OCCViewer", "enable_vsync", true ) );
+ setQuadBufferSupport( aResMgr->booleanValue( "OCCViewer", "enable_quad_buffer_support", false ) );
+ }
+ else {
+ toolMgr()->action( PerspectiveId )->actionGroup()->setEnabled(true);
+ if (myModel->projectionType() == Orthographic) {
+ toolMgr()->action( OrthographicId )->setChecked(true);
+ aCamera->SetProjectionType(Graphic3d_Camera::Projection_Orthographic);
+ }
+ else if (myModel->projectionType() == Perspective) {
+ toolMgr()->action( PerspectiveId )->setChecked(true);
+ aCamera->SetProjectionType(Graphic3d_Camera::Projection_Perspective);
+ }
+ }
+ aView3d->Redraw();
+ onViewFitAll();
+ }
+
+ if ( isQuadBufferSupport() && !isOpenGlStereoSupport() && stereoType() == QuadBuffer )
+ SUIT_MessageBox::warning( 0, tr( "WRN_WARNING" ), tr( "WRN_SUPPORT_QUAD_BUFFER" ) );
+#endif
+}
+
+/*!
+ \brief Restore the view.
+
+ Restore the projection mode based on tool-buttons states.
*/
void OCCViewer_ViewWindow::onProjectionType()
{
emit vpTransformationStarted( PROJECTION );
if (toolMgr()->action( OrthographicId )->isChecked())
- setProjectionType( Orthographic);
+ setProjectionType( Orthographic );
if (toolMgr()->action( PerspectiveId )->isChecked())
- setProjectionType( Perspective);
+ setProjectionType( Perspective );
#if OCC_VERSION_LARGE > 0x06090000
if (toolMgr()->action( StereoId )->isChecked())
- setProjectionType( Stereo);
+ setProjectionType( Stereo );
#endif
emit vpTransformationFinished( PROJECTION );
}
+void OCCViewer_ViewWindow::setProjectionType( int mode )
+{
+ QtxAction* anOrthographicAction = dynamic_cast<QtxAction*>( toolMgr()->action( OrthographicId ) );
+ QtxAction* aPerspectiveAction = dynamic_cast<QtxAction*>( toolMgr()->action( PerspectiveId ) );
+#if OCC_VERSION_LARGE > 0x06090000
+ QtxAction* aStereoAction = dynamic_cast<QtxAction*>( toolMgr()->action( StereoId ) );
+#endif
+ switch ( mode ) {
+ case Orthographic:
+ onProjectionType( anOrthographicAction );
+ break;
+ case Perspective:
+ onProjectionType( aPerspectiveAction );
+ break;
+ case Stereo:
+ onStereoType( true );
+ break;
+ }
+ // update action state if method is called outside
+ if ( mode == Orthographic && !anOrthographicAction->isChecked() ) {
+ anOrthographicAction->setChecked( true );
+ #if OCC_VERSION_LARGE > 0x06090000
+ aStereoAction->setChecked( false );
+ #endif
+ }
+ if ( mode == Perspective && !aPerspectiveAction->isChecked() ) {
+ aPerspectiveAction->setChecked( true );
+ #if OCC_VERSION_LARGE > 0x06090000
+ aStereoAction->setChecked( false );
+ #endif
+ }
+#if OCC_VERSION_LARGE > 0x06090000
+ if ( mode == Stereo ) {
+ aStereoAction->setChecked( true );
+ if ( anOrthographicAction->isEnabled() ) {
+ anOrthographicAction->setEnabled( false );
+ anOrthographicAction->setChecked( false );
+ aStereoAction->setChecked( false );
+ }
+ else {
+ anOrthographicAction->setEnabled( true );
+ aStereoAction->setChecked( false );
+ anOrthographicAction->setChecked(myModel->projectionType() == Orthographic);
+ }
+ if ( aPerspectiveAction->isEnabled() ) {
+ aPerspectiveAction->setEnabled( false );
+ aPerspectiveAction->setChecked( true );
+ if ( isQuadBufferSupport() && !isOpenGlStereoSupport() && stereoType() == QuadBuffer )
+ SUIT_MessageBox::warning( 0, tr( "WRN_WARNING" ), tr( "WRN_SUPPORT_QUAD_BUFFER" ) );
+ }
+ else {
+ aPerspectiveAction->setEnabled( true );
+ aStereoAction->setChecked( false );
+ aPerspectiveAction->setChecked(myModel->projectionType() == Perspective);
+ onProjectionType();
+ }
+ }
+ else {
+ if ( !anOrthographicAction->isEnabled() )
+ anOrthographicAction->setEnabled( true );
+ if ( !aPerspectiveAction->isEnabled() )
+ aPerspectiveAction->setEnabled( true );
+ }
+#endif
+}
+
/*!
\brief Perform "fit all" transformation.
*/
my2dMode = theType;
}
-void OCCViewer_ViewWindow::setProjectionType( int mode )
-{
- Handle(V3d_View) aView3d = myViewPort->getView();
- if ( !aView3d.IsNull() ) {
- Handle(Graphic3d_Camera) aCamera = aView3d->Camera();
- if (mode == Perspective) {
- myModel->setProjectionType(Perspective);
- aCamera->SetProjectionType ( Graphic3d_Camera::Projection_Perspective );
- }
- if (mode == Orthographic) {
- myModel->setProjectionType(Orthographic);
- aCamera->SetProjectionType ( Graphic3d_Camera::Projection_Orthographic );
- }
- #if OCC_VERSION_LARGE > 0x06090000
- if (mode == Stereo) {
- aCamera->SetProjectionType ( Graphic3d_Camera::Projection_Stereo );
- SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
- setStereoType( aResMgr->integerValue( "OCCViewer", "stereo_type", 0 ) );
- setAnaglyphFilter( aResMgr->integerValue( "OCCViewer", "anaglyph_filter", 0 ) );
- setReverseStereo( aResMgr->booleanValue( "OCCViewer", "reverse_stereo", false ) );
- setVSync( aResMgr->booleanValue( "OCCViewer", "enable_vsync", true ) );
- setQuadBufferSupport( aResMgr->booleanValue( "OCCViewer", "enable_quad_buffer_support", false ) );
- }
- #endif
- aView3d->Redraw();
- onViewFitAll();
- }
- // update action state if method is called outside
- QtxAction* anOrthographicAction = dynamic_cast<QtxAction*>( toolMgr()->action( OrthographicId ) );
- QtxAction* aPerspectiveAction = dynamic_cast<QtxAction*>( toolMgr()->action( PerspectiveId ) );
-#if OCC_VERSION_LARGE > 0x06090000
- QtxAction* aStereoAction = dynamic_cast<QtxAction*>( toolMgr()->action( StereoId ) );
-#endif
- if ( mode == Orthographic && !anOrthographicAction->isChecked() ) {
- anOrthographicAction->setChecked( true );
- #if OCC_VERSION_LARGE > 0x06090000
- aStereoAction->setChecked( false );
- #endif
- }
- if ( mode == Perspective && !aPerspectiveAction->isChecked() ) {
- aPerspectiveAction->setChecked( true );
- #if OCC_VERSION_LARGE > 0x06090000
- aStereoAction->setChecked( false );
- #endif
- }
-#if OCC_VERSION_LARGE > 0x06090000
- if ( mode == Stereo ) {
- aStereoAction->setChecked( true );
- if ( anOrthographicAction->isEnabled() ) {
- anOrthographicAction->setEnabled( false );
- anOrthographicAction->setChecked( false );
- aStereoAction->setChecked( false );
- }
- else {
- anOrthographicAction->setEnabled( true );
- aStereoAction->setChecked( false );
- anOrthographicAction->setChecked(myModel->projectionType() == Orthographic);
- }
- if ( aPerspectiveAction->isEnabled() ) {
- aPerspectiveAction->setEnabled( false );
- aPerspectiveAction->setChecked( true );
- #if OCC_VERSION_LARGE > 0x06090000
- if ( isQuadBufferSupport() && !isOpenGlStereoSupport() && stereoType() == QuadBuffer )
- SUIT_MessageBox::warning( 0, tr( "WRN_WARNING" ), tr( "WRN_SUPPORT_QUAD_BUFFER" ) );
- #endif
- }
- else {
- aPerspectiveAction->setEnabled( true );
- aStereoAction->setChecked( false );
- aPerspectiveAction->setChecked(myModel->projectionType() == Perspective);
- onProjectionType();
- }
- }
- else {
- if ( !anOrthographicAction->isEnabled() )
- anOrthographicAction->setEnabled( true );
- if ( !aPerspectiveAction->isEnabled() )
- aPerspectiveAction->setEnabled( true );
- }
-#endif
-}
-
int OCCViewer_ViewWindow::projectionType() const
{
int mode = Orthographic;
*/
void SVTK_ViewWindow::SetProjectionMode(const int theMode)
{
- SVTK_Viewer* aViewer = dynamic_cast<SVTK_Viewer*>(myModel);
+ QtxAction* aParallelAction = dynamic_cast<QtxAction*>( toolMgr()->action( ParallelModeId ) );
+ QtxAction* aProjectionAction = dynamic_cast<QtxAction*>( toolMgr()->action( ProjectionModeId ) );
+ QtxAction* aStereoAction = dynamic_cast<QtxAction*>( toolMgr()->action( StereoModeId ) );
- if ( theMode != Stereo ) {
- aViewer->setProjectionMode(theMode);
- bool anIsParallelMode = (theMode == Parallel);
- vtkCamera* aCamera = getRenderer()->GetActiveCamera();
- aCamera->SetParallelProjection(anIsParallelMode);
- GetInteractor()->GetDevice()->CreateTimer(VTKI_TIMER_FIRST);
- getRenderWindow()->SetStereoRender(0);
- }
- else {
- SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
- SetStereoType( aResMgr->integerValue( "VTKViewer", "stereo_type", 0 ) );
- getRenderWindow()->SetStereoRender(1);
+ switch ( theMode ) {
+ case Parallel:
+ onProjectionMode( aParallelAction );
+ break;
+ case Projection:
+ onProjectionMode( aProjectionAction );
+ break;
+ case Stereo:
+ onStereoMode( true );
+ break;
}
- Repaint();
// update action state if method is called outside
- QtxAction* aParallelAction = dynamic_cast<QtxAction*>( toolMgr()->action( ParallelModeId ) );
- QtxAction* aProjectionAction = dynamic_cast<QtxAction*>( toolMgr()->action( ProjectionModeId ) );
- QtxAction* aStereoAction = dynamic_cast<QtxAction*>( toolMgr()->action( StereoModeId ) );
+ SVTK_Viewer* aViewer = dynamic_cast<SVTK_Viewer*>(myModel);
QtxAction* aSwitchZoomingStyle = dynamic_cast<QtxAction*>( toolMgr()->action( SwitchZoomingStyleId ) );
if ( theMode == Parallel && !aParallelAction->isChecked() ) {
aParallelAction->setChecked( true );
aProjectionAction->setEnabled( true );
aStereoAction->setChecked( false );
aProjectionAction->setChecked( aViewer->projectionMode() == Projection );
- onPerspectiveMode();
+ onProjectionMode();
}
}
else {
myEventDispatcher->InvokeEvent(SVTK::StartPointSelection,0);
}
+/*!
+ \brief Set the given projection mode.
+
+ Set the given projection mode: Orthographic or Perspective.
+*/
+void SVTK_ViewWindow::onProjectionMode( QAction* theAction )
+{
+ int aMode = Parallel;
+ if (theAction == toolMgr()->action( ProjectionModeId ))
+ aMode = Projection;
+ SVTK_Viewer* aViewer = dynamic_cast<SVTK_Viewer*>(myModel);
+ aViewer->setProjectionMode(aMode);
+ bool anIsParallelMode = (aMode == Parallel);
+ vtkCamera* aCamera = getRenderer()->GetActiveCamera();
+ aCamera->SetParallelProjection(anIsParallelMode);
+ GetInteractor()->GetDevice()->CreateTimer(VTKI_TIMER_FIRST);
+ getRenderWindow()->SetStereoRender(0);
+ Repaint();
+}
+
+/*!
+ \brief Sets Stereo projection mode.
+
+ Sets Stereo projection mode.
+*/
+void SVTK_ViewWindow::onStereoMode( bool activate )
+{
+ if (activate) {
+ toolMgr()->action( ProjectionModeId )->setChecked(true);
+ vtkCamera* aCamera = getRenderer()->GetActiveCamera();
+ aCamera->SetParallelProjection(false);
+ toolMgr()->action( ProjectionModeId )->actionGroup()->setEnabled(false);
+ SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
+ SetStereoType( aResMgr->integerValue( "VTKViewer", "stereo_type", 0 ) );
+ getRenderWindow()->SetStereoRender(1);
+ Repaint();
+ }
+ else {
+ toolMgr()->action( ProjectionModeId )->actionGroup()->setEnabled(true);
+ SVTK_Viewer* aViewer = dynamic_cast<SVTK_Viewer*>(myModel);
+ if (aViewer->projectionMode() == Parallel) {
+ toolMgr()->action( ParallelModeId )->setChecked(true);
+ onProjectionMode(toolMgr()->action( ParallelModeId ));
+ }
+ else if (aViewer->projectionMode() == Projection) {
+ toolMgr()->action( ProjectionModeId )->setChecked(true);
+ onProjectionMode(toolMgr()->action( ProjectionModeId ));
+ }
+ }
+}
+
/*!
Set the view projection mode: orthogonal or perspective
*/
-void SVTK_ViewWindow::onPerspectiveMode()
+void SVTK_ViewWindow::onProjectionMode()
{
if (toolMgr()->action( ParallelModeId )->isChecked())
SetProjectionMode( Parallel);
tr( "MNU_SVTK_PARALLEL_MODE" ), 0, this);
anAction->setStatusTip(tr("DSC_SVTK_PARALLEL_MODE"));
anAction->setCheckable(true);
- //connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onPerspectiveMode()));
mgr->registerAction( anAction, ParallelModeId );
anAction = new QtxAction(tr("MNU_SVTK_PERSPECTIVE_MODE"),
tr( "MNU_SVTK_PERSPECTIVE_MODE" ), 0, this);
anAction->setStatusTip(tr("DSC_SVTK_PERSPECTIVE_MODE"));
anAction->setCheckable(true);
- //connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onPerspectiveMode()));
mgr->registerAction( anAction, ProjectionModeId );
anAction = new QtxAction(tr("MNU_SVTK_STEREO_MODE"),
tr( "MNU_SVTK_STEREO_MODE" ), 0, this);
anAction->setStatusTip(tr("DSC_SVTK_STEREO_MODE"));
anAction->setCheckable(true);
- //connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onPerspectiveMode()));
+ 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 ) );
- aPerspectiveGroup->addAction( mgr->action( StereoModeId ) );
- connect(aPerspectiveGroup, SIGNAL(triggered(QAction*)), this, SLOT(onPerspectiveMode()));
+ connect(aPerspectiveGroup, SIGNAL(triggered(QAction*)), this, SLOT(onProjectionMode(QAction*)));
// View Parameters
anAction = new QtxAction(tr("MNU_VIEWPARAMETERS_VIEW"),