A value wrapped to an interval [min, max) More...
#include <Types.h>
Public Member Functions | |
| ValWrap & | operator= (const T &v) |
| Set value. | |
| ValWrap & | operator+= (const T &v) |
| Add value. | |
| ValWrap & | operator-= (const T &v) |
| Subtract value. | |
| ValWrap & | operator*= (const T &v) |
| Multiply value. | |
| ValWrap & | operator/= (const T &v) |
| Divide value. | |
| ValWrap | operator++ (int) |
| Postfix increment value. | |
| ValWrap | operator-- (int) |
| Postfix decrement value. | |
| ValWrap & | operator++ () |
| Prefix increment value. | |
| ValWrap & | operator-- () |
| Prefix decrement value. | |
| ValWrap & | endpoints (const T &min, const T &max) |
| Set wrapping interval. | |
| ValWrap & | max (const T &v) |
| Set maximum endpoint. | |
| ValWrap & | min (const T &v) |
| Set minimum endpoint. | |
| double | fraction () const |
| Returns positive unit fractional position in interval. | |
| T | center () const |
| Returns center point. | |
| Interval & | center (const T &v) |
| Set center point preserving diameter. | |
| bool | contains (const T &v) const |
| Test is point is contained exclusively within interval. | |
| bool | degenerate () const |
| Returns true if diameter is zero. | |
| T | diameter () const |
| Returns absolute difference of endpoints. | |
| Interval & | diameter (const T &v) |
| Set diameter (width) preserving center. | |
| const T & | max () const |
| Get maximum endpoint. | |
| const T & | min () const |
| Get minimum endpoint. | |
| bool | proper () const |
| Returns true if diameter is non-zero. | |
| T | radius () const |
| Returns one-half the diameter. | |
| T | toUnit (const T &v) const |
| Linearly map point in interval to point in the unit interval. | |
| Interval & | centerDiameter (const T &c, const T &d) |
| Set center and diameter. | |
| Interval & | translate (const T &v) |
| Translate interval by fixed amount. | |
A value wrapped to an interval [min, max)
Mathematical correctness is strongly enforced. The value will always lie in the specified interval.