From: jean-pierre roux Date: Thu, 15 Apr 2010 17:47:06 +0000 (+0000) Subject: Fix compile error std::string vs char[25] X-Git-Tag: CREATOOLS.2-0-3~36 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=8ac87d3ddc867c538bff2c80c9c84ad780094dad;p=creaMaracasVisu.git Fix compile error std::string vs char[25] --- diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramDialogComboBox.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramDialogComboBox.cxx index f358647..c47ec1b 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramDialogComboBox.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramDialogComboBox.cxx @@ -11,7 +11,7 @@ HistogramDialogComboBox::HistogramDialogComboBox(wxWindow* parent) : wxPanel(parent) { - _img = NULL; + _img = NULL; _bitmapcombo = NULL; _slidercolor = NULL; _sliderwindowlevel = NULL; @@ -19,7 +19,7 @@ HistogramDialogComboBox::HistogramDialogComboBox(wxWindow* parent) _bitmapsizer = NULL; this->SetSizer(getBitmapCombo()); - _img = NULL; + _img = NULL; _currentitem = -1; _maxgreyvalue = 0; printf("EED HistogramDialogComboBox\n"); @@ -52,7 +52,6 @@ wxSizer* HistogramDialogComboBox::getBitmapCombo() comboeditsizer->Add(_bitmapcombo,wxSizerFlags().Center().FixedMinSize()); comboeditsizer->Add(edit,wxSizerFlags().Center()); - _bitmapsizer->Add(comboeditsizer,wxSizerFlags().FixedMinSize().Center()); _bitmapsizer->AddSpacer(5); _bitmapsizer->Add(getSlidersWlCo(),wxSizerFlags().Expand().Center()); @@ -69,7 +68,7 @@ wxSizer* HistogramDialogComboBox::getSlidersWlCo(){ sizersliders->Add(_slidercolor,wxSizerFlags().Expand().Center()); sizersliders->Add(_sliderwindowlevel,wxSizerFlags().Expand().Center()); - Connect(_slidercolor->GetId(), wxEVT_SCROLL_THUMBTRACK, (wxObjectEventFunction)&HistogramDialogComboBox::OnColorLevelChanged); + Connect(_slidercolor->GetId(), wxEVT_SCROLL_THUMBTRACK, (wxObjectEventFunction)&HistogramDialogComboBox::OnColorLevelChanged); Connect(_sliderwindowlevel->GetId(), wxEVT_SCROLL_THUMBTRACK, (wxObjectEventFunction)&HistogramDialogComboBox::OnWindowLevelChanged); return sizersliders; @@ -127,7 +126,7 @@ void HistogramDialogComboBox::setSlidersValue() } void HistogramDialogComboBox::OnEditBitmapCombo(wxCommandEvent& event) -{ +{ if(_img!=NULL) { bool createaddandremovecontrols = true; @@ -137,12 +136,12 @@ void HistogramDialogComboBox::OnEditBitmapCombo(wxCommandEvent& event) if(dialog->ShowModal()==wxID_OK) { - dialog->UpdateCurrentComboElement(); _bitmapsitems = dialog->getComboBoxItems(); - - std::string currentpath = crea::System::GetDllAppPath("bbcreaMaracasVisu"); + //std::string currentpath = crea::System::GetDllAppPath("bbcreaMaracasVisu"); // JPR + std::string dllLastName("bbcreaMaracasVisu"); + std::string currentpath = crea::System::GetDllAppPath(dllLastName); currentpath.append(FILENAME); std::vector redvect,greenvect,bluevect; @@ -301,81 +300,81 @@ void HistogramDialogComboBox::OnLoadComboBoxData(std::vector")!=-1)) - { - item = new HistogramDialogComboBoxItem(); - }else if((int)(line.find(""))!=-1){ - int pos1=line.find(">"); - int pos2=line.find("<",pos1+1); - std::string x=line.substr(pos1+1,pos2-pos1-1); - gvtransfer=atof(x.c_str()); - greyvecttransfunct.push_back(gvtransfer); - }else if((int)(line.find(""))!=-1){ - int pos1=line.find(">"); - int pos2=line.find("<",pos1+1); - std::string x=line.substr(pos1+1,pos2-pos1-1); - intensity=atof(x.c_str()); - value.push_back(intensity); - } - else if( (int)(line.find(""))!=-1) - { - int pos1=line.find(">"); - int pos2=line.find("<",pos1+1); - std::string x=line.substr(pos1+1,pos2-pos1-1); - gv=atof(x.c_str()); - greyvect.push_back(gv); - } - else if( (int)(line.find(""))!=-1) - { - int pos1=line.find(">"); - int pos2=line.find("<",pos1+1); - std::string x=line.substr(pos1+1,pos2-pos1-1); - red=atof(x.c_str()); - redvect.push_back(red); - } - else if( (int)(line.find(""))!=-1) - { - int pos1=line.find(">"); - int pos2=line.find("<",pos1+1); - std::string x=line.substr(pos1+1,pos2-pos1-1); - gr=atof(x.c_str()); - greenvect.push_back(gr); - } - else if( (int)(line.find(""))!=-1 ) - { - int pos1=line.find(">"); - int pos2=line.find("<",pos1+1); - std::string x=line.substr(pos1+1,pos2-pos1-1); - bl=atof(x.c_str()); - bluevect.push_back(bl); + { + item = new HistogramDialogComboBoxItem(); + }else if((int)(line.find(""))!=-1) { + int pos1=line.find(">"); + int pos2=line.find("<",pos1+1); + std::string x=line.substr(pos1+1,pos2-pos1-1); + gvtransfer=atof(x.c_str()); + greyvecttransfunct.push_back(gvtransfer); + }else if((int)(line.find(""))!=-1) { + int pos1=line.find(">"); + int pos2=line.find("<",pos1+1); + std::string x=line.substr(pos1+1,pos2-pos1-1); + intensity=atof(x.c_str()); + value.push_back(intensity); + } + else if( (int)(line.find(""))!=-1) + { + int pos1=line.find(">"); + int pos2=line.find("<",pos1+1); + std::string x=line.substr(pos1+1,pos2-pos1-1); + gv=atof(x.c_str()); + greyvect.push_back(gv); + } + else if( (int)(line.find(""))!=-1) + { + int pos1=line.find(">"); + int pos2=line.find("<",pos1+1); + std::string x=line.substr(pos1+1,pos2-pos1-1); + red=atof(x.c_str()); + redvect.push_back(red); + } + else if( (int)(line.find(""))!=-1) + { + int pos1=line.find(">"); + int pos2=line.find("<",pos1+1); + std::string x=line.substr(pos1+1,pos2-pos1-1); + gr=atof(x.c_str()); + greenvect.push_back(gr); + } + else if( (int)(line.find(""))!=-1 ) + { + int pos1=line.find(">"); + int pos2=line.find("<",pos1+1); + std::string x=line.substr(pos1+1,pos2-pos1-1); + bl=atof(x.c_str()); + bluevect.push_back(bl); - }else if( (int)(line.find(""))!=-1 ){ + }else if( (int)(line.find(""))!=-1 ) { - item->SetColors(greyvect,redvect,greenvect,bluevect); - item->SetTransferFunction(greyvecttransfunct,value); - /*for(int i = 0; i < greyvecttransfunct.size();i++){ + item->SetColors(greyvect,redvect,greenvect,bluevect); + item->SetTransferFunction(greyvecttransfunct,value); + /*for(int i = 0; i < greyvecttransfunct.size();i++){ std::cout<<"HistogramDialogComboBox::OnLoadComboBoxData("<& greylevel,std::vector& value) { - for(int i = 0; i < _greyvecttransfer.size();i++){ + for(int i = 0; i < _greyvecttransfer.size();i++) { greylevel.push_back(_greyvecttransfer[i]*_maxgreyvalue); value.push_back(_value[i]); } @@ -399,7 +398,7 @@ void HistogramDialogComboBox::GetValuesColorPointsFunction(std::vector& std::vector& green, std::vector& blue) { - for(int i = 0; i < _greyvect.size();i++){ + for(int i = 0; i < _greyvect.size();i++) { greylevel.push_back(_greyvect[i]*_maxgreyvalue); red.push_back(_redvect[i]); green.push_back(_greenvect[i]);