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 a
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 const itk::Object* i = this->GetITK< itk::Object >( );
46 vtkObject* v = const_cast< vtkObject* >( this->GetVTK< vtkObject >( ) );
47 if( i != NULL && v == NULL )
48 return( i->GetMTime( ) );
49 else if( i == NULL && v != NULL )
50 return( v->GetMTime( ) );
51 else if( i != NULL && v != NULL )
53 auto iTime = i->GetMTime( );
54 auto vTime = i->GetMTime( );
55 return( itk::ModifiedTimeType( ( iTime > vTime )? iTime: vTime ) );
58 return( this->Superclass::GetMTime( ) );
61 // -------------------------------------------------------------------------
62 void cpPlugins::BaseObjects::Object::
63 SetITK( itk::LightObject* o )
65 if( this->m_ITK.GetPointer( ) != o )
73 // -------------------------------------------------------------------------
74 void cpPlugins::BaseObjects::Object::
75 SetVTK( vtkObjectBase* o )
77 if( this->m_VTK.GetPointer( ) != o )
85 // -------------------------------------------------------------------------
86 cpPlugins::BaseObjects::Object::
90 m_ViewX( float( 0 ) ),
95 // -------------------------------------------------------------------------
96 cpPlugins::BaseObjects::Object::