iaux::iaRectangle< T > Struct Template Reference

#include <iaRectangle.h>

Public Member Functions

 iaRectangle ()=default
 
 iaRectangle (T x, T y, T width=0, T height=0)
 
 iaRectangle (const iaVector2< T > &pos, const iaVector2< T > &size)
 
 iaRectangle (const iaRectangle< 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
 
void setCenter (T x, T y)
 
void setCenter (const iaVector2< T > &center)
 
const iaVector2< T > getCenter () const
 
void setTopLeft (const iaVector2< T > &pos)
 
void setTopLeft (T x, T y)
 
const iaVector2< T > getTopLeft () const
 
const iaVector2< T > getTopRight () const
 
const iaVector2< T > getBottomLeft () const
 
const iaVector2< T > getBottomRight () 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)
 
iaRectangle< T > operator= (const iaRectangle< T > &rectangle)
 
bool operator== (const iaRectangle< T > &other) const
 
bool operator!= (const iaRectangle< T > &other) const
 

Public Attributes

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

Detailed Description

template<typename T>
struct iaux::iaRectangle< T >

2d rectangle

Constructor & Destructor Documentation

◆ iaRectangle() [1/4]

template<typename T >
iaux::iaRectangle< T >::iaRectangle ( )
default

does nothing

◆ iaRectangle() [2/4]

template<typename T >
iaRectangle::iaRectangle ( x,
y,
width = 0,
height = 0 
)

ctor with parameters

Parameters
xhorizontal position
yvertical position
widthwidth
heightheight

◆ iaRectangle() [3/4]

template<typename T >
iaRectangle::iaRectangle ( const iaVector2< T > &  pos,
const iaVector2< T > &  size 
)

ctor with parameters

Parameters
postop left position
sizethe size of the rectangle

◆ iaRectangle() [4/4]

template<typename T >
iaRectangle::iaRectangle ( const iaRectangle< T > &  rect)

copy ctor

Parameters
rectthe rectangle to copy

Member Function Documentation

◆ adjust()

template<typename T >
void iaRectangle::adjust ( x,
y,
width,
height 
)

adjust the dimensions of the rectangle

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

◆ getBottom()

template<typename T >
const T iaRectangle::getBottom ( ) const
Returns
vertical position of bottom edge

◆ getBottomLeft()

template<typename T >
const iaVector2< T > iaRectangle::getBottomLeft ( ) const
Returns
bottom left corner of rectangle

◆ getBottomRight()

template<typename T >
const iaVector2< T > iaRectangle::getBottomRight ( ) const
Returns
bottom right corner of rectangle

◆ getCenter()

template<typename T >
const iaVector2< T > iaRectangle::getCenter ( ) const
Returns
center of rectangle

◆ getHeight()

template<typename T >
const T iaRectangle::getHeight ( ) const
Returns
rectangle height

◆ getLeft()

template<typename T >
const T iaRectangle::getLeft ( ) const
Returns
horrizonal position

◆ getRight()

template<typename T >
const T iaRectangle::getRight ( ) const
Returns
horizontal position of right edge

◆ getTop()

template<typename T >
const T iaRectangle::getTop ( ) const
Returns
vertical position

◆ getTopLeft()

template<typename T >
const iaVector2< T > iaRectangle::getTopLeft ( ) const
Returns
top left corner of rectangle

◆ getTopRight()

template<typename T >
const iaVector2< T > iaRectangle::getTopRight ( ) const
Returns
top right corner of rectangle

◆ getWidth()

template<typename T >
const T iaRectangle::getWidth ( ) const
Returns
rectangle width

◆ getX()

template<typename T >
const T iaRectangle::getX ( ) const
Returns
horrizonal position

◆ getY()

template<typename T >
const T iaRectangle::getY ( ) const
Returns
vertical position

◆ operator!=()

template<typename T >
bool iaRectangle::operator!= ( const iaRectangle< T > &  other) const

compares two rectangles

Parameters
otherthe other rectangle
Returns
true if rectangles are not equal

◆ operator=()

template<typename T >
iaRectangle< T > iaRectangle::operator= ( const iaRectangle< T > &  rectangle)

assignment operator

Parameters
rectanglethe rectangle to assign
Returns
resulting rectangle

◆ operator==()

template<typename T >
bool iaRectangle::operator== ( const iaRectangle< T > &  other) const

compares two rectangles

Parameters
otherthe other rectangle
Returns
true if both rectangles are equal

◆ set()

template<typename T >
void iaRectangle::set ( x,
y,
width,
height 
)

sets all values at once

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

◆ setCenter() [1/2]

template<typename T >
void iaRectangle::setCenter ( const iaVector2< T > &  center)

sets center of rectangle without changing it's size

Parameters
centerthe center to se

◆ setCenter() [2/2]

template<typename T >
void iaRectangle::setCenter ( x,
y 
)

sets center of rectangle without changing it's size

Parameters
xx component of the new center
yy component of the new center

◆ setHeight()

template<typename T >
void iaRectangle::setHeight ( height)

sets height of rectangle

Parameters
heightheight of rectangle

◆ setSize()

template<typename T >
void iaRectangle::setSize ( width,
height 
)

sets width and height of rectangle

Parameters
heightheight of rectangle
widthwidth of rectangle

◆ setTopLeft() [1/2]

template<typename T >
void iaRectangle::setTopLeft ( const iaVector2< T > &  pos)

sets top left of rectangle

Parameters
posthe top left corner

◆ setTopLeft() [2/2]

template<typename T >
void iaRectangle::setTopLeft ( x,
y 
)

sets top left of rectangle

Parameters
xhorizontal position
yvertical position

◆ setWidth()

template<typename T >
void iaRectangle::setWidth ( width)

sets width of rectangle

Parameters
widthwidth of rectangle

◆ setX()

template<typename T >
void iaRectangle::setX ( x)

sets horizontal position

Parameters
xhorizontal position

◆ setY()

template<typename T >
void iaRectangle::setY ( y)

sets vertical position

Parameters
yvertical position

Member Data Documentation

◆ _height

template<typename T >
T iaux::iaRectangle< T >::_height = (T)0

height of rectangle

◆ _width

template<typename T >
T iaux::iaRectangle< T >::_width = (T)0

height of rectangle

◆ _x

template<typename T >
T iaux::iaRectangle< T >::_x = (T)0

horizontal position

◆ _y

template<typename T >
T iaux::iaRectangle< T >::_y = (T)0

vertical position


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