Salome HOME
Moved some functionality to VTKViewer_Utilities.h
[modules/kernel.git] / src / OCCViewer / OCCViewer_ViewPort3d.cxx
index 6a5d747a80cb3acde91b43136a8518fc88df3298..0ace89025e595e3354be5a7024d17fe80f65a3fc 100644 (file)
@@ -45,6 +45,7 @@
 #if !defined WNT
 #include <Xw.hxx>
 #endif
+
 using namespace std;
 
 /*!
@@ -83,8 +84,6 @@ void OCCViewer_ViewPort3d::onCreatePopup()
 {
   if ( myPopup ) {     
     QAD_Desktop*     Desktop = (QAD_Desktop*) QAD_Application::getDesktop();
-    QAD_Study*   myActiveStudy = Desktop->getActiveStudy();
-    SALOME_Selection*      Sel = SALOME_Selection::Selection( myActiveStudy->getSelection() );
     
     QString theContext;
     QString theParent("Viewer");
@@ -295,10 +294,11 @@ void OCCViewer_ViewPort3d::setBackgroundColor( const QColor& color)
       myActiveView->SetBackgroundColor( Quantity_TOC_RGB, color.red()/255., 
                                        color.green()/255., color.blue()/255.);
 
+      /* VSR : PAL5420 ---------------------------------------------------
       QAD_CONFIG->addSetting( "OCCViewer:BackgroundColorRed",   color.red() );
       QAD_CONFIG->addSetting( "OCCViewer:BackgroundColorGreen", color.green() );
       QAD_CONFIG->addSetting( "OCCViewer:BackgroundColorBlue",  color.blue() );
-      
+      VSR : PAL5420 --------------------------------------------------- */
       myActiveView->Update();
     }
 }
@@ -384,3 +384,35 @@ void OCCViewer_ViewPort3d::reset()
       myActiveView->Reset();
     }
 }
+
+/*!
+  Incremental panning
+*/
+void OCCViewer_ViewPort3d::incrementalPan( const int incrX, const int incrY )
+{
+  this->pan( incrX, incrY );
+}
+
+/*!
+  Incremental zooming
+*/
+void OCCViewer_ViewPort3d::incrementalZoom( const int incr )
+{
+  int cx = width()  / 2;
+  int cy = height() / 2;
+  this->zoom( cx, cy, cx + incr, cy + incr );
+}
+
+/*!
+  Incremental rotating
+*/
+void OCCViewer_ViewPort3d::incrementalRotate( const int incrX, const int incrY )
+{
+  int cx = width()  / 2;
+  int cy = height() / 2;
+  this->startRotation( cx, cy );
+  this->rotate( cx + incrX, cy + incrY );
+  this->endRotation();
+}
+
+