gfx::Rect< T > Class Template Reference

2D rectangle. More...

#include <gfx_types.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
 
Returns:
True if a 2D point is inside this rectangle.

bool IfInside (const Vector2 &v) const
bool IfOutside (const Rect< T > &rect) const
 
Returns:
True if the passed rectangle is ENTIRELY outside this one.

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.
GetWidth (void) const
GetHeight (void) const

Public Attributes

x1
y1
x2
y2


Detailed Description

template<typename T>
class gfx::Rect< T >

2D rectangle.

PRECONDITION: (X1,Y1) < (X2,Y2).

(The similar 3D Box class was moved to engine.)


Constructor & Destructor Documentation

template<typename T>
gfx::Rect< T >::Rect ( void   )  [inline]

template<typename T>
gfx::Rect< T >::Rect ( X1,
Y1,
X2,
Y2 
) [inline]


Member Function Documentation

template<typename T>
void gfx::Rect< T >::Set ( X1,
Y1,
X2,
Y2 
) [inline]

template<typename T>
bool gfx::Rect< T >::IfZero ( void   )  const [inline]

template<typename T>
bool gfx::Rect< T >::IfInside ( x,
y 
) const [inline]

Returns:
True if a 2D point is inside this rectangle.

template<typename T>
bool gfx::Rect< T >::IfInside ( const Vector2 v  )  const [inline]

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>
void gfx::Rect< T >::Grow ( x,
y 
) [inline]

Grow rectangle (expand a corner) to enclose a point.

template<typename T>
T gfx::Rect< T >::GetWidth ( void   )  const [inline]

template<typename T>
T gfx::Rect< T >::GetHeight ( void   )  const [inline]


Member Data Documentation

template<typename T>
T gfx::Rect< T >::x1

template<typename T>
T gfx::Rect< T >::y1

template<typename T>
T gfx::Rect< T >::x2

template<typename T>
T gfx::Rect< T >::y2


The documentation for this class was generated from the following file: Palomino 3D Engine documents generated by doxygen 1.5.3 on Fri Nov 23 11:26:28 2007