]> Creatis software - cpPlugins.git/blobdiff - lib/cpExtensions/Visualization/ImageInteractorStyle.cxx
Intermediary commit
[cpPlugins.git] / lib / cpExtensions / Visualization / ImageInteractorStyle.cxx
index aa688bff93ddfbc1e54ab54e6615c50bec858b43..f0f01b1fe76d9739026f8a246a273ec3bd3b5264 100644 (file)
@@ -30,13 +30,12 @@ AssociateImageActor( vtkImageActor* actor )
 void cpExtensions::Visualization::ImageInteractorStyle::
 OnMouseMove( )
 {
+  this->Superclass::OnMouseMove( );
+
   // Get current position on the associated actors
   vtkRenderWindowInteractor* rwi = this->GetInteractor( );
   if( rwi == NULL || this->MouseMoveCommand == NULL )
     return;
-  double pos[ 3 ];
-  if( !( this->_PickPosition( pos ) ) )
-    return;
 
   // Get modifiers
   bool alt = ( rwi->GetAltKey( ) == 1 );
@@ -44,6 +43,10 @@ OnMouseMove( )
   bool sft = ( rwi->GetShiftKey( ) == 1 );
   ButtonID button = this->GetButtonID( );
 
+  double pos[ 3 ];
+  if( !( this->_PickPosition( pos ) ) )
+    return;
+
   // Invoke possible events
   this->MouseMoveCommand( this->Data, button, pos, alt, ctr, sft );
   rwi->Render( );
@@ -64,6 +67,7 @@ OnMouseWheelForward( )
 
   // Invoke possible events
   this->MouseWheelCommand( this->Data, 1, alt, ctr, sft );
+  rwi->Render( );
 }
 
 // -------------------------------------------------------------------------
@@ -81,6 +85,7 @@ OnMouseWheelBackward( )
 
   // Invoke possible events
   this->MouseWheelCommand( this->Data, -1, alt, ctr, sft );
+  rwi->Render( );
 }
 
 // -------------------------------------------------------------------------
@@ -101,7 +106,10 @@ OnLeftClick( )
   bool sft = ( rwi->GetShiftKey( ) == 1 );
 
   // Invoke possible events
-  this->MouseClickCommand( this->Data, Self::ButtonID_Left, pos, alt, ctr, sft );
+  this->MouseClickCommand(
+    this->Data, Self::ButtonID_Left, pos, alt, ctr, sft
+    );
+  rwi->Render( );
 }
 
 // -------------------------------------------------------------------------
@@ -122,7 +130,10 @@ OnLeftDoubleClick( )
   bool sft = ( rwi->GetShiftKey( ) == 1 );
 
   // Invoke possible events
-  this->MouseDoubleClickCommand( this->Data, Self::ButtonID_Left, pos, alt, ctr, sft );
+  this->MouseDoubleClickCommand(
+    this->Data, Self::ButtonID_Left, pos, alt, ctr, sft
+    );
+  rwi->Render( );
 }
 
 // -------------------------------------------------------------------------
@@ -143,7 +154,10 @@ OnMiddleClick( )
   bool sft = ( rwi->GetShiftKey( ) == 1 );
 
   // Invoke possible events
-  this->MouseClickCommand( this->Data, Self::ButtonID_Middle, pos, alt, ctr, sft );
+  this->MouseClickCommand(
+    this->Data, Self::ButtonID_Middle, pos, alt, ctr, sft
+    );
+  rwi->Render( );
 }
 
 // -------------------------------------------------------------------------
@@ -164,7 +178,10 @@ OnMiddleDoubleClick( )
   bool sft = ( rwi->GetShiftKey( ) == 1 );
 
   // Invoke possible events
-  this->MouseDoubleClickCommand( this->Data, Self::ButtonID_Middle, pos, alt, ctr, sft );
+  this->MouseDoubleClickCommand(
+    this->Data, Self::ButtonID_Middle, pos, alt, ctr, sft
+    );
+  rwi->Render( );
 }
 
 // -------------------------------------------------------------------------
@@ -185,7 +202,10 @@ OnRightClick( )
   bool sft = ( rwi->GetShiftKey( ) == 1 );
 
   // Invoke possible events
-  this->MouseClickCommand( this->Data, Self::ButtonID_Right, pos, alt, ctr, sft );
+  this->MouseClickCommand(
+    this->Data, Self::ButtonID_Right, pos, alt, ctr, sft
+    );
+  rwi->Render( );
 }
 
 // -------------------------------------------------------------------------
@@ -206,7 +226,10 @@ OnRightDoubleClick( )
   bool sft = ( rwi->GetShiftKey( ) == 1 );
 
   // Invoke possible events
-  this->MouseDoubleClickCommand( this->Data, Self::ButtonID_Right, pos, alt, ctr, sft );
+  this->MouseDoubleClickCommand(
+    this->Data, Self::ButtonID_Right, pos, alt, ctr, sft
+    );
+  rwi->Render( );
 }
 
 // -------------------------------------------------------------------------
@@ -217,6 +240,7 @@ OnChar( )
   if( rwi == NULL || this->KeyCommand == NULL )
     return;
   this->KeyCommand( this->Data, rwi->GetKeyCode( ) );
+  rwi->Render( );
 }
 
 // -------------------------------------------------------------------------
@@ -226,6 +250,7 @@ OnExpose( )
   vtkRenderWindowInteractor* rwi = this->GetInteractor( );
   if( rwi == NULL )
     return;
+  rwi->Render( );
 }
 
 // -------------------------------------------------------------------------
@@ -235,6 +260,7 @@ OnConfigure( )
   vtkRenderWindowInteractor* rwi = this->GetInteractor( );
   if( rwi == NULL )
     return;
+  rwi->Render( );
 }
 
 // -------------------------------------------------------------------------
@@ -244,6 +270,7 @@ OnEnter( )
   vtkRenderWindowInteractor* rwi = this->GetInteractor( );
   if( rwi == NULL )
     return;
+  rwi->Render( );
 }
 
 // -------------------------------------------------------------------------
@@ -253,6 +280,7 @@ OnLeave( )
   vtkRenderWindowInteractor* rwi = this->GetInteractor( );
   if( rwi == NULL )
     return;
+  rwi->Render( );
 }
 
 // -------------------------------------------------------------------------