lxgui
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
lxgui::gui::bounds2< T > Struct Template Reference

Holds 2D bounds of a region. More...

#include <gui_bounds2.hpp>

Public Member Functions

constexpr bounds2 ()=default
 
constexpr bounds2 (T l, T r, T t, T b) noexcept
 
constexpr bounds2 (const vector2< T > &center, const vector2< T > &size) noexcept
 
void set (T l, T r, T t, T b) noexcept
 
vector2< T > top_left () const noexcept
 
vector2< T > top_right () const noexcept
 
vector2< T > bottom_right () const noexcept
 
vector2< T > bottom_left () const noexcept
 
vector2< T > center () const noexcept
 
width () const noexcept
 
height () const noexcept
 
vector2< T > dimensions () const noexcept
 
bool contains (const vector2< T > &p) const
 
bool overlaps (const bounds2< T > &quad) const
 
bool operator== (const bounds2< T > &quad) const
 
bool operator!= (const bounds2< T > &quad) const
 

Public Attributes

left = 0
 
right = 0
 
top = 0
 
bottom = 0
 

Static Public Attributes

static const bounds2 zero
 

Detailed Description

template<typename T>
struct lxgui::gui::bounds2< T >

Holds 2D bounds of a region.

The bounds are stored as left, right, top, and bottom coordinates.

Definition at line 14 of file gui_bounds2.hpp.

Constructor & Destructor Documentation

◆ bounds2() [1/3]

template<typename T >
constexpr lxgui::gui::bounds2< T >::bounds2 ( )
constexprdefault

◆ bounds2() [2/3]

template<typename T >
constexpr lxgui::gui::bounds2< T >::bounds2 ( l,
r,
t,
b 
)
inlineconstexprnoexcept

Definition at line 17 of file gui_bounds2.hpp.

◆ bounds2() [3/3]

template<typename T >
constexpr lxgui::gui::bounds2< T >::bounds2 ( const vector2< T > &  center,
const vector2< T > &  size 
)
inlineconstexprnoexcept

Definition at line 19 of file gui_bounds2.hpp.

Member Function Documentation

◆ bottom_left()

template<typename T >
vector2<T> lxgui::gui::bounds2< T >::bottom_left ( ) const
inlinenoexcept

Definition at line 44 of file gui_bounds2.hpp.

◆ bottom_right()

template<typename T >
vector2<T> lxgui::gui::bounds2< T >::bottom_right ( ) const
inlinenoexcept

Definition at line 40 of file gui_bounds2.hpp.

◆ center()

template<typename T >
vector2<T> lxgui::gui::bounds2< T >::center ( ) const
inlinenoexcept

Definition at line 48 of file gui_bounds2.hpp.

◆ contains()

template<typename T >
bool lxgui::gui::bounds2< T >::contains ( const vector2< T > &  p) const
inline

Definition at line 64 of file gui_bounds2.hpp.

◆ dimensions()

template<typename T >
vector2<T> lxgui::gui::bounds2< T >::dimensions ( ) const
inlinenoexcept

Definition at line 60 of file gui_bounds2.hpp.

◆ height()

template<typename T >
T lxgui::gui::bounds2< T >::height ( ) const
inlinenoexcept

Definition at line 56 of file gui_bounds2.hpp.

◆ operator!=()

template<typename T >
bool lxgui::gui::bounds2< T >::operator!= ( const bounds2< T > &  quad) const
inline

Definition at line 81 of file gui_bounds2.hpp.

◆ operator==()

template<typename T >
bool lxgui::gui::bounds2< T >::operator== ( const bounds2< T > &  quad) const
inline

Definition at line 77 of file gui_bounds2.hpp.

◆ overlaps()

template<typename T >
bool lxgui::gui::bounds2< T >::overlaps ( const bounds2< T > &  quad) const
inline

Definition at line 68 of file gui_bounds2.hpp.

◆ set()

template<typename T >
void lxgui::gui::bounds2< T >::set ( l,
r,
t,
b 
)
inlinenoexcept

Definition at line 25 of file gui_bounds2.hpp.

◆ top_left()

template<typename T >
vector2<T> lxgui::gui::bounds2< T >::top_left ( ) const
inlinenoexcept

Definition at line 32 of file gui_bounds2.hpp.

◆ top_right()

template<typename T >
vector2<T> lxgui::gui::bounds2< T >::top_right ( ) const
inlinenoexcept

Definition at line 36 of file gui_bounds2.hpp.

◆ width()

template<typename T >
T lxgui::gui::bounds2< T >::width ( ) const
inlinenoexcept

Definition at line 52 of file gui_bounds2.hpp.

Member Data Documentation

◆ bottom

template<typename T >
T lxgui::gui::bounds2< T >::bottom = 0

Definition at line 87 of file gui_bounds2.hpp.

◆ left

template<typename T >
T lxgui::gui::bounds2< T >::left = 0

Definition at line 87 of file gui_bounds2.hpp.

◆ right

template<typename T >
T lxgui::gui::bounds2< T >::right = 0

Definition at line 87 of file gui_bounds2.hpp.

◆ top

template<typename T >
T lxgui::gui::bounds2< T >::top = 0

Definition at line 87 of file gui_bounds2.hpp.

◆ zero

template<typename T >
const bounds2< T > lxgui::gui::bounds2< T >::zero
static

Definition at line 85 of file gui_bounds2.hpp.


The documentation for this struct was generated from the following file: