#include // ------------------------------------------------------------------------- itk::ModifiedTimeType cpPlugins::BaseWidget:: GetMTime( ) const { // Let time only be managed by itk -> synch issues when data is // represented by vtk return( this->itk::Object::GetMTime( ) ); } // ------------------------------------------------------------------------- const cpPlugins::BaseWidget::TMPRWidget* cpPlugins::BaseWidget:: GetMPRViewer( ) const { return( this->m_MPRViewer ); } // ------------------------------------------------------------------------- const vtkRenderWindowInteractor* cpPlugins::BaseWidget:: GetSingleInteractor( ) const { return( this->m_SingleInteractor ); } // ------------------------------------------------------------------------- void cpPlugins::BaseWidget:: SetMPRViewer( cpPlugins::BaseWidget::TMPRWidget* v ) { if( this->m_MPRViewer != v ) { this->m_MPRViewer = v; this->Modified( ); } // fi } // ------------------------------------------------------------------------- void cpPlugins::BaseWidget:: SetSingleInteractor( vtkRenderWindowInteractor* i ) { if( this->m_SingleInteractor != i ) { this->m_SingleInteractor = i; this->Modified( ); } // fi } // ------------------------------------------------------------------------- bool cpPlugins::BaseWidget:: IsInteractive( ) { return( true ); } // ------------------------------------------------------------------------- void cpPlugins::BaseWidget:: SetInteractionObjects( const std::vector< void* >& objs ) { if( objs.size( ) > 0 ) { vtkRenderWindowInteractor* rwi = reinterpret_cast< vtkRenderWindowInteractor* >( objs[ 0 ] ); this->SetSingleInteractor( rwi ); } if( objs.size( ) > 1 ) { TMPRWidget* wdg = reinterpret_cast< TMPRWidget* >( objs[ 1 ] ); this->SetMPRViewer( wdg ); } // fi } // ------------------------------------------------------------------------- cpPlugins::BaseWidget:: BaseWidget( ) : Superclass( ), m_MPRViewer( NULL ), m_SingleInteractor( NULL ) { this->m_Parameters.ConfigureAsString( "Text" ); this->m_Parameters.SetString( "Text", "" ); } // ------------------------------------------------------------------------- cpPlugins::BaseWidget:: ~BaseWidget( ) { // Warning: Qt's smartpointers require this to avoid segfaults this->m_MPRViewer = NULL; this->m_SingleInteractor = NULL; } // eof - $RCSfile$