Salome HOME
Moved some functionality to VTKViewer_Utilities.h
[modules/kernel.git] / src / OCCViewer / OCCViewer_ViewPort3d.cxx
index 88601ea0bfc73307fdd147b6d4ccf9886589ac3c..0ace89025e595e3354be5a7024d17fe80f65a3fc 100644 (file)
@@ -26,7 +26,6 @@
 //  Module : SALOME
 //  $Header$
 
-using namespace std;
 #include "OCCViewer_ViewPort3d.h"
 
 #include "QAD.h"
@@ -47,6 +46,8 @@ using namespace std;
 #include <Xw.hxx>
 #endif
 
+using namespace std;
+
 /*!
     Constructor
 */
@@ -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();
+}
+
+