]> Creatis software - cpPlugins.git/blobdiff - lib/cpExtensions/Interaction/ImageInteractorStyle.cxx
More widgets added
[cpPlugins.git] / lib / cpExtensions / Interaction / ImageInteractorStyle.cxx
similarity index 61%
rename from lib/cpExtensions/Visualization/ImageInteractorStyle.cxx
rename to lib/cpExtensions/Interaction/ImageInteractorStyle.cxx
index 9ed180ad93a42e45229d5508e5e5e4490b0a0e15..d0a313760b8bac6e1c8096b8eed35f85a8b78dda 100644 (file)
@@ -1,18 +1,18 @@
-#include <cpExtensions/Visualization/ImageInteractorStyle.h>
+#include <cpExtensions/Interaction/ImageInteractorStyle.h>
 
 #include <vtkImageActor.h>
 #include <vtkRenderWindowInteractor.h>
 
 // -------------------------------------------------------------------------
-cpExtensions::Visualization::ImageInteractorStyle::
-Self* cpExtensions::Visualization::ImageInteractorStyle::
+cpExtensions::Interaction::ImageInteractorStyle::
+Self* cpExtensions::Interaction::ImageInteractorStyle::
 New( )
 {
   return( new Self );
 }
 
 // -------------------------------------------------------------------------
-void cpExtensions::Visualization::ImageInteractorStyle::
+void cpExtensions::Interaction::ImageInteractorStyle::
 AssociateImageActor( vtkImageActor* actor )
 {
   if( actor != NULL )
@@ -24,7 +24,7 @@ AssociateImageActor( vtkImageActor* actor )
 }
 
 // -------------------------------------------------------------------------
-cpExtensions::Visualization::ImageInteractorStyle::
+cpExtensions::Interaction::ImageInteractorStyle::
 ImageInteractorStyle( )
   : Superclass( )
 {
@@ -33,27 +33,29 @@ ImageInteractorStyle( )
 }
 
 // -------------------------------------------------------------------------
-cpExtensions::Visualization::ImageInteractorStyle::
+cpExtensions::Interaction::ImageInteractorStyle::
 ~ImageInteractorStyle( )
 {
 }
 
 // -------------------------------------------------------------------------
-bool cpExtensions::Visualization::ImageInteractorStyle::
-_PickPosition( double pos[ 3 ] )
+bool cpExtensions::Interaction::ImageInteractorStyle::
+_PickPosition( int idx[ 2 ], double pos[ 3 ] )
 {
-  static const double _0 = double( 0 );
   vtkRenderWindowInteractor* rwi = this->GetInteractor( );
   if( rwi == NULL )
     return( false );
 
   // Find the renderer where the event has been raised
-  double x = double( rwi->GetEventPosition( )[ 0 ] );
-  double y = double( rwi->GetEventPosition( )[ 1 ] );
-  this->FindPokedRenderer( x, y );
+  idx[ 0 ] = rwi->GetEventPosition( )[ 0 ];
+  idx[ 1 ] = rwi->GetEventPosition( )[ 1 ];
+  this->FindPokedRenderer( double( idx[ 0 ] ), double( idx[ 1 ] ) );
 
   // Pick a 3D position
-  int r = this->m_PropPicker->Pick( x, y, _0, this->CurrentRenderer );
+  int r = this->m_PropPicker->Pick(
+    double( idx[ 0 ] ), double( idx[ 1 ] ), double( 0 ),
+    this->CurrentRenderer
+    );
   if( r == 0 )
     return( false );
   this->m_PropPicker->GetPickPosition( pos );