1 #include <cpPlugins/BaseWidget.h>
3 // -------------------------------------------------------------------------
4 itk::ModifiedTimeType cpPlugins::BaseWidget::
7 // Let time only be managed by itk -> synch issues when data is
9 return( this->itk::Object::GetMTime( ) );
12 // -------------------------------------------------------------------------
13 const cpPlugins::BaseWidget::TMPRWidget* cpPlugins::BaseWidget::
16 return( this->m_MPRViewer );
19 // -------------------------------------------------------------------------
20 const vtkRenderWindowInteractor* cpPlugins::BaseWidget::
21 GetSingleInteractor( ) const
23 return( this->m_SingleInteractor );
26 // -------------------------------------------------------------------------
27 void cpPlugins::BaseWidget::
28 SetMPRViewer( cpPlugins::BaseWidget::TMPRWidget* v )
30 if( this->m_MPRViewer != v )
32 this->m_MPRViewer = v;
38 // -------------------------------------------------------------------------
39 void cpPlugins::BaseWidget::
40 SetSingleInteractor( vtkRenderWindowInteractor* i )
42 if( this->m_SingleInteractor != i )
44 this->m_SingleInteractor = i;
50 // -------------------------------------------------------------------------
51 bool cpPlugins::BaseWidget::
57 // -------------------------------------------------------------------------
58 void cpPlugins::BaseWidget::
59 SetInteractionObjects( const std::vector< void* >& objs )
61 if( objs.size( ) > 0 )
63 vtkRenderWindowInteractor* rwi =
64 reinterpret_cast< vtkRenderWindowInteractor* >( objs[ 0 ] );
65 this->SetSingleInteractor( rwi );
67 if( objs.size( ) > 1 )
69 TMPRWidget* wdg = reinterpret_cast< TMPRWidget* >( objs[ 1 ] );
70 this->SetMPRViewer( wdg );
75 // -------------------------------------------------------------------------
76 cpPlugins::BaseWidget::
80 m_SingleInteractor( NULL )
82 this->m_Parameters.ConfigureAsString( "Text" );
83 this->m_Parameters.SetString( "Text", "" );
86 // -------------------------------------------------------------------------
87 cpPlugins::BaseWidget::
90 // Warning: Qt's smartpointers require this to avoid segfaults
91 this->m_MPRViewer = NULL;
92 this->m_SingleInteractor = NULL;