1 #include <cpPlugins/Interface/Object.h>
6 // -------------------------------------------------------------------------
7 void cpPlugins::Interface::Object::
8 SetViewCoords( float x, float y )
12 // WARNING: do not call "this->Modified( )" -> It could lead to a
13 // re-execution of all pipeline
16 #ifdef cpPlugins_Interface_QT4
17 // -------------------------------------------------------------------------
18 void cpPlugins::Interface::Object::
19 SetViewCoords( const QPointF& coords )
21 this->SetViewCoords( coords.x( ), coords.y( ) );
24 // -------------------------------------------------------------------------
25 QPointF cpPlugins::Interface::Object::
26 GetViewCoords( ) const
28 return( QPointF( this->m_ViewX, this->m_ViewY ) );
30 #endif // cpPlugins_Interface_QT4
32 // -------------------------------------------------------------------------
33 void cpPlugins::Interface::Object::
36 const itk::Object* i = this->GetITK< itk::Object >( );
37 vtkObject* v = const_cast< vtkObject* >( this->GetVTK< vtkObject >( ) );
38 if( i != NULL ) i->Modified( );
39 if( v != NULL ) v->Modified( );
40 this->Superclass::Modified( );
43 // -------------------------------------------------------------------------
44 itk::ModifiedTimeType cpPlugins::Interface::Object::
47 unsigned long tTime = this->Superclass::GetMTime( );
48 unsigned long iTime = tTime;
49 unsigned long vTime = tTime;
51 const itk::Object* i = this->GetITK< itk::Object >( );
52 vtkObject* v = const_cast< vtkObject* >( this->GetVTK< vtkObject >( ) );
53 if( i != NULL ) iTime = i->GetMTime( );
54 if( v != NULL ) vTime = v->GetMTime( );
56 tTime = ( tTime < iTime )? tTime: iTime;
57 return( ( itk::ModifiedTimeType )( ( tTime < vTime )? tTime: vTime ) );
60 // -------------------------------------------------------------------------
61 void cpPlugins::Interface::Object::
62 SetITK( itk::LightObject* o )
64 if( this->m_ITKObject.GetPointer( ) != o )
66 this->m_ITKObject = o;
72 // -------------------------------------------------------------------------
73 void cpPlugins::Interface::Object::
74 SetVTK( vtkObjectBase* o )
76 if( this->m_VTKObject.GetPointer( ) != o )
78 this->m_VTKObject = o;
84 // -------------------------------------------------------------------------
85 cpPlugins::Interface::Object::
90 m_ViewX( float( 0 ) ),
95 // -------------------------------------------------------------------------
96 cpPlugins::Interface::Object::