1 #include <cpPlugins/BaseWidget.h>
5 // -------------------------------------------------------------------------
6 const cpPlugins::BaseWidget::TMPRWidget* cpPlugins::BaseWidget::
9 return( this->m_MPRViewer );
12 // -------------------------------------------------------------------------
13 const vtkRenderWindowInteractor* cpPlugins::BaseWidget::
14 GetSingleInteractor( ) const
16 return( this->m_SingleInteractor );
19 // -------------------------------------------------------------------------
20 void cpPlugins::BaseWidget::
21 SetMPRViewer( cpPlugins::BaseWidget::TMPRWidget* v )
23 if( this->m_MPRViewer != v )
25 this->m_MPRViewer = v;
31 // -------------------------------------------------------------------------
32 void cpPlugins::BaseWidget::
33 SetSingleInteractor( vtkRenderWindowInteractor* i )
35 if( this->m_SingleInteractor != i )
37 this->m_SingleInteractor = i;
43 // -------------------------------------------------------------------------
44 bool cpPlugins::BaseWidget::
50 // -------------------------------------------------------------------------
51 void cpPlugins::BaseWidget::
52 SetInteractionObjects( const std::vector< void* >& objs )
54 if( objs.size( ) > 0 )
56 vtkRenderWindowInteractor* rwi =
57 reinterpret_cast< vtkRenderWindowInteractor* >( objs[ 0 ] );
58 this->SetSingleInteractor( rwi );
60 if( objs.size( ) > 1 )
62 TMPRWidget* wdg = reinterpret_cast< TMPRWidget* >( objs[ 1 ] );
63 this->SetMPRViewer( wdg );
68 // -------------------------------------------------------------------------
69 cpPlugins::BaseWidget::
73 m_SingleInteractor( NULL )
77 // -------------------------------------------------------------------------
78 cpPlugins::BaseWidget::
81 // Warning: Qt's smartpointers require this to avoid segfaults
82 this->m_MPRViewer = NULL;
83 this->m_SingleInteractor = NULL;
86 #endif // cpPlugins_QT4