1 #include <cpPlugins/BaseObjects/Object.h>
6 // -------------------------------------------------------------------------
7 const float& cpPlugins::BaseObjects::Object::
10 return( this->m_ViewX );
13 // -------------------------------------------------------------------------
14 const float& cpPlugins::BaseObjects::Object::
17 return( this->m_ViewY );
20 // -------------------------------------------------------------------------
21 void cpPlugins::BaseObjects::Object::
22 SetViewCoords( float x, float y )
26 // WARNING: do not call "this->Modified( )" -> It could lead to
27 // re-execution of all pipeline
30 // -------------------------------------------------------------------------
31 void cpPlugins::BaseObjects::Object::
34 const itk::Object* i = this->GetITK< itk::Object >( );
35 vtkObject* v = const_cast< vtkObject* >( this->GetVTK< vtkObject >( ) );
36 if( i != NULL ) i->Modified( );
37 if( v != NULL ) v->Modified( );
38 this->Superclass::Modified( );
41 // -------------------------------------------------------------------------
42 itk::ModifiedTimeType cpPlugins::BaseObjects::Object::
45 itk::ModifiedTimeType lt = this->Superclass::GetMTime( );
46 const itk::Object* i = this->GetITK< itk::Object >( );
47 vtkObject* v = const_cast< vtkObject* >( this->GetVTK< vtkObject >( ) );
49 itk::ModifiedTimeType rt;
50 if( i != NULL && v == NULL )
52 else if( i == NULL && v != NULL )
54 else if( i != NULL && v != NULL )
56 auto iTime = i->GetMTime( );
57 auto vTime = v->GetMTime( );
58 rt = ( iTime < vTime )? vTime: iTime;
61 return( ( lt < rt )? rt: lt );
64 // -------------------------------------------------------------------------
65 void cpPlugins::BaseObjects::Object::
66 SetITK( itk::LightObject* o )
68 if( this->m_ITK.GetPointer( ) != o )
76 // -------------------------------------------------------------------------
77 void cpPlugins::BaseObjects::Object::
78 SetVTK( vtkObjectBase* o )
80 if( this->m_VTK.GetPointer( ) != o )
88 // -------------------------------------------------------------------------
89 cpPlugins::BaseObjects::Object::
93 m_ViewX( float( 0 ) ),
98 // -------------------------------------------------------------------------
99 cpPlugins::BaseObjects::Object::