]> Creatis software - cpPlugins.git/blob - lib/cpPlugins/Interface/Object.cxx
...
[cpPlugins.git] / lib / cpPlugins / Interface / Object.cxx
1 #include <cpPlugins/Interface/Object.h>
2
3 #include <itkObject.h>
4 #include <vtkObject.h>
5
6 // -------------------------------------------------------------------------
7 void cpPlugins::Interface::Object::
8 Modified( ) const
9 {
10   const itk::Object* i = this->GetITK< itk::Object >( );
11   vtkObject* v = const_cast< vtkObject* >( this->GetVTK< vtkObject >( ) );
12   if( i != NULL ) i->Modified( );
13   if( v != NULL ) v->Modified( );
14   this->Superclass::Modified( );
15 }
16
17 // -------------------------------------------------------------------------
18 void cpPlugins::Interface::Object::
19 SetViewCoords( float x, float y )
20 {
21   this->SetViewX( x );
22   this->SetViewY( y );
23 }
24
25 // -------------------------------------------------------------------------
26 void cpPlugins::Interface::Object::
27 SetITK( itk::LightObject* o )
28 {
29   if( this->m_ITKObject.GetPointer( ) != o )
30   {
31     this->m_ITKObject = o;
32     this->Modified( );
33
34   } // fi
35 }
36
37 // -------------------------------------------------------------------------
38 void cpPlugins::Interface::Object::
39 SetVTK( vtkObjectBase* o )
40 {
41   if( this->m_VTKObject.GetPointer( ) != o )
42   {
43     this->m_VTKObject = o;
44     this->Modified( );
45
46   } // fi
47 }
48
49 // -------------------------------------------------------------------------
50 cpPlugins::Interface::Object::
51 Object( )
52   : Superclass( ),
53     m_ITKObject( NULL ),
54     m_VTKObject( NULL ),
55     m_Name( "" ),
56     m_ViewX( float( 0 ) ),
57     m_ViewY( float( 0 ) )
58 {
59 }
60
61 // -------------------------------------------------------------------------
62 cpPlugins::Interface::Object::
63 ~Object( )
64 {
65 }
66
67 // eof - $RCSfile$