GG::Rect Struct Reference

A GG rectangle class. More...

#include <PtRect.h>

List of all members.

Public Attributes

Pt ul
Pt lr

Structors



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

Accessors



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

Mutators



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


Detailed Description

A GG rectangle class.

This is essentially just two points that bound the rectangle.

Definition at line 94 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 ( X  x1,
Y  y1,
X  x2,
Y  y2 
)

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


Member Function Documentation

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

returns the left boundary of the Rect

Definition at line 103 of file PtRect.h.

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

returns the right boundary of the Rect

Definition at line 104 of file PtRect.h.

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

returns the top boundary of the Rect

Definition at line 105 of file PtRect.h.

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

returns the bottom boundary of the Rect

Definition at line 106 of file PtRect.h.

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

returns the upper-left corner of the Rect

Definition at line 107 of file PtRect.h.

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

returns the lower-right corner of the Rect

Definition at line 108 of file PtRect.h.

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

returns the width of the Rect

Definition at line 109 of file PtRect.h.

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

returns the height of the Rect

Definition at line 110 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 116 of file PtRect.h.

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

shifts the Rect by subtracting pt from each corner

Definition at line 117 of file PtRect.h.


Member Data Documentation

the upper-left corner of the Rect

Definition at line 120 of file PtRect.h.

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

the lower-right corner of the Rect

Definition at line 121 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 Sat Mar 26 07:08:38 2011 for GG by  doxygen 1.5.9