X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpPlugins%2FInterface%2FObject.cxx;h=3e259169d517d949665405550f98c544c63aa32f;hb=1b600247da314fe62d007ca8a0ce24d0006931f4;hp=85ef6a123f332d99ff8093906333cebe9fce8c3d;hpb=d5863750d8146d52ee20ce7835f5fb92e6d13fe9;p=cpPlugins.git diff --git a/lib/cpPlugins/Interface/Object.cxx b/lib/cpPlugins/Interface/Object.cxx index 85ef6a1..3e25916 100644 --- a/lib/cpPlugins/Interface/Object.cxx +++ b/lib/cpPlugins/Interface/Object.cxx @@ -1,10 +1,60 @@ #include +#include +#include + +// ------------------------------------------------------------------------- +void cpPlugins::Interface::Object:: +Modified( ) const +{ + const itk::Object* i = this->GetITK< itk::Object >( ); + vtkObject* v = const_cast< vtkObject* >( this->GetVTK< vtkObject >( ) ); + if( i != NULL ) i->Modified( ); + if( v != NULL ) v->Modified( ); + this->Superclass::Modified( ); +} + +// ------------------------------------------------------------------------- +void cpPlugins::Interface::Object:: +SetViewCoords( float x, float y ) +{ + this->SetViewX( x ); + this->SetViewY( y ); +} + +// ------------------------------------------------------------------------- +void cpPlugins::Interface::Object:: +SetITK( itk::LightObject* o ) +{ + if( this->m_ITKObject.GetPointer( ) != o ) + { + this->m_ITKObject = o; + this->Modified( ); + + } // fi +} + +// ------------------------------------------------------------------------- +void cpPlugins::Interface::Object:: +SetVTK( vtkObjectBase* o ) +{ + if( this->m_VTKObject.GetPointer( ) != o ) + { + this->m_VTKObject = o; + this->Modified( ); + + } // fi +} + // ------------------------------------------------------------------------- cpPlugins::Interface::Object:: Object( ) : Superclass( ), - m_Name( "" ) + m_ITKObject( NULL ), + m_VTKObject( NULL ), + m_Name( "" ), + m_ViewX( float( 0 ) ), + m_ViewY( float( 0 ) ) { }