Keos::CRectangle Class Reference

Class of the rectangles 2D in integer coordinates. More...

#include <KeosRectangle.h>

List of all members.

Public Member Functions

 CRectangle (const TVector2I &Start=TVector2I(0, 0), const TVector2I &Size=TVector2I(0, 0))
 Default constructor.
 CRectangle (int nLeft, int nTop, int nWidth, int nHeight)
 Constructor with 2 coordinates and 2 dimensions.
void Set (int nLeft, int nTop, int nWidth, int nHeight)
 Reinitialize the rectangle.
int Left () const
 Return the left side of the rectangle.
int Right () const
 Return the right side of the rectangle.
int Top () const
 Return the top side of the rectangle.
int Bottom () const
 Return the bottom side of the rectangle.
int Width () const
 Return the width of the rectangle.
int Height () const
 Return the height of the rectangle.
TVector2I Size () const
 Return the size of the rectangle.
TIntersection Intersects (const TVector2I &Point) const
 Test of intersection with a point.
TIntersection Intersects (const CRectangle &Rect) const
 Test of intersection with a rectangle.
bool operator== (const CRectangle &Rect) const
bool operator!= (const CRectangle &Rect) const

Public Attributes

TVector2I Origin
 Top-Left corner.
TVector2I End
 Bottom-Right corner.


Detailed Description

Class of the rectangles 2D in integer coordinates.

Definition at line 12 of file KeosRectangle.h.


Constructor & Destructor Documentation

Keos::CRectangle::CRectangle ( const TVector2I Start = TVector2I(0, 0),
const TVector2I Size = TVector2I(0, 0) 
)

Default constructor.

Parameters:
Start (default (0,0))
Size (default (0,0))

Definition at line 31 of file KeosRectangle.cpp.

Keos::CRectangle::CRectangle ( int  nLeft,
int  nTop,
int  nWidth,
int  nHeight 
)

Constructor with 2 coordinates and 2 dimensions.

Definition at line 37 of file KeosRectangle.cpp.


Member Function Documentation

void Keos::CRectangle::Set ( int  nLeft,
int  nTop,
int  nWidth,
int  nHeight 
)

Reinitialize the rectangle.

Definition at line 43 of file KeosRectangle.cpp.

References End, Origin, and Keos::CVector2< T >::Set().

int Keos::CRectangle::Left (  )  const

Return the left side of the rectangle.

Definition at line 50 of file KeosRectangle.cpp.

References Origin, and Keos::CVector2< T >::x.

Referenced by Keos::CGraphicString::Align(), and Keos::CImage::SubImage().

int Keos::CRectangle::Right (  )  const

Return the right side of the rectangle.

Definition at line 56 of file KeosRectangle.cpp.

References End, and Keos::CVector2< T >::x.

Referenced by Keos::CGraphicString::Align(), and Keos::CImage::SubImage().

int Keos::CRectangle::Top (  )  const

Return the top side of the rectangle.

Definition at line 62 of file KeosRectangle.cpp.

References Origin, and Keos::CVector2< T >::y.

Referenced by Keos::CGraphicString::Align(), and Keos::CImage::SubImage().

int Keos::CRectangle::Bottom (  )  const

Return the bottom side of the rectangle.

Definition at line 68 of file KeosRectangle.cpp.

References End, and Keos::CVector2< T >::y.

Referenced by Keos::CGraphicString::Align().

int Keos::CRectangle::Width (  )  const

Return the width of the rectangle.

Definition at line 74 of file KeosRectangle.cpp.

References End, Origin, and Keos::CVector2< T >::x.

Referenced by Keos::CGraphicString::Align(), Keos::CImage::SubImage(), and Keos::CTexture::Update().

int Keos::CRectangle::Height (  )  const

Return the height of the rectangle.

Definition at line 80 of file KeosRectangle.cpp.

References End, Origin, and Keos::CVector2< T >::y.

Referenced by Keos::CGraphicString::Align(), and Keos::CImage::SubImage().

TVector2I Keos::CRectangle::Size (  )  const

Return the size of the rectangle.

Definition at line 86 of file KeosRectangle.cpp.

References End, and Origin.

TIntersection Keos::CRectangle::Intersects ( const TVector2I Point  )  const

Test of intersection with a point.

Parameters:
Point Point to be tested.
Returns:
Intersection type.

Definition at line 92 of file KeosRectangle.cpp.

References End, Keos::INT_IN, Keos::INT_OUT, Origin, Keos::CVector2< T >::x, and Keos::CVector2< T >::y.

TIntersection Keos::CRectangle::Intersects ( const CRectangle Rect  )  const

Test of intersection with a rectangle.

Parameters:
Rect Rectangle to be tested.
Returns:
Intersection type.

Definition at line 101 of file KeosRectangle.cpp.

References End, Keos::INT_IN, Keos::INT_INTERSECTS, Keos::INT_OUT, Origin, Keos::CVector2< T >::x, and Keos::CVector2< T >::y.

bool Keos::CRectangle::operator== ( const CRectangle Rect  )  const

Definition at line 117 of file KeosRectangle.cpp.

References End, and Origin.

bool Keos::CRectangle::operator!= ( const CRectangle Rect  )  const

Definition at line 123 of file KeosRectangle.cpp.


Member Data Documentation

TVector2I Keos::CRectangle::Origin

Top-Left corner.

Definition at line 75 of file KeosRectangle.h.

Referenced by Height(), Intersects(), Left(), Keos::operator<<(), operator==(), Keos::operator>>(), Set(), Size(), Top(), and Width().

TVector2I Keos::CRectangle::End

Bottom-Right corner.

Definition at line 77 of file KeosRectangle.h.

Referenced by Bottom(), Height(), Intersects(), Keos::operator<<(), operator==(), Keos::operator>>(), Right(), Set(), Size(), and Width().


The documentation for this class was generated from the following files:
Generated on Fri Mar 9 14:29:26 2007 for Keos by  doxygen 1.5.1-p1