Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
CRect Class Reference

Rectangle class used for screen rectangles. More...

#include <Rect.h>

Public Member Functions

 CRect ()
 
 CRect (const CVector2D &pos)
 
 CRect (const CSize2D &size)
 
 CRect (const CVector2D &upperleft, const CVector2D &bottomright)
 
 CRect (const CVector2D &pos, const CSize2D &size)
 
 CRect (const float l, const float t, const float r, const float b)
 
 CRect (const CRect &)
 
CRectoperator= (const CRect &a)
 
bool operator== (const CRect &a) const
 
bool operator!= (const CRect &a) const
 
CRect operator- () const
 
CRect operator+ () const
 
CRect operator+ (const CRect &a) const
 
CRect operator+ (const CVector2D &a) const
 
CRect operator+ (const CSize2D &a) const
 
CRect operator- (const CRect &a) const
 
CRect operator- (const CVector2D &a) const
 
CRect operator- (const CSize2D &a) const
 
void operator+= (const CRect &a)
 
void operator+= (const CVector2D &a)
 
void operator+= (const CSize2D &a)
 
void operator-= (const CRect &a)
 
void operator-= (const CVector2D &a)
 
void operator-= (const CSize2D &a)
 
float GetWidth () const
 
float GetHeight () const
 
CSize2D GetSize () const
 Get Size. More...
 
CVector2D TopLeft () const
 Get Position equivalent to top/left corner. More...
 
CVector2D TopRight () const
 Get Position equivalent to top/right corner. More...
 
CVector2D BottomLeft () const
 Get Position equivalent to bottom/left corner. More...
 
CVector2D BottomRight () const
 Get Position equivalent to bottom/right corner. More...
 
CVector2D CenterPoint () const
 Get Position equivalent to the center of the rectangle. More...
 
bool PointInside (const CVector2D &point) const
 Evalutates if point is within the rectangle. More...
 
CRect Scale (float x, float y) const
 

Public Attributes

float left
 Returning CVector2D representing each corner. More...
 
float top
 
float right
 
float bottom
 

Detailed Description

Rectangle class used for screen rectangles.

It's very similar to the MS CRect, but with FLOATS because it's meant to be used with OpenGL which takes float values.

Constructor & Destructor Documentation

◆ CRect() [1/7]

CRect::CRect ( )

◆ CRect() [2/7]

CRect::CRect ( const CVector2D pos)

◆ CRect() [3/7]

CRect::CRect ( const CSize2D size)

◆ CRect() [4/7]

CRect::CRect ( const CVector2D upperleft,
const CVector2D bottomright 
)

◆ CRect() [5/7]

CRect::CRect ( const CVector2D pos,
const CSize2D size 
)

◆ CRect() [6/7]

CRect::CRect ( const float  l,
const float  t,
const float  r,
const float  b 
)

◆ CRect() [7/7]

CRect::CRect ( const CRect rect)

Member Function Documentation

◆ BottomLeft()

CVector2D CRect::BottomLeft ( ) const

Get Position equivalent to bottom/left corner.

◆ BottomRight()

CVector2D CRect::BottomRight ( ) const

Get Position equivalent to bottom/right corner.

◆ CenterPoint()

CVector2D CRect::CenterPoint ( ) const

Get Position equivalent to the center of the rectangle.

◆ GetHeight()

float CRect::GetHeight ( ) const
Returns
Height of Rectangle

◆ GetSize()

CSize2D CRect::GetSize ( ) const

Get Size.

◆ GetWidth()

float CRect::GetWidth ( ) const
Returns
Width of Rectangle

◆ operator!=()

bool CRect::operator!= ( const CRect a) const

◆ operator+() [1/4]

CRect CRect::operator+ ( ) const

◆ operator+() [2/4]

CRect CRect::operator+ ( const CRect a) const

◆ operator+() [3/4]

CRect CRect::operator+ ( const CSize2D a) const

◆ operator+() [4/4]

CRect CRect::operator+ ( const CVector2D a) const

◆ operator+=() [1/3]

void CRect::operator+= ( const CRect a)

◆ operator+=() [2/3]

void CRect::operator+= ( const CSize2D a)

◆ operator+=() [3/3]

void CRect::operator+= ( const CVector2D a)

◆ operator-() [1/4]

CRect CRect::operator- ( ) const

◆ operator-() [2/4]

CRect CRect::operator- ( const CRect a) const

◆ operator-() [3/4]

CRect CRect::operator- ( const CSize2D a) const

◆ operator-() [4/4]

CRect CRect::operator- ( const CVector2D a) const

◆ operator-=() [1/3]

void CRect::operator-= ( const CRect a)

◆ operator-=() [2/3]

void CRect::operator-= ( const CSize2D a)

◆ operator-=() [3/3]

void CRect::operator-= ( const CVector2D a)

◆ operator=()

CRect & CRect::operator= ( const CRect a)

◆ operator==()

bool CRect::operator== ( const CRect a) const

◆ PointInside()

bool CRect::PointInside ( const CVector2D point) const

Evalutates if point is within the rectangle.

Parameters
pointCVector2D representing point
Returns
true if inside.

◆ Scale()

CRect CRect::Scale ( float  x,
float  y 
) const

◆ TopLeft()

CVector2D CRect::TopLeft ( ) const

Get Position equivalent to top/left corner.

◆ TopRight()

CVector2D CRect::TopRight ( ) const

Get Position equivalent to top/right corner.

Member Data Documentation

◆ bottom

float CRect::bottom

◆ left

float CRect::left

Returning CVector2D representing each corner.

Dimensions

◆ right

float CRect::right

◆ top

float CRect::top

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