vm->setProjectionMode( resMgr->integerValue( "VTKViewer", "projection_mode", vm->projectionMode() ) );
vm->setStereoType( resMgr->integerValue( "VTKViewer", "stereo_type", vm->stereoType() ) );
vm->setAnaglyphFilter( resMgr->integerValue( "VTKViewer", "anaglyph_filter", vm->anaglyphFilter() ) );
+ vm->setQuadBufferSupport( resMgr->booleanValue( "VTKViewer", "enable_quad_buffer_support", vm->isQuadBufferSupport() ) );
vm->setBackground( resMgr->backgroundValue( "VTKViewer", "background", vm->background() ) );
vm->setTrihedronSize( resMgr->doubleValue( "3DViewer", "trihedron_size", vm->trihedronSize() ),
resMgr->booleanValue( "3DViewer", "relative_size", vm->trihedronRelative() ) );
}
#endif
+#ifndef DISABLE_VTKVIEWER
+ if ( sec == QString( "VTKViewer" ) && param == QString( "enable_quad_buffer_support" ) )
+ {
+ int enable = resMgr->booleanValue( "VTKViewer", "enable_quad_buffer_support", false );
+ QList<SUIT_ViewManager*> lst;
+#ifndef DISABLE_SALOMEOBJECT
+ viewManagers( SVTK_Viewer::Type(), lst );
+ QListIterator<SUIT_ViewManager*> it( lst );
+ while ( it.hasNext() )
+ {
+ SUIT_ViewModel* vm = it.next()->getViewModel();
+ if ( !vm || !vm->inherits( "SVTK_Viewer" ) )
+ continue;
+
+ SVTK_Viewer* vtkVM = dynamic_cast<SVTK_Viewer*>( vm );
+ if( vtkVM ) vtkVM->setQuadBufferSupport( enable );
+ }
+#endif
+ }
+#endif
+
#ifndef DISABLE_VTKVIEWER
if ( sec == QString( "VTKViewer" ) && param == QString( "preselection" ) )
{
<parameter name="iod_value" value="0.05"/>
<parameter name="reverse_stereo" value="false"/>
<parameter name="enable_vsync" value="true"/>
- <parameter name="enable_quad_buffer_support" value="false"/>
+ <parameter name="enable_quad_buffer_support" value="true"/>
<parameter name="enable_preselection" value="true"/>
<parameter name="enable_selection" value="true"/>
<parameter name="clipping_color" value="50, 50, 50"/>
<parameter name="projection_mode" value="0"/>
<parameter name="stereo_type" value="0"/>
<parameter name="anaglyph_filter" value="0"/>
- <parameter name="enable_quad_buffer_support" value="false"/>
+ <parameter name="enable_quad_buffer_support" value="true"/>
<parameter name="preselection" value="0"/>
<parameter name="enable_selection" value="true"/>
<parameter name="speed_value" value="10"/>
onViewFitAll();
}
- if ( isQuadBufferSupport() && !isOpenGlStereoSupport() && stereoType() == QuadBuffer )
+ if ( isQuadBufferSupport() && !isOpenGlStereoSupport() && stereoType() == QuadBuffer &&
+ toolMgr()->action( StereoId )->isChecked() )
SUIT_MessageBox::warning( 0, tr( "WRN_WARNING" ), tr( "WRN_SUPPORT_QUAD_BUFFER" ) );
#endif
}
if ( aPerspectiveAction->isEnabled() ) {
aPerspectiveAction->setEnabled( false );
aPerspectiveAction->setChecked( true );
- if ( isQuadBufferSupport() && !isOpenGlStereoSupport() && stereoType() == QuadBuffer )
+ if ( isQuadBufferSupport() && !isOpenGlStereoSupport() && stereoType() == QuadBuffer &&
+ toolMgr()->action( StereoId )->isChecked() )
SUIT_MessageBox::warning( 0, tr( "WRN_WARNING" ), tr( "WRN_SUPPORT_QUAD_BUFFER" ) );
}
else {
aViewWindow->SetProjectionMode( projectionMode() );
aViewWindow->SetStereoType( stereoType() );
aViewWindow->SetAnaglyphFilter( anaglyphFilter() );
+ aViewWindow->SetQuadBufferSupport( isQuadBufferSupport() );
aViewWindow->SetInteractionStyle( interactionStyle() );
aViewWindow->SetZoomingStyle( zoomingStyle() );
aViewWindow->SetPreSelectionMode( preSelectionMode() );
}
}
+/*!
+ \return support quad-buffered stereo
+*/
+bool SVTK_Viewer::isQuadBufferSupport() const
+{
+ return myQuadBufferSupport;
+}
+
+/*!
+ Set support quad-buffered stereo
+ \param theEnable - enable/disable support quad-buffered stereo
+*/
+void SVTK_Viewer::setQuadBufferSupport( const bool theEnable )
+{
+ if ( myQuadBufferSupport != theEnable ) {
+ myQuadBufferSupport = theEnable;
+
+ if (SUIT_ViewManager* aViewManager = getViewManager()) {
+ QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
+ for ( uint i = 0; i < aViews.count(); i++ )
+ {
+ if ( TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at( i )) )
+ aView->SetQuadBufferSupport( theEnable );
+ }
+ }
+ }
+}
/*!
\return interaction style
*/
//! Sets anaglyph filter
void setAnaglyphFilter( const int );
+ //! Get support quad-buffered stereo
+ bool isQuadBufferSupport() const;
+
+ //! Set support quad-buffered stereo
+ void setQuadBufferSupport( const bool );
+
//! Gets interaction style
int interactionStyle() const;
int myProjMode;
int myStereoType;
int myAnaglyphFilter;
+ bool myQuadBufferSupport;
int myStyle;
int myZoomingStyle;
Preselection_Mode myPreSelectionMode;
aProjectionAction->setEnabled( false );
aProjectionAction->setChecked( true );
if ( getRenderWindow()->GetStereoCapableWindow() == 1 && !isOpenGlStereoSupport() &&
- strcmp( "CrystalEyes", getRenderWindow()->GetStereoTypeAsString() ) == 0 ){
+ strcmp( "CrystalEyes", getRenderWindow()->GetStereoTypeAsString() ) == 0 &&
+ toolMgr()->action( StereoModeId )->isChecked() ) {
SUIT_MessageBox::warning( 0, tr( "WRN_WARNING" ), tr( "WRN_SUPPORT_QUAD_BUFFER" ) );
}
}
}
}
+/*!
+ 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);
+}
+
/*!
\return OpenGl stereo support
*/
onProjectionMode(toolMgr()->action( ProjectionModeId ));
}
}
+ 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" ) );
}
/*!
//! Sets anaglyph filter
virtual void SetAnaglyphFilter( const int );
+ //! Set support quad-buffered stereo
+ virtual void SetQuadBufferSupport( const bool );
+
//! Set interactive style
virtual void SetInteractionStyle( const int );