]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
OCCT 6.9.0 compatibility (OCCT stereo render integrated in IR-2015-06-25) edited
authorimn <imn@opencascade.com>
Fri, 17 Jul 2015 17:08:48 +0000 (20:08 +0300)
committerimn <imn@opencascade.com>
Fri, 17 Jul 2015 17:08:48 +0000 (20:08 +0300)
src/OCCViewer/OCCViewer_ViewFrame.cxx
src/OCCViewer/OCCViewer_ViewFrame.h
src/OCCViewer/OCCViewer_ViewModel.cxx
src/OCCViewer/OCCViewer_ViewModel.h
src/OCCViewer/OCCViewer_ViewWindow.cxx
src/OCCViewer/OCCViewer_ViewWindow.h

index 23945aeadd0b3f330f74178b32985b54c08890a2..5907af309539dc23729ca01787f1d5220be3329d 100644 (file)
@@ -327,7 +327,7 @@ void OCCViewer_ViewFrame::setProjectionType( int t)
     aView->setProjectionType(t);
   }
 }
-#if OCC_VERSION_LARGE > 0x06090000
+
 //**************************************************************************************
 int OCCViewer_ViewFrame::stereoType() const
 {
@@ -437,7 +437,7 @@ void OCCViewer_ViewFrame::setQuadBufferSupport( bool t)
     aView->setQuadBufferSupport(t);
   }
 }
-#endif
+
 //**************************************************************************************
 void OCCViewer_ViewFrame::setZoomingStyle( const int i ) 
 { 
index 8fd06d6c51ee060c6373c09bc721f2ca38c1917c..1e56502dafe66bae1ec913ba1aa1a7c8e5acf0e2 100644 (file)
@@ -72,7 +72,7 @@ public:
 
   virtual int projectionType() const;
   virtual void setProjectionType( int );
-#if OCC_VERSION_LARGE > 0x06090000
+
   virtual int stereoType() const;
   virtual void setStereoType( const int );
 
@@ -95,7 +95,7 @@ public:
 
   virtual bool isQuadBufferSupport() const;
   virtual void setQuadBufferSupport( const bool );
-#endif
+
   virtual int  zoomingStyle() const { return getView(MAIN_VIEW)->zoomingStyle(); }
   virtual void setZoomingStyle( const int );
 
index f94fbba33c8a2642a3b9e8d872263647f1fd1f87..afa24d3751b1bfbb5dca460b583338cc8a200e4e 100755 (executable)
@@ -169,7 +169,6 @@ OCCViewer_Viewer::OCCViewer_Viewer( bool DisplayTrihedron)
 
   // set projection type to orthographic
   myProjectionType = 0;
-#if OCC_VERSION_LARGE > 0x06090000
   // set stereo parameters
   myStereoType = 0;
   myAnaglyphFilter = 0;
@@ -180,7 +179,6 @@ OCCViewer_Viewer::OCCViewer_Viewer( bool DisplayTrihedron)
   myInterocularDistanceType = 1;
   myStereographicFocusValue = 1.0;
   myInterocularDistanceValue = 0.05;
-#endif
   //set clipping color and texture to standard
   myClippingColor = QColor( 50, 50, 50 );
   myDefaultTextureUsed = true;
@@ -245,7 +243,6 @@ void OCCViewer_Viewer::initView( OCCViewer_ViewWindow* view )
     view->initSketchers();
     view->setInteractionStyle( interactionStyle() );
     view->setProjectionType( projectionType() );
-#if OCC_VERSION_LARGE > 0x06090000
     view->setStereoType( stereoType() );
     view->setAnaglyphFilter( anaglyphFilter() );
     view->setStereographicFocus( stereographicFocusType(), stereographicFocusValue() );
@@ -253,7 +250,6 @@ void OCCViewer_Viewer::initView( OCCViewer_ViewWindow* view )
     view->setReverseStereo( isReverseStereo() );
     view->setVSync( isVSync() );
     view->setQuadBufferSupport( isQuadBufferSupport() );
-#endif
     view->setZoomingStyle( zoomingStyle() );
     view->enablePreselection( isPreselectionEnabled() );
     view->enableSelection( isSelectionEnabled() );
@@ -544,7 +540,7 @@ void OCCViewer_Viewer::setProjectionType( const int theType )
     }
   }
 }
-#if OCC_VERSION_LARGE > 0x06090000
+
 /*!
   \return stereo type
 */
@@ -760,7 +756,7 @@ void OCCViewer_Viewer::setQuadBufferSupport( const bool theEnable )
       win->setQuadBufferSupport( theEnable );
   }
 }
-#endif
+
 /*!
   \return zooming style
 */
index 191e41760e89c1e7caa4588ba30a7e645e3b6b5c..0115104bfdb1a2666d6ca7aefe215b418ac82952 100755 (executable)
@@ -143,7 +143,6 @@ public:
 
   int                             projectionType() const;
   void                            setProjectionType( const int );
-#if OCC_VERSION_LARGE > 0x06090000
   int                             stereoType() const;
   void                            setStereoType( const int );
 
@@ -166,7 +165,6 @@ public:
 
   bool                            isQuadBufferSupport() const;
   void                            setQuadBufferSupport( const bool );
-#endif
   int                             zoomingStyle() const;
   void                            setZoomingStyle( const int );
 
@@ -243,12 +241,10 @@ protected:
   int                             myInteractionStyle;
   int                             myZoomingStyle;
   int                             myProjectionType;
-#if OCC_VERSION_LARGE > 0x06090000
   int                             myStereoType;
   int                             myAnaglyphFilter;
   int                             myStereographicFocusType;
   int                             myInterocularDistanceType;
-#endif
 
   double                          myStereographicFocusValue;
   double                          myInterocularDistanceValue;
@@ -257,11 +253,9 @@ protected:
   bool                            mySelectionEnabled;
   bool                            myMultiSelectionEnabled;
   bool                            myIsRelative;
-#if OCC_VERSION_LARGE > 0x06090000
   bool                            myToReverseStereo;
   bool                            myVSyncMode;
   bool                            myQuadBufferSupport;
-#endif
 
   int                             myTopLayerId;
 
index 31e415c4ea503d682c1876bf8d51335aed41ccc5..6d03da7df0ddb8e68acd2c8b67194df9a5a9e718 100755 (executable)
@@ -2917,13 +2917,14 @@ int OCCViewer_ViewWindow::projectionType() const
   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
   }
 }
 
@@ -2932,8 +2933,10 @@ int OCCViewer_ViewWindow::stereoType() const
   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;
 }
@@ -2942,6 +2945,7 @@ void OCCViewer_ViewWindow::setAnaglyphFilter( int 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;
@@ -2949,6 +2953,7 @@ void OCCViewer_ViewWindow::setAnaglyphFilter( int type )
       aParams->AnaglyphFilter = Graphic3d_RenderingParams::Anaglyph_YellowBlue_Optimized;
     if (type == GreenMagenta)
       aParams->AnaglyphFilter = Graphic3d_RenderingParams::Anaglyph_GreenMagenta_Simple;
+  #endif
   }
 }
 
@@ -2957,6 +2962,7 @@ int OCCViewer_ViewWindow::anaglyphFilter() const
   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;
@@ -2964,6 +2970,7 @@ int OCCViewer_ViewWindow::anaglyphFilter() const
       type = YellowBlue;
     if (aParams->AnaglyphFilter == Graphic3d_RenderingParams::Anaglyph_GreenMagenta_Simple)
       type = GreenMagenta;
+  #endif
   }
   return type;
 }
@@ -2972,8 +2979,10 @@ void OCCViewer_ViewWindow::setStereographicFocus( int type, double value )
 {
   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
   }
 }
 
@@ -2982,8 +2991,10 @@ int OCCViewer_ViewWindow::stereographicFocusType() const
   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;
 }
@@ -2993,8 +3004,10 @@ double OCCViewer_ViewWindow::stereographicFocusValue() const
   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;
 }
@@ -3003,8 +3016,10 @@ void OCCViewer_ViewWindow::setInterocularDistance( int type, double 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
   }
 }
 
@@ -3013,8 +3028,10 @@ int OCCViewer_ViewWindow::interocularDistanceType() const
   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;
 }
@@ -3024,8 +3041,10 @@ double OCCViewer_ViewWindow::interocularDistanceValue() const
   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;
 }
@@ -3034,8 +3053,10 @@ void OCCViewer_ViewWindow::setReverseStereo( bool reverse )
 {
   Handle(V3d_View) aView3d = myViewPort->getView();
   if ( !aView3d.IsNull() ) {
+  #if OCC_VERSION_LARGE > 0x06090000
     Graphic3d_RenderingParams* aParams = &aView3d->ChangeRenderingParams();
     aParams->ToReverseStereo = reverse;
+  #endif
   }
 }
 
@@ -3044,8 +3065,10 @@ bool OCCViewer_ViewWindow::isReverseStereo() const
   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;
 }
@@ -3054,9 +3077,11 @@ void OCCViewer_ViewWindow::setVSync( bool 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->swapInterval = enable;
+  #endif
   }
 }
 
@@ -3065,9 +3090,11 @@ bool OCCViewer_ViewWindow::isVSync() const
   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;
 }
@@ -3076,9 +3103,11 @@ void OCCViewer_ViewWindow::setQuadBufferSupport( bool 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
   }
 }
 
@@ -3087,13 +3116,16 @@ bool OCCViewer_ViewWindow::isQuadBufferSupport() const
   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];
index 5a1ef0424a7c0ac954566e7ade1f0373d199101c..08f4202e36ebe299ccb832e69027767a49de7a94 100755 (executable)
@@ -216,7 +216,7 @@ public:
  
   virtual int                     projectionType() const;
   virtual void                    setProjectionType( int );
-#if OCC_VERSION_LARGE > 0x06090000
+
   virtual int                     stereoType() const;
   virtual void                    setStereoType( const int );
 
@@ -239,7 +239,7 @@ public:
 
   virtual bool                    isQuadBufferSupport() const;
   virtual void                    setQuadBufferSupport( const bool );
-#endif
+
   void setTransformEnabled( const OperationType, const bool );
   bool transformEnabled( const OperationType ) const;