1 #include <cpPlugins/BaseWidget.h>
5 // -------------------------------------------------------------------------
6 itk::ModifiedTimeType cpPlugins::BaseWidget::
9 // Let time only be managed by itk -> synch issues when data is
11 return( this->itk::Object::GetMTime( ) );
14 // -------------------------------------------------------------------------
15 const cpPlugins::BaseWidget::TMPRWidget* cpPlugins::BaseWidget::
18 return( this->m_MPRViewer );
21 // -------------------------------------------------------------------------
22 const vtkRenderWindowInteractor* cpPlugins::BaseWidget::
23 GetSingleInteractor( ) const
25 return( this->m_SingleInteractor );
28 // -------------------------------------------------------------------------
29 void cpPlugins::BaseWidget::
30 SetMPRViewer( cpPlugins::BaseWidget::TMPRWidget* v )
32 if( this->m_MPRViewer != v )
34 this->m_MPRViewer = v;
40 // -------------------------------------------------------------------------
41 void cpPlugins::BaseWidget::
42 SetSingleInteractor( vtkRenderWindowInteractor* i )
44 if( this->m_SingleInteractor != i )
46 this->m_SingleInteractor = i;
52 // -------------------------------------------------------------------------
53 bool cpPlugins::BaseWidget::
59 // -------------------------------------------------------------------------
60 void cpPlugins::BaseWidget::
61 SetInteractionObjects( const std::vector< void* >& objs )
63 if( objs.size( ) > 0 )
65 vtkRenderWindowInteractor* rwi =
66 reinterpret_cast< vtkRenderWindowInteractor* >( objs[ 0 ] );
67 this->SetSingleInteractor( rwi );
69 if( objs.size( ) > 1 )
71 TMPRWidget* wdg = reinterpret_cast< TMPRWidget* >( objs[ 1 ] );
72 this->SetMPRViewer( wdg );
77 // -------------------------------------------------------------------------
78 cpPlugins::BaseWidget::
82 m_SingleInteractor( NULL )
84 this->m_Parameters.ConfigureAsString( "Text" );
85 this->m_Parameters.SetString( "Text", "" );
88 // -------------------------------------------------------------------------
89 cpPlugins::BaseWidget::
92 // Warning: Qt's smartpointers require this to avoid segfaults
93 this->m_MPRViewer = NULL;
94 this->m_SingleInteractor = NULL;
97 #endif // cpPlugins_QT4