]> Creatis software - cpPlugins.git/blobdiff - lib/cpExtensions/Visualization/ImageInteractorStyle.cxx
Widget integration (step 5/6): Just one step leftgit shortlog !
[cpPlugins.git] / lib / cpExtensions / Visualization / ImageInteractorStyle.cxx
index f0f01b1fe76d9739026f8a246a273ec3bd3b5264..55df632c5997311e37ea50c3dcce16121baf4a51 100644 (file)
@@ -26,6 +26,18 @@ AssociateImageActor( vtkImageActor* actor )
   this->Modified( );
 }
 
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::ImageInteractorStyle::
+AssociateInteractor( vtkRenderWindowInteractor* rwi )
+{
+  if( rwi != NULL )
+  {
+    this->AssociatedInteractors.push_back( rwi );
+    this->Modified( );
+
+  } // fi
+}
+
 // -------------------------------------------------------------------------
 void cpExtensions::Visualization::ImageInteractorStyle::
 OnMouseMove( )
@@ -50,6 +62,7 @@ OnMouseMove( )
   // Invoke possible events
   this->MouseMoveCommand( this->Data, button, pos, alt, ctr, sft );
   rwi->Render( );
+  this->_RenderAssociatedInteractors( );
 }
 
 // -------------------------------------------------------------------------
@@ -68,6 +81,7 @@ OnMouseWheelForward( )
   // Invoke possible events
   this->MouseWheelCommand( this->Data, 1, alt, ctr, sft );
   rwi->Render( );
+  this->_RenderAssociatedInteractors( );
 }
 
 // -------------------------------------------------------------------------
@@ -86,6 +100,7 @@ OnMouseWheelBackward( )
   // Invoke possible events
   this->MouseWheelCommand( this->Data, -1, alt, ctr, sft );
   rwi->Render( );
+  this->_RenderAssociatedInteractors( );
 }
 
 // -------------------------------------------------------------------------
@@ -110,6 +125,7 @@ OnLeftClick( )
     this->Data, Self::ButtonID_Left, pos, alt, ctr, sft
     );
   rwi->Render( );
+  this->_RenderAssociatedInteractors( );
 }
 
 // -------------------------------------------------------------------------
@@ -134,6 +150,7 @@ OnLeftDoubleClick( )
     this->Data, Self::ButtonID_Left, pos, alt, ctr, sft
     );
   rwi->Render( );
+  this->_RenderAssociatedInteractors( );
 }
 
 // -------------------------------------------------------------------------
@@ -158,6 +175,7 @@ OnMiddleClick( )
     this->Data, Self::ButtonID_Middle, pos, alt, ctr, sft
     );
   rwi->Render( );
+  this->_RenderAssociatedInteractors( );
 }
 
 // -------------------------------------------------------------------------
@@ -182,6 +200,7 @@ OnMiddleDoubleClick( )
     this->Data, Self::ButtonID_Middle, pos, alt, ctr, sft
     );
   rwi->Render( );
+  this->_RenderAssociatedInteractors( );
 }
 
 // -------------------------------------------------------------------------
@@ -206,6 +225,7 @@ OnRightClick( )
     this->Data, Self::ButtonID_Right, pos, alt, ctr, sft
     );
   rwi->Render( );
+  this->_RenderAssociatedInteractors( );
 }
 
 // -------------------------------------------------------------------------
@@ -230,6 +250,7 @@ OnRightDoubleClick( )
     this->Data, Self::ButtonID_Right, pos, alt, ctr, sft
     );
   rwi->Render( );
+  this->_RenderAssociatedInteractors( );
 }
 
 // -------------------------------------------------------------------------
@@ -241,6 +262,7 @@ OnChar( )
     return;
   this->KeyCommand( this->Data, rwi->GetKeyCode( ) );
   rwi->Render( );
+  this->_RenderAssociatedInteractors( );
 }
 
 // -------------------------------------------------------------------------
@@ -251,6 +273,7 @@ OnExpose( )
   if( rwi == NULL )
     return;
   rwi->Render( );
+  this->_RenderAssociatedInteractors( );
 }
 
 // -------------------------------------------------------------------------
@@ -261,6 +284,7 @@ OnConfigure( )
   if( rwi == NULL )
     return;
   rwi->Render( );
+  this->_RenderAssociatedInteractors( );
 }
 
 // -------------------------------------------------------------------------
@@ -271,6 +295,7 @@ OnEnter( )
   if( rwi == NULL )
     return;
   rwi->Render( );
+  this->_RenderAssociatedInteractors( );
 }
 
 // -------------------------------------------------------------------------
@@ -281,6 +306,7 @@ OnLeave( )
   if( rwi == NULL )
     return;
   rwi->Render( );
+  this->_RenderAssociatedInteractors( );
 }
 
 // -------------------------------------------------------------------------
@@ -326,6 +352,14 @@ _PickPosition( double pos[ 3 ] )
   return( true );
 }
 
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::ImageInteractorStyle::
+_RenderAssociatedInteractors( )
+{
+  for( unsigned int i = 0; i < this->AssociatedInteractors.size( ); ++i )
+    this->AssociatedInteractors[ i ]->Render( );
+}
+
 /*
 #include <cmath>
 #include <ctime>