Pyrogenesis  trunk
Public Member Functions | Public Attributes | List of all members
CRect Class Reference

Rectangle class used for screen rectangles. More...

#include <Shapes.h>

Public Member Functions

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

Public Attributes

float left
 Returning CPos 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.

Changed to floats 2004-08-31 /GL

Constructor & Destructor Documentation

CRect::CRect ( )
CRect::CRect ( const CPos pos)
CRect::CRect ( const CSize size)
CRect::CRect ( const CPos upperleft,
const CPos bottomright 
)
CRect::CRect ( const CPos pos,
const CSize size 
)
CRect::CRect ( const float  l,
const float  t,
const float  r,
const float  b 
)

Member Function Documentation

CPos CRect::BottomLeft ( ) const

Get Position equivalent to bottom/left corner.

CPos CRect::BottomRight ( ) const

Get Position equivalent to bottom/right corner.

CPos CRect::CenterPoint ( ) const

Get Position equivalent to the center of the rectangle.

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

Get Size.

float CRect::GetWidth ( ) const
Returns
Width of Rectangle
bool CRect::operator!= ( const CRect a) const
CRect CRect::operator+ ( void  ) const
CRect CRect::operator+ ( const CRect a) const
CRect CRect::operator+ ( const CPos a) const
CRect CRect::operator+ ( const CSize a) const
void CRect::operator+= ( const CRect a)
void CRect::operator+= ( const CPos a)
void CRect::operator+= ( const CSize a)
CRect CRect::operator- ( void  ) const
CRect CRect::operator- ( const CRect a) const
CRect CRect::operator- ( const CPos a) const
CRect CRect::operator- ( const CSize a) const
void CRect::operator-= ( const CRect a)
void CRect::operator-= ( const CPos a)
void CRect::operator-= ( const CSize a)
CRect & CRect::operator= ( const CRect a)
bool CRect::operator== ( const CRect a) const
bool CRect::PointInside ( const CPos point) const

Evalutates if point is within the rectangle.

Parameters
pointCPos representing point
Returns
true if inside.
CRect CRect::Scale ( float  x,
float  y 
) const
CPos CRect::TopLeft ( ) const

Get Position equivalent to top/left corner.

CPos CRect::TopRight ( ) const

Get Position equivalent to top/right corner.

Member Data Documentation

float CRect::bottom
float CRect::left

Returning CPos representing each corner.

Dimensions

float CRect::right
float CRect::top

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