Xrb::Rect< T > Class Template Reference

A rectangle primitive. More...

#include <xrb_rect.hpp>

List of all members.

Public Member Functions

 Rect ()
 Default constructor.
 Rect (Vector< T, 2 > const &size)
 Rect (T left, T bottom, T right, T top)
 Rect (Vector< T, 2 > const &bottom_left, Vector< T, 2 > const &top_right)
 Rect (Rect< T > const &source)
void operator= (Vector< T, 2 > const &size)
void operator= (Rect< T > const &source)
bool operator== (Rect< T > const &operand)
bool operator!= (Rect< T > const &operand)
void operator|= (Rect< T > const &operand)
void operator&= (Rect< T > const &operand)
void operator+= (Vector< T, 2 > const &operand)
void operator-= (Vector< T, 2 > const &operand)
void operator*= (SimpleTransform2< T > const &transform)
Vector< T, 2 > TopLeft () const
Vector< T, 2 > const & TopRight () const
Vector< T, 2 > const & BottomLeft () const
Vector< T, 2 > BottomRight () const
Top () const
Left () const
Bottom () const
Right () const
Vector< T, 2 > Center () const
Vector< T, 2 > Size () const
Width () const
Height () const
Rect< T > Grown (Vector< T, 2 > const &vector_to_grow_by) const
bool IsValid () const
bool HasPositiveArea () const
bool IsPointInside (Vector< T, 2 > const &point) const
template<typename U >
Rect< U > StaticCast () const
void SetTopLeft (Vector< T, 2 > const &top_left)
void SetTopRight (Vector< T, 2 > const &top_right)
void SetBottomLeft (Vector< T, 2 > const &bottom_left)
void SetBottomRight (Vector< T, 2 > const &bottom_right)
void SetTop (T top)
void SetLeft (T left)
void SetBottom (T bottom)
void SetRight (T right)
void SetCenter (Vector< T, 2 > const &center)
void SetSize (Vector< T, 2 > const &size)
void SetSize (Uint32 component, T size)
void SetWidth (T const width)
void SetHeight (T const height)
template<typename U >
void StaticCastAssign (Rect< U > const &source)
void EncompassPoint (Vector< T, 2 > const &point)
void Flip ()
void Flip (Dim::Component const component)
void Fprint (FILE *const fptr, char const *const component_printf_format, bool const show_size_instead_of_top_right=true, bool const add_newline=true) const
void Grow (Vector< T, 2 > const &vector_to_grow_by)

Public Attributes

Vector< T, 2 > m_bottom_left
 The bottom-left coordinate of the rectangle.
Vector< T, 2 > m_top_right
 The top-right coordinate of the rectangle.


Detailed Description

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

A rectangle primitive.

Intended for use to specify regions in screen coordinates. Templatized for the purpose of allowing integer and floating-point based rectangles. The coordinate system used is right-handed:

      A
      |  top-left corner          top-right corner
    Y |       +-----------------------------+
      |       |                             |
    a |       |                             |
    x |       |                             |
    i |       |                             |
    s |       +-----------------------------+
      |  bottom-left corner       bottom-right corner
  ----+----------------------------------------------------->
      |                                          X axis
      |
 
The region specified by a Rect object is the axially-aligned box contained within the coordinates given by m_bottom_left and m_top_right.

Definition at line 44 of file xrb_rect.hpp.


Constructor & Destructor Documentation

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

Default constructor.

Does no initialization.

Definition at line 56 of file xrb_rect.hpp.


The documentation for this class was generated from the following file:

Hosted by SourceForge.net Logo -- Generated on Fri Aug 21 21:46:39 2009 for XuqRijBuh by doxygen 1.5.8