Public Member Functions | Public Attributes

gfx::Rect< T > Class Template Reference

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.
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).


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>
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 ( x,
y 
) [inline]

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

template<typename T>
bool gfx::Rect< T >::IfInside ( const Vector2 v  )  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 >::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 ( X1,
Y1,
X2,
Y2 
) [inline]

Member Data Documentation

template<typename T>
T gfx::Rect< T >::x1
template<typename T>
T gfx::Rect< T >::x2
template<typename T>
T gfx::Rect< T >::y1
template<typename T>
T gfx::Rect< T >::y2

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Palomino Flight Simulator documents generated by doxygen 1.7.1 on Tue May 15 2012 22:40:11