]> Creatis software - cpPlugins.git/blob - lib/cpPlugins/Pipeline/Object.cxx
abcac9c57ad32b2950d71323e461acca4bc02247
[cpPlugins.git] / lib / cpPlugins / Pipeline / Object.cxx
1 #include <cpPlugins/Pipeline/Object.h>
2
3 #include <itkObject.h>
4 #include <vtkObject.h>
5
6 // -------------------------------------------------------------------------
7 const float& cpPlugins::Pipeline::Object::
8 GetViewX( ) const
9 {
10   return( this->m_ViewX );
11 }
12
13 // -------------------------------------------------------------------------
14 const float& cpPlugins::Pipeline::Object::
15 GetViewY( ) const
16 {
17   return( this->m_ViewY );
18 }
19
20 // -------------------------------------------------------------------------
21 void cpPlugins::Pipeline::Object::
22 SetViewCoords( float x, float y )
23 {
24   this->m_ViewX = x;
25   this->m_ViewY = y;
26   // WARNING: do not call "this->Modified( )" -> It could lead to
27   //          re-execution of all pipeline
28 }
29
30 // -------------------------------------------------------------------------
31 void cpPlugins::Pipeline::Object::
32 Modified( ) const
33 {
34   const itk::Object* i =
35     dynamic_cast< const itk::Object* >( this->m_ITK.GetPointer( ) );
36   vtkObject* v = dynamic_cast< vtkObject* >( this->m_VTK.GetPointer( ) );
37   if( i != NULL ) i->Modified( );
38   if( v != NULL ) v->Modified( );
39   this->Superclass::Modified( );
40 }
41
42 // -------------------------------------------------------------------------
43 void cpPlugins::Pipeline::Object::
44 SetITK( itk::LightObject* o )
45 {
46   if( this->m_ITK.GetPointer( ) != o )
47   {
48     this->m_ITK = o;
49     this->Modified( );
50
51   } // fi
52 }
53
54 // -------------------------------------------------------------------------
55 void cpPlugins::Pipeline::Object::
56 SetVTK( vtkObjectBase* o )
57 {
58   if( this->m_VTK.GetPointer( ) != o )
59   {
60     this->m_VTK = o;
61     this->Modified( );
62
63   } // fi
64 }
65
66 // -------------------------------------------------------------------------
67 cpPlugins::Pipeline::Object::
68 Object( )
69   : m_ITK( NULL ),
70     m_VTK( NULL ),
71     m_ViewX( float( 0 ) ),
72     m_ViewY( float( 0 ) )
73 {
74 }
75
76 // -------------------------------------------------------------------------
77 cpPlugins::Pipeline::Object::
78 ~Object( )
79 {
80 }
81
82 // -------------------------------------------------------------------------
83 void cpPlugins::Pipeline::Object::
84 _UpdateITK( ) const
85 {
86   // WARNING: do nothing since this is supposed to be defined by DataObjects
87   // with ITK-VTK conversion strategies.
88 }
89
90 // -------------------------------------------------------------------------
91 void cpPlugins::Pipeline::Object::
92 _UpdateVTK( ) const
93 {
94   // WARNING: do nothing since this is supposed to be defined by DataObjects
95   // with ITK-VTK conversion strategies.
96 }
97
98 // eof - $RCSfile$