igor::iRectangle< T > Class Template Reference

#include <iRectangle.h>

Public Member Functions

 iRectangle ()=default
 
 iRectangle (T x, T y, T width=0, T height=0)
 
 iRectangle (const iRectangle< T > &rect)
 
void adjust (T x, T y, T width, T height)
 
const T getX () const
 
const T getY () const
 
const T getWidth () const
 
const T getHeight () const
 
const T getLeft () const
 
const T getRight () const
 
const T getTop () const
 
const T getBottom () const
 
const iaVector2< T > getCenter () const
 
void setX (T x)
 
void setY (T y)
 
void setWidth (T width)
 
void setHeight (T height)
 
void setSize (T width, T height)
 
void set (T x, T y, T width, T height)
 
iRectangle< T > operator= (const iRectangle< T > &rectangle)
 

Public Attributes

_x = (T)0
 
_y = (T)0
 
_width = (T)0
 
_height = (T)0
 

Detailed Description

template<class T>
class igor::iRectangle< T >

2d rectangle

Constructor & Destructor Documentation

◆ iRectangle() [1/3]

template<class T >
igor::iRectangle< T >::iRectangle ( )
default

does nothing

◆ iRectangle() [2/3]

template<class T >
igor::iRectangle< T >::iRectangle ( x,
y,
width = 0,
height = 0 
)
inline

ctor with parameters

Parameters
xhorizontal position
yvertical position
widthwidth
heightheight

◆ iRectangle() [3/3]

template<class T >
igor::iRectangle< T >::iRectangle ( const iRectangle< T > &  rect)
inline

copy ctor

Parameters
rectthe rectangle to copy

Member Function Documentation

◆ adjust()

template<class T >
void igor::iRectangle< T >::adjust ( x,
y,
width,
height 
)

adjust the size of the rectangle

Parameters
xthe horizontal position adjustment
ythe vertical position adjustment
widththe horizontal size adjustment
heightthe vertical size adjustment

◆ getBottom()

template<class T >
const T igor::iRectangle< T >::getBottom ( ) const
Returns
vertical position of bottom edge

◆ getCenter()

template<class T >
const iaVector2< T > igor::iRectangle< T >::getCenter ( ) const
Returns
center of rectangle

◆ getHeight()

template<class T >
const T igor::iRectangle< T >::getHeight ( ) const
Returns
rectangle height

◆ getLeft()

template<class T >
const T igor::iRectangle< T >::getLeft ( ) const
Returns
horrizonal position

◆ getRight()

template<class T >
const T igor::iRectangle< T >::getRight ( ) const
Returns
horizontal position of right edge

◆ getTop()

template<class T >
const T igor::iRectangle< T >::getTop ( ) const
Returns
vertical position

◆ getWidth()

template<class T >
const T igor::iRectangle< T >::getWidth ( ) const
Returns
rectangle width

◆ getX()

template<class T >
const T igor::iRectangle< T >::getX ( ) const
Returns
horrizonal position

◆ getY()

template<class T >
const T igor::iRectangle< T >::getY ( ) const
Returns
vertical position

◆ operator=()

template<class T >
iRectangle< T > igor::iRectangle< T >::operator= ( const iRectangle< T > &  rectangle)

assignment operator

Parameters
rectanglethe rectangle to assign
Returns
resulting rectangle

◆ set()

template<class T >
void igor::iRectangle< T >::set ( x,
y,
width,
height 
)

sets all values at once

Parameters
xthe horizontal position
ythe vertical position
widththe horizontal size
heightthe vertical size

◆ setHeight()

template<class T >
void igor::iRectangle< T >::setHeight ( height)

sets height of rectangle

Parameters
heightheight of rectangle

◆ setSize()

template<class T >
void igor::iRectangle< T >::setSize ( width,
height 
)

sets width and height of rectangle

Parameters
heightheight of rectangle
widthwidth of rectangle

◆ setWidth()

template<class T >
void igor::iRectangle< T >::setWidth ( width)

sets width of rectangle

Parameters
widthwidth of rectangle

◆ setX()

template<class T >
void igor::iRectangle< T >::setX ( x)

sets horizontal position

Parameters
xhorizontal position

◆ setY()

template<class T >
void igor::iRectangle< T >::setY ( y)

sets vertical position

Parameters
yvertical position

Member Data Documentation

◆ _height

template<class T >
T igor::iRectangle< T >::_height = (T)0

height of rectangle

◆ _width

template<class T >
T igor::iRectangle< T >::_width = (T)0

height of rectangle

◆ _x

template<class T >
T igor::iRectangle< T >::_x = (T)0

horizontal position

◆ _y

template<class T >
T igor::iRectangle< T >::_y = (T)0

vertical position


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