An interval describes the area between two numbers. It is understood to contain the near one and exlude the far.
More...
|
| constexpr auto | Sign () const noexcept -> decltype(Valtype{}/Valtype{}) |
|
constexpr bool | Normal () const noexcept |
| | Is m_Near <= m_Far.
|
|
Interval & | Normalize () noexcept |
| | Make m_Near <= m_Far by flipping.
|
|
Interval & | Flip () noexcept |
| | swap near and far.
|
| constexpr Valtype | Near () const noexcept |
| constexpr Valtype | Far () const noexcept |
|
Interval & | Near (Valtype val) noexcept |
| | Sets the near value of this interval.
|
|
Interval & | Far (Valtype val) noexcept |
| | Sets the far value of this interval.
|
| constexpr Valtype | Max () const noexcept |
| constexpr Valtype | Min () const noexcept |
|
constexpr Valtype | Length () const noexcept |
| | Distance from m_Near to m_Far.
|
|
Interval & | Length (Valtype length) noexcept |
| | Sets the length of the interval by centering it around 0.
|
|
constexpr Valtype | Center () const noexcept |
| | gets the value centered in the interval.
|
|
Interval & | Union (const Interval &i1, const Interval &i2) noexcept |
| | Calculates the union of the two intervals.
|
|
Interval & | Union (const Interval &interval) noexcept |
| | Calculates the union of this and interval.
|
| Interval & | Intersection (const Interval &intersected, const Interval &with) noexcept |
| | Calculates the intersection interval of i1 and i2.
|
| Interval & | Intersection (const Interval &interval) noexcept |
| | Calculates the intersection interval of this and interval.
|
| constexpr bool | Includes (Valtype val) const noexcept |
| constexpr bool | Includes (const Interval &interval) const noexcept |
| constexpr bool | Touches (Valtype val, Valtype epsilon=Valtype{0}) const noexcept |
| Valtype | Clip (Valtype &val) const noexcept |
| | Clips the value to the interval.
|
|
constexpr const Valtype & | Clip (const Valtype &val) const noexcept |
| Valtype | Wrap (Valtype &val) const noexcept |
| | Wraps the value to the interval.
|
| Interval & | Expand (Valtype val) noexcept |
| | Expands the interval so that it touches (being included or laying on border) val.
|
|
Interval & | Inflate (Valtype dx) noexcept |
| | Extends the inteval by dx at each end.
|
|
Interval & | Deflate (Valtype dx) noexcept |
| | Shrinks the interval by dx at each end.
|
|
Interval & | Move (Valtype dx) noexcept |
| | Moves the interval by dx.
|
| Interval & | ToParent (Interval &interval) const noexcept |
| | Understands interval as relative to this and transforms it to parent.
|
| Interval & | FromParent (Interval &interval) const noexcept |
| | Understands interval as relative to parent and transforms it to this.
|
| constexpr bool | Equals (const Interval &interval, Valtype epsilon=std::numeric_limits< Valtype >::epsilon()) const noexcept |
| | Comparison.
|
|
Interval & | Round (int toDigit) noexcept |
| | Rounds the inteval's values to a certain digit after the point.
|
- Parameters
-
| val | Set the interval at val with no extention |
| nearval | lower value of interval. |
| farval | lower value of interval |
|
|
constexpr | Interval () noexcept=default |
| | Does not initialize the members.
|
|
constexpr | Interval (Valtype val) noexcept |
| | Does not initialize the members.
|
|
constexpr | Interval (Valtype nearval, Valtype farval) noexcept |
| | Does not initialize the members.
|
|
constexpr | Interval (const std::pair< Valtype, Valtype > &pair) noexcept |
| | Does not initialize the members.
|
|
template<typename Valtype2> |
| constexpr | Interval (const Interval< Valtype2 > &interval) noexcept |
| | Does not initialize the members.
|
Initializes the interval to origin.
|
|
Interval & | Init () noexcept |
|
Interval & | Init (Valtype nearval, Valtype length) noexcept |
template<typename Valtype>
struct common::Interval< Valtype >
An interval describes the area between two numbers. It is understood to contain the near one and exlude the far.