#include #include #include // ------------------------------------------------------------------------- void cpPlugins::Interface::Object:: SetViewCoords( float x, float y ) { this->m_ViewX = x; this->m_ViewY = y; // WARNING: do not call "this->Modified( )" -> It could lead to a // re-execution of all pipeline } #ifdef cpPlugins_Interface_QT4 // ------------------------------------------------------------------------- void cpPlugins::Interface::Object:: SetViewCoords( const QPointF& coords ) { this->SetViewCoords( coords.x( ), coords.y( ) ); } // ------------------------------------------------------------------------- QPointF cpPlugins::Interface::Object:: GetViewCoords( ) const { return( QPointF( this->m_ViewX, this->m_ViewY ) ); } #endif // cpPlugins_Interface_QT4 // ------------------------------------------------------------------------- void cpPlugins::Interface::Object:: Modified( ) const { const itk::Object* i = this->GetITK< itk::Object >( ); vtkObject* v = const_cast< vtkObject* >( this->GetVTK< vtkObject >( ) ); if( i != NULL ) i->Modified( ); if( v != NULL ) v->Modified( ); this->Superclass::Modified( ); } // ------------------------------------------------------------------------- itk::ModifiedTimeType cpPlugins::Interface::Object:: GetMTime( ) const { unsigned long tTime = this->Superclass::GetMTime( ); unsigned long iTime = tTime; unsigned long vTime = tTime; const itk::Object* i = this->GetITK< itk::Object >( ); vtkObject* v = const_cast< vtkObject* >( this->GetVTK< vtkObject >( ) ); if( i != NULL ) iTime = i->GetMTime( ); if( v != NULL ) vTime = v->GetMTime( ); tTime = ( tTime < iTime )? tTime: iTime; return( ( itk::ModifiedTimeType )( ( tTime < vTime )? tTime: vTime ) ); } // ------------------------------------------------------------------------- void cpPlugins::Interface::Object:: SetITK( itk::LightObject* o ) { if( this->m_ITKObject.GetPointer( ) != o ) { this->m_ITKObject = o; this->Modified( ); } // fi } // ------------------------------------------------------------------------- void cpPlugins::Interface::Object:: SetVTK( vtkObjectBase* o ) { if( this->m_VTKObject.GetPointer( ) != o ) { this->m_VTKObject = o; this->Modified( ); } // fi } // ------------------------------------------------------------------------- cpPlugins::Interface::Object:: Object( ) : Superclass( ), m_ITKObject( NULL ), m_VTKObject( NULL ), m_ViewX( float( 0 ) ), m_ViewY( float( 0 ) ) { } // ------------------------------------------------------------------------- cpPlugins::Interface::Object:: ~Object( ) { } // eof - $RCSfile$