Blame view

build3/apps/statistics/box_range.cpp 698 Bytes
6663b6c9   adorian   projet complet av...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
  #include "box_range.h"
  
  namespace Statistics {
  
  BoxRange::BoxRange(Store * store) :
    m_store(store)
  {
  }
  
  float BoxRange::xMin() {
    float min = m_store->minValue();
    float max = m_store->maxValue();
    max = min >= max ? min + 1 : max;
    return min - k_displayLeftMarginRatio*(max-min);
  }
  
  float BoxRange::xMax() {
    float min = m_store->minValue();
    float max = m_store->maxValue();
    max = min >= max ? min + 1 : max;
    return max + k_displayRightMarginRatio*(max - min);
  }
  
  float BoxRange::yMin() {
    return -k_displayBottomMarginRatio;
  }
  
  float BoxRange::yMax() {
    return 1.0f+k_displayTopMarginRatio;
  }
  
  float BoxRange::xGridUnit() {
    return computeGridUnit(Axis::X, xMin(), xMax());
  }
  
  }