#include <rect.h>
Public Member Functions | |
RectType (T x=0, T y=0, T w=0, T h=0) | |
T | right () const |
T | bottom () const |
bool | operator== (const RectType< T > &rect) const |
bool | contains (const PointType2D< T > &point) const |
bool | intersects (const RectType< T > &rect) const |
bool | intersectInplace (const RectType< T > &rect) |
Public Attributes | |
T | x |
T | y |
T | w |
T | h |
A Rectangle on screen.
This is a small helper class used for screen coordinate arithmetics. The same thoughts reasong using int as value type as in Point apply.
Definition at line 80 of file rect.h.
FIFE::RectType< T >::RectType | ( | T | x = 0 , |
|
T | y = 0 , |
|||
T | w = 0 , |
|||
T | h = 0 | |||
) | [inline, explicit] |
T FIFE::RectType< T >::bottom | ( | ) | const [inline] |
The Y coordinate of the bottom edge.
Definition at line 162 of file rect.h.
References FIFE::RectType< T >::h, and FIFE::RectType< T >::y.
Referenced by FIFE::SDLImage::render(), and FIFE::GLImage::render().
bool FIFE::RectType< T >::contains | ( | const PointType2D< T > & | point | ) | const [inline] |
Checks whether a rectangle contains a Point.
p | The point that is checked. |
Definition at line 173 of file rect.h.
References FIFE::RectType< T >::h, FIFE::RectType< T >::w, FIFE::RectType< T >::x, and FIFE::RectType< T >::y.
bool FIFE::RectType< T >::intersectInplace | ( | const RectType< T > & | rect | ) | [inline] |
Calculate rectangle intersection in place
rect | The other rectangle that is checked. |
Definition at line 181 of file rect.h.
References FIFE::RectType< T >::h, FIFE::RectType< T >::w, FIFE::RectType< T >::x, and FIFE::RectType< T >::y.
bool FIFE::RectType< T >::intersects | ( | const RectType< T > & | rect | ) | const [inline] |
Check whether two rectangles share some area.
rect | The other rectangle that is checked. |
Definition at line 216 of file rect.h.
References FIFE::RectType< T >::h, FIFE::RectType< T >::w, FIFE::RectType< T >::x, and FIFE::RectType< T >::y.
bool FIFE::RectType< T >::operator== | ( | const RectType< T > & | rect | ) | const [inline] |
Equivalence operator.
rect | The rectangle to which this is compared. |
Definition at line 167 of file rect.h.
References FIFE::RectType< T >::h, FIFE::RectType< T >::w, FIFE::RectType< T >::x, and FIFE::RectType< T >::y.
T FIFE::RectType< T >::right | ( | ) | const [inline] |
The X coordinate of the right edge.
Definition at line 157 of file rect.h.
References FIFE::RectType< T >::w, and FIFE::RectType< T >::x.
Referenced by FIFE::SDLImage::render(), and FIFE::GLImage::render().
T FIFE::RectType< T >::h |
Height of the rectangle.
Definition at line 93 of file rect.h.
Referenced by FIFE::RectType< T >::bottom(), FIFE::RectType< T >::contains(), FIFE::RectType< T >::intersectInplace(), FIFE::RectType< T >::intersects(), FIFE::RectType< T >::operator==(), FIFE::SDLImage::render(), FIFE::GLImage::render(), FIFE::SDLImage::setClipArea(), and FIFE::GLImage::setClipArea().
T FIFE::RectType< T >::w |
Width of the rectangle.
Definition at line 90 of file rect.h.
Referenced by FIFE::RectType< T >::contains(), FIFE::RectType< T >::intersectInplace(), FIFE::RectType< T >::intersects(), FIFE::RectType< T >::operator==(), FIFE::SDLImage::render(), FIFE::GLImage::render(), FIFE::RectType< T >::right(), FIFE::SDLImage::setClipArea(), and FIFE::GLImage::setClipArea().
T FIFE::RectType< T >::x |
The X Coordinate.
Definition at line 84 of file rect.h.
Referenced by FIFE::RectType< T >::contains(), FIFE::RectType< T >::intersectInplace(), FIFE::RectType< T >::intersects(), FIFE::OpenGLGuiGraphics::OpenGLGuiGraphics(), FIFE::RectType< T >::operator==(), FIFE::SDLImage::render(), FIFE::GLImage::render(), FIFE::RectType< T >::right(), FIFE::SdlGuiGraphics::SdlGuiGraphics(), FIFE::SDLImage::setClipArea(), and FIFE::GLImage::setClipArea().
T FIFE::RectType< T >::y |
The Y Coordinate.
Definition at line 87 of file rect.h.
Referenced by FIFE::RectType< T >::bottom(), FIFE::RectType< T >::contains(), FIFE::RectType< T >::intersectInplace(), FIFE::RectType< T >::intersects(), FIFE::OpenGLGuiGraphics::OpenGLGuiGraphics(), FIFE::RectType< T >::operator==(), FIFE::SDLImage::render(), FIFE::GLImage::render(), FIFE::SdlGuiGraphics::SdlGuiGraphics(), FIFE::SDLImage::setClipArea(), and FIFE::GLImage::setClipArea().