2 #include "bbmaracasvisuViewerMPR.h"
3 #include "bbcreaMaracasVisuPackage.h"
4 namespace bbcreaMaracasVisu
7 //--------------------------------------------------------------------------
8 //--------------------------------------------------------------------------
9 //--------------------------------------------------------------------------
12 //--------------------------------------------------------------------------
14 //--------------------------------------------------------------------------
15 BEGIN_EVENT_TABLE( wxWidgetMPR, wxPanel )
16 EVT_MENU( 12121, wxWidgetMPR::OnRefreshView )
17 EVT_MENU( 12122, wxWidgetMPR::OnDClickLeft )
23 wxWidgetMPR::wxWidgetMPR(ViewerMPR* box,wxWindow* parent, marImageData *marimagedata)
24 : wxPanel( parent, -1 )
26 wxPanel *panel = this;
29 wxwidget = new wxMPRWidget2( panel, marimagedata , 1 );
30 wxwidget->ConfigureVTK();
31 wxFlexGridSizer *sizer=new wxFlexGridSizer(1);
32 sizer -> Add( wxwidget,0,wxGROW );
33 sizer -> AddGrowableCol(1);
34 panel -> SetSizer(sizer);
35 panel -> SetAutoLayout(true);
38 //--------------------------------------------------------------------------
39 wxWidgetMPR::~wxWidgetMPR()
43 //--------------------------------------------------------------------------
47 std::vector<int> wxWidgetMPR::GetPoint()
54 vtkRenderer* wxWidgetMPR::GetRenderer()
58 return wxwidget->GetWxvtkmpr3Dview_BB()->GetWxvtk3Dbaseview()->GetRenderer();
66 //--------------------------------------------------------------------------
67 void wxWidgetMPR::Refresh()
69 wxwidget->RefreshView();
72 //--------------------------------------------------------------------------
76 void wxWidgetMPR::OnRefreshView(wxCommandEvent &event)
79 if((wxwidget!=NULL) && (mbbViewerMPR!=NULL))
82 point.push_back((int)wxwidget->GetVtkMPRBaseData()->GetX());
83 point.push_back((int)wxwidget->GetVtkMPRBaseData()->GetY());
84 point.push_back((int)wxwidget->GetVtkMPRBaseData()->GetZ());
85 mbbViewerMPR->bbSetOutputPoint( GetPoint() );
86 mbbViewerMPR->bbSignalOutputModification(std::string("Point"));
87 wxwidget->RefreshView();
91 //--------------------------------------------------------------------------
92 void wxWidgetMPR::OnDClickLeft(wxCommandEvent & event)
94 wxwidget->RefreshView();
97 //--------------------------------------------------------------------------
98 //--------------------------------------------------------------------------
99 //--------------------------------------------------------------------------
108 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,ViewerMPR)
109 BBTK_BLACK_BOX_IMPLEMENTATION(ViewerMPR,bbtk::WxBlackBox);
110 void ViewerMPR::Process()
114 bbSetOutputPoint( wxwidget->GetPoint() );
115 bbSetOutputRenderer( wxwidget->GetRenderer() );
119 void ViewerMPR::CreateWidget(wxWindow* parent)
121 bbtkDebugMessageInc("Core",9,"ViewerMPR::CreateWidget() " <<std::endl);
122 marImageData *marimagedata = new marImageData(bbGetInputIn() );
123 bbtkDebugDecTab("Core",9);
124 wxwidget = new wxWidgetMPR(this , parent ,marimagedata);
125 bbSetOutputWidget( wxwidget );
128 void ViewerMPR::bbUserConstructor()
133 void ViewerMPR::bbUserCopyConstructor(bbtk::BlackBox::Pointer)
137 void ViewerMPR::bbUserDestructor()
142 // EO namespace bbcreaMaracasVisu