#include <KeosRectangle.h>
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. | |
Definition at line 12 of file KeosRectangle.h.
| Keos::CRectangle::CRectangle | ( | const TVector2I & | Start = TVector2I(0, 0), |
|
| const TVector2I & | Size = TVector2I(0, 0) | |||
| ) |
Default constructor.
| 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 | |||
| ) |
| 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 |
| TIntersection Keos::CRectangle::Intersects | ( | const TVector2I & | Point | ) | const |
Test of intersection with a point.
| Point | Point to be tested. |
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.
| Rect | Rectangle to be tested. |
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 |
| bool Keos::CRectangle::operator!= | ( | const CRectangle & | Rect | ) | const |
Definition at line 123 of file KeosRectangle.cpp.
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().
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().
1.5.1-p1