plotter->setType(2);
//setting the popMenu
plotter->setPopUpMenu(true,true,true,true,true,true,false,false,false,false,false,false,false);
- histogramSize=0;
- idTransferenceFunction=-1;
- idHistogram=-1;
- transferenceFunctionHasColor=true;
- transferenceFunctionHasPoints=true;
+ histogramSize = 0;
+ idTransferenceFunction = -1;
+ idHistogram = -1;
+ transferenceFunctionHasColor = true;
+ transferenceFunctionHasPoints = true;
this->type=type;
this->SetAutoLayout(true);
//drawing
drawHistogram();
drawTransferenceFunction();
-
}
HistogramWidget::HistogramWidget( wxWindow *parent, wxWindowID id)
: wxPanel(parent,id){
-
SetBackgroundColour(wxColour(255,255,255));
histogram = NULL;
-
//plotter
plotter=new pPlotter(this, 400,350);
plotter->setType(2);
//setting the popMenu
plotter->setPopUpMenu(true,true,true,true,true,true,false,false,false,false,false,false,false);
- histogramSize=0;
- idTransferenceFunction=-1;
- idHistogram=-1;
- transferenceFunctionHasColor=true;
- transferenceFunctionHasPoints=true;
- this->type=type;;
+ histogramSize = 0;
+ idTransferenceFunction = -1;
+ idHistogram = -1;
+ transferenceFunctionHasColor = true;
+ transferenceFunctionHasPoints = true;
+ this->type = type;;
this->SetAutoLayout(true);
this->Refresh();
-
-
}
double xValues[5],yValues[5];
//xValues
int maxValueGrey=histogram->getMaximumLevelOfGrey();
- xValues[0]=0;
- xValues[1]=maxValueGrey/16;
- xValues[2]=maxValueGrey/8;
- xValues[3]=maxValueGrey/16+(maxValueGrey-maxValueGrey/2)/2;
- xValues[4]=maxValueGrey;
+ xValues[0] = 0;
+ xValues[1] = maxValueGrey/16;
+ xValues[2] = maxValueGrey/8;
+ xValues[3] = maxValueGrey/16+(maxValueGrey-maxValueGrey/2)/2;
+ xValues[4] = maxValueGrey;
//yValues
- yValues[0]=0;
- yValues[1]=25;
- yValues[2]=100;
- yValues[3]=25;
- yValues[4]=0;
+ yValues[0] = 0;
+ yValues[1] = 25;
+ yValues[2] = 100;
+ yValues[3] = 25;
+ yValues[4] = 0;
pGraphicalFunction * tf = plotter ->getFunctionForVectors( xValues, 5, yValues, 5 );
printf("EED %p HistogramWidget::drawTransferenceFunction %p\n", this , tf);
pGraphicalFunction* histogramFunction = plotter->getFunction(idHistogram);
int min = histogramFunction->getMinX();
float x = porcentageMaxX*(histogramFunction->getMaxX()-min);
- return min+ x;
+ return min + x;
}
/*
Returns the minimum value ot the histogram that is show to the user
pGraphicalFunction* histogramFunction = plotter->getFunction(idHistogram);
int min = histogramFunction->getMinX();
float x = porcentageMinX*(histogramFunction->getMaxX()-min);
- return min+ x;
+ return min + x;
}
/*
Returns the minimum value ot the histogram that is show to the user