]> Creatis software - creaMaracasVisu.git/commitdiff
Fix compile error std::string vs char[25]
authorjean-pierre roux <jean-pierre.roux@creatis.insa-lyon.fr>
Thu, 15 Apr 2010 17:47:06 +0000 (17:47 +0000)
committerjean-pierre roux <jean-pierre.roux@creatis.insa-lyon.fr>
Thu, 15 Apr 2010 17:47:06 +0000 (17:47 +0000)
lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramDialogComboBox.cxx

index f3586470487e8fa0a41d04224efc243715d2da74..c47ec1b75233d2cb2e704c775b34de404857b496 100644 (file)
@@ -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<double> redvect,greenvect,bluevect;
@@ -301,81 +300,81 @@ void HistogramDialogComboBox::OnLoadComboBoxData(std::vector<HistogramDialogComb
                        std::getline(file,line);
                        //std::cout<<line<<std::endl;
             if( (int)(line.find("<ComboBoxItem>")!=-1))
-                       {
-                               item = new HistogramDialogComboBoxItem();
-                       }else if((int)(line.find("<greyValue>"))!=-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("<intensity>"))!=-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("<RGBgreyValue>"))!=-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("<red>"))!=-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("<green>"))!=-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("<blue>"))!=-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("<greyValue>"))!=-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("<intensity>"))!=-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("<RGBgreyValue>"))!=-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("<red>"))!=-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("<green>"))!=-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("<blue>"))!=-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("</ComboBoxItem>"))!=-1 ){
+               }else if( (int)(line.find("</ComboBoxItem>"))!=-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("<<greyvecttransfunct[i]<<std::endl;
                                        std::cout<<value[i]<<std::endl;
-                               }
-                               for(int i = 0; i < greyvect.size();i++){
+                       }
+                       for(int i = 0; i < greyvect.size();i++){
                                        std::cout<<"HistogramDialogComboBox::OnLoadComboBoxData("<<greyvect[i]<<std::endl;
                                        std::cout<<redvect[i]<<std::endl;
                                        std::cout<<greenvect[i]<<std::endl;
                                        std::cout<<bluevect[i]<<std::endl;
-                               }*/
+                       }*/
                                
-                               itembitmaps.push_back(item);
-
-                               greyvecttransfunct.clear();
-                               value.clear();
-                               greyvect.clear();
-                               redvect.clear();
-                               greenvect.clear();
-                               bluevect.clear();
-                       }
-                       line.clear();
+                       itembitmaps.push_back(item);
+
+                       greyvecttransfunct.clear();
+                       value.clear();
+                       greyvect.clear();
+                       redvect.clear();
+                       greenvect.clear();
+                       bluevect.clear();
                }
-               file.close();                   
-               //std::cout<<itembitmaps.size()<<std::endl;
+               line.clear();
+       }
+       file.close();                   
+       //std::cout<<itembitmaps.size()<<std::endl;
      }         
 }
 
@@ -384,7 +383,7 @@ void HistogramDialogComboBox::OnLoadComboBoxData(std::vector<HistogramDialogComb
 **/
 void HistogramDialogComboBox::GetValuesPointsFunction(std::vector<double>& greylevel,std::vector<double>& 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<double>&
                                                                std::vector<double>& green,
                                                                std::vector<double>& 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]);