|
constexpr | RectType () noexcept=default |
|
constexpr | RectType (const PointType< Dim > &point, const SizeType< Dim, DimCompat > &size) noexcept |
| Construct a rectangle with an explicit point and size.
|
|
template<typename Dim2 > |
constexpr | RectType (const RectType< Dim2 > &r) |
|
constexpr | RectType (const SizeType< Dim, DimCompat > &size) noexcept |
| Construct a rectangle with the specified size and the point being at the default origin 0,0.
|
|
constexpr | RectType (Dim x, Dim y, Dim width, Dim height) noexcept |
|
EGT_NODISCARD constexpr Dim | area () const noexcept |
| Calculate the area of the rectangle.
|
|
EGT_NODISCARD constexpr Dim | bottom () const noexcept |
| Get the bottom side the rectangle.
|
|
EGT_NODISCARD constexpr PointType< Dim, DimCompat > | bottom_left () const noexcept |
| Get the bottom left point of the rectangle.
|
|
EGT_NODISCARD constexpr PointType< Dim, DimCompat > | bottom_right () const noexcept |
| Get the bottom right point of the rectangle.
|
|
EGT_NODISCARD constexpr PointType< Dim, DimCompat > | center () const noexcept |
| Return the center point of the rectangle.
|
|
constexpr void | clear () noexcept |
| Clear the rectangle by giving it no width or height.
|
|
EGT_NODISCARD constexpr bool | contains (const RectType &rhs) const noexcept |
| Returns true if this rectangle contains the specified one.
|
|
EGT_NODISCARD constexpr bool | empty () const noexcept |
| Returns true if the rectangle has no width or height.
|
|
constexpr void | grow_around_center (Dim radius) noexcept |
| Grow the rectangle around its center by the specified radius.
|
|
EGT_NODISCARD constexpr Dim | height () const noexcept |
| Get the height value.
|
|
constexpr void | height (Dim height) noexcept |
| Set the height value.
|
|
EGT_NODISCARD constexpr bool | intersect (const PointType< Dim, DimCompat > &point) const noexcept |
| Returns true if the specified point is inside the rectangle.
|
|
EGT_NODISCARD constexpr bool | intersect (const RectType &rect) const noexcept |
| Determine if two rectangles intersect, or, overlap.
|
|
EGT_NODISCARD constexpr Dim | left () const noexcept |
| Get the left side the rectangle.
|
|
constexpr void | move_to_center (const PointType< Dim, DimCompat > ¢er) noexcept |
| Move the rectangle's center to the specified point.
|
|
constexpr RectType & | operator+= (const PointType< Dim, DimCompat > &rhs) noexcept |
| RectType operator.
|
|
constexpr RectType & | operator+= (const SizeType< Dim, DimCompat > &rhs) noexcept |
| RectType operator.
|
|
constexpr RectType & | operator-= (const PointType< Dim, DimCompat > &rhs) noexcept |
| RectType operator.
|
|
constexpr RectType & | operator-= (const SizeType< Dim, DimCompat > &rhs) noexcept |
| RectType operator.
|
|
EGT_NODISCARD constexpr const PointType< Dim, DimCompat > & | point () const noexcept |
| Get the PointType of the rectangle.
|
|
constexpr void | point (const PointType< Dim, DimCompat > &p) noexcept |
| Set the rectangle's origin to the specified point.
|
|
EGT_NODISCARD constexpr Dim | right () const noexcept |
| Get the right side the rectangle.
|
|
constexpr void | shrink_around_center (Dim radius) noexcept |
| Shrink the rectangle around its center by the specified radius.
|
|
EGT_NODISCARD constexpr const SizeType< Dim, DimCompat > & | size () const noexcept |
| Get the SizeType of the rectangle.
|
|
constexpr void | size (const SizeType< Dim, DimCompat > &size) noexcept |
| Set the SizeType of the rectangle.
|
|
EGT_NODISCARD constexpr Dim | top () const noexcept |
| Get the top side of the rectangle.
|
|
EGT_NODISCARD constexpr PointType< Dim, DimCompat > | top_left () const noexcept |
| Get the top left point of the rectangle.
|
|
EGT_NODISCARD constexpr PointType< Dim, DimCompat > | top_right () const noexcept |
| Get the top right point of the rectangle.
|
|
EGT_NODISCARD constexpr Dim | width () const noexcept |
| Get the width value.
|
|
constexpr void | width (Dim width) noexcept |
| Set the width value.
|
|
EGT_NODISCARD constexpr Dim | x () const noexcept |
| Get the x value.
|
|
constexpr void | x (Dim x) noexcept |
| Set the x value.
|
|
EGT_NODISCARD constexpr Dim | y () const noexcept |
| Get the y value.
|
|
constexpr void | y (Dim y) noexcept |
| Set the y value.
|
|
template<class Dim,
detail::Compatible DimCompat = detail::Compatible::normal>
class egt::v1::RectType< Dim, DimCompat >
A rectangle with a point and a size.
Typically Rect, RectF are used as aliases.
All rectangle points are at the top left.