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;
30 wxwidget = new wxMPRWidget2( panel, marimagedata , 1 );
32 if(marimagedata != NULL){
33 wxwidget->ConfigureVTK();
35 wxFlexGridSizer *sizer=new wxFlexGridSizer(1);
36 sizer -> Add( wxwidget,0,wxGROW );
37 sizer -> AddGrowableCol(1);
38 panel -> SetSizer(sizer);
39 panel -> SetAutoLayout(true);
43 void wxWidgetMPR::setImageData(vtkImageData* img){
44 wxwidget->setImageData(img, 1);
46 void wxWidgetMPR::ConfigureVTK(){
47 wxwidget->ConfigureVTK();
49 //--------------------------------------------------------------------------
50 wxWidgetMPR::~wxWidgetMPR()
54 //--------------------------------------------------------------------------
58 std::vector<int> wxWidgetMPR::GetPoint()
65 vtkRenderer* wxWidgetMPR::GetRenderer()
69 return wxwidget->GetWxvtkmpr3Dview_BB()->GetWxvtk3Dbaseview()->GetRenderer();
77 //--------------------------------------------------------------------------
78 void wxWidgetMPR::Refresh()
80 wxwidget->RefreshView();
83 //--------------------------------------------------------------------------
87 void wxWidgetMPR::OnRefreshView(wxCommandEvent &event)
89 printf("EED wxWidgetMPR::OnRefreshView 01\n");
90 if((wxwidget!=NULL) && (mbbViewerMPR!=NULL))
92 printf("EED wxWidgetMPR::OnRefreshView 02\n");
94 point.push_back((int)wxwidget->GetVtkMPRBaseData()->GetX());
95 point.push_back((int)wxwidget->GetVtkMPRBaseData()->GetY());
96 point.push_back((int)wxwidget->GetVtkMPRBaseData()->GetZ());
97 mbbViewerMPR->bbSetOutputPoint( GetPoint() );
98 mbbViewerMPR->bbSignalOutputModification(std::string("Point"));
99 wxwidget->RefreshView();
103 //--------------------------------------------------------------------------
104 void wxWidgetMPR::OnDClickLeft(wxCommandEvent & event)
106 wxwidget->RefreshView();
109 //--------------------------------------------------------------------------
110 //--------------------------------------------------------------------------
111 //--------------------------------------------------------------------------
120 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,ViewerMPR)
121 BBTK_BLACK_BOX_IMPLEMENTATION(ViewerMPR,bbtk::WxBlackBox);
122 void ViewerMPR::Process()
126 vtkImageData* img = bbGetInputIn();
127 if(img!=NULL && img != _img){
129 wxwidget->setImageData(_img);
130 wxwidget->ConfigureVTK();
132 // wxwidget->wxPanel::Refresh();
139 bbSetOutputPoint( wxwidget->GetPoint() );
140 bbSetOutputRenderer( wxwidget->GetRenderer() );
144 void ViewerMPR::CreateWidget(wxWindow* parent)
146 bbtkDebugMessageInc("Core",9,"ViewerMPR::CreateWidget() " <<std::endl);
147 //JCP 10 - 03 - 09 marImageData *marimagedata = new marImageData(bbGetInputIn() );
148 bbtkDebugDecTab("Core",9);
149 wxwidget = new wxWidgetMPR(this , parent);//JCP 10 - 03 - 09,marimagedata);
150 bbSetOutputWidget( wxwidget );
153 void ViewerMPR::bbUserSetDefaultValues()
161 //-----------------------------------------------------------------
162 void ViewerMPR::bbUserInitializeProcessing()
166 //-----------------------------------------------------------------
167 void ViewerMPR::bbUserFinalizeProcessing()
171 //-----------------------------------------------------------------
174 // EO namespace bbcreaMaracasVisu