Base Framework
|
A two-dimensional coordinate. More...
#include <base/ui/Position.h>
Inherits Object.
Public Member Functions | |
Position () noexcept | |
Position (int _x, int _y) noexcept | |
Position (const Dimension &dimension) noexcept | |
Position (const Position ©) noexcept | |
Position & | operator= (const Position &assign) noexcept |
bool | isOrigin () const noexcept |
bool | isWithin (const Position &upperLeft, const Position &lowerRight) const noexcept |
bool | isWithin (const Position &position, const Dimension &dimension) const noexcept |
bool | isWithin (const Dimension &dimension) const noexcept |
bool | confineTo (const Position &a, const Position &b) noexcept |
int | getX () const noexcept |
int | getY () const noexcept |
void | setX (int x) noexcept |
void | setY (int y) noexcept |
Position & | negate () noexcept |
Position & | add (const Position &value) noexcept |
Position & | subtract (const Position &value) noexcept |
bool | operator== (const Position &position) const noexcept |
bool | operator!= (const Position &position) const noexcept |
Position & | operator+= (const Position &value) noexcept |
Position & | operator-= (const Position &value) noexcept |
Position & | operator- (const Position &position) noexcept |
Position & | operator+ (const Position &position) noexcept |
bool | isAfter (const Position &position) const noexcept |
bool | isBefore (const Position &position) const noexcept |
Dimension | getDimension (const Position &position) const noexcept |
Static Public Member Functions | |
static Dimension | getDimension (const Position &upperLeft, const Position &lowerRight) noexcept |
A two-dimensional coordinate.
A two-dimensional discrete coordinate.
|
inlinenoexcept |
Initializes position as (0, 0).
|
inlinenoexcept |
Initializes position with specified x and y values.
|
inlinenoexcept |
Initializes position from dimension (width, height) as (width - 1, height - 1).
|
inlinenoexcept |
Initializes position from other position.
Adds the specified position to this position.
Confines the position to the specified rectangle.
a | Corner. |
b | Corner. |
Returns the dimension of the rectangle from this position (upper left) to the specified lower right corner.
position | The lower right corner. |
|
inlinestaticnoexcept |
Returns the dimension of the rectangle defined by the 2 positions.
upperLeft | The upper left or lower right corner. |
lowerRight | The upper left or lower right corner. |
|
inlinenoexcept |
Returns the X coordinate.
|
inlinenoexcept |
Returns the Y coordinate.
|
inlinenoexcept |
Returns true if the position is after the specified position.
|
inlinenoexcept |
Returns true if the position is before the specified position.
|
inlinenoexcept |
Returns true if position is (0, 0).
|
inlinenoexcept |
Returns true if the position is contained in the bounding rectangle given by the upper left corner (0, 0) and the specified dimension.
dimension | Dimension of the bounding rectangle. |
|
inlinenoexcept |
Returns true if the position is contained in the bounding rectangle specified by the upper left corner and the dimension.
position | Upper left corner of the bounding rectangle. |
dimension | Dimension of the bounding rectangle. |
|
inlinenoexcept |
Returns true if the position is contained in the bounding rectangle specified by the upper left and lower right corners.
upperLeft | The upper left corner. |
lowerRight | The lower right corner. |
|
inlinenoexcept |
Negates this vector.
|
inlinenoexcept |
Returns true if the positions are different.
position | The position to be compared. |
Adds the position from this position.
Adds the specified position from this position.
value | The value to be added. |
Subtracts the position from this position.
Subtracts the specified position from this position.
value | The value to be subtracted. |
Assignment of position by position.
|
inlinenoexcept |
Returns true if the positions are equal.
position | The position to be compared. |
|
inlinenoexcept |
Sets the X coordinate.
|
inlinenoexcept |
Sets the Y coordinate.