HistogramDialogComboBox::HistogramDialogComboBox(wxWindow* parent)
: wxPanel(parent)
{
- _img = NULL;
+ _img = NULL;
_bitmapcombo = NULL;
_slidercolor = NULL;
_sliderwindowlevel = NULL;
_bitmapsizer = NULL;
this->SetSizer(getBitmapCombo());
- _img = NULL;
+ _img = NULL;
_currentitem = -1;
_maxgreyvalue = 0;
printf("EED HistogramDialogComboBox\n");
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());
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;
}
void HistogramDialogComboBox::OnEditBitmapCombo(wxCommandEvent& event)
-{
+{
if(_img!=NULL)
{
bool createaddandremovecontrols = true;
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;
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;
}
}
**/
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]);
}
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]);