1 #include <cpPlugins/BaseWidget.h>
3 // -------------------------------------------------------------------------
4 const cpPlugins::BaseWidget::TMPRWidget* cpPlugins::BaseWidget::
7 return( this->m_MPRViewer );
10 // -------------------------------------------------------------------------
11 const vtkRenderWindowInteractor* cpPlugins::BaseWidget::
12 GetSingleInteractor( ) const
14 return( this->m_SingleInteractor );
17 // -------------------------------------------------------------------------
18 void cpPlugins::BaseWidget::
19 SetMPRViewer( cpPlugins::BaseWidget::TMPRWidget* v )
21 if( this->m_MPRViewer != v )
23 this->m_MPRViewer = v;
29 // -------------------------------------------------------------------------
30 void cpPlugins::BaseWidget::
31 SetSingleInteractor( vtkRenderWindowInteractor* i )
33 if( this->m_SingleInteractor != i )
35 this->m_SingleInteractor = i;
41 // -------------------------------------------------------------------------
42 bool cpPlugins::BaseWidget::
48 // -------------------------------------------------------------------------
49 void cpPlugins::BaseWidget::
50 SetInteractionObjects( const std::vector< void* >& objs )
52 if( objs.size( ) > 0 )
54 vtkRenderWindowInteractor* rwi =
55 reinterpret_cast< vtkRenderWindowInteractor* >( objs[ 0 ] );
56 this->SetSingleInteractor( rwi );
58 if( objs.size( ) > 1 )
60 TMPRWidget* wdg = reinterpret_cast< TMPRWidget* >( objs[ 1 ] );
61 this->SetMPRViewer( wdg );
66 // -------------------------------------------------------------------------
67 cpPlugins::BaseWidget::
71 m_SingleInteractor( NULL )
75 // -------------------------------------------------------------------------
76 cpPlugins::BaseWidget::
79 // Warning: Qt's smartpointers require this to avoid segfaults
80 this->m_MPRViewer = NULL;
81 this->m_SingleInteractor = NULL;