![]() |
Murl Engine API
Version 2018.3
|
The minimum maximum values template class. More...
#include <murl_math_min_max.h>
The minimum maximum values template class.
This template can be specialized with UInt32, SInt32, UInt64, SInt64, Float and Double, e.g:
Specialization of other datatypes require the LimitsType template parameter, e.g. use of System::Time:
DataType | The minimum and maximum value datatype, must support being compared with operator<. |
LimitsType | The datatype's limits type, must implement a static Min() and Max() method. |
Public Types | |
typedef DataType | ValueType |
The template parameter value type. More... | |
Public Member Functions | |
MinMax () | |
The default constructor. More... | |
MinMax (const DataType &min, const DataType &max) | |
Constructor to initialize with a given minimum and maximum value. More... | |
MinMax (const Array< DataType > &values) | |
Constructor to initialize with given values. More... | |
void | Reset () |
Reset the minimum and maximum value. More... | |
void | Add (const DataType &value) |
Add a value. More... | |
void | Add (const Array< DataType > &values) |
Add values. More... | |
const DataType & | GetMin () const |
Get the minimum. More... | |
const DataType & | GetMax () const |
Get the maximum. More... | |
Bool | IsInRange (const DataType &value) const |
Check if a value is in minimum / maximum range. More... | |
Bool | IsInRangeEx (const DataType &value) const |
Check if a value is in minimum / maximum range excluding the bounds. More... | |
Bool | IsInRangeExMin (const DataType &value) const |
Check if a value is in minimum / maximum range excluding minimum. More... | |
Bool | IsInRangeExMax (const DataType &value) const |
Check if a value is in minimum / maximum range excluding maximum. More... | |
void | Unite (const MinMax &other) |
Unite this MinMax with another MinMax object. More... | |
void | SetMin (const DataType &min) |
Set the minimum. More... | |
void | SetMax (const DataType &max) |
Set the maximum. More... | |
void | Set (const DataType &min, const DataType &max) |
Set the minimum and the maximum. More... | |
String | ToString () const |
Get the string representation of the object. More... | |
Protected Attributes | |
DataType | mMin |
The minimum value. More... | |
DataType | mMax |
The maximum value. More... | |
Friends | |
bool | operator== (const MinMax &lhs, const MinMax &rhs) |
Equal to comparison operator. More... | |
bool | operator!= (const MinMax &lhs, const MinMax &rhs) |
Not equal to comparison operator. More... | |
typedef DataType Murl::Math::MinMax< DataType, LimitsType >::ValueType |
The template parameter value type.
|
inline |
The default constructor.
Initialize the minimum with LimitsType::Max() and the maximum with LimitsType::Min().
|
inline |
Constructor to initialize with a given minimum and maximum value.
min | The minimum value. |
max | The maximum value. |
|
inline |
Constructor to initialize with given values.
Initialize the minimum with LimitsType::Max() and the maximum with LimitsType::Min() and Add() values from an array.
values | The values to add. |
|
inline |
Reset the minimum and maximum value.
Set the minimum to LimitsType::Max() and the maximum to LimitsType::Min().
|
inline |
Add a value.
Set the minimum to the value if the value is less than the current minimum. Set the maximum to the value if the value is greater than the current maximum.
value | The value to add. |
|
inline |
|
inline |
Get the minimum.
|
inline |
Get the maximum.
|
inline |
Check if a value is in minimum / maximum range.
value | The value to check. |
|
inline |
Check if a value is in minimum / maximum range excluding the bounds.
value | The value to check. |
|
inline |
Check if a value is in minimum / maximum range excluding minimum.
value | The value to check. |
|
inline |
Check if a value is in minimum / maximum range excluding maximum.
value | The value to check. |
|
inline |
|
inline |
Set the minimum.
min | The minimum to set. |
|
inline |
Set the maximum.
max | The maximum to set. |
|
inline |
Set the minimum and the maximum.
min | The maximum to set. |
max | The maximum to set. |
|
inline |
Get the string representation of the object.
|
friend |
Equal to comparison operator.
lhs | The left hand side to compare. |
rhs | The right hand side to compare. |
|
friend |
Not equal to comparison operator.
lhs | The left hand side vector to compare. |
rhs | The right hand side vector to compare. |
|
protected |
The minimum value.
|
protected |
The maximum value.