sfRect< T > Class Template Reference

sfRect is an utility class for manipulating rectangles. More...

#include <Rect.hpp>

List of all members.


Public Member Functions

 sfRect ()
 Default constructor.
 sfRect (T LeftCoord, T TopCoord, T RightCoord, T BottomCoord)
 Construct the rectangle from its coordinates.
GetWidth () const
 Get the width of the rectangle.
GetHeight () const
 Get the height of the rectangle.
bool Contains (T X, T Y) const
 Check if a point is inside the rectangle's area.
bool Intersects (const sfRect< T > &Rect, sfRect< T > *OverlappingRect=NULL) const
 Check intersection between two rectangles.

Public Attributes

Left
 Left coordinate of the rectangle.
Top
 Top coordinate of the rectangle.
Right
 Right coordinate of the rectangle.
Bottom
 Bottom coordinate of the rectangle.

Detailed Description

template<typename T>
class sfRect< T >

sfRect is an utility class for manipulating rectangles.

Template parameter defines the type of coordinates (integer float, ...)

Definition at line 39 of file Rect.hpp.


Constructor & Destructor Documentation

template<typename T>
sfRect< T >::sfRect (  )  [inline]

Default constructor.

Definition at line 30 of file Rect.inl.

template<typename T>
sfRect< T >::sfRect ( LeftCoord,
TopCoord,
RightCoord,
BottomCoord 
) [inline]

Construct the rectangle from its coordinates.

Parameters:
LeftCoord : Left coordinate of the rectangle
TopCoord : Top coordinate of the rectangle
RightCoord : Right coordinate of the rectangle
BottomCoord : Bottom coordinate of the rectangle

Definition at line 44 of file Rect.inl.


Member Function Documentation

template<typename T>
T sfRect< T >::GetWidth (  )  const [inline]

Get the width of the rectangle.

Returns:
Width of rectangle

Definition at line 58 of file Rect.inl.

template<typename T>
T sfRect< T >::GetHeight (  )  const [inline]

Get the height of the rectangle.

Returns:
Height of rectangle

Definition at line 68 of file Rect.inl.

template<typename T>
bool sfRect< T >::Contains ( X,
Y 
) const [inline]

Check if a point is inside the rectangle's area.

Parameters:
X : X coordinate of the point to test
Y : Y coordinate of the point to test
Returns:
True if the point is inside

Definition at line 78 of file Rect.inl.

template<typename T>
bool sfRect< T >::Intersects ( const sfRect< T > &  Rect,
sfRect< T > *  OverlappingRect = NULL 
) const [inline]

Check intersection between two rectangles.

Parameters:
Rect : Rectangle to test
OverlappingRect : Rectangle to be filled with overlapping rect (NULL by default)
Returns:
True if rectangles overlap

Definition at line 88 of file Rect.inl.


Member Data Documentation

template<typename T>
T sfRect< T >::Left

Left coordinate of the rectangle.

Definition at line 101 of file Rect.hpp.

template<typename T>
T sfRect< T >::Top

Top coordinate of the rectangle.

Definition at line 102 of file Rect.hpp.

template<typename T>
T sfRect< T >::Right

Right coordinate of the rectangle.

Definition at line 103 of file Rect.hpp.

template<typename T>
T sfRect< T >::Bottom

Bottom coordinate of the rectangle.

Definition at line 104 of file Rect.hpp.


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