HikoGUI
A low latency retained GUI
|
#include <hikogui/geometry/rectangle.hpp>
Public Member Functions | |
constexpr | rectangle (rectangle const &rhs) noexcept=default |
constexpr rectangle & | operator= (rectangle const &rhs) noexcept=default |
constexpr | rectangle (rectangle &&rhs) noexcept=default |
constexpr rectangle & | operator= (rectangle &&rhs) noexcept=default |
constexpr | rectangle (point3 origin, vector3 right, vector3 up) noexcept |
Create a rectangle from a corner point and two vectors. | |
constexpr | rectangle (point3 origin, point3 right_bottom, point3 left_top, point3 right_top) noexcept |
Create a rectangle from 4 corner points. | |
constexpr | rectangle (aarectangle rhs) noexcept |
constexpr | rectangle (extent2 size) noexcept |
constexpr rectangle & | operator= (aarectangle rhs) noexcept |
constexpr | rectangle (point3 origin, extent2 extent) noexcept |
operator bool () const noexcept | |
Check if the rectangle has an area. | |
constexpr bool | is_rectangle () const noexcept |
Check if this is a rectangle. | |
constexpr bool | is_axis_aligned () const noexcept |
Check if this is an axis aligned rectangle. | |
float | width () const noexcept |
The width, or length of the right vector. | |
float | height () const noexcept |
The height, or length of the up vector. | |
constexpr extent2 | size () const noexcept |
The size, or length of the right and up vectors. | |
float | area () const noexcept |
constexpr point3 | operator[] (std::size_t i) const noexcept |
Data Fields | |
point3 | origin |
vector3 | right |
vector3 | up |
Friends | |
constexpr friend aarectangle | bounding_rectangle (rectangle const &rhs) noexcept |
Return the axis-aligned bounding rectangle of this rectangle. | |
template<std::size_t I> | |
constexpr point3 | get (rectangle const &rhs) noexcept |
constexpr rectangle | operator+ (rectangle const &lhs, extent2 rhs) noexcept |
Expand the rectangle by adding an absolute distance on each side. | |
constexpr rectangle | operator- (rectangle const &lhs, extent2 rhs) noexcept |
Shrink the rectangle by subtracting an absolute distance from each side. | |
constexpr rectangle | operator+ (rectangle const &lhs, float rhs) noexcept |
Expand the rectangle by adding an absolute distance on each side. | |
constexpr rectangle | operator- (rectangle const &lhs, float rhs) noexcept |
Shrink the rectangle by subtracting an absolute distance from each side. | |
A rectangle / parallelogram in 3D space.
This class actually describes a parallelogram in 3D space using a point to the left bottom corner and a right & up vector.
|
inlineconstexprnoexcept |
Create a rectangle from a corner point and two vectors.
origin | The left-bottom corner. |
right | The right vector. |
up | The up vector. |
|
inlineconstexprnoexcept |
Create a rectangle from 4 corner points.
origin | The left-bottom corner. |
right_bottom | The right-bottom corner. |
left_top | The left-top corner. |
right_top | The right-top corner. |
|
inlinenoexcept |
The height, or length of the up vector.
|
inlineconstexprnoexcept |
Check if this is an axis aligned rectangle.
|
inlineconstexprnoexcept |
Check if this is a rectangle.
|
inlineexplicitnoexcept |
Check if the rectangle has an area.
|
inlineconstexprnoexcept |
The size, or length of the right and up vectors.
|
inlinenoexcept |
The width, or length of the right vector.
|
friend |
Return the axis-aligned bounding rectangle of this rectangle.
Expand the rectangle by adding an absolute distance on each side.
The expansion is done by:
It is possible for the rectangle to flip, when the right-hand-side is negative.
lhs | The rectangle to expand. |
rhs | The size in 2D to expand the rectangle |
Expand the rectangle by adding an absolute distance on each side.
The expansion is done by:
It is possible for the rectangle to flip, when the right-hand-side is negative.
lhs | The rectangle to expand. |
rhs | The scalar value which is added to the rectangle in each side. |
Shrink the rectangle by subtracting an absolute distance from each side.
The shrinking is done by:
It is possible for the rectangle to flip, when the right-hand-side is negative.
lhs | The rectangle to shrink. |
rhs | The size in 2D to shrink the rectangle |
Shrink the rectangle by subtracting an absolute distance from each side.
The shrinking is done by:
It is possible for the rectangle to flip, when the right-hand-side is negative.
lhs | The rectangle to shrink. |
rhs | The scalar value which is added to the rectangle in each side. |