|
HikoGUI
A low latency retained GUI
|
#include <hikogui/geometry/aarectangle.hpp>
Public Types | |
| using | array_type = simd<float, 4> |
| using | value_type = array_type::value_type |
Public Member Functions | |
| constexpr | aarectangle (aarectangle const &rhs) noexcept=default |
| constexpr aarectangle & | operator= (aarectangle const &rhs) noexcept=default |
| constexpr | aarectangle (aarectangle &&rhs) noexcept=default |
| constexpr aarectangle & | operator= (aarectangle &&rhs) noexcept=default |
| constexpr | aarectangle (array_type const &other) noexcept |
| constexpr | aarectangle (float x, float y, float width, float height) noexcept |
| Create a box from the position and size. | |
| constexpr | aarectangle (extent2 const &extent) noexcept |
| Create a rectangle from the size. | |
| constexpr | aarectangle (point2 const &p0, point2 const &p3) noexcept |
| Create a rectangle from the left-bottom and right-top points. | |
| constexpr | aarectangle (point2 const &p0, extent2 const &extent) noexcept |
| Create a rectangle from the size. | |
| constexpr | operator array_type () const noexcept |
| constexpr bool | holds_invariant () const noexcept |
| Make sure p0 is left/bottom from p3. | |
| constexpr bool | empty () const noexcept |
| Check if the rectangle has no area. | |
| constexpr | operator bool () const noexcept |
| True when the rectangle has an area. | |
| constexpr aarectangle & | operator|= (aarectangle const &rhs) noexcept |
| Expand the current rectangle to include the new rectangle. | |
| constexpr aarectangle & | operator|= (point2 const &rhs) noexcept |
| Expand the current rectangle to include the new rectangle. | |
| constexpr point2 | operator[] (std::size_t i) const noexcept |
| constexpr extent2 | size () const noexcept |
| Get size of the rectangle. | |
| constexpr value_type | x () const noexcept |
| constexpr value_type | y () const noexcept |
| constexpr value_type | width () const noexcept |
| constexpr value_type | height () const noexcept |
| constexpr value_type | bottom () const noexcept |
| constexpr value_type | top () const noexcept |
| constexpr value_type | left () const noexcept |
| constexpr value_type | right () const noexcept |
| constexpr value_type | middle () const noexcept |
| The middle on the y-axis between bottom and top. | |
| constexpr value_type | center () const noexcept |
| The center on the x-axis between left and right. | |
| constexpr aarectangle & | set_width (value_type newWidth) noexcept |
| constexpr aarectangle & | set_height (value_type newHeight) noexcept |
| constexpr bool | contains (point2 const &rhs) const noexcept |
| Check if a 2D coordinate is inside the rectangle. | |
| constexpr bool | contains (point3 const &rhs) const noexcept |
| Check if a 3D coordinate is inside the rectangle. | |
Static Public Member Functions | |
| static constexpr aarectangle | large () noexcept |
| Create a large axis aligned rectangle. | |
| static constexpr aarectangle | _align (aarectangle outside, aarectangle inside, alignment alignment) noexcept |
| Need to call the hidden friend function from within another class. | |
Class which represents an axis-aligned rectangle.
|
inlineconstexprnoexcept |
Create a box from the position and size.
| x | The x location of the left-bottom corner of the box |
| y | The y location of the left-bottom corner of the box |
| width | The width of the box. |
| height | The height of the box. |
|
inlineexplicitconstexprnoexcept |
Create a rectangle from the size.
The rectangle's left bottom corner is at the origin.
| extent | The size of the box. |
|
inlineconstexprnoexcept |
Create a rectangle from the left-bottom and right-top points.
| p0 | The left bottom point. |
| p3 | The right opt point. |
|
inlineconstexprnoexcept |
Create a rectangle from the size.
The rectangle's left bottom corner is at the origin.
| p0 | The left-bottom point where the rectangle starts. |
| extent | The size of the rectangle. |
|
inlinestaticconstexprnoexcept |
Need to call the hidden friend function from within another class.
|
inlineconstexprnoexcept |
The center on the x-axis between left and right.
Check if a 2D coordinate is inside the rectangle.
| rhs | The coordinate of the point to test. |
Check if a 3D coordinate is inside the rectangle.
| rhs | The coordinate of the point to test. This point is converted to 2D by this function. |
Check if the rectangle has no area.
Make sure p0 is left/bottom from p3.
|
inlinestaticconstexprnoexcept |
Create a large axis aligned rectangle.
|
inlineconstexprnoexcept |
The middle on the y-axis between bottom and top.
True when the rectangle has an area.
|
inlineconstexprnoexcept |
Expand the current rectangle to include the new rectangle.
This is mostly used for extending bounding a bounding box.
| rhs | The new rectangle to include in the current rectangle. |
|
inlineconstexprnoexcept |
Expand the current rectangle to include the new rectangle.
This is mostly used for extending bounding a bounding box.
| rhs | A new point to include in the current rectangle. |
Get size of the rectangle.
|
friend |
Align a rectangle within another rectangle.
| haystack | The outside rectangle |
| needle | The inside rectangle; to be aligned. |
| alignment | How the inside rectangle should be aligned. |
|
friend |
Align a rectangle within another rectangle.
| haystack | The outside rectangle |
| needle | The size of the rectangle to be aligned. |
| alignment | How the inside rectangle should be aligned. |
|
friend |
Round rectangle by expanding to a certain granularity.
|
friend |
Round rectangle by expanding to pixel edge.
|
friend |
Round rectangle by shrinking to pixel edge.
|
friend |
Return the overlapping part of two rectangles.
When the rectangles are not overlapping, the width and height are zero.
|
friend |
Get the center of the rectangle.
|
friend |
Expand the rectangle for the same amount in all directions.
| lhs | The original rectangle. |
| rhs | How much the width and height should be scaled by. |
|
friend |
Expand the rectangle for the same amount in all directions.
| lhs | The original rectangle. |
| rhs | How much should be added on each side of the rectangle, this value may be zero or negative. |
|
friend |
Shrink the rectangle for the same amount in all directions.
| lhs | The original rectangle. |
| rhs | How much should be added on each side of the rectangle, this value may be zero or negative. |