resMgr->booleanValue( "3DViewer", "relative_size", vm->trihedronRelative() ));
vm->setInteractionStyle( resMgr->integerValue( "3DViewer", "navigation_mode", vm->interactionStyle() ) );
vm->setProjectionType( resMgr->integerValue( "OCCViewer", "projection_mode", vm->projectionType() ) );
+ #if OCC_VERSION_LARGE > 0x06090000
vm->setStereoType( resMgr->integerValue( "OCCViewer", "stereo_type", vm->stereoType() ) );
vm->setAnaglyphFilter( resMgr->integerValue( "OCCViewer", "anaglyph_filter", vm->anaglyphFilter() ) );
vm->setStereographicFocus( resMgr->integerValue( "OCCViewer", "focus_type", vm->stereographicFocusType() ),
vm->setReverseStereo( resMgr->booleanValue( "OCCViewer", "reverse_stereo", vm->isReverseStereo() ) );
vm->setVSync( resMgr->booleanValue( "OCCViewer", "enable_vsync", vm->isVSync() ) );
vm->setQuadBufferSupport( resMgr->booleanValue( "OCCViewer", "enable_quad_buffer_support", vm->isQuadBufferSupport() ) );
+ #endif
vm->setZoomingStyle( resMgr->integerValue( "3DViewer", "zooming_mode", vm->zoomingStyle() ) );
vm->enablePreselection( resMgr->booleanValue( "OCCViewer", "enable_preselection", vm->isPreselectionEnabled() ) );
vm->enableSelection( resMgr->booleanValue( "OCCViewer", "enable_selection", vm->isSelectionEnabled() ) );
anIndicesList << 0 << 1;
pref->setItemProperty( "strings", aValuesList, occProjMode );
pref->setItemProperty( "indexes", anIndicesList, occProjMode );
-
+#if OCC_VERSION_LARGE > 0x06090000
// .... -> Stereo group
int stereoGroup = pref->addPreference( tr( "PREF_GROUP_STEREO" ), occGroup);
pref->setItemProperty( "columns", 2, stereoGroup );
// .... -> Enable quad-buffer support
pref->addPreference( tr( "PREF_ENABLE_QUAD_BUFFER_SUPPORT" ), stereoGroup,
LightApp_Preferences::Bool, "OCCViewer", "enable_quad_buffer_support" );
-
+#endif
// ... "Background" group <<start>>
int bgGroup = pref->addPreference( tr( "PREF_VIEWER_BACKGROUND" ), occGroup );
// pref->setItemProperty( "columns", 2, bgGroup );
}
}
#endif
-
+#if OCC_VERSION_LARGE > 0x06090000
#ifndef DISABLE_OCCVIEWER
if ( sec == QString( "OCCViewer" ) && param == QString( "stereo_type" ) )
{
}
}
#endif
-
+#endif
if ( sec == QString( "3DViewer" ) && param == QString( "zooming_mode" ) )
{
int mode = resMgr->integerValue( "3DViewer", "zooming_mode", 0 );
aView->setProjectionType(t);
}
}
-
+#if OCC_VERSION_LARGE > 0x06090000
//**************************************************************************************
int OCCViewer_ViewFrame::stereoType() const
{
aView->setQuadBufferSupport(t);
}
}
-
+#endif
//**************************************************************************************
void OCCViewer_ViewFrame::setZoomingStyle( const int i )
{
virtual int projectionType() const;
virtual void setProjectionType( int );
-
+#if OCC_VERSION_LARGE > 0x06090000
virtual int stereoType() const;
virtual void setStereoType( const int );
virtual bool isQuadBufferSupport() const;
virtual void setQuadBufferSupport( const bool );
-
+#endif
virtual int zoomingStyle() const { return getView(MAIN_VIEW)->zoomingStyle(); }
virtual void setZoomingStyle( const int );
// set projection type to orthographic
myProjectionType = 0;
-
+#if OCC_VERSION_LARGE > 0x06090000
// set stereo parameters
myStereoType = 0;
myAnaglyphFilter = 0;
myInterocularDistanceType = 1;
myStereographicFocusValue = 1.0;
myInterocularDistanceValue = 0.05;
-
+#endif
//set clipping color and texture to standard
myClippingColor = QColor( 50, 50, 50 );
myDefaultTextureUsed = true;
view->initSketchers();
view->setInteractionStyle( interactionStyle() );
view->setProjectionType( projectionType() );
+#if OCC_VERSION_LARGE > 0x06090000
view->setStereoType( stereoType() );
view->setAnaglyphFilter( anaglyphFilter() );
view->setStereographicFocus( stereographicFocusType(), stereographicFocusValue() );
view->setReverseStereo( isReverseStereo() );
view->setVSync( isVSync() );
view->setQuadBufferSupport( isQuadBufferSupport() );
+#endif
view->setZoomingStyle( zoomingStyle() );
view->enablePreselection( isPreselectionEnabled() );
view->enableSelection( isSelectionEnabled() );
}
}
}
-
+#if OCC_VERSION_LARGE > 0x06090000
/*!
\return stereo type
*/
win->setQuadBufferSupport( theEnable );
}
}
-
+#endif
/*!
\return zooming style
*/
int projectionType() const;
void setProjectionType( const int );
-
+#if OCC_VERSION_LARGE > 0x06090000
int stereoType() const;
void setStereoType( const int );
bool isQuadBufferSupport() const;
void setQuadBufferSupport( const bool );
-
+#endif
int zoomingStyle() const;
void setZoomingStyle( const int );
int myInteractionStyle;
int myZoomingStyle;
int myProjectionType;
+#if OCC_VERSION_LARGE > 0x06090000
int myStereoType;
int myAnaglyphFilter;
int myStereographicFocusType;
int myInterocularDistanceType;
+#endif
double myStereographicFocusValue;
double myInterocularDistanceValue;
bool mySelectionEnabled;
bool myMultiSelectionEnabled;
bool myIsRelative;
+#if OCC_VERSION_LARGE > 0x06090000
bool myToReverseStereo;
bool myVSyncMode;
bool myQuadBufferSupport;
+#endif
int myTopLayerId;
#include <Graphic3d_MapOfStructure.hxx>
#include <Graphic3d_Structure.hxx>
#include <Graphic3d_ExportFormat.hxx>
+#if OCC_VERSION_LARGE > 0x06090000
#include <Graphic3d_StereoMode.hxx>
#include <Graphic3d_RenderingParams.hxx>
+#endif
#include <Visual3d_View.hxx>
aAction->setCheckable(true);
//connect(aAction, SIGNAL(toggled(bool)), this, SLOT(onProjectionType()));
toolMgr()->registerAction( aAction, PerspectiveId );
-
+#if OCC_VERSION_LARGE > 0x06090000
// - stereo projection
aAction = new QtxAction(tr("MNU_STEREO_MODE"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_STEREO" ) ),
tr( "MNU_STEREO_MODE" ), 0, this);
aAction->setCheckable(true);
toolMgr()->registerAction( aAction, StereoId );
//connect(aAction, SIGNAL(toggled(bool)), this, SLOT(onProjectionType()));
-
+#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()));
// Reset
setProjectionType( Orthographic);
if (toolMgr()->action( PerspectiveId )->isChecked())
setProjectionType( Perspective);
+#if OCC_VERSION_LARGE > 0x06090000
if (toolMgr()->action( StereoId )->isChecked())
setProjectionType( Stereo);
+#endif
emit vpTransformationFinished( PROJECTION );
}
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();
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() ) {
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 );
if ( !aPerspectiveAction->isEnabled() )
aPerspectiveAction->setEnabled( true );
}
+#endif
}
int OCCViewer_ViewWindow::projectionType() const
mode = Perspective;
if (aCamera->ProjectionType() == Graphic3d_Camera::Projection_Orthographic)
mode = Orthographic;
+ #if OCC_VERSION_LARGE > 0x06090000
if (aCamera->ProjectionType() == Graphic3d_Camera::Projection_Stereo)
mode = Stereo;
+ #endif
}
return mode;
}
+#if OCC_VERSION_LARGE > 0x06090000
void OCCViewer_ViewWindow::setStereoType( int type )
{
Handle(V3d_View) aView3d = myViewPort->getView();
}
return enable;
}
-
+#endif
bool OCCViewer_ViewWindow::isOpenGlStereoSupport() const
{
GLboolean support[1];
virtual int projectionType() const;
virtual void setProjectionType( int );
-
+#if OCC_VERSION_LARGE > 0x06090000
virtual int stereoType() const;
virtual void setStereoType( const int );
virtual bool isQuadBufferSupport() const;
virtual void setQuadBufferSupport( const bool );
-
+#endif
void setTransformEnabled( const OperationType, const bool );
bool transformEnabled( const OperationType ) const;