X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpExtensions%2FVisualization%2FImageSliceActors.cxx;h=f945bd397eb6c6b885f61f5e234c2bdb44182c7e;hb=d1d816d1eaf980d5cd266798b8f7a0bbb089a383;hp=31787e54fc66c9e7736ea37180e4adf19a2fa573;hpb=4f6c47b5d9994cd1bbb601bfe8bc087a0a619e72;p=cpPlugins.git diff --git a/lib/cpExtensions/Visualization/ImageSliceActors.cxx b/lib/cpExtensions/Visualization/ImageSliceActors.cxx index 31787e5..f945bd3 100644 --- a/lib/cpExtensions/Visualization/ImageSliceActors.cxx +++ b/lib/cpExtensions/Visualization/ImageSliceActors.cxx @@ -170,10 +170,17 @@ GetPlaneFunction( ) const void cpExtensions::Visualization::ImageSliceActors:: AddActor( vtkAlgorithm* algorithm, vtkActor* actor ) { - this->OtherActors.push_back( std::pair< vtkSmartPointer< vtkAlgorithm >, vtkSmartPointer< vtkActor > >( algorithm, actor ) ); + this->OtherActors.push_back( TActorPair( algorithm, actor ) ); this->AddItem( actor ); } +// ------------------------------------------------------------------------- +void cpExtensions::Visualization::ImageSliceActors:: +AddActor( vtkActor* actor ) +{ + this->AddActor( NULL, actor ); +} + // ------------------------------------------------------------------------- void cpExtensions::Visualization::ImageSliceActors:: SetInterpolate( bool v ) @@ -376,12 +383,19 @@ SetSliceNumber( const int& slice ) // Prepare other actors to update for( unsigned int i = 0; i < this->OtherActors.size( ); ++i ) { -#error CLEAN UP CODING STYLE AND NULL POINTER CHECK + if( this->OtherActors[ i ].first.GetPointer( ) != NULL ) + { + this->OtherActors[ i ].first->Modified( ); + this->OtherActors[ i ].first->Update( ); + + } // fi + + if( this->OtherActors[ i ].second.GetPointer( ) != NULL ) + { + this->OtherActors[ i ].second->GetMapper( )->Modified( ); + this->OtherActors[ i ].second->Modified( ); - this->OtherActors[ i ].first->Modified( ); - this->OtherActors[ i ].first->Update( ); - this->OtherActors[ i ].second->GetMapper( )->Modified( ); - this->OtherActors[ i ].second->Modified( ); + } // fi } // rof