header_utils
Loading...
Searching...
No Matches
ghassanpl::trec2< T > Struct Template Reference

Represents a 2D rectangle polygon_shape. More...

#include <rec2.h>

Public Types

using tvec
using value_type

Public Member Functions

constexpr trec2 (tvec a, tvec b) noexcept
constexpr trec2 (span< tvec const > points) noexcept
template<GHPL_TYPENAME(std::same_as< tvec >)... ARGS>
constexpr trec2 (bounding_box_for_t, ARGS &&... args) noexcept
constexpr trec2 (tvec a) noexcept
constexpr trec2 (T x1, T y1, T x2, T y2) noexcept
constexpr trec2 (const trec2 &) noexcept=default
constexpr trec2 (trec2 &&) noexcept=default
template<typename U>
constexpr trec2 (const trec2< U > &other) noexcept
template<typename U>
constexpr trec2 (trec2< U > &&other) noexcept
constexpr trec2 & operator= (const trec2 &) noexcept=default
constexpr trec2 & operator= (trec2 &&) noexcept=default
constexpr trec2 operator+ (tvec op) const noexcept
constexpr trec2 & operator+= (tvec op) noexcept
constexpr trec2 operator- (tvec op) const noexcept
constexpr trec2 & operator-= (tvec op) noexcept
constexpr trec2 operator* (T op) const noexcept
constexpr trec2 operator* (tvec op) const noexcept
constexpr trec2 operator/ (T op) const noexcept
constexpr trec2 operator/ (tvec op) const noexcept
constexpr bool operator== (trec2 const &other) const noexcept
constexpr tvec operator[] (size_t i) const noexcept
 TODO: Write this manually (what does it even mean to compare two rectangles?).
constexpr tvec size () const noexcept
constexpr tvec position () const noexcept
constexpr trec2 & set_position (tvec pos) noexcept
constexpr trec2 & set_position (T x, T y) noexcept
constexpr trec2 & set_x (T x) noexcept
constexpr trec2 & set_y (T y) noexcept
constexpr trec2 & set_size (tvec size) noexcept
constexpr trec2 & set_size (T w, T h) noexcept
constexpr trec2 & grow (T by) noexcept
constexpr trec2 & grow (tvec by) noexcept
constexpr trec2 & grow (T left, T top, T right, T bottom) noexcept
constexpr trec2 & shrink (T by) noexcept
constexpr trec2 & shrink (tvec by) noexcept
constexpr trec2 & shrink (T left, T top, T right, T bottom) noexcept
constexpr trec2 grown (T by) const noexcept
constexpr trec2 grown (tvec by) const noexcept
constexpr trec2 grown (T left, T top, T right, T bottom) const noexcept
constexpr trec2 shrunk (T by) const noexcept
constexpr trec2 shrunk (tvec by) const noexcept
constexpr trec2 shrunk (T left, T top, T right, T bottom) const noexcept
constexpr trec2 at_position (tvec pos) const noexcept
constexpr trec2 at_position (T x, T y) const noexcept
constexpr trec2 sized (tvec size) const noexcept
constexpr trec2 sized (T w, T h) const noexcept
constexpr trec2 translated (tvec op) const noexcept
constexpr trec2 translated (T x, T y) const noexcept
constexpr trec2 scaled (tvec op) const noexcept
constexpr trec2 scaled (T x, T y) const noexcept
constexpr trec2 scaled (T s) const noexcept
constexpr T width () const noexcept
constexpr T height () const noexcept
constexpr trec2 & set_width (T w) noexcept
constexpr trec2 & set_height (T h) noexcept
constexpr T x () const noexcept
constexpr T y () const noexcept
constexpr T left () const noexcept
constexpr T top () const noexcept
constexpr T right () const noexcept
constexpr T bottom () const noexcept
constexpr tvec left_top () const noexcept
constexpr tvec left_bottom () const noexcept
constexpr tvec right_top () const noexcept
constexpr tvec right_bottom () const noexcept
constexpr tvec half_size () const noexcept
constexpr tvec center () const noexcept
constexpr tvec centroid () const noexcept
constexpr trec2 & set_center (tvec pos) noexcept
constexpr trec2 at_center (tvec pos) const noexcept
constexpr trec2 local () const noexcept
constexpr trec2 relative_to (trec2 const &other) const noexcept
constexpr trec2 to_global (trec2 const &parent_rect) const noexcept
constexpr glm::vec2 to_rect_space (tvec world_space) const noexcept
constexpr tvec to_world_space (glm::vec2 rect_space) const noexcept
constexpr trec2 & include (tvec pt) noexcept
constexpr trec2 & include (trec2 const &rec) noexcept
constexpr trec2 including (tvec pt) const noexcept
constexpr trec2 including (trec2 const &rec) const noexcept
constexpr bool intersects (trec2 const &other) const noexcept
constexpr trec2 intersection (trec2 const &other) const noexcept
constexpr trec2 clipped_to (trec2 const &other) const noexcept
constexpr trec2 constrained_to (trec2 const &other) const noexcept
constexpr bool contains (glm::vec< 2, T > const &other) const noexcept
 translated by the minimum offset so that it fits inside other
constexpr bool contains (trec2 const &other) const noexcept
constexpr bool is_valid () const noexcept
constexpr trec2 valid () const noexcept
constexpr trec2 & make_valid () noexcept
constexpr std::pair< trec2, trec2 > split_vertical (T top_height) const noexcept
constexpr std::pair< trec2, trec2 > split_horizontal (T left_width) const noexcept
constexpr std::array< tvec, 4 > split_on (tvec split_center) const noexcept
constexpr std::array< tvec, 4 > split_on (trec2 const &removed_portion) const noexcept
constexpr trec2 lerp (trec2 const &other, float factor) const noexcept
constexpr T calculate_area () const noexcept
constexpr T edge_length () const noexcept
constexpr glm::vec2 edge_point_alpha (double edge_progress) const
constexpr glm::vec2 point_alpha (glm::vec2 alpha) const
constexpr glm::vec2 edge_point (double edge_pos) const
constexpr trec2 bounding_box () const noexcept
constexpr glm::vec2 closest_point_to (glm::vec2 pt) const
template<typename FUNC>
 GHPL_REQUIRES (std::is_invocable_v< FUNC, tvec > &&std::is_integral_v< T >) const expr void for_each_pixel(FUNC &&func) const
template<typename FUNC>
constexpr void for_each_edge (FUNC &&func) const
template<typename FUNC>
constexpr void for_each_vertex (FUNC &&func) const
constexpr size_t vertex_count () const noexcept
constexpr size_t edge_count () const noexcept
auto edge (size_t index) const -> std::optional< std::pair< glm::tvec2< T >, glm::tvec2< T > > >
auto vertex (size_t index) const -> std::optional< tvec >

Static Public Member Functions

static constexpr trec2 from_points (span< tvec const > points) noexcept
template<GHPL_TYPENAME(std::same_as< tvec >)... ARGS>
static constexpr trec2 from_points (ARGS &&... args) noexcept
static constexpr trec2 from_size (tvec s) noexcept
static constexpr trec2 from_size (tvec p, tvec s) noexcept
static constexpr trec2 from_size (T x, T y, T w, T h) noexcept
static constexpr trec2 from_center_and_size (tvec p, tvec s) noexcept
static constexpr trec2 from_center_and_size (T x, T y, T w, T h) noexcept
static constexpr trec2 from_center_and_half_size (tvec p, tvec s) noexcept
static constexpr trec2 from_center_and_half_size (T x, T y, T w, T h) noexcept
static constexpr trec2 invalid () noexcept
static constexpr trec2 exclusive () noexcept
static constexpr trec2 inclusive () noexcept

Public Attributes

glm::tvec2< T > p1
glm::tvec2< T > p2

Detailed Description

template<typename T>
struct ghassanpl::trec2< T >

Represents a 2D rectangle polygon_shape.

Definition at line 30 of file rec2.h.

Member Typedef Documentation

◆ tvec

template<typename T>
using ghassanpl::geometry::trec2< T >::tvec

Definition at line 35 of file rec2.h.

◆ value_type

template<typename T>
using ghassanpl::geometry::trec2< T >::value_type

Definition at line 36 of file rec2.h.

Constructor & Destructor Documentation

◆ trec2() [1/7]

template<typename T>
ghassanpl::geometry::trec2< T >::trec2 ( tvec a,
tvec b )
inlineconstexprnoexcept

Definition at line 39 of file rec2.h.

◆ trec2() [2/7]

template<typename T>
ghassanpl::geometry::trec2< T >::trec2 ( span< tvec const > points)
inlineexplicitconstexprnoexcept

Definition at line 40 of file rec2.h.

◆ trec2() [3/7]

template<typename T>
template<GHPL_TYPENAME(std::same_as< tvec >)... ARGS>
ghassanpl::geometry::trec2< T >::trec2 ( bounding_box_for_t ,
ARGS &&... args )
inlineexplicitconstexprnoexcept

Definition at line 48 of file rec2.h.

◆ trec2() [4/7]

template<typename T>
ghassanpl::geometry::trec2< T >::trec2 ( tvec a)
inlineexplicitconstexprnoexcept

Definition at line 54 of file rec2.h.

◆ trec2() [5/7]

template<typename T>
ghassanpl::geometry::trec2< T >::trec2 ( T x1,
T y1,
T x2,
T y2 )
inlineconstexprnoexcept

Definition at line 55 of file rec2.h.

◆ trec2() [6/7]

template<typename T>
template<typename U>
ghassanpl::geometry::trec2< T >::trec2 ( const trec2< U > & other)
inlineexplicitconstexprnoexcept

Definition at line 59 of file rec2.h.

◆ trec2() [7/7]

template<typename T>
template<typename U>
ghassanpl::geometry::trec2< T >::trec2 ( trec2< U > && other)
inlineexplicitconstexprnoexcept

Definition at line 61 of file rec2.h.

Member Function Documentation

◆ at_center()

template<typename T>
trec2 ghassanpl::geometry::trec2< T >::at_center ( tvec pos) const
inlineconstexprnoexcept

Definition at line 183 of file rec2.h.

◆ at_position() [1/2]

template<typename T>
trec2 ghassanpl::geometry::trec2< T >::at_position ( T x,
T y ) const
inlineconstexprnoexcept

Definition at line 157 of file rec2.h.

◆ at_position() [2/2]

template<typename T>
trec2 ghassanpl::geometry::trec2< T >::at_position ( tvec pos) const
inlineconstexprnoexcept

Definition at line 156 of file rec2.h.

◆ bottom()

template<typename T>
T ghassanpl::geometry::trec2< T >::bottom ( ) const
inlineconstexprnoexcept

Definition at line 174 of file rec2.h.

◆ bounding_box()

template<typename T>
trec2 ghassanpl::geometry::trec2< T >::bounding_box ( ) const
inlineconstexprnoexcept

Definition at line 313 of file rec2.h.

◆ calculate_area()

template<typename T>
T ghassanpl::geometry::trec2< T >::calculate_area ( ) const
inlineconstexprnoexcept

Definition at line 272 of file rec2.h.

◆ center()

template<typename T>
tvec ghassanpl::geometry::trec2< T >::center ( ) const
inlineconstexprnoexcept

Definition at line 180 of file rec2.h.

◆ centroid()

template<typename T>
tvec ghassanpl::geometry::trec2< T >::centroid ( ) const
inlineconstexprnoexcept

Definition at line 181 of file rec2.h.

◆ clipped_to()

template<typename T>
trec2 ghassanpl::geometry::trec2< T >::clipped_to ( trec2< T > const & other) const
inlineconstexprnoexcept

Definition at line 213 of file rec2.h.

◆ closest_point_to()

template<typename T>
glm::vec2 ghassanpl::geometry::trec2< T >::closest_point_to ( glm::vec2 pt) const
inlineconstexpr

Definition at line 318 of file rec2.h.

◆ contains() [1/2]

template<typename T>
bool ghassanpl::geometry::trec2< T >::contains ( glm::vec< 2, T > const & other) const
inlineconstexprnoexcept

translated by the minimum offset so that it fits inside other

TODO: CSS Background-size-style funcs: cover, contain

Definition at line 222 of file rec2.h.

◆ contains() [2/2]

template<typename T>
bool ghassanpl::geometry::trec2< T >::contains ( trec2< T > const & other) const
inlineconstexprnoexcept
Precondition
other must be valid

Definition at line 228 of file rec2.h.

◆ edge()

template<typename T>
auto ghassanpl::geometry::trec2< T >::edge ( size_t index) const -> std::optional< std::pair< glm::tvec2< T >, glm::tvec2< T > > >
inline

Definition at line 355 of file rec2.h.

◆ edge_count()

template<typename T>
size_t ghassanpl::geometry::trec2< T >::edge_count ( ) const
inlineconstexprnoexcept

Definition at line 353 of file rec2.h.

◆ edge_length()

template<typename T>
T ghassanpl::geometry::trec2< T >::edge_length ( ) const
inlineconstexprnoexcept

Definition at line 274 of file rec2.h.

◆ edge_point()

template<typename T>
glm::vec2 ghassanpl::geometry::trec2< T >::edge_point ( double edge_pos) const
inlineconstexpr

Definition at line 298 of file rec2.h.

◆ edge_point_alpha()

template<typename T>
glm::vec2 ghassanpl::geometry::trec2< T >::edge_point_alpha ( double edge_progress) const
inlineconstexpr

Definition at line 276 of file rec2.h.

◆ exclusive()

template<typename T>
constexpr trec2 ghassanpl::geometry::trec2< T >::exclusive ( )
inlinestaticconstexprnoexcept

Definition at line 78 of file rec2.h.

◆ for_each_edge()

template<typename T>
template<typename FUNC>
void ghassanpl::geometry::trec2< T >::for_each_edge ( FUNC && func) const
inlineconstexpr

Definition at line 335 of file rec2.h.

◆ for_each_vertex()

template<typename T>
template<typename FUNC>
void ghassanpl::geometry::trec2< T >::for_each_vertex ( FUNC && func) const
inlineconstexpr

Definition at line 344 of file rec2.h.

◆ from_center_and_half_size() [1/2]

template<typename T>
constexpr trec2 ghassanpl::geometry::trec2< T >::from_center_and_half_size ( T x,
T y,
T w,
T h )
inlinestaticconstexprnoexcept

Definition at line 75 of file rec2.h.

◆ from_center_and_half_size() [2/2]

template<typename T>
constexpr trec2 ghassanpl::geometry::trec2< T >::from_center_and_half_size ( tvec p,
tvec s )
inlinestaticconstexprnoexcept

Definition at line 74 of file rec2.h.

◆ from_center_and_size() [1/2]

template<typename T>
constexpr trec2 ghassanpl::geometry::trec2< T >::from_center_and_size ( T x,
T y,
T w,
T h )
inlinestaticconstexprnoexcept

Definition at line 73 of file rec2.h.

◆ from_center_and_size() [2/2]

template<typename T>
constexpr trec2 ghassanpl::geometry::trec2< T >::from_center_and_size ( tvec p,
tvec s )
inlinestaticconstexprnoexcept

Definition at line 72 of file rec2.h.

◆ from_points() [1/2]

template<typename T>
template<GHPL_TYPENAME(std::same_as< tvec >)... ARGS>
constexpr trec2 ghassanpl::geometry::trec2< T >::from_points ( ARGS &&... args)
inlinestaticconstexprnoexcept

Definition at line 68 of file rec2.h.

◆ from_points() [2/2]

template<typename T>
constexpr trec2 ghassanpl::geometry::trec2< T >::from_points ( span< tvec const > points)
inlinestaticconstexprnoexcept

Definition at line 66 of file rec2.h.

◆ from_size() [1/3]

template<typename T>
constexpr trec2 ghassanpl::geometry::trec2< T >::from_size ( T x,
T y,
T w,
T h )
inlinestaticconstexprnoexcept

Definition at line 71 of file rec2.h.

◆ from_size() [2/3]

template<typename T>
constexpr trec2 ghassanpl::geometry::trec2< T >::from_size ( tvec p,
tvec s )
inlinestaticconstexprnoexcept

Definition at line 70 of file rec2.h.

◆ from_size() [3/3]

template<typename T>
constexpr trec2 ghassanpl::geometry::trec2< T >::from_size ( tvec s)
inlinestaticconstexprnoexcept

Definition at line 69 of file rec2.h.

◆ GHPL_REQUIRES()

template<typename T>
template<typename FUNC>
ghassanpl::geometry::trec2< T >::GHPL_REQUIRES ( std::is_invocable_v< FUNC, tvec > &&std::is_integral_v< T > ) const &&
inline

Definition at line 326 of file rec2.h.

◆ grow() [1/3]

template<typename T>
trec2 & ghassanpl::geometry::trec2< T >::grow ( T by)
inlineconstexprnoexcept

Definition at line 143 of file rec2.h.

◆ grow() [2/3]

template<typename T>
trec2 & ghassanpl::geometry::trec2< T >::grow ( T left,
T top,
T right,
T bottom )
inlineconstexprnoexcept

Definition at line 151 of file rec2.h.

◆ grow() [3/3]

template<typename T>
trec2 & ghassanpl::geometry::trec2< T >::grow ( tvec by)
inlineconstexprnoexcept

Definition at line 145 of file rec2.h.

◆ grown() [1/3]

template<typename T>
trec2 ghassanpl::geometry::trec2< T >::grown ( T by) const
inlineconstexprnoexcept

Definition at line 147 of file rec2.h.

◆ grown() [2/3]

template<typename T>
trec2 ghassanpl::geometry::trec2< T >::grown ( T left,
T top,
T right,
T bottom ) const
inlineconstexprnoexcept

Definition at line 153 of file rec2.h.

◆ grown() [3/3]

template<typename T>
trec2 ghassanpl::geometry::trec2< T >::grown ( tvec by) const
inlineconstexprnoexcept

Definition at line 149 of file rec2.h.

◆ half_size()

template<typename T>
tvec ghassanpl::geometry::trec2< T >::half_size ( ) const
inlineconstexprnoexcept

Definition at line 179 of file rec2.h.

◆ height()

template<typename T>
T ghassanpl::geometry::trec2< T >::height ( ) const
inlineconstexprnoexcept

Definition at line 166 of file rec2.h.

◆ include() [1/2]

template<typename T>
trec2 & ghassanpl::geometry::trec2< T >::include ( trec2< T > const & rec)
inlineconstexprnoexcept

Definition at line 194 of file rec2.h.

◆ include() [2/2]

template<typename T>
trec2 & ghassanpl::geometry::trec2< T >::include ( tvec pt)
inlineconstexprnoexcept

Definition at line 193 of file rec2.h.

◆ including() [1/2]

template<typename T>
trec2 ghassanpl::geometry::trec2< T >::including ( trec2< T > const & rec) const
inlineconstexprnoexcept

Definition at line 197 of file rec2.h.

◆ including() [2/2]

template<typename T>
trec2 ghassanpl::geometry::trec2< T >::including ( tvec pt) const
inlineconstexprnoexcept

Definition at line 196 of file rec2.h.

◆ inclusive()

template<typename T>
constexpr trec2 ghassanpl::geometry::trec2< T >::inclusive ( )
inlinestaticconstexprnoexcept

Definition at line 86 of file rec2.h.

◆ intersection()

template<typename T>
trec2 ghassanpl::geometry::trec2< T >::intersection ( trec2< T > const & other) const
inlineconstexprnoexcept

Definition at line 204 of file rec2.h.

◆ intersects()

template<typename T>
bool ghassanpl::geometry::trec2< T >::intersects ( trec2< T > const & other) const
inlineconstexprnoexcept

Definition at line 199 of file rec2.h.

◆ invalid()

template<typename T>
constexpr trec2 ghassanpl::geometry::trec2< T >::invalid ( )
inlinestaticconstexprnoexcept

Definition at line 77 of file rec2.h.

◆ is_valid()

template<typename T>
bool ghassanpl::geometry::trec2< T >::is_valid ( ) const
inlineconstexprnoexcept

Definition at line 233 of file rec2.h.

◆ left()

template<typename T>
T ghassanpl::geometry::trec2< T >::left ( ) const
inlineconstexprnoexcept

Definition at line 171 of file rec2.h.

◆ left_bottom()

template<typename T>
tvec ghassanpl::geometry::trec2< T >::left_bottom ( ) const
inlineconstexprnoexcept

Definition at line 176 of file rec2.h.

◆ left_top()

template<typename T>
tvec ghassanpl::geometry::trec2< T >::left_top ( ) const
inlineconstexprnoexcept

Definition at line 175 of file rec2.h.

◆ local()

template<typename T>
trec2 ghassanpl::geometry::trec2< T >::local ( ) const
inlineconstexprnoexcept

Definition at line 185 of file rec2.h.

◆ make_valid()

template<typename T>
trec2 & ghassanpl::geometry::trec2< T >::make_valid ( )
inlineconstexprnoexcept

Definition at line 246 of file rec2.h.

◆ operator*() [1/2]

template<typename T>
trec2 ghassanpl::geometry::trec2< T >::operator* ( T op) const
inlineconstexprnoexcept

Definition at line 98 of file rec2.h.

◆ operator*() [2/2]

template<typename T>
trec2 ghassanpl::geometry::trec2< T >::operator* ( tvec op) const
inlineconstexprnoexcept

Definition at line 100 of file rec2.h.

◆ operator+()

template<typename T>
trec2 ghassanpl::geometry::trec2< T >::operator+ ( tvec op) const
inlineconstexprnoexcept

Definition at line 94 of file rec2.h.

◆ operator+=()

template<typename T>
trec2 & ghassanpl::geometry::trec2< T >::operator+= ( tvec op)
inlineconstexprnoexcept

Definition at line 95 of file rec2.h.

◆ operator-()

template<typename T>
trec2 ghassanpl::geometry::trec2< T >::operator- ( tvec op) const
inlineconstexprnoexcept

Definition at line 96 of file rec2.h.

◆ operator-=()

template<typename T>
trec2 & ghassanpl::geometry::trec2< T >::operator-= ( tvec op)
inlineconstexprnoexcept

Definition at line 97 of file rec2.h.

◆ operator/() [1/2]

template<typename T>
trec2 ghassanpl::geometry::trec2< T >::operator/ ( T op) const
inlineconstexprnoexcept

Definition at line 99 of file rec2.h.

◆ operator/() [2/2]

template<typename T>
trec2 ghassanpl::geometry::trec2< T >::operator/ ( tvec op) const
inlineconstexprnoexcept

Definition at line 101 of file rec2.h.

◆ operator==()

template<typename T>
bool ghassanpl::geometry::trec2< T >::operator== ( trec2< T > const & other) const
inlineconstexprnoexcept

Definition at line 103 of file rec2.h.

◆ operator[]()

template<typename T>
tvec ghassanpl::geometry::trec2< T >::operator[] ( size_t i) const
inlineconstexprnoexcept

TODO: Write this manually (what does it even mean to compare two rectangles?).

Definition at line 107 of file rec2.h.

◆ point_alpha()

template<typename T>
glm::vec2 ghassanpl::geometry::trec2< T >::point_alpha ( glm::vec2 alpha) const
inlineconstexpr

Definition at line 293 of file rec2.h.

◆ position()

template<typename T>
tvec ghassanpl::geometry::trec2< T >::position ( ) const
inlineconstexprnoexcept

Definition at line 135 of file rec2.h.

◆ relative_to()

template<typename T>
trec2 ghassanpl::geometry::trec2< T >::relative_to ( trec2< T > const & other) const
inlineconstexprnoexcept

Definition at line 186 of file rec2.h.

◆ right()

template<typename T>
T ghassanpl::geometry::trec2< T >::right ( ) const
inlineconstexprnoexcept

Definition at line 173 of file rec2.h.

◆ right_bottom()

template<typename T>
tvec ghassanpl::geometry::trec2< T >::right_bottom ( ) const
inlineconstexprnoexcept

Definition at line 178 of file rec2.h.

◆ right_top()

template<typename T>
tvec ghassanpl::geometry::trec2< T >::right_top ( ) const
inlineconstexprnoexcept

Definition at line 177 of file rec2.h.

◆ scaled() [1/3]

template<typename T>
trec2 ghassanpl::geometry::trec2< T >::scaled ( T s) const
inlineconstexprnoexcept

Definition at line 164 of file rec2.h.

◆ scaled() [2/3]

template<typename T>
trec2 ghassanpl::geometry::trec2< T >::scaled ( T x,
T y ) const
inlineconstexprnoexcept

Definition at line 163 of file rec2.h.

◆ scaled() [3/3]

template<typename T>
trec2 ghassanpl::geometry::trec2< T >::scaled ( tvec op) const
inlineconstexprnoexcept

Definition at line 162 of file rec2.h.

◆ set_center()

template<typename T>
trec2 & ghassanpl::geometry::trec2< T >::set_center ( tvec pos)
inlineconstexprnoexcept

Definition at line 182 of file rec2.h.

◆ set_height()

template<typename T>
trec2 & ghassanpl::geometry::trec2< T >::set_height ( T h)
inlineconstexprnoexcept

Definition at line 168 of file rec2.h.

◆ set_position() [1/2]

template<typename T>
trec2 & ghassanpl::geometry::trec2< T >::set_position ( T x,
T y )
inlineconstexprnoexcept

Definition at line 137 of file rec2.h.

◆ set_position() [2/2]

template<typename T>
trec2 & ghassanpl::geometry::trec2< T >::set_position ( tvec pos)
inlineconstexprnoexcept

Definition at line 136 of file rec2.h.

◆ set_size() [1/2]

template<typename T>
trec2 & ghassanpl::geometry::trec2< T >::set_size ( T w,
T h )
inlineconstexprnoexcept

Definition at line 141 of file rec2.h.

◆ set_size() [2/2]

template<typename T>
trec2 & ghassanpl::geometry::trec2< T >::set_size ( tvec size)
inlineconstexprnoexcept

Definition at line 140 of file rec2.h.

◆ set_width()

template<typename T>
trec2 & ghassanpl::geometry::trec2< T >::set_width ( T w)
inlineconstexprnoexcept

Definition at line 167 of file rec2.h.

◆ set_x()

template<typename T>
trec2 & ghassanpl::geometry::trec2< T >::set_x ( T x)
inlineconstexprnoexcept

Definition at line 138 of file rec2.h.

◆ set_y()

template<typename T>
trec2 & ghassanpl::geometry::trec2< T >::set_y ( T y)
inlineconstexprnoexcept

Definition at line 139 of file rec2.h.

◆ shrink() [1/3]

template<typename T>
trec2 & ghassanpl::geometry::trec2< T >::shrink ( T by)
inlineconstexprnoexcept

Definition at line 144 of file rec2.h.

◆ shrink() [2/3]

template<typename T>
trec2 & ghassanpl::geometry::trec2< T >::shrink ( T left,
T top,
T right,
T bottom )
inlineconstexprnoexcept

Definition at line 152 of file rec2.h.

◆ shrink() [3/3]

template<typename T>
trec2 & ghassanpl::geometry::trec2< T >::shrink ( tvec by)
inlineconstexprnoexcept

Definition at line 146 of file rec2.h.

◆ shrunk() [1/3]

template<typename T>
trec2 ghassanpl::geometry::trec2< T >::shrunk ( T by) const
inlineconstexprnoexcept

Definition at line 148 of file rec2.h.

◆ shrunk() [2/3]

template<typename T>
trec2 ghassanpl::geometry::trec2< T >::shrunk ( T left,
T top,
T right,
T bottom ) const
inlineconstexprnoexcept

Definition at line 154 of file rec2.h.

◆ shrunk() [3/3]

template<typename T>
trec2 ghassanpl::geometry::trec2< T >::shrunk ( tvec by) const
inlineconstexprnoexcept

Definition at line 150 of file rec2.h.

◆ size()

template<typename T>
tvec ghassanpl::geometry::trec2< T >::size ( ) const
inlineconstexprnoexcept

Definition at line 134 of file rec2.h.

◆ sized() [1/2]

template<typename T>
trec2 ghassanpl::geometry::trec2< T >::sized ( T w,
T h ) const
inlineconstexprnoexcept

Definition at line 159 of file rec2.h.

◆ sized() [2/2]

template<typename T>
trec2 ghassanpl::geometry::trec2< T >::sized ( tvec size) const
inlineconstexprnoexcept

Definition at line 158 of file rec2.h.

◆ split_horizontal()

template<typename T>
std::pair< trec2, trec2 > ghassanpl::geometry::trec2< T >::split_horizontal ( T left_width) const
inlineconstexprnoexcept

Definition at line 260 of file rec2.h.

◆ split_vertical()

template<typename T>
std::pair< trec2, trec2 > ghassanpl::geometry::trec2< T >::split_vertical ( T top_height) const
inlineconstexprnoexcept

Definition at line 253 of file rec2.h.

◆ to_global()

template<typename T>
trec2 ghassanpl::geometry::trec2< T >::to_global ( trec2< T > const & parent_rect) const
inlineconstexprnoexcept

Definition at line 188 of file rec2.h.

◆ to_rect_space()

template<typename T>
glm::vec2 ghassanpl::geometry::trec2< T >::to_rect_space ( tvec world_space) const
inlineconstexprnoexcept

Definition at line 190 of file rec2.h.

◆ to_world_space()

template<typename T>
tvec ghassanpl::geometry::trec2< T >::to_world_space ( glm::vec2 rect_space) const
inlineconstexprnoexcept

Definition at line 191 of file rec2.h.

◆ top()

template<typename T>
T ghassanpl::geometry::trec2< T >::top ( ) const
inlineconstexprnoexcept

Definition at line 172 of file rec2.h.

◆ translated() [1/2]

template<typename T>
trec2 ghassanpl::geometry::trec2< T >::translated ( T x,
T y ) const
inlineconstexprnoexcept

Definition at line 161 of file rec2.h.

◆ translated() [2/2]

template<typename T>
trec2 ghassanpl::geometry::trec2< T >::translated ( tvec op) const
inlineconstexprnoexcept

Definition at line 160 of file rec2.h.

◆ valid()

template<typename T>
trec2 ghassanpl::geometry::trec2< T >::valid ( ) const
inlineconstexprnoexcept

Definition at line 238 of file rec2.h.

◆ vertex()

template<typename T>
auto ghassanpl::geometry::trec2< T >::vertex ( size_t index) const -> std::optional< tvec >
inline

Definition at line 367 of file rec2.h.

◆ vertex_count()

template<typename T>
size_t ghassanpl::geometry::trec2< T >::vertex_count ( ) const
inlineconstexprnoexcept

Definition at line 352 of file rec2.h.

◆ width()

template<typename T>
T ghassanpl::geometry::trec2< T >::width ( ) const
inlineconstexprnoexcept

Definition at line 165 of file rec2.h.

◆ x()

template<typename T>
T ghassanpl::geometry::trec2< T >::x ( ) const
inlineconstexprnoexcept

Definition at line 169 of file rec2.h.

◆ y()

template<typename T>
T ghassanpl::geometry::trec2< T >::y ( ) const
inlineconstexprnoexcept

Definition at line 170 of file rec2.h.

Member Data Documentation

◆ p1

template<typename T>
glm::tvec2<T> ghassanpl::geometry::trec2< T >::p1

Definition at line 32 of file rec2.h.

◆ p2

template<typename T>
glm::tvec2<T> ghassanpl::geometry::trec2< T >::p2

Definition at line 33 of file rec2.h.