16 #ifndef ROOT7_TPadLinearUserCoord 17 #define ROOT7_TPadLinearUserCoord 25 namespace Experimental {
35 std::array<double, 2>
fMin;
36 std::array<double, 2>
fMax;
41 if (fMin[idx] < fMax[idx])
42 return std::max(std::numeric_limits<double>::min(), fMin[idx] - fMax[idx]);
43 return std::min(-std::numeric_limits<double>::min(), fMin[idx] - fMax[idx]);
48 TPadLinearUserCoord(
const std::array<double, 2> &min,
const std::array<double, 2> &max): fMin(min), fMax(max) {}
54 std::array<TPadCoord::Normal, 2>
ToNormal(
const std::array<TPadCoord::User, 2> &pos)
const override Namespace for new ROOT classes and functions.
std::array< double, 2 > fMin
(x,y) user coordinate of bottom-left corner
double GetDenominator(int idx) const
For (pos-min)/(max-min) calculations, return a sensible, div-by-0 protected denominator.
The default, linear min/max coordinate system for TPad, TCanvas.
virtual ~TPadLinearUserCoord()
Destructor to have a vtable.
std::array< double, 2 > fMax
(x,y) user coordinate of top-right corner
std::array< TPadCoord::Normal, 2 > ToNormal(const std::array< TPadCoord::User, 2 > &pos) const override
Convert user coordinates to normal coordinates.
TPadLinearUserCoord(const std::array< double, 2 > &min, const std::array< double, 2 > &max)
Initialize a TPadLinearUserCoord.