16#ifndef ROOT7_RPadLength
17#define ROOT7_RPadLength
24namespace Experimental {
38 template <
class DERIVED>
44 DERIVED &
ToDerived() {
return static_cast<DERIVED &
>(*this); }
48 friend DERIVED
operator+(DERIVED lhs, DERIVED rhs) {
return DERIVED{lhs.fVal + rhs.fVal}; }
49 friend DERIVED
operator-(DERIVED lhs, DERIVED rhs) {
return DERIVED{lhs.fVal - rhs.fVal}; }
50 friend double operator/(DERIVED lhs, DERIVED rhs) {
return lhs.fVal / rhs.fVal; }
66 friend DERIVED
operator*(
const DERIVED &lhs,
double rhs) {
return DERIVED(lhs.fVal * rhs); }
67 friend DERIVED
operator*(
double lhs,
const DERIVED &rhs) {
return DERIVED(lhs * rhs.fVal); }
68 friend DERIVED
operator/(
const DERIVED &lhs,
double rhs) {
return DERIVED(lhs.fVal * rhs); }
69 friend bool operator<(
const DERIVED &lhs,
const DERIVED &rhs) {
return lhs.fVal < rhs.fVal; }
70 friend bool operator>(
const DERIVED &lhs,
const DERIVED &rhs) {
return lhs.fVal > rhs.fVal; }
71 friend bool operator<=(
const DERIVED &lhs,
const DERIVED &rhs) {
return lhs.fVal <= rhs.fVal; }
72 friend bool operator>=(
const DERIVED &lhs,
const DERIVED &rhs) {
return lhs.fVal >= rhs.fVal; }
RPadLength & SetNormal(double v)
friend RPadLength operator+(RPadLength lhs, const RPadLength &rhs)
Add two RPadLengths.
friend RPadLength operator-(RPadLength lhs, const RPadLength &rhs)
Subtract two RPadLengths.
RPadLength(User user)
Constructor from a User coordinate.
std::string AsString() const
Converts RPadLength to string like "0.1 + 25px" User coordinates not (yet) supported.
RPadLength(Normal normal, Pixel px, User user)
Constructor for normal, pixel and user coordinate.
RPadLength(Normal normal)
Constructor from a Normal coordinate.
RPadLength(Pixel px)
Constructor from a Pixel coordinate.
bool operator==(const RPadLength &rhs) const
Compare a RPadLength.
RPadLength & operator-=(const RPadLength &rhs)
Subtract a RPadLength.
RPadLength & SetPixel(double v)
RPadLength(double normal)
By default all numeric values are normal values.
bool ParseString(const std::string &val)
Parse string and fill RPadLength attributes String can be like "0.1 + 25px" User coordinates not (yet...
RPadLength operator-()
Unary -.
RPadLength & SetUser(double v)
RPadLength & operator*=(double scale)
Multiply a RPadLength.
std::vector< double > fArr
components [0] - normalized, [1] - pixel, [2] - user
RPadLength(const std::string &csscode)
Constructor from string representation.
RPadLength & operator+=(const RPadLength &rhs)
Add a RPadLength.
RPadLength(Normal normal, Pixel px)
Constructor for normal and pixel coordinate.
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.
friend bool operator>=(const DERIVED &lhs, const DERIVED &rhs)
friend double operator/(DERIVED lhs, DERIVED rhs)
friend bool operator<=(const DERIVED &lhs, const DERIVED &rhs)
friend DERIVED operator*(double lhs, const DERIVED &rhs)
friend bool operator>(const DERIVED &lhs, const DERIVED &rhs)
friend DERIVED operator*(const DERIVED &lhs, double rhs)
friend DERIVED operator/(const DERIVED &lhs, double rhs)
DERIVED & operator+=(const DERIVED &rhs)
friend DERIVED operator+(DERIVED lhs, DERIVED rhs)
DERIVED & operator*=(double scale)
friend DERIVED operator-(DERIVED lhs, DERIVED rhs)
friend bool operator<(const DERIVED &lhs, const DERIVED &rhs)
DERIVED & operator-=(const DERIVED &rhs)
double fVal
! Coordinate value