X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FmaracasVisuLib%2Fsrc%2Finterface%2FwxWindows%2Fwidgets%2FpPlotter%2FHistogramWidget.cxx;h=24628b6ae9b43032f0b3667dcd34ce05eda1d1c1;hb=80b04dc9e3b981e24fe9ae0d81cdeb8af6e6f8c1;hp=9d80407174362c6653c4377464ef52e776354922;hpb=63a0a21e6736a800c58442edd531c91d75e71694;p=creaMaracasVisu.git diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramWidget.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramWidget.cxx index 9d80407..24628b6 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramWidget.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramWidget.cxx @@ -49,6 +49,7 @@ //---------------------------------------------------------------------------- IMPLEMENT_CLASS(HistogramWidget, wxWindow) + //---------------------------------------------------------------------------- // Event Table //---------------------------------------------------------------------------- @@ -82,11 +83,11 @@ HistogramWidget::HistogramWidget( wxWindow *parent, wxWindowID id, const wxPoint 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); @@ -95,17 +96,14 @@ HistogramWidget::HistogramWidget( wxWindow *parent, wxWindowID id, const wxPoint //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); @@ -113,16 +111,14 @@ HistogramWidget::HistogramWidget( wxWindow *parent, wxWindowID id, const wxPoint 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(); - - } @@ -205,18 +201,18 @@ HistogramWidget::HistogramWidget( wxWindow *parent, wxWindowID id, const wxPoint 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); @@ -311,7 +307,7 @@ HistogramWidget::HistogramWidget( wxWindow *parent, wxWindowID id, const wxPoint 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 @@ -322,7 +318,7 @@ HistogramWidget::HistogramWidget( wxWindow *parent, wxWindowID id, const wxPoint 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