X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=bbtk%2Fsrc%2FbbmaracasvisuViewerNV.cxx;h=e404aaf4a0d2eabf7b24a5d64f6807dc0dc6e0d9;hb=e0db3524deab4b66c1a59949fc1a0c60047328f3;hp=fa98991abab773e8bc646b4befa1fbb5a02a76bf;hpb=d37b5379345cb4c29e10caf62b4d881bd84bf929;p=creaMaracasVisu.git diff --git a/bbtk/src/bbmaracasvisuViewerNV.cxx b/bbtk/src/bbmaracasvisuViewerNV.cxx index fa98991..e404aaf 100644 --- a/bbtk/src/bbmaracasvisuViewerNV.cxx +++ b/bbtk/src/bbmaracasvisuViewerNV.cxx @@ -3,7 +3,6 @@ namespace bbcreaMaracasVisu { - BEGIN_EVENT_TABLE( bbwxMaracas_N_ViewersWidget, wxPanel ) EVT_MENU( 12121, bbwxMaracas_N_ViewersWidget::OnRefreshView ) EVT_MENU( 12122, bbwxMaracas_N_ViewersWidget::OnDClickLeft ) @@ -15,9 +14,9 @@ END_EVENT_TABLE( ); //------------------------------------------------------------- bbwxMaracas_N_ViewersWidget::bbwxMaracas_N_ViewersWidget(ViewerNV* box, - wxWindow *parent, - vtkImageData* imagedata, - std::vector *nTypeView) + wxWindow *parent, + vtkImageData* imagedata, + std::vector *nTypeView) :wxMaracas_N_ViewersWidget(parent,imagedata,nTypeView) { mbbViewerNV=box; @@ -31,7 +30,7 @@ bbwxMaracas_N_ViewersWidget::~bbwxMaracas_N_ViewersWidget() //------------------------------------------------------------- void bbwxMaracas_N_ViewersWidget::OnRefreshView(wxCommandEvent & event) { - printf("CPR: bbwxMaracas_N_ViewersWidget::OnRefreshView -> actualiza X, Y y Z\n"); + //printf("CPR: bbwxMaracas_N_ViewersWidget::OnRefreshView -> actualiza X, Y y Z\n"); mbbViewerNV->point.clear(); mbbViewerNV->point.push_back( (int)GetX() ); @@ -61,7 +60,6 @@ BBTK_BLACK_BOX_IMPLEMENTATION(ViewerNV,bbtk::WxBlackBox); //------------------------------------------------------------- void ViewerNV::Process() { - vtkImageData* img = bbGetInputIn(); /* double spc[3]; @@ -76,12 +74,8 @@ void ViewerNV::Process() */ std::vector type = bbGetInputnTypeView(); -// std::cout<<"img "<SetType(&type); mwxwidget->UpdateLayout(img); @@ -90,12 +84,15 @@ void ViewerNV::Process() //mwxwidget->UpdateLayout(img); } - mwxwidget->ConfigureVTK(); + if (firsttime==true) // EED 21 aout 2010 + { + firsttime=false; + mwxwidget->ConfigureVTK(); + } mwxwidget->RefreshView(); currenttype = type; currentimg = img; - point.clear(); point.push_back((int)mwxwidget->GetX()); @@ -121,28 +118,32 @@ void ViewerNV::Process() if (wvbv3!=NULL) { bbSetOutputRenderer3( wvbv3->GetRenderer() ); } if (wvbv4!=NULL) { bbSetOutputRenderer4( wvbv4->GetRenderer() ); } - if (wvbv1!=NULL) { bbSetOutputInteractor1( wvbv1->GetWxVTKRenderWindowInteractor() ); + if (wvbv1!=NULL) + { + bbSetOutputInteractor1( wvbv1->GetWxVTKRenderWindowInteractor() ); updateObservers(); } - if(bbGetInputColorFunction()!=NULL){ + if(bbGetInputColorFunction()!=NULL) + { mwxwidget->setColorTransferFunction(bbGetInputColorFunction()); } - if(bbGetInputWindowLevel()!=-1){ - mwxwidget->setWindowLevel(bbGetInputWindowLevel()); + if(bbGetInputWindowLevel()!=-1) + { + mwxwidget->setWindowLevel(bbGetInputWindowLevel()); } - if(bbGetInputColorLevel()!=-1){ - if(bbGetInputColorLevel() == 0){ + if(bbGetInputColorLevel()!=-1) + { + if(bbGetInputColorLevel() == 0) + { std::cout<<"colorlevel "<setColorLevel(0.1); }else{ mwxwidget->setColorLevel(bbGetInputColorLevel()); } } - - }// mwxwidget != NULL } @@ -163,48 +164,47 @@ void ViewerNV::CreateWidget(wxWindow* parent) //------------------------------------------------------------- void ViewerNV::bbUserSetDefaultValues() { - - mwxwidget = NULL; - bbSetInputIn(NULL); - - bbSetInputObs1(NULL); - bbSetInputObs2(NULL); - bbSetInputObs3(NULL); - bbSetInputObs4(NULL); - bbSetInputObs5(NULL); - - std::vector vecNTypeViwer; - vecNTypeViwer.push_back(5); - vecNTypeViwer.push_back(0); - vecNTypeViwer.push_back(1); - vecNTypeViwer.push_back(3); - bbSetInputnTypeView(vecNTypeViwer); - - - bbSetOutputwxVtkBaseView1( NULL ); - bbSetOutputwxVtkBaseView2( NULL ); - bbSetOutputwxVtkBaseView3( NULL ); - bbSetOutputwxVtkBaseView4( NULL ); - bbSetOutputRenderer1( NULL ); - bbSetOutputRenderer2( NULL ); - bbSetOutputRenderer3( NULL ); - bbSetOutputRenderer4( NULL ); - bbSetInputColorFunction(NULL); - bbSetInputWindowLevel(-1); - bbSetInputColorLevel(-1); + firsttime=true; + mwxwidget = NULL; + bbSetInputIn(NULL); + + bbSetInputObs1(NULL); + bbSetInputObs2(NULL); + bbSetInputObs3(NULL); + bbSetInputObs4(NULL); + bbSetInputObs5(NULL); + + std::vector vecNTypeViwer; + vecNTypeViwer.push_back(5); + vecNTypeViwer.push_back(0); + vecNTypeViwer.push_back(1); + vecNTypeViwer.push_back(3); + bbSetInputnTypeView(vecNTypeViwer); + + bbSetOutputwxVtkBaseView1( NULL ); + bbSetOutputwxVtkBaseView2( NULL ); + bbSetOutputwxVtkBaseView3( NULL ); + bbSetOutputwxVtkBaseView4( NULL ); + bbSetOutputRenderer1( NULL ); + bbSetOutputRenderer2( NULL ); + bbSetOutputRenderer3( NULL ); + bbSetOutputRenderer4( NULL ); + bbSetInputColorFunction(NULL); + bbSetInputWindowLevel(-1); + bbSetInputColorLevel(-1); } - //----------------------------------------------------------------- - void ViewerNV::bbUserInitializeProcessing() - { - } +//----------------------------------------------------------------- +void ViewerNV::bbUserInitializeProcessing() +{ +} - //----------------------------------------------------------------- - void ViewerNV::bbUserFinalizeProcessing() - { - } +//----------------------------------------------------------------- +void ViewerNV::bbUserFinalizeProcessing() +{ +} - //----------------------------------------------------------------- +//----------------------------------------------------------------- @@ -222,8 +222,6 @@ bool ViewerNV::compareVectors(std::vector type,std::vector currenttype ret=false; } return ret; - - } void ViewerNV::updateObservers(){ @@ -231,28 +229,28 @@ void ViewerNV::updateObservers(){ interactor = bbGetOutputInteractor1(); if(interactor){ if (bbGetInputObs1()!=NULL){ - bbGetInputObs1()->SetInteractor(interactor); - bbGetInputObs1()->EnabledOn(); + bbGetInputObs1()->SetInteractor(interactor); + bbGetInputObs1()->EnabledOn(); } if (bbGetInputObs2()!=NULL) { bbGetInputObs2()->SetInteractor(interactor); - bbGetInputObs2()->EnabledOn(); + bbGetInputObs2()->EnabledOn(); } if (bbGetInputObs3()!=NULL) { bbGetInputObs3()->SetInteractor(interactor); - bbGetInputObs3()->EnabledOn(); + bbGetInputObs3()->EnabledOn(); } if (bbGetInputObs4()!=NULL) { bbGetInputObs4()->SetInteractor(interactor); - bbGetInputObs4()->EnabledOn(); + bbGetInputObs4()->EnabledOn(); } if (bbGetInputObs5()!=NULL) { bbGetInputObs5()->SetInteractor(interactor); - bbGetInputObs5()->EnabledOn(); + bbGetInputObs5()->EnabledOn(); } } } @@ -260,4 +258,3 @@ void ViewerNV::updateObservers(){ } // EO namespace bbcreaMaracasVisu -