// 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
*/
return mode;
}
-#if OCC_VERSION_LARGE > 0x06090000
void OCCViewer_ViewWindow::setStereoType( int type )
{
Handle(V3d_View) aView3d = myViewPort->getView();
if ( !aView3d.IsNull() ) {
+ #if OCC_VERSION_LARGE > 0x06090000
Graphic3d_RenderingParams* aParams = &aView3d->ChangeRenderingParams();
aParams->StereoMode = (Graphic3d_StereoMode)type;
+ #endif
}
}
int type = QuadBuffer;
Handle(V3d_View) aView3d = myViewPort->getView();
if ( !aView3d.IsNull() ) {
+ #if OCC_VERSION_LARGE > 0x06090000
Graphic3d_RenderingParams* aParams = &aView3d->ChangeRenderingParams();
type = (OCCViewer_ViewWindow::StereoType)aParams->StereoMode;
+ #endif
}
return type;
}
{
Handle(V3d_View) aView3d = myViewPort->getView();
if ( !aView3d.IsNull() ) {
+ #if OCC_VERSION_LARGE > 0x06090000
Graphic3d_RenderingParams* aParams = &aView3d->ChangeRenderingParams();
if (type == RedCyan)
aParams->AnaglyphFilter = Graphic3d_RenderingParams::Anaglyph_RedCyan_Optimized;
aParams->AnaglyphFilter = Graphic3d_RenderingParams::Anaglyph_YellowBlue_Optimized;
if (type == GreenMagenta)
aParams->AnaglyphFilter = Graphic3d_RenderingParams::Anaglyph_GreenMagenta_Simple;
+ #endif
}
}
int type = RedCyan;
Handle(V3d_View) aView3d = myViewPort->getView();
if ( !aView3d.IsNull() ) {
+ #if OCC_VERSION_LARGE > 0x06090000
Graphic3d_RenderingParams* aParams = &aView3d->ChangeRenderingParams();
if (aParams->AnaglyphFilter == Graphic3d_RenderingParams::Anaglyph_RedCyan_Optimized)
type = RedCyan;
type = YellowBlue;
if (aParams->AnaglyphFilter == Graphic3d_RenderingParams::Anaglyph_GreenMagenta_Simple)
type = GreenMagenta;
+ #endif
}
return type;
}
{
Handle(V3d_View) aView3d = myViewPort->getView();
if ( !aView3d.IsNull() ) {
+ #if OCC_VERSION_LARGE > 0x06090000
Handle(Graphic3d_Camera) aCamera = aView3d->Camera();
aCamera->SetZFocus( (Graphic3d_Camera::FocusType) type, value );
+ #endif
}
}
int type = Relative;
Handle(V3d_View) aView3d = myViewPort->getView();
if ( !aView3d.IsNull() ) {
+ #if OCC_VERSION_LARGE > 0x06090000
Handle(Graphic3d_Camera) aCamera = aView3d->Camera();
type = (OCCViewer_ViewWindow::FocusIODType)aCamera->ZFocusType();
+ #endif
}
return type;
}
double value = 1.0;
Handle(V3d_View) aView3d = myViewPort->getView();
if ( !aView3d.IsNull() ) {
+ #if OCC_VERSION_LARGE > 0x06090000
Handle(Graphic3d_Camera) aCamera = aView3d->Camera();
value = aCamera->ZFocus();
+ #endif
}
return value;
}
{
Handle(V3d_View) aView3d = myViewPort->getView();
if ( !aView3d.IsNull() ) {
+ #if OCC_VERSION_LARGE > 0x06090000
Handle(Graphic3d_Camera) aCamera = aView3d->Camera();
aCamera->SetIOD( (Graphic3d_Camera::IODType) type, value );
+ #endif
}
}
int type = Relative;
Handle(V3d_View) aView3d = myViewPort->getView();
if ( !aView3d.IsNull() ) {
+ #if OCC_VERSION_LARGE > 0x06090000
Handle(Graphic3d_Camera) aCamera = aView3d->Camera();
type = (OCCViewer_ViewWindow::FocusIODType)aCamera->GetIODType();
+ #endif
}
return type;
}
double value = 0.05;
Handle(V3d_View) aView3d = myViewPort->getView();
if ( !aView3d.IsNull() ) {
+ #if OCC_VERSION_LARGE > 0x06090000
Handle(Graphic3d_Camera) aCamera = aView3d->Camera();
value = aCamera->IOD();
+ #endif
}
return value;
}
{
Handle(V3d_View) aView3d = myViewPort->getView();
if ( !aView3d.IsNull() ) {
+ #if OCC_VERSION_LARGE > 0x06090000
Graphic3d_RenderingParams* aParams = &aView3d->ChangeRenderingParams();
aParams->ToReverseStereo = reverse;
+ #endif
}
}
int reverse = false;
Handle(V3d_View) aView3d = myViewPort->getView();
if ( !aView3d.IsNull() ) {
+ #if OCC_VERSION_LARGE > 0x06090000
Graphic3d_RenderingParams* aParams = &aView3d->ChangeRenderingParams();
reverse = aParams->ToReverseStereo;
+ #endif
}
return reverse;
}
{
Handle(AIS_InteractiveContext) anIntCont = myModel->getAISContext();
if ( !anIntCont.IsNull() ) {
+ #if OCC_VERSION_LARGE > 0x06090000
Handle(OpenGl_GraphicDriver) aDriver = Handle(OpenGl_GraphicDriver)::DownCast(anIntCont->CurrentViewer()->Driver());
OpenGl_Caps* aCaps = &aDriver->ChangeOptions();
aCaps->swapInterval = enable;
+ #endif
}
}
int enable = true;
Handle(AIS_InteractiveContext) anIntCont = myModel->getAISContext();
if ( !anIntCont.IsNull() ) {
+ #if OCC_VERSION_LARGE > 0x06090000
Handle(OpenGl_GraphicDriver) aDriver = Handle(OpenGl_GraphicDriver)::DownCast(anIntCont->CurrentViewer()->Driver());
OpenGl_Caps* aCaps = &aDriver->ChangeOptions();
enable = aCaps->swapInterval;
+ #endif
}
return enable;
}
{
Handle(AIS_InteractiveContext) anIntCont = myModel->getAISContext();
if ( !anIntCont.IsNull() ) {
+ #if OCC_VERSION_LARGE > 0x06090000
Handle(OpenGl_GraphicDriver) aDriver = Handle(OpenGl_GraphicDriver)::DownCast(anIntCont->CurrentViewer()->Driver());
OpenGl_Caps* aCaps = &aDriver->ChangeOptions();
aCaps->contextStereo = enable;
+ #endif
}
}
int enable = true;
Handle(AIS_InteractiveContext) anIntCont = myModel->getAISContext();
if ( !anIntCont.IsNull() ) {
+ #if OCC_VERSION_LARGE > 0x06090000
Handle(OpenGl_GraphicDriver) aDriver = Handle(OpenGl_GraphicDriver)::DownCast(anIntCont->CurrentViewer()->Driver());
OpenGl_Caps* aCaps = &aDriver->ChangeOptions();
enable = aCaps->contextStereo;
+ #endif
}
return enable;
}
-#endif
+
+
bool OCCViewer_ViewWindow::isOpenGlStereoSupport() const
{
GLboolean support[1];