Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

double Impala::Application::TagsLife::BarPlot::findStep ( double  min,
double  max,
double &  newMin,
double &  newMax 
) [inline, private]

Definition at line 218 of file BarPlot.h.

00218                                                                             {
00219         double range = max - min;
00220         if(range < 0) range *= -1;
00221         double exponent = floor(log10(range));
00222         double coefficient = range/pow(10, exponent);
00223 
00224         double step = 1;
00225         if(coefficient <= 5) {
00226                 step = 0.5;
00227                 if(coefficient <= 2.5) {
00228                         step = 0.25;
00229                         if(coefficient == 1) step = 0.1;
00230                 }
00231         }
00232 
00233         step *= pow(10, exponent);
00234         if(step == 2.5) step = 2;
00235 
00236         newMin = floor(min/step)*step;
00237         newMax = ceil(max/step)*step;
00238 
00239         if(min > max) return -step;
00240         return step;
00241     }


Generated on Fri Mar 19 10:51:22 2010 for ImpalaSrc by  doxygen 1.5.1