FastUIDraw
Public Member Functions | Public Attributes | List of all members
fastuidraw::RectT< T > Class Template Reference

#include <rect.hpp>

Inheritance diagram for fastuidraw::RectT< T >:
Inheritance graph
[legend]

Public Member Functions

 RectT (void)
 
template<typename S >
 RectT (const RectT< S > &rect)
 
RectTheight (T h)
 
height (void) const
 
RectTmax_point (const vecN< T, 2 > &p)
 
RectTmax_point (T x, T y)
 
T & max_x (void)
 
max_x (void) const
 
T & max_y (void)
 
max_y (void) const
 
RectTmin_point (const vecN< T, 2 > &p)
 
RectTmin_point (T x, T y)
 
T & min_x (void)
 
min_x (void) const
 
T & min_y (void)
 
min_y (void) const
 
vecN< T, 2 > point (enum corner_t c) const
 
RectTsanitize_size (void)
 
RectTsize (const vecN< T, 2 > &sz)
 
RectTsize (T width, T height)
 
vecN< T, 2 > size (void) const
 
RectTtranslate (const vecN< T, 2 > &tr)
 
RectTtranslate (T x, T y)
 
RectTwidth (T w)
 
width (void) const
 

Public Attributes

vecN< T, 2 > m_max_point
 
vecN< T, 2 > m_min_point
 

Additional Inherited Members

- Public Types inherited from fastuidraw::RectEnums
enum  { maxx_mask = 1, maxy_mask = 2 }
 
enum  corner_t { minx_miny_corner = 0, minx_maxy_corner = maxy_mask, maxx_miny_corner = maxx_mask, maxx_maxy_corner = maxx_mask | maxy_mask }
 

Detailed Description

template<typename T>
class fastuidraw::RectT< T >

Class to specify the geometry of a rectangle.

Definition at line 60 of file rect.hpp.

Constructor & Destructor Documentation

◆ RectT() [1/2]

template<typename T>
fastuidraw::RectT< T >::RectT ( void  )
inline

Empty ctor; intializes both m_min_point and m_max_point to (0, 0);

Definition at line 67 of file rect.hpp.

◆ RectT() [2/2]

template<typename T>
template<typename S >
fastuidraw::RectT< T >::RectT ( const RectT< S > &  rect)
inlineexplicit

Copy ctor from different rect type

Definition at line 77 of file rect.hpp.

Member Function Documentation

◆ height() [1/2]

template<typename T>
RectT& fastuidraw::RectT< T >::height ( h)
inline

Set the height of the Rect, equivalent to

Parameters
hvalue to make the height of the rect

Definition at line 283 of file rect.hpp.

◆ height() [2/2]

template<typename T>
T fastuidraw::RectT< T >::height ( void  ) const
inline

Returns the width of the Rect, equivalent to

Definition at line 308 of file rect.hpp.

◆ max_point() [1/2]

template<typename T>
RectT& fastuidraw::RectT< T >::max_point ( const vecN< T, 2 > &  p)
inline

Set m_max_point.

Definition at line 107 of file rect.hpp.

◆ max_point() [2/2]

template<typename T>
RectT& fastuidraw::RectT< T >::max_point ( x,
y 
)
inline

Set m_max_point.

Definition at line 117 of file rect.hpp.

◆ max_x() [1/2]

template<typename T>
T& fastuidraw::RectT< T >::max_x ( void  )
inline

Equivalent to

Definition at line 152 of file rect.hpp.

◆ max_x() [2/2]

template<typename T>
T fastuidraw::RectT< T >::max_x ( void  ) const
inline

Equivalent to

Definition at line 158 of file rect.hpp.

◆ max_y() [1/2]

template<typename T>
T& fastuidraw::RectT< T >::max_y ( void  )
inline

Equivalent to

Definition at line 164 of file rect.hpp.

◆ max_y() [2/2]

template<typename T>
T fastuidraw::RectT< T >::max_y ( void  ) const
inline

Equivalent to

Definition at line 170 of file rect.hpp.

◆ min_point() [1/2]

template<typename T>
RectT& fastuidraw::RectT< T >::min_point ( const vecN< T, 2 > &  p)
inline

Set m_min_point.

Definition at line 86 of file rect.hpp.

◆ min_point() [2/2]

template<typename T>
RectT& fastuidraw::RectT< T >::min_point ( x,
y 
)
inline

Set m_min_point.

Definition at line 96 of file rect.hpp.

◆ min_x() [1/2]

template<typename T>
T& fastuidraw::RectT< T >::min_x ( void  )
inline

Equivalent to

Definition at line 128 of file rect.hpp.

◆ min_x() [2/2]

template<typename T>
T fastuidraw::RectT< T >::min_x ( void  ) const
inline

Equivalent to

Definition at line 134 of file rect.hpp.

◆ min_y() [1/2]

template<typename T>
T& fastuidraw::RectT< T >::min_y ( void  )
inline

Equivalent to

Definition at line 140 of file rect.hpp.

◆ min_y() [2/2]

template<typename T>
T fastuidraw::RectT< T >::min_y ( void  ) const
inline

Equivalent to

Definition at line 146 of file rect.hpp.

◆ point()

template<typename T>
vecN<T, 2> fastuidraw::RectT< T >::point ( enum corner_t  c) const
inline

Return the named point of the Rect.

Parameters
cwhich corner of the rect.

Definition at line 177 of file rect.hpp.

◆ sanitize_size()

template<typename T>
RectT& fastuidraw::RectT< T >::sanitize_size ( void  )
inline

Sanitizes the Rect so that both width() and height() are non-negative.

Definition at line 318 of file rect.hpp.

◆ size() [1/3]

template<typename T>
RectT& fastuidraw::RectT< T >::size ( const vecN< T, 2 > &  sz)
inline

Set m_max_point from m_min_point and a size. Equivalent to

Parameters
szsize to which to set the Rect

Definition at line 225 of file rect.hpp.

◆ size() [2/3]

template<typename T>
RectT& fastuidraw::RectT< T >::size ( width,
height 
)
inline

Set m_max_point from m_min_point and a size. Equivalent to

max_point(min_point() + vecN<T, 2>(width, height))
Parameters
widthwidth to which to set the rect
heightheight to which to set the rect

Definition at line 241 of file rect.hpp.

◆ size() [3/3]

template<typename T>
vecN<T, 2> fastuidraw::RectT< T >::size ( void  ) const
inline

Returns the size of the Rect; provided as a conveniance, equivalent to

Definition at line 256 of file rect.hpp.

◆ translate() [1/2]

template<typename T>
RectT& fastuidraw::RectT< T >::translate ( const vecN< T, 2 > &  tr)
inline

Translate the Rect, equivalent to

Parameters
tramount by which to translate

Definition at line 195 of file rect.hpp.

◆ translate() [2/2]

template<typename T>
RectT& fastuidraw::RectT< T >::translate ( x,
y 
)
inline

Translate the Rect, equivalent to

translate(vecN<T, 2>(x, y))
Parameters
xamount by which to translate in x-coordinate
yamount by which to translate in y-coordinate

Definition at line 211 of file rect.hpp.

◆ width() [1/2]

template<typename T>
RectT& fastuidraw::RectT< T >::width ( w)
inline

Set the width of the Rect, equivalent to

Parameters
wvalue to make the width of the rect

Definition at line 269 of file rect.hpp.

◆ width() [2/2]

template<typename T>
T fastuidraw::RectT< T >::width ( void  ) const
inline

Returns the width of the Rect, equivalent to

Definition at line 296 of file rect.hpp.

Member Data Documentation

◆ m_max_point

template<typename T>
vecN<T, 2> fastuidraw::RectT< T >::m_max_point

Specifies the max-corner of the rectangle.

Definition at line 333 of file rect.hpp.

◆ m_min_point

template<typename T>
vecN<T, 2> fastuidraw::RectT< T >::m_min_point

Specifies the min-corner of the rectangle

Definition at line 328 of file rect.hpp.


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