2D rectangle.
More...
#include <_src_gfx_graphics.hh>
List of all members.
Public Member Functions |
| | Rect (void) |
| | Rect (T X1, T Y1, T X2, T Y2) |
| void | Set (T X1, T Y1, T X2, T Y2) |
| bool | IfZero (void) const |
| bool | IfInside (T x, T y) const |
| bool | IfInside (const Vector2 &v) const |
| bool | IfOutside (const Rect< T > &rect) const |
| bool | IfOverlaps (const Rect &rect) const |
| | If any part of another rectangle overlaps this one.
|
| void | Grow (T x, T y) |
| | Grow rectangle (expand a corner) to enclose a point.
|
| T | GetWidth (void) const |
| T | GetHeight (void) const |
Public Attributes |
| T | x1 |
| T | y1 |
| T | x2 |
| T | y2 |
Detailed Description
template<typename T>
class gfx::Rect< T >
2D rectangle.
PRECONDITION: (X1,Y1) < (X2,Y2).
Constructor & Destructor Documentation
Member Function Documentation
template<typename T>
| T gfx::Rect< T >::GetHeight |
( |
void |
|
) |
const [inline] |
template<typename T>
| T gfx::Rect< T >::GetWidth |
( |
void |
|
) |
const [inline] |
template<typename T>
| void gfx::Rect< T >::Grow |
( |
T |
x, |
|
|
T |
y | |
|
) |
| | [inline] |
Grow rectangle (expand a corner) to enclose a point.
template<typename T>
| bool gfx::Rect< T >::IfInside |
( |
T |
x, |
|
|
T |
y | |
|
) |
| | const [inline] |
- Returns:
- True if a 2D point is inside this rectangle.
template<typename T>
| bool gfx::Rect< T >::IfOutside |
( |
const Rect< T > & |
rect |
) |
const [inline] |
- Returns:
- True if the passed rectangle is ENTIRELY outside this one.
template<typename T>
| bool gfx::Rect< T >::IfOverlaps |
( |
const Rect< T > & |
rect |
) |
const [inline] |
If any part of another rectangle overlaps this one.
template<typename T>
| bool gfx::Rect< T >::IfZero |
( |
void |
|
) |
const [inline] |
template<typename T>
| void gfx::Rect< T >::Set |
( |
T |
X1, |
|
|
T |
Y1, |
|
|
T |
X2, |
|
|
T |
Y2 | |
|
) |
| | [inline] |
Member Data Documentation
The documentation for this class was generated from the following file: