GG::Rect Struct Reference

a GG rectangle class. More...

#include <PtRect.h>

List of all members.

Structors

 Rect ()
 Rect (const Pt &pt1, const Pt &pt2)
 Rect (int x1, int y1, int x2, int y2)

Accessors

int Left () const
int Right () const
int Top () const
int Bottom () const
Pt UpperLeft () const
Pt LowerRight () const
int Width () const
int Height () const
bool Contains (const Pt &pt) const

Mutators

void operator+= (const Pt &pt)
void operator-= (const Pt &pt)

Public Attributes

Pt ul
Pt lr


Detailed Description

a GG rectangle class.

this is essentially just two points that bound the rectangle

Definition at line 72 of file PtRect.h.


Constructor & Destructor Documentation

GG::Rect::Rect (  ) 

default ctor

GG::Rect::Rect ( const Pt pt1,
const Pt pt2 
)

ctor that constructs a Rect from two corners; any two opposing corners will do

GG::Rect::Rect ( int  x1,
int  y1,
int  x2,
int  y2 
)

ctor taht constructs a Rect from its left, upper, right, and bottom boundaries


Member Function Documentation

int GG::Rect::Left (  )  const [inline]

returns the left boundary of the Rect

Definition at line 81 of file PtRect.h.

int GG::Rect::Right (  )  const [inline]

returns the right boundary of the Rect

Definition at line 82 of file PtRect.h.

int GG::Rect::Top (  )  const [inline]

returns the top boundary of the Rect

Definition at line 83 of file PtRect.h.

int GG::Rect::Bottom (  )  const [inline]

returns the bottom boundary of the Rect

Definition at line 84 of file PtRect.h.

Pt GG::Rect::UpperLeft (  )  const [inline]

returns the upper-left corner of the Rect

Definition at line 85 of file PtRect.h.

Pt GG::Rect::LowerRight (  )  const [inline]

returns the lower-right corner of the Rect

Definition at line 86 of file PtRect.h.

int GG::Rect::Width (  )  const [inline]

returns the width of the Rect

Definition at line 87 of file PtRect.h.

int GG::Rect::Height (  )  const [inline]

returns the height of the Rect

Definition at line 88 of file PtRect.h.

bool GG::Rect::Contains ( const Pt pt  )  const

returns true iff pt falls inside the Rect

void GG::Rect::operator+= ( const Pt pt  )  [inline]

shifts the Rect by adding pt to each corner

Definition at line 94 of file PtRect.h.

void GG::Rect::operator-= ( const Pt pt  )  [inline]

shifts the Rect by subtracting pt from each corner

Definition at line 95 of file PtRect.h.


Member Data Documentation

Pt GG::Rect::ul

the upper-left corner of the Rect

Definition at line 98 of file PtRect.h.

Referenced by GG::operator+(), GG::operator-(), and GG::operator==().

Pt GG::Rect::lr

the lower-right corner of the Rect

Definition at line 99 of file PtRect.h.

Referenced by GG::operator+(), GG::operator-(), and GG::operator==().


The documentation for this struct was generated from the following file:
Generated on Wed Mar 26 14:35:42 2008 for GG by  doxygen 1.5.2