mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 08:47:28 +01:00
37 lines
698 B
C++
37 lines
698 B
C++
#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());
|
|
}
|
|
|
|
}
|