Represents the dimensions of an object, or more generally, the displacement between two Posns.
The coordinate type COORDINATE
may be any arithmetic type.
Definition at line 34 of file ge211_geometry.hxx.
Public Types | |
using | Coordinate = COORDINATE |
The coordinate type for the dimensions. More... | |
Public Member Functions | |
Constructors and Conversions | |
Dims (Coordinate width, Coordinate height) | |
Constructs a dimensions from the given width and height. | |
Dims () | |
Default-constructs the zero-sized Dims. | |
template<typename FROM_COORD > | |
Dims (const Dims< FROM_COORD > &that) | |
Casts or converts a Dims to a Dims of a different coordinate type. More... | |
template<typename TO_COORD > | |
ge211::Dims< TO_COORD > | into () const |
Explicitly converts a Dims to a different coordinate type. More... | |
Operators | |
bool | operator== (Dims that) const |
Equality for Dims. | |
bool | operator!= (Dims that) const |
Disequality for Dims. | |
bool | operator<= (Dims that) const |
Less-than-or-equal for Dims. More... | |
bool | operator>= (Dims that) const |
Greater-than-or-equal for Dims. More... | |
bool | operator< (Dims that) const |
Less-than for Dims. More... | |
bool | operator> (Dims that) const |
Greater-than for Dims. More... | |
Dims | operator+ (Dims that) const |
Adds two Dimses. This is vector addition. | |
Dims | operator- (Dims that) const |
Subtracts two Dimses. This is vector subtraction. | |
template<typename OTHER_COORD , typename RESULT_COORD = Multiply_Result<Coordinate, OTHER_COORD>> | |
Dims< RESULT_COORD > | operator* (Dims< OTHER_COORD > that) const |
Multiplies two Dimses. More... | |
template<typename ARITHMETIC_TYPE , typename = std::enable_if_t<Is_Arithmetic<ARITHMETIC_TYPE>>> | |
Dims | operator* (ARITHMETIC_TYPE scalar) const |
Multiplies a Dims by a scalar. | |
template<typename ARITHMETIC_TYPE , typename = std::enable_if_t<Is_Arithmetic<ARITHMETIC_TYPE>>> | |
Dims | operator/ (ARITHMETIC_TYPE scalar) const |
Divides a Dims by a scalar. | |
Dims | operator- () const |
Dims & | operator+= (Dims that) |
Succinct Dims addition. | |
Dims & | operator-= (Dims that) |
Succinct Dims subtraction. | |
template<typename OTHER_COORD > | |
Dims & | operator*= (Dims< OTHER_COORD > that) |
Succinct Dims–Dims multiplication. Scales *this by that . | |
template<typename ARITHMETIC_TYPE , typename = std::enable_if_t<Is_Arithmetic<ARITHMETIC_TYPE>>> | |
Dims & | operator*= (ARITHMETIC_TYPE scalar) |
Succinct Dims-scalar multiplication. | |
template<typename ARITHMETIC_TYPE , typename = std::enable_if_t<Is_Arithmetic<ARITHMETIC_TYPE>>> | |
Dims & | operator/= (ARITHMETIC_TYPE scalar) |
Succinct Dims-scalar division. More... | |
Public Attributes | |
Coordinate | width |
The width of the object. | |
Coordinate | height |
The height of the object. | |
using Coordinate = COORDINATE |
The coordinate type for the dimensions.
This is an alias of geometry type parameter COORDINATE
.
Definition at line 38 of file ge211_geometry.hxx.
Casts or converts a Dims to a Dims of a different coordinate type.
For example:
Definition at line 65 of file ge211_geometry.hxx.
|
inline |
Explicitly converts a Dims to a different coordinate type.
For example:
Definition at line 80 of file ge211_geometry.hxx.
Multiplies two Dimses.
This scales them by multiplying the widths and heights, pointwise.
Definition at line 163 of file ge211_geometry.hxx.
|
inline |
Succinct Dims-scalar division.
scalar != 0
(when ARITHMETIC_TYPE
is an integer type) Definition at line 238 of file ge211_geometry.hxx.
|
inline |
Less-than for Dims.
True when *this
Dims fits inside that
Dims but they aren't equal.
Definition at line 118 of file ge211_geometry.hxx.
|
inline |
Less-than-or-equal for Dims.
Determines whether *this
Dims fits inside that
Dims.
Definition at line 104 of file ge211_geometry.hxx.
|
inline |
Greater-than for Dims.
True when that
Dims fits inside *this
Dims but they aren't equal.
Definition at line 125 of file ge211_geometry.hxx.
|
inline |
Greater-than-or-equal for Dims.
Determines whether that
Dims fits inside *this
Dims.
Definition at line 111 of file ge211_geometry.hxx.