X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpPlugins%2FPipeline%2FObject.cxx;fp=lib%2FcpPlugins%2FPipeline%2FObject.cxx;h=abcac9c57ad32b2950d71323e461acca4bc02247;hb=3c250e0e573d7f08276aefd93a5336f128e6b1a7;hp=0000000000000000000000000000000000000000;hpb=32cfe91acc85230333199444bc712ea86da65c4e;p=cpPlugins.git diff --git a/lib/cpPlugins/Pipeline/Object.cxx b/lib/cpPlugins/Pipeline/Object.cxx new file mode 100644 index 0000000..abcac9c --- /dev/null +++ b/lib/cpPlugins/Pipeline/Object.cxx @@ -0,0 +1,98 @@ +#include + +#include +#include + +// ------------------------------------------------------------------------- +const float& cpPlugins::Pipeline::Object:: +GetViewX( ) const +{ + return( this->m_ViewX ); +} + +// ------------------------------------------------------------------------- +const float& cpPlugins::Pipeline::Object:: +GetViewY( ) const +{ + return( this->m_ViewY ); +} + +// ------------------------------------------------------------------------- +void cpPlugins::Pipeline::Object:: +SetViewCoords( float x, float y ) +{ + this->m_ViewX = x; + this->m_ViewY = y; + // WARNING: do not call "this->Modified( )" -> It could lead to + // re-execution of all pipeline +} + +// ------------------------------------------------------------------------- +void cpPlugins::Pipeline::Object:: +Modified( ) const +{ + 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( ); +} + +// ------------------------------------------------------------------------- +void cpPlugins::Pipeline::Object:: +SetITK( itk::LightObject* o ) +{ + if( this->m_ITK.GetPointer( ) != o ) + { + this->m_ITK = o; + this->Modified( ); + + } // fi +} + +// ------------------------------------------------------------------------- +void cpPlugins::Pipeline::Object:: +SetVTK( vtkObjectBase* o ) +{ + if( this->m_VTK.GetPointer( ) != o ) + { + this->m_VTK = o; + this->Modified( ); + + } // fi +} + +// ------------------------------------------------------------------------- +cpPlugins::Pipeline::Object:: +Object( ) + : m_ITK( NULL ), + m_VTK( NULL ), + m_ViewX( float( 0 ) ), + m_ViewY( float( 0 ) ) +{ +} + +// ------------------------------------------------------------------------- +cpPlugins::Pipeline::Object:: +~Object( ) +{ +} + +// ------------------------------------------------------------------------- +void cpPlugins::Pipeline::Object:: +_UpdateITK( ) const +{ + // WARNING: do nothing since this is supposed to be defined by DataObjects + // with ITK-VTK conversion strategies. +} + +// ------------------------------------------------------------------------- +void cpPlugins::Pipeline::Object:: +_UpdateVTK( ) const +{ + // WARNING: do nothing since this is supposed to be defined by DataObjects + // with ITK-VTK conversion strategies. +} + +// eof - $RCSfile$