#include <TTauri/Foundation/iaarect.hpp>
|
|
tt_force_inline | iaarect (iaarect const &rhs) noexcept=default |
| |
|
tt_force_inline iaarect & | operator= (iaarect const &rhs) noexcept=default |
| |
|
tt_force_inline | iaarect (iaarect &&rhs) noexcept=default |
| |
|
tt_force_inline iaarect & | operator= (iaarect &&rhs) noexcept=default |
| |
|
| iaarect (__m128i rhs) noexcept |
| |
|
iaarect & | operator= (__m128i rhs) noexcept |
| |
|
| operator __m128i () const noexcept |
| |
| template<typename T , std::enable_if_t< std::is_integral_v< T >, int > = 0> |
| tt_force_inline | iaarect (T x, T y, T width, T height) noexcept |
| | Create a box from the position and size.
|
| |
| tt_force_inline | iaarect (ivec const &offset, ivec const &extent) noexcept |
| | Create a box from the position and size.
|
| |
| iaarect & | operator|= (iaarect const &rhs) noexcept |
| | Expand the current rectangle to include the new rectangle.
|
| |
| iaarect & | operator+= (ivec const &rhs) noexcept |
| | Translate the box to a new position.
|
| |
| iaarect & | operator-= (ivec const &rhs) noexcept |
| | Translate the box to a new position.
|
| |
| template<size_t I> |
| tt_force_inline ivec | corner () const noexcept |
| | Get coordinate of a corner.
|
| |
| tt_force_inline ivec | offset () const noexcept |
| | Get coordinate of the bottom-left corner.
|
| |
| ivec | extent () const noexcept |
| | Get size of the rectangle.
|
| |
|
tt_force_inline int | x1 () const noexcept |
| |
|
tt_force_inline int | y1 () const noexcept |
| |
|
tt_force_inline int | x2 () const noexcept |
| |
|
tt_force_inline int | y2 () const noexcept |
| |
|
tt_force_inline int | width () const noexcept |
| |
|
tt_force_inline int | height () const noexcept |
| |
| bool | contains (ivec const &rhs) const noexcept |
| | Check if a 2D coordinate is inside the rectangle.
|
| |
|
|
static tt_force_inline iaarect | p0p3 (ivec const &p1, ivec const &p2) noexcept |
| |
Class which represents an axis-aligned rectangle.
◆ iaarect() [1/2]
template<typename T , std::enable_if_t< std::is_integral_v< T >, int > = 0>
| tt_force_inline tt::iaarect::iaarect |
( |
T | x, |
|
|
T | y, |
|
|
T | width, |
|
|
T | height ) |
|
inlinenoexcept |
Create a box from the position and size.
- Parameters
-
| 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. |
◆ iaarect() [2/2]
| tt_force_inline tt::iaarect::iaarect |
( |
ivec const & | offset, |
|
|
ivec const & | extent ) |
|
inlinenoexcept |
Create a box from the position and size.
- Parameters
-
| offset | The position of the left-bottom corner of the box |
| extent | The size of the box (z and w must be zero). |
◆ contains()
| bool tt::iaarect::contains |
( |
ivec const & | rhs | ) |
const |
|
inlinenoexcept |
Check if a 2D coordinate is inside the rectangle.
- Parameters
-
| rhs | The coordinate of the point to test. |
◆ corner()
template<size_t I>
| tt_force_inline ivec tt::iaarect::corner |
( |
| ) |
const |
|
inlinenoexcept |
Get coordinate of a corner.
- Parameters
-
| I | Corner number: 0 = left-bottom, 1 = right-bottom, 2 = left-top, 3 = right-top. |
- Returns
- The homogenious coordinate of the corner.
◆ extent()
| ivec tt::iaarect::extent |
( |
| ) |
const |
|
inlinenoexcept |
Get size of the rectangle.
- Returns
- The (x, y) ivector representing the width and height of the rectangle.
◆ offset()
| tt_force_inline ivec tt::iaarect::offset |
( |
| ) |
const |
|
inlinenoexcept |
Get coordinate of the bottom-left corner.
- Returns
- The homogenious coordinate of the bottom-left corner.
◆ operator+=()
Translate the box to a new position.
- Parameters
-
| rhs | The ivector to add to the coordinates of the rectangle. |
◆ operator-=()
Translate the box to a new position.
- Parameters
-
| rhs | The ivector to subtract from the coordinates of the rectangle. |
◆ operator|=()
Expand the current rectangle to include the new rectangle.
This is mostly used for extending bounding a bounding box.
- Parameters
-
| rhs | The new rectangle to include in the current rectangle. |
◆ expand
template<typename T , std::enable_if_t< std::is_integral_v< T >, int > = 0>
Expand the rectangle for the same amount in all directions.
- Parameters
-
| lhs | The original rectangle. |
| rhs | How much should be added on each side of the rectangle, this value may be zero or negative. |
- Returns
- A new rectangle expanded on each side.
The documentation for this class was generated from the following file: