HistogramDialogComboBox::HistogramDialogComboBox(wxWindow* parent)
: wxPanel(parent)
{
-
_img = NULL;
_bitmapcombo=NULL;
_slidercolor=NULL;
_maxgreyvalue=0;
}
-HistogramDialogComboBox::~HistogramDialogComboBox(){
-
-
+HistogramDialogComboBox::~HistogramDialogComboBox(){
}
+
void HistogramDialogComboBox::SetColors(std::vector<double> greyvect, std::vector<double> redvect, std::vector<double> greenvect, std::vector<double> bluevect){
_greyvect=greyvect;
}
-
wxSizer* HistogramDialogComboBox::getBitmapCombo(){
//_bitmapsizer = new wxBoxSizer(wxVERTICAL);
_bitmapsizer = new wxBoxSizer(wxVERTICAL);
return _sliderwindowlevel->GetValue();
}
}
+
double HistogramDialogComboBox::GetColorLevel(){
if(_slidercolor != NULL){
return _slidercolor->GetValue();
ProcessEvent(newevent);
}
+
void HistogramDialogComboBox::setImageData(vtkImageData* img){
_maxgreyvalue = img->GetScalarRange()[1];
_img = img;
}
}
}
+
void HistogramDialogComboBox::OnEditBitmapCombo(wxCommandEvent& event){
if(_img!=NULL){
}
dialog->Destroy();
}
-
-
-
}
void HistogramDialogComboBox::saveCurrentConfiguration(std::vector<HistogramDialogComboBoxItem*>& itembitmaps,std::string filename){
double gv=-1,red=-1,gr=-1,bl=-1;
int in=-1;
-
-
if(file.is_open())
{
file << "<ComboBoxData>" << std::endl;
file << " </Colors>" << std::endl;
}
}
-
file << " </ComboBoxItem>"<< std::endl;
-
}
- file << "</ComboBoxData>" << std::endl;
-
+ file << "</ComboBoxData>" << std::endl;
}
file.close();
Connect(bitmapcombo->GetId(), wxEVT_COMMAND_COMBOBOX_SELECTED, (wxObjectEventFunction)&HistogramDialogComboBox::OnBitmapComboItemSelected);
-
-
for(int i = 0; i < bitmapsitems.size(); i++){
bitmapcombo->SetItemBitmap(i, bitmapsitems[i]->GetBitmap());
}
-
-
return bitmapcombo;
}
void HistogramDialogComboBox::OnBitmapComboItemSelected(wxCommandEvent& event){
_value = currentconfig->getValueVector();
wxCommandEvent newevent(wxEVT_COMMAND_COMBOBOX_SELECTED,this->GetId());
ProcessEvent(newevent);
- }
-
-
-
+ }
}
-
}
void HistogramDialogComboBox::OnLoadComboBoxData(std::vector<HistogramDialogComboBoxItem*>& itembitmaps, std::string filename)
itembitmaps.push_back(item);
-
greyvecttransfunct.clear();
value.clear();
greyvect.clear();
redvect.clear();
greenvect.clear();
bluevect.clear();
-
}
-
line.clear();
}
file.close();
//std::cout<<itembitmaps.size()<<std::endl;
- }
-
+ }
}
/**
{
for(int i = 0; i < _greyvecttransfer.size();i++){
greylevel.push_back(_greyvecttransfer[i]*_maxgreyvalue);
- value.push_back(_value[i]);
-
-
+ value.push_back(_value[i]);
}
}
std::vector<double>& red,
std::vector<double>& green,
std::vector<double>& blue)
-{
-
+{
for(int i = 0; i < _greyvect.size();i++){
greylevel.push_back(_greyvect[i]*_maxgreyvalue);
red.push_back(_redvect[i]);
green.push_back(_greenvect[i]);
blue.push_back(_bluevect[i]);
}
-}
\ No newline at end of file
+}