10 Range() {_min
= 0; _max
= 0;}
11 Range(int min
, int max
) : _min(min
), _max(max
) {}
13 bool operator==(const Range
&other
) const
14 {return _min
== other
._min
&& _max
== other
._max
;}
15 bool operator!=(const Range
&other
) const
16 {return _min
!= other
._min
|| _max
!= other
._max
;}
18 int size() const {return (_max
- _min
);}
19 int min() const {return _min
;}
20 int max() const {return _max
;}
22 bool isValid() const {return size() >= 0;}
23 bool isNull() const {return _min
== 0 && _max
== 0;}
25 void setMin(int min
) {_min
= min
;}
26 void setMax(int max
) {_max
= max
;}
28 bool contains(int val
) const {return (val
>= _min
&& val
<= _max
);}
37 RangeF() {_min
= 0; _max
= 0;}
38 RangeF(qreal min
, qreal max
) : _min(min
), _max(max
) {}
40 RangeF
operator&(const RangeF
&r
) const;
41 RangeF
&operator&=(const RangeF
&r
) {*this = *this & r
; return *this;}
43 qreal
min() const {return _min
;}
44 qreal
max() const {return _max
;}
45 qreal
size() const {return (_max
- _min
);}
47 bool isNull() const {return _min
== 0 && _max
== 0;}
48 bool isValid() const {return size() >= 0;}
50 void setMin(qreal min
) {_min
= min
;}
51 void setMax(qreal max
) {_max
= max
;}
53 void resize(qreal size
);
60 QDebug
operator<<(QDebug dbg
, const Range
&range
);
61 QDebug
operator<<(QDebug dbg
, const RangeF
&range
);