X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpPlugins%2FBaseObjects%2FObject.cxx;h=bb9ab4a211923d00f53f51cd2460cc29d7d8eec4;hb=510ac31d52c1ac725baf278243c958e6c564b5b3;hp=89d7fe6a59c4c5a4a60d7ceb44a08c398dc56c8f;hpb=3393941bf8f26babc7b592db434b40c1b747a687;p=cpPlugins.git diff --git a/lib/cpPlugins/BaseObjects/Object.cxx b/lib/cpPlugins/BaseObjects/Object.cxx index 89d7fe6..bb9ab4a 100644 --- a/lib/cpPlugins/BaseObjects/Object.cxx +++ b/lib/cpPlugins/BaseObjects/Object.cxx @@ -23,7 +23,7 @@ SetViewCoords( float x, float y ) { this->m_ViewX = x; this->m_ViewY = y; - // WARNING: do not call "this->Modified( )" -> It could lead to a + // WARNING: do not call "this->Modified( )" -> It could lead to // re-execution of all pipeline } @@ -31,33 +31,14 @@ SetViewCoords( float x, float y ) void cpPlugins::BaseObjects::Object:: Modified( ) const { - const itk::Object* i = this->GetITK< itk::Object >( ); - vtkObject* v = const_cast< vtkObject* >( this->GetVTK< vtkObject >( ) ); + const itk::Object* i = + dynamic_cast< const itk::Object* >( this->m_ITK.GetPointer( ) ); + vtkObject* v = dynamic_cast< vtkObject* >( this->m_VTK.GetPointer( ) ); if( i != NULL ) i->Modified( ); if( v != NULL ) v->Modified( ); this->Superclass::Modified( ); } -// ------------------------------------------------------------------------- -itk::ModifiedTimeType cpPlugins::BaseObjects::Object:: -GetMTime( ) const -{ - const itk::Object* i = this->GetITK< itk::Object >( ); - vtkObject* v = const_cast< vtkObject* >( this->GetVTK< vtkObject >( ) ); - if( i != NULL && v == NULL ) - return( i->GetMTime( ) ); - else if( i == NULL && v != NULL ) - return( v->GetMTime( ) ); - else if( i != NULL && v != NULL ) - { - auto iTime = i->GetMTime( ); - auto vTime = i->GetMTime( ); - return( itk::ModifiedTimeType( ( iTime > vTime )? iTime: vTime ) ); - } - else - return( this->Superclass::GetMTime( ) ); -} - // ------------------------------------------------------------------------- void cpPlugins::BaseObjects::Object:: SetITK( itk::LightObject* o ) @@ -98,4 +79,20 @@ cpPlugins::BaseObjects::Object:: { } +// ------------------------------------------------------------------------- +void cpPlugins::BaseObjects::Object:: +_UpdateITK( ) const +{ + // WARNING: do nothing since this is supposed to be defined by DataObjects + // with ITK-VTK conversion strategies. +} + +// ------------------------------------------------------------------------- +void cpPlugins::BaseObjects::Object:: +_UpdateVTK( ) const +{ + // WARNING: do nothing since this is supposed to be defined by DataObjects + // with ITK-VTK conversion strategies. +} + // eof - $RCSfile$