Salome HOME
Upgrade to paraview 5.4
[modules/gui.git] / src / SVTK / SVTK_ViewModel.cxx
index 4a257b5f7fc07edd40b46805432cf651e6308e5f..28bc07177cc4b7979a05a8d4d885bae60918a659 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -94,6 +94,7 @@ SVTK_Viewer::SVTK_Viewer()
   mySpaceBtn[1] = 2;
   mySpaceBtn[2] = 9;
   myDefaultBackground = Qtx::BackgroundData( Qt::black );
+  myQuadBufferSupport = false;
 }
 
 /*!
@@ -196,6 +197,7 @@ SUIT_ViewWindow* SVTK_Viewer::createView( SUIT_Desktop* theDesktop )
   aViewWindow->SetProjectionMode( projectionMode() );
   aViewWindow->SetStereoType( stereoType() );
   aViewWindow->SetAnaglyphFilter( anaglyphFilter() );
+  aViewWindow->SetQuadBufferSupport( isQuadBufferSupport() );
   aViewWindow->SetInteractionStyle( interactionStyle() );
   aViewWindow->SetZoomingStyle( zoomingStyle() );
   aViewWindow->SetPreSelectionMode( preSelectionMode() );
@@ -358,6 +360,33 @@ void SVTK_Viewer::setAnaglyphFilter( const int theFilter )
   }
 }
 
+/*!
+  \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
 */
@@ -536,7 +565,7 @@ void SVTK_Viewer::contextMenuPopup( QMenu* thePopup )
 
   if(TViewWindow* aView = dynamic_cast<TViewWindow*>(myViewManager->getActiveView())){
     //Support of several toolbars in the popup menu
-    QList<QToolBar*> lst = qFindChildren<QToolBar*>( aView );
+    QList<QToolBar*> lst = aView->findChildren<QToolBar*>();
     QList<QToolBar*>::const_iterator it = lst.begin(), last = lst.end();
     for( ; it!=last; it++ )
       thePopup->addAction( (*it)->toggleViewAction() );