]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramWidget.cxx
#2490 creaMaracasVisu Feature New High - Histogram Interaction
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / pPlotter / HistogramWidget.cxx
index 9d80407174362c6653c4377464ef52e776354922..eb6d6333cde0e8af09cfef6ef48d58f81d539ffe 100644 (file)
@@ -82,11 +82,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 +95,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 +110,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 +200,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 +306,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 +317,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