MFMv2.0.10
Movable Feast Machine Simulator 2.0.10
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions
MFM::Rect Class Reference

#include <Rect.h>

Public Member Functions

 Rect ()
 
 Rect (const Rect &copy)
 
 Rect (const SPoint &pos, const UPoint &size)
 
 Rect (s32 x, s32 y, u32 w, u32 h)
 
void IntersectWith (const Rect &other)
 
bool IsEmpty () const
 
bool Contains (const SPoint &point)
 
const SPointGetPosition () const
 
s32 GetX () const
 
s32 GetY () const
 
void SetPosition (const SPoint &newPos)
 
void SetX (s32 newX)
 
void SetY (s32 newY)
 
const UPointGetSize () const
 
u32 GetWidth () const
 
u32 GetHeight () const
 
void SetSize (const UPoint &newSize)
 
void SetWidth (u32 newWidth)
 
void SetHeight (u32 newHeight)
 
Rectoperator= (const Rect &rhs)
 
Rectoperator&= (const Rect &rhs)
 

Detailed Description

A 2D Rectangle with a location and dimensions.

Constructor & Destructor Documentation

MFM::Rect::Rect ( )
inline

Creates a new Rectangle with a position at the origin and no size.

MFM::Rect::Rect ( const Rect copy)
inline

Creates a new Rectangle with the properties of another given rectangle.

Parameters
copyThe Rectangle of which to copy the properties from.
MFM::Rect::Rect ( const SPoint pos,
const UPoint size 
)
inline

Creates a new Rectangle with a given position and a given size.

Parameters
posThe initial position of this Rect .
sizeThe initial size of this Rect .
MFM::Rect::Rect ( s32  x,
s32  y,
u32  w,
u32  h 
)
inline

Creates a new Rectangle with a given position and a given size.

Parameters
xThe initial x coordinate of the position of this Rect .
yThe initial y coordinate of the position of this Rect .
wThe initial width of this Rect .
hThe initial height of this Rect .

Member Function Documentation

bool MFM::Rect::Contains ( const SPoint point)
inline

Checks to see that a given SPoint lies within the bounds of this Rect .

Parameters
pointThe SPoint in question of existing within the bounds of this Rect .
Returns
true if point lies within this Rect , else false .
u32 MFM::Rect::GetHeight ( ) const
inline

Gets the current height of this Rect .

Returns
The current width of this Rect .
const SPoint& MFM::Rect::GetPosition ( ) const
inline

Gets the position of this Rect .

Returns
The position of this Rect .
const UPoint& MFM::Rect::GetSize ( ) const
inline

Gets the current size of this Rect .

Returns
The current size of this Rect .
u32 MFM::Rect::GetWidth ( ) const
inline

Gets the current width of this Rect .

Returns
The current width of this Rect .
s32 MFM::Rect::GetX ( ) const
inline

Gets the x coordinate of the position of this Rect .

Returns
The x coordinate of the position of this Rect .
s32 MFM::Rect::GetY ( ) const
inline

Gets the y coordinate of the position of this Rect .

Returns
The y coordinate of the position of this Rect .
void MFM::Rect::IntersectWith ( const Rect other)

Transforms this Rect into one which represents the intersection of this Rect and a specified Rect . This intersection will be stored in this Rect .

Parameters
otherThe other Rect which will be used to calculate an intersection with this Rect .
bool MFM::Rect::IsEmpty ( ) const
inline

Checks to see if this Rect has an empty size.

Returns
true if the size of this Rect is empty, i.e. that both of the coordinates in its size vector are equal to 0 .
Rect& MFM::Rect::operator&= ( const Rect rhs)
inline

Calculates the intersection between this Rect and another Rect , storing the result in this Rect .

Parameters
rhsThe Rect used to calculate this intersection.
Returns
A reference to this Rect .
Rect& MFM::Rect::operator= ( const Rect rhs)
inline

Copies the values of a given Rect to this Rect .

Parameters
rhsThe Rect of which to copy the values from and into this Rect .
Returns
A reference to this Rect .
void MFM::Rect::SetHeight ( u32  newHeight)
inline

Sets the height of this Rect to a specified integral height.

Parameters
newheightThe new height of this Rect .
void MFM::Rect::SetPosition ( const SPoint newPos)
inline

Sets the position of this Rect to a given SPoint .

Parameters
newPosThe new position of this Rect .
void MFM::Rect::SetSize ( const UPoint newSize)
inline

Sets the size of this Rect to a specified dimension.

Parameters
newSizeThe new size of this Rect .
void MFM::Rect::SetWidth ( u32  newWidth)
inline

Sets the width of this Rect to a specified integral width.

Parameters
newWidthThe new width of this Rect .
void MFM::Rect::SetX ( s32  newX)
inline

Sets the x coordinate of the position of this Rect to a given integral coordinate.

Parameters
newXThe new x coordinate of this Rect .
void MFM::Rect::SetY ( s32  newY)
inline

Sets the y coordinate of the position of this Rect to a given integral coordinate.

Parameters
newYThe new y coordinate of this Rect .

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