X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=bbtk%2Fsrc%2FbbmaracasvisuShowNPoints.cxx;h=25debba998835ec2288161ba90eb76b10d9a49d3;hb=c68f4e0d9298fe538f87a974947cce470148c60b;hp=83d7fe2a6c03597899453dfa2c0edf9104549248;hpb=1747b4600c1578c814c8cffcc17f548d14b4a6fa;p=creaMaracasVisu.git diff --git a/bbtk/src/bbmaracasvisuShowNPoints.cxx b/bbtk/src/bbmaracasvisuShowNPoints.cxx index 83d7fe2..25debba 100644 --- a/bbtk/src/bbmaracasvisuShowNPoints.cxx +++ b/bbtk/src/bbmaracasvisuShowNPoints.cxx @@ -6,60 +6,133 @@ #include "vtkPolyDataMapper.h" #include "vtkRenderWindow.h" #include "vtkTextActor3D.h" +#include namespace bbcreaMaracasVisu { - //---------------------------------------------------------------------- - WidgetShowNPoints::WidgetShowNPoints(wxWindow *parent, bbcreaMaracasVisu::ShowNPoints *box) + WidgetShowNPoints::WidgetShowNPoints(wxWindow *parent, bbcreaMaracasVisu::ShowNPoints *box) : wxPanel( parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL) { - mbbShowNPoints = box; - this->renderer = NULL; - wxPanel *panel = this; - wxSizer *sizer = NULL; - - - // Widget interface - textCtrl = new wxTextCtrl(panel, -1); - wxButton *btnAddPoint = new wxButton( panel, -1, _T("Add Point")); - wxButton *btnRenamePoint = new wxButton( panel, -1, _T("Rename point")); - wxButton *btnEraseLastPoint = new wxButton( panel, -1, _T("Erase Last point")); - wxButton *btnErasePoint = new wxButton( panel, -1, _T("Erase point")); - wxButton *btnDeleteAllPoints = new wxButton( panel, -1, _T("Delete all points")); - wxButton *btnSavePoints = new wxButton( panel, -1, _T("Save points")); - wxButton *btnLoadPoints = new wxButton( panel, -1, _T("Load points")); - txtNrPoints = new wxStaticText(panel,-1, _T(" ")); - - wxFlexGridSizer *sizer1 = new wxFlexGridSizer(1); -// sizer1->Add(new wxStaticText(panel,-1,_T(" "))); - - Connect(btnAddPoint->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnAddPoint); - Connect(btnRenamePoint->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnRenamePoint); - Connect(btnEraseLastPoint->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnEraseLastPoint); - Connect(btnErasePoint->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnErasePoint); - Connect(btnDeleteAllPoints->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnDeleteAllPoints); - Connect(btnSavePoints->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnSavePoints); - Connect(btnLoadPoints->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnLoadPoints); - - sizer1->Add(textCtrl); - sizer1->Add(btnAddPoint); - sizer1->Add(btnRenamePoint); - sizer1->Add(btnErasePoint); - sizer1->Add(btnEraseLastPoint); - sizer1->Add(btnDeleteAllPoints); - sizer1->Add(txtNrPoints); - sizer1->Add(btnSavePoints); - sizer1->Add(btnLoadPoints); - - sizer = sizer1; - panel -> SetSizer(sizer); - panel -> SetAutoLayout(true); - panel -> Layout(); + mbbShowNPoints = box; + this->renderer = NULL; + wxPanel *panel = this; + wxSizer *sizer = NULL; -} + if (mbbShowNPoints->bbGetInputType()==0) + { + // Widget interface + askPointLabel = new wxStaticText(panel, -1, _T("Point label :")); // JPR + textCtrl = new wxTextCtrl(panel, -1); + wxButton *btnAddPoint = new wxButton( panel, -1, _T("Add Point")); + wxButton *btnSetPositionPoint = new wxButton( panel, -1, _T("Set nearest point")); + wxButton *btnRenamePoint = new wxButton( panel, -1, _T("Rename point")); + wxButton *btnEraseLastPoint = new wxButton( panel, -1, _T("Erase Last point")); + wxButton *btnErasePoint = new wxButton( panel, -1, _T("Erase point")); + wxButton *btnDeleteAllPoints = new wxButton( panel, -1, _T("Delete all points")); + wxButton *btnSavePoints = new wxButton( panel, -1, _T("Save points")); + wxButton *btnLoadPoints = new wxButton( panel, -1, _T("Load points")); + txtNrPoints = new wxStaticText(panel,-1, _T(" ")); + + //NTU: Sliders for opacity and radio change + wxStaticText* txOpacity = new wxStaticText(this, -1, wxString(_T(" Points Opacity "))); + sdrOpacity = new wxSlider(this, -1, 0, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_LABELS); + wxStaticText* txRadio = new wxStaticText(this, -1, wxString(_T(" Points Radio "))); + sdrRadio = new wxSlider(this, -1, 0, 1, 50, wxDefaultPosition, wxDefaultSize, wxSL_LABELS); + + wxFlexGridSizer *sizer1 = new wxFlexGridSizer(1); + // sizer1->Add(new wxStaticText(panel,-1,_T(" "))); + + Connect(btnAddPoint->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnAddPoint); + Connect(btnSetPositionPoint->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnSetPoint); + Connect(btnRenamePoint->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnRenamePoint); + Connect(btnEraseLastPoint->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnEraseLastPoint); + Connect(btnErasePoint->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnErasePoint); + Connect(btnDeleteAllPoints->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnDeleteAllPoints); + Connect(btnSavePoints->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnSavePoints); + Connect(btnLoadPoints->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnLoadPoints); + + //NTU: Slider events + Connect(sdrOpacity->GetId() , wxEVT_COMMAND_SLIDER_UPDATED , (wxObjectEventFunction) &WidgetShowNPoints::UpdatePoints); + Connect(sdrRadio->GetId() , wxEVT_COMMAND_SLIDER_UPDATED , (wxObjectEventFunction) &WidgetShowNPoints::UpdatePoints); + + sizer1->Add(askPointLabel); // JPR + sizer1->Add(textCtrl); + sizer1->Add(btnAddPoint); + sizer1->Add(btnSetPositionPoint); + sizer1->Add(btnRenamePoint); + sizer1->Add(btnErasePoint); + sizer1->Add(btnEraseLastPoint); + sizer1->Add(btnDeleteAllPoints); + sizer1->Add(txtNrPoints); + sizer1->Add(txOpacity); + sizer1->Add(sdrOpacity,1,wxGROW ); + sizer1->Add(txRadio); + sizer1->Add(sdrRadio,1,wxGROW ); + sizer1->Add(btnSavePoints); + sizer1->Add(btnLoadPoints); + sizer = sizer1; + } + if (mbbShowNPoints->bbGetInputType()==1) + { + // Widget interface + wxButton *btnSetPositionPoint = new wxButton( panel, -1, _T("Set nearest point")); + txtNrPoints = new wxStaticText(panel,-1, _T(" ")); + + //NTU: Sliders for opacity and radio change + wxStaticText* txOpacity = new wxStaticText(this, -1, wxString(_T(" Points Opacity "))); + sdrOpacity = new wxSlider(this, -1, 0, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_LABELS); + wxStaticText* txRadio = new wxStaticText(this, -1, wxString(_T(" Points Radio "))); + sdrRadio = new wxSlider(this, -1, 0, 1, 50, wxDefaultPosition, wxDefaultSize, wxSL_LABELS); + wxFlexGridSizer *sizer1 = new wxFlexGridSizer(1); + Connect(btnSetPositionPoint->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnSetPoint); + Connect(sdrOpacity->GetId() , wxEVT_COMMAND_SLIDER_UPDATED , (wxObjectEventFunction) &WidgetShowNPoints::UpdatePoints); + Connect(sdrRadio->GetId() , wxEVT_COMMAND_SLIDER_UPDATED , (wxObjectEventFunction) &WidgetShowNPoints::UpdatePoints); + + sizer1->Add(btnSetPositionPoint); + sizer1->Add(txtNrPoints); + sizer1->Add(txOpacity); + sizer1->Add(sdrOpacity,1,wxGROW ); + sizer1->Add(txRadio); + sizer1->Add(sdrRadio,1,wxGROW ); + sizer = sizer1; + } + + if (mbbShowNPoints->bbGetInputType() == 2) { + askPointLabel = new wxStaticText(panel, -1, _T("\nPOINT CONTROLS:")); // JPR + + wxButton *btnAddPoint = new wxButton(panel, -1, _T(" Add Point ")); + wxButton *btnDeleteAllPoints = new wxButton(panel, -1, _T(" Delete All ")); + wxStaticText* spacer = new wxStaticText(panel, -1, _T("\n")); // JPR + textCtrl = new wxTextCtrl(panel, -1); + + wxFlexGridSizer *sizer1 = new wxFlexGridSizer(1); + + Connect(btnAddPoint->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction) & WidgetShowNPoints::OnAddPoint); + Connect(btnDeleteAllPoints->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction) & WidgetShowNPoints::OnDeleteAllPoints); + + sizer1->Add(askPointLabel); + sizer1->Add(btnAddPoint); + sizer1->Add(btnDeleteAllPoints); + sizer1->Add(spacer); + sizer1->Add(textCtrl); + + sdrOpacity = new wxSlider(); + sdrRadio = new wxSlider(); + + txtNrPoints = new wxStaticText(panel, -1, _T("\n\n\n")); + + sizer = sizer1; + } + if (sizer!=NULL) + { + panel->SetSizer(sizer); + panel->SetAutoLayout(true); + panel->Layout(); + } +} //------------------------------------------------------------------------ WidgetShowNPoints::~WidgetShowNPoints() @@ -68,7 +141,9 @@ WidgetShowNPoints::~WidgetShowNPoints() void WidgetShowNPoints::SetRadio(double radio) { - mradio=radio; + this->mradio=radio; + //NTU: For Slider + sdrRadio->SetValue(this->mradio); } //------------------------------------------------------------------------ @@ -95,9 +170,6 @@ std::vector WidgetShowNPoints::GetLstPointsZ() return lstLabels; } - - - //------------------------------------------------------------------------ void WidgetShowNPoints::SetPoint(std::vector ppoint) { @@ -114,6 +186,8 @@ void WidgetShowNPoints::SetColour(std::vector colour) void WidgetShowNPoints::SetOpacity(double opacity) { this->mopacity=opacity; + //NTU: For Slider + sdrOpacity->SetValue(this->mopacity/100.0); } //------------------------------------------------------------------------ @@ -128,6 +202,7 @@ void WidgetShowNPoints::SetRenderer(vtkRenderer *renderer) this->renderer = renderer; } +//------------------------------------------------------------------------ std::string WidgetShowNPoints::CleanSpaces(std::string ss) { @@ -139,6 +214,26 @@ std::string WidgetShowNPoints::CleanSpaces(std::string ss) return ss; } + +//------------------------------------------------------------------------ + +void WidgetShowNPoints::RefreshPoint(int id) +{ + int x = lstPointsX[id]; + int y = lstPointsY[id]; + int z = lstPointsZ[id]; + + double spc[3]; + mimage->GetSpacing(spc); + + lstActorsSphere[id]->SetPosition( spc[0]*x , spc[1]*y , spc[2]*z ); + lstActorsSphere[id]->GetProperty()->SetColor( mcolour[0] , mcolour[1] , mcolour[2] ); + lstActorsSphere[id]->GetProperty()->SetOpacity( mopacity ); + + lstActorsText[id]->SetPosition( mradio+spc[0]*x , spc[1]*y , spc[2]*z ); +} + + //------------------------------------------------------------------------ void WidgetShowNPoints::AddPoint(int x, int y, int z, std::string label) { @@ -155,34 +250,60 @@ void WidgetShowNPoints::AddPoint(int x, int y, int z, std::string label) vtksphere->SetThetaResolution (20); vtksphere->SetPhiResolution (20); vtksphere->SetRadius( mradio ); + + //NTU: For updating points + + lstSourceSphere.push_back(vtksphere); + vtkPolyDataMapper *sphereMapper = vtkPolyDataMapper::New(); sphereMapper->SetInput( vtksphere->GetOutput() ); vtkActor *sphereActor = vtkActor::New(); sphereActor->SetMapper(sphereMapper); sphereActor->SetOrigin(0, 0, 0); + +/*EED Borrame double spc[3]; + if(mimage==NULL){ + wxMessageDialog dialog(this, _T("Image Not Set"),_T("Image Not Set"),wxICON_ERROR); + dialog.ShowModal(); + return; + } mimage->GetSpacing(spc); sphereActor->SetPosition( spc[0]*x , spc[1]*y , spc[2]*z ); sphereActor->GetProperty()->SetColor( mcolour[0] , mcolour[1] , mcolour[2] ); sphereActor->GetProperty()->SetOpacity( mopacity ); +*/ lstActorsSphere.push_back(sphereActor); + if(renderer==NULL){ + wxMessageDialog dialog(this, _T("Renderer Not Set"),_T("Renderer Not Set"),wxICON_ERROR); + dialog.ShowModal(); + return; + } renderer->AddActor( sphereActor ); // Actor vtkTextActor3D *textActor = vtkTextActor3D::New(); +/* EED Borrame textActor->SetPosition( mradio+spc[0]*x , spc[1]*y , spc[2]*z ); +*/ textActor->SetInput( strLabel.c_str() ); renderer->AddActor( textActor ); lstActorsText.push_back(textActor); + RefreshPoint(lstPointsX.size()-1); SetOutputBox(); - } //------------------------------------------------------------------------ void WidgetShowNPoints::OnAddPoint (wxCommandEvent& event) { + if(mimage==NULL){ + wxMessageDialog dialog(this, _T("Image Not Set"),_T("Image Not Set"),wxICON_ERROR); + dialog.ShowModal(); + return; + } + if (this->renderer!=NULL){ if (mpoint.size()==3){ AddPoint(mpoint[0],mpoint[1],mpoint[2], (const char*) ( textCtrl->GetValue().mb_str() ) ); @@ -192,8 +313,7 @@ void WidgetShowNPoints::OnAddPoint (wxCommandEvent& event) } // renderer } - - //------------------------------------------------------------------------ +//------------------------------------------------------------------------ void WidgetShowNPoints::SetOutputBox() { renderer->GetRenderWindow()->Render(); @@ -212,21 +332,21 @@ void WidgetShowNPoints::OnAddPoint (wxCommandEvent& event) mbbShowNPoints->bbSignalOutputModification(std::string("lstLabels")); } - //------------------------------------------------------------------------ +//------------------------------------------------------------------------ void WidgetShowNPoints::OnSavePoints(wxCommandEvent& event) { - wxFileDialog* FD = new wxFileDialog( 0, - _T("Save points .."), - _T(""), - _T(""), - _T("(*.xls)|*.xls"), - wxSAVE | wxOVERWRITE_PROMPT, - wxDefaultPosition); + _T("Save points .."), + _T(""), + _T(""), + _T("(*.xls)|*.xls"), + wxSAVE | wxOVERWRITE_PROMPT, + wxDefaultPosition); //EED int result_FD = FD->ShowModal(); - + std::string tmpLabel; + // This line is need it by windows //EED FD->SetReturnCode( result_FD ); @@ -248,26 +368,31 @@ void WidgetShowNPoints::OnAddPoint (wxCommandEvent& event) y=lstPointsY[i]; z=lstPointsZ[i]; value= mimage->GetScalarComponentAsDouble(x,y,z,0); - fprintf(ff,"%d\t %d\t %d\t %f\t %s\n", x , y , z , value , lstLabels[i].c_str()); + if (lstLabels[i]!="") + { + tmpLabel=lstLabels[i]; + } else{ + tmpLabel="<_VOID_>"; + } + fprintf(ff,"%d\t%d\t%d\t%f\t%s\n", x , y , z , value , tmpLabel.c_str()); } // for fclose(ff); } else { // else ff printf("WidgetShowNPoints::OnSavePoints ...Error... creating file"); } //ff } // dialog box - } - //------------------------------------------------------------------------ +//------------------------------------------------------------------------ void WidgetShowNPoints::OnLoadPoints(wxCommandEvent& event) { wxFileDialog* FD = new wxFileDialog( 0, - _T("Load points .."), - _T(""), - _T(""), - _T("(*.xls)|*.xls"), - wxOPEN | wxFILE_MUST_EXIST, - wxDefaultPosition); + _T("Load points .."), + _T(""), + _T(""), + _T("(*.xls)|*.xls"), + wxOPEN | wxFILE_MUST_EXIST, + wxDefaultPosition); //EED int result_FD = FD->ShowModal(); @@ -291,7 +416,8 @@ void WidgetShowNPoints::OnAddPoint (wxCommandEvent& event) int x,y,z; for (i=0; i")==0) { strcpy(chartmp,""); } AddPoint(x,y,z, chartmp ); } fclose(ff); @@ -303,31 +429,100 @@ void WidgetShowNPoints::OnAddPoint (wxCommandEvent& event) } +//------------------------------------------------------------------------ + int WidgetShowNPoints::GetNearestPoint() { int id=-1; int i, size=(int)(lstActorsSphere.size()); - double spc[3]; - mimage->GetSpacing(spc); + double radioMin=10000000; + + if(mimage ==NULL){ + wxMessageDialog* diag = new wxMessageDialog(this, _T("Image not set"), _T("Image Not Set"), wxICON_ERROR); + diag->ShowModal(); + return -1; + }else{ + + for ( i=0 ; ibbGetInputType()==1)) { - double rx = spc[0]*(mpoint[0] - lstPointsX [i]); - double ry = spc[1]*(mpoint[1] - lstPointsY [i]); - double rz = spc[2]*(mpoint[2] - lstPointsZ [i]); - if ( rx*rx + ry*ry + rz*rz <= mradio*mradio) + id=0; + AddPoint(0,0,0,""); + } + + + if (id>=0) + { + printf("WidgetShowNPoints::OnSetPoint \n"); + lstPointsX[id] = mpoint[0]; + lstPointsY[id] = mpoint[1]; + lstPointsZ[id] = mpoint[2]; + RefreshPoint(id); + /*EED Borrame + this->lstActorsSphere[id]->SetPosition( spc[0]*mpoint[0]+difradio, spc[1]*mpoint[1], spc[2]* mpoint[2] ); + this->lstActorsText[id]->SetPosition( spc[0]*mpoint[0]+difradio, spc[1]*mpoint[1], spc[2]* mpoint[2] ); + */ + } // if id + SetOutputBox(); + } + + + //------------------------------------------------------------------------ + + int WidgetShowNPoints::IdInsidePoint() + { + int id=-1; + int i, size=(int)(lstActorsSphere.size()); + double spc[3]; + + if(mimage ==NULL){ + wxMessageDialog* diag = new wxMessageDialog(this, _T("Image not set"), _T("Image Not Set"), wxICON_ERROR); + diag->ShowModal(); + return -1; + }else{ + + mimage->GetSpacing(spc); + + for ( i=0 ; i=0) { std::string strLabel = CleanSpaces( (const char*) ( textCtrl->GetValue().mb_str() ) ); @@ -337,7 +532,7 @@ void WidgetShowNPoints::OnAddPoint (wxCommandEvent& event) } } - //------------------------------------------------------------------------ +//------------------------------------------------------------------------ void WidgetShowNPoints::ErasePoint(int id) { if (this->renderer!=NULL){ @@ -346,8 +541,10 @@ void WidgetShowNPoints::OnAddPoint (wxCommandEvent& event) renderer->RemoveActor( lstActorsText[id] ); lstActorsSphere[id]->Delete(); lstActorsText[id]->Delete(); + lstSourceSphere[id]->Delete(); lstActorsSphere.erase( lstActorsSphere.begin()+id ); lstActorsText.erase( lstActorsText.begin()+id ); + lstSourceSphere.erase( lstSourceSphere.begin()+id ); lstPointsX.erase( lstPointsX.begin()+id ); lstPointsY.erase( lstPointsY.begin()+id ); @@ -360,19 +557,18 @@ void WidgetShowNPoints::OnAddPoint (wxCommandEvent& event) } // if renderer } - //------------------------------------------------------------------------ +//------------------------------------------------------------------------ void WidgetShowNPoints::OnErasePoint(wxCommandEvent& event) { - ErasePoint( GetNearestPoint() ); + ErasePoint( IdInsidePoint() ); } - //------------------------------------------------------------------------ +//------------------------------------------------------------------------ void WidgetShowNPoints::OnEraseLastPoint(wxCommandEvent& event) { ErasePoint(lstActorsSphere.size()-1); } - //------------------------------------------------------------------------ void WidgetShowNPoints::OnDeleteAllPoints(wxCommandEvent& event) { @@ -381,17 +577,44 @@ void WidgetShowNPoints::OnDeleteAllPoints(wxCommandEvent& event) { ErasePoint(id); } - } +//NTU: Method for updating points opacity and Radio + +//------------------------------------------------------------------------ +void WidgetShowNPoints::UpdatePoints(wxCommandEvent &event) +{ + //Difference in Radio for text placement + int difradio = sdrRadio->GetValue() - this->mradio; + + this->mopacity = sdrOpacity->GetValue()/100.0; + this->mradio = sdrRadio->GetValue(); + + //NTU refresh the inputs + mbbShowNPoints->bbSetInputOpacity(this->mopacity); + mbbShowNPoints->bbSetInputRadio(this->mradio); + + int size = (int) this->lstActorsSphere.size(); + int i; + for(i = 0; i < size; i ++) + { + this->lstSourceSphere[i]->SetRadius(mradio); + this->lstActorsSphere[i]->GetProperty()->SetOpacity(mopacity); + this->lstActorsText[i]->GetTextProperty()->SetOpacity(mopacity); + this->lstActorsText[i]->SetPosition(this->lstActorsText[i]->GetPosition()[0]+difradio,this->lstActorsText[i]->GetPosition()[1], this->lstActorsText[i]->GetPosition()[2]); + } + //NTU: For updating + SetOutputBox(); +} BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,ShowNPoints) BBTK_BLACK_BOX_IMPLEMENTATION(ShowNPoints,bbtk::WxBlackBox); void ShowNPoints::Process() { - if (mwxwidget!=NULL){ + if (mwxwidget!=NULL) + { mwxwidget->SetRenderer( bbGetInputRenderer() ); mwxwidget->SetPoint( bbGetInputIn() ); mwxwidget->SetImage( bbGetInputImage() ); @@ -406,25 +629,17 @@ void ShowNPoints::Process() } // mwxwidget } - void ShowNPoints::CreateWidget(wxWindow* parent) { - mwxwidget = new WidgetShowNPoints( parent , this); - mwxwidget->SetPoint( bbGetInputIn() ); - - if (bbGetInputImage()==NULL) - { - printf("Missing Image (ShowNPoints) \n"); - } - - bbSetOutputWidget( mwxwidget ); + mwxwidget = new WidgetShowNPoints( parent, this); + bbSetOutputWidget( mwxwidget ); } void ShowNPoints::bbUserSetDefaultValues() { mwxwidget = NULL; - bbSetInputRadio(0.5); + bbSetInputRadio(1); bbSetInputOpacity(1); std::vector colour; @@ -434,22 +649,21 @@ void ShowNPoints::bbUserSetDefaultValues() bbSetInputColour(colour); bbSetInputImage(NULL); + bbSetInputType(0); bbSetInputRenderer(NULL); } - //----------------------------------------------------------------- +//----------------------------------------------------------------- void ShowNPoints::bbUserInitializeProcessing() { } - //----------------------------------------------------------------- +//----------------------------------------------------------------- void ShowNPoints::bbUserFinalizeProcessing() { } - //----------------------------------------------------------------- +//----------------------------------------------------------------- } // EO namespace bbcreaMaracasVisu - -