X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=lib%2FcpExtensions%2FVisualization%2FImageInteractorStyle.cxx;h=55df632c5997311e37ea50c3dcce16121baf4a51;hb=9586180ab9da1ba2778099482b0231b933192719;hp=f0f01b1fe76d9739026f8a246a273ec3bd3b5264;hpb=4c644edb0ddb4adcf7bbecc8fb2316723df15825;p=cpPlugins.git diff --git a/lib/cpExtensions/Visualization/ImageInteractorStyle.cxx b/lib/cpExtensions/Visualization/ImageInteractorStyle.cxx index f0f01b1..55df632 100644 --- a/lib/cpExtensions/Visualization/ImageInteractorStyle.cxx +++ b/lib/cpExtensions/Visualization/ImageInteractorStyle.cxx @@ -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 #include