A position in the T-valued Cartesian plane.
In graphics, the origin is traditionally in the upper left, so the x coordinate increases to the right and the y coordinate increases downward. Note that much of the library uses geometry::Position, which is a type alias for Basic_position<int>.
Definition at line 74 of file ge211_forward.h.
Public Types | |
using | Coordinate = T |
The coordinate type for the position. More... | |
using | Dimensions = Basic_dimensions< Coordinate > |
A dimensions type having the same coordinate type as this position type. More... | |
Public Member Functions | |
Constructors | |
Basic_position (Coordinate x, Coordinate y) noexcept(is_nothrow_convertible< Coordinate >()) | |
Constructs a position from the given x and y coordinates. | |
Basic_position (Dimensions dims) noexcept(is_nothrow_convertible< Coordinate >()) | |
Constructs a position from a Basic_dimensions, which gives the displacement of the position from the origin. More... | |
template<class U > | |
Basic_position< U > | into () const noexcept(is_nothrow_convertible< Coordinate, U >()) |
Converts a Basic_position to another coordinate type. More... | |
Shifting member functions | |
Basic_position | up_by (Coordinate dy) const noexcept(has_nothrow_arithmetic< Coordinate >()) |
Constructs the position that is above this position by the given amount. More... | |
Basic_position | down_by (Coordinate dy) const noexcept(has_nothrow_arithmetic< Coordinate >()) |
Constructs the position that is below this position by the given amount. More... | |
Basic_position | left_by (Coordinate dx) const noexcept(has_nothrow_arithmetic< Coordinate >()) |
Constructs the position that is to the left of this position by the given amount. More... | |
Basic_position | right_by (Coordinate dx) const noexcept(has_nothrow_arithmetic< Coordinate >()) |
Constructs the position that is to the right of this position by the given amount. More... | |
Basic_position | up_left_by (Dimensions dims) const noexcept(has_nothrow_arithmetic< Coordinate >()) |
Constructs the position that is above and left of this position by the given dimensions. More... | |
Basic_position | up_right_by (Dimensions dims) const noexcept(has_nothrow_arithmetic< Coordinate >()) |
Constructs the position that is above and right of this position by the given dimensions. More... | |
Basic_position | down_left_by (Dimensions dims) const noexcept(has_nothrow_arithmetic< Coordinate >()) |
Constructs the position that is below and left of this position by the given dimensions. More... | |
Basic_position | down_right_by (Dimensions dims) const noexcept(has_nothrow_arithmetic< Coordinate >()) |
Constructs the position that is below and right of this position by the given dimensions. More... | |
Public Attributes | |
Coordinate | x |
The x coordinate. | |
Coordinate | y |
The y coordiante. | |
using Coordinate = T |
The coordinate type for the position.
This is an alias of type parameter T
.
Definition at line 217 of file ge211_geometry.h.
using Dimensions = Basic_dimensions<Coordinate> |
A dimensions type having the same coordinate type as this position type.
Definition at line 220 of file ge211_geometry.h.
|
inlineexplicitnoexcept |
Constructs a position from a Basic_dimensions, which gives the displacement of the position from the origin.
Definition at line 236 of file ge211_geometry.h.
|
inlinenoexcept |
Constructs the position that is below this position by the given amount.
Definition at line 270 of file ge211_geometry.h.
|
inlinenoexcept |
Constructs the position that is below and left of this position by the given dimensions.
Definition at line 310 of file ge211_geometry.h.
|
inlinenoexcept |
Constructs the position that is below and right of this position by the given dimensions.
Definition at line 318 of file ge211_geometry.h.
|
inlinenoexcept |
Converts a Basic_position to another coordinate type.
For example:
Definition at line 249 of file ge211_geometry.h.
|
inlinenoexcept |
Constructs the position that is to the left of this position by the given amount.
Definition at line 278 of file ge211_geometry.h.
|
inlinenoexcept |
Constructs the position that is to the right of this position by the given amount.
Definition at line 286 of file ge211_geometry.h.
|
inlinenoexcept |
Constructs the position that is above this position by the given amount.
Definition at line 262 of file ge211_geometry.h.
|
inlinenoexcept |
Constructs the position that is above and left of this position by the given dimensions.
Definition at line 294 of file ge211_geometry.h.
|
inlinenoexcept |
Constructs the position that is above and right of this position by the given dimensions.
Definition at line 302 of file ge211_geometry.h.