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::setMarImage(marImageData* marimagedata){
44 wxwidget->setMarImage(marimagedata, 1);
48 void wxWidgetMPR::ConfigureVTK(){
49 wxwidget->ConfigureVTK();
51 //--------------------------------------------------------------------------
52 wxWidgetMPR::~wxWidgetMPR()
56 //--------------------------------------------------------------------------
60 std::vector<int> wxWidgetMPR::GetPoint()
67 vtkRenderer* wxWidgetMPR::GetRenderer()
71 return wxwidget->GetWxvtkmpr3Dview_BB()->GetWxvtk3Dbaseview()->GetRenderer();
79 //--------------------------------------------------------------------------
80 void wxWidgetMPR::Refresh()
82 wxwidget->RefreshView();
85 //--------------------------------------------------------------------------
89 void wxWidgetMPR::OnRefreshView(wxCommandEvent &event)
92 if((wxwidget!=NULL) && (mbbViewerMPR!=NULL))
95 point.push_back((int)wxwidget->GetVtkMPRBaseData()->GetX());
96 point.push_back((int)wxwidget->GetVtkMPRBaseData()->GetY());
97 point.push_back((int)wxwidget->GetVtkMPRBaseData()->GetZ());
98 mbbViewerMPR->bbSetOutputPoint( GetPoint() );
99 mbbViewerMPR->bbSignalOutputModification(std::string("Point"));
100 wxwidget->RefreshView();
104 //--------------------------------------------------------------------------
105 void wxWidgetMPR::OnDClickLeft(wxCommandEvent & event)
107 wxwidget->RefreshView();
110 //--------------------------------------------------------------------------
111 //--------------------------------------------------------------------------
112 //--------------------------------------------------------------------------
121 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,ViewerMPR)
122 BBTK_BLACK_BOX_IMPLEMENTATION(ViewerMPR,bbtk::WxBlackBox);
123 void ViewerMPR::Process()
127 if(marimagedata==NULL){
128 wxwidget->setMarImage(new marImageData(bbGetInputIn() ));
129 wxwidget->ConfigureVTK();
131 // wxwidget->wxPanel::Refresh();
135 bbSetOutputPoint( wxwidget->GetPoint() );
136 bbSetOutputRenderer( wxwidget->GetRenderer() );
140 void ViewerMPR::CreateWidget(wxWindow* parent)
142 bbtkDebugMessageInc("Core",9,"ViewerMPR::CreateWidget() " <<std::endl);
143 //JCP 10 - 03 - 09 marImageData *marimagedata = new marImageData(bbGetInputIn() );
144 bbtkDebugDecTab("Core",9);
145 wxwidget = new wxWidgetMPR(this , parent);//JCP 10 - 03 - 09,marimagedata);
146 bbSetOutputWidget( wxwidget );
149 void ViewerMPR::bbUserConstructor()
155 void ViewerMPR::bbUserCopyConstructor(bbtk::BlackBox::Pointer)
163 void ViewerMPR::bbUserDestructor()
168 // EO namespace bbcreaMaracasVisu