Index   Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  
Public Member Functions | Private Attributes

SgRect Class Reference

Rectangle on the Go board. More...

#include <SgRect.h>

List of all members.

Public Member Functions

 SgRect ()
 SgRect (int left, int right, int top, int bottom)
 SgRect (const SgPoint &topleft, const SgPoint &bottomright)
bool operator== (const SgRect &rhs) const
void Set (int left, int right, int top, int bottom)
void MirrorX (int boardSize)
void MirrorY (int boardSize)
void SwapXY ()
void Include (SgPoint p)
void Include (const SgRect &rect)
void Intersect (const SgRect &rect)
bool IsEmpty () const
bool InRect (SgPoint p) const
SgPoint Center () const
bool Contains (SgPoint p) const
bool Contains (const SgRect &rect) const
bool Overlaps (const SgRect &rect) const
void Expand (int margin)
int Left () const
int Right () const
int Top () const
int Bottom () const
int Width () const
int Height () const
int Area () const
void IncLeft ()
void DecRight ()
void IncTop ()
void DecBottom ()
void SetLeft (int value)
void SetRight (int value)
void SetTop (int value)
void SetBottom (int value)

Private Attributes

int m_left
int m_right
int m_top
int m_bottom

Detailed Description

Rectangle on the Go board.

top < bottom, coordinates grow from top to bottom.

Definition at line 15 of file SgRect.h.


Constructor & Destructor Documentation

SgRect::SgRect (  ) 

Definition at line 16 of file SgRect.cpp.

SgRect::SgRect ( int  left,
int  right,
int  top,
int  bottom 
)

Definition at line 20 of file SgRect.h.

SgRect::SgRect ( const SgPoint topleft,
const SgPoint bottomright 
)

Definition at line 27 of file SgRect.h.


Member Function Documentation

int SgRect::Area (  )  const

Definition at line 129 of file SgRect.h.

References Height(), and Width().

int SgRect::Bottom (  )  const

Definition at line 112 of file SgRect.h.

References m_bottom.

Referenced by operator<<().

SgPoint SgRect::Center (  )  const

Definition at line 64 of file SgRect.cpp.

References IsEmpty(), m_bottom, m_left, m_right, m_top, SgPointUtil::Pt(), and SG_ASSERT.

Referenced by SgPointSet::Center().

bool SgRect::Contains ( SgPoint  p  )  const

Definition at line 86 of file SgRect.h.

References InRect().

Referenced by SgRectIterator::operator++().

bool SgRect::Contains ( const SgRect rect  )  const

Definition at line 78 of file SgRect.cpp.

References m_bottom, m_left, m_right, and m_top.

void SgRect::DecBottom (  ) 

Definition at line 149 of file SgRect.h.

References m_bottom.

void SgRect::DecRight (  ) 

Definition at line 139 of file SgRect.h.

References m_right.

void SgRect::Expand ( int  margin  ) 

Definition at line 92 of file SgRect.cpp.

References m_bottom, m_left, m_right, and m_top.

int SgRect::Height (  )  const

Definition at line 123 of file SgRect.h.

References IsEmpty(), m_bottom, m_top, and SG_ASSERT.

Referenced by Area().

void SgRect::IncLeft (  ) 

Definition at line 134 of file SgRect.h.

References m_left.

void SgRect::Include ( SgPoint  p  ) 

Definition at line 30 of file SgRect.cpp.

References SgPointUtil::Col(), m_bottom, m_left, m_right, m_top, and SgPointUtil::Row().

Referenced by SgPointSet::EnclosingRect().

void SgRect::Include ( const SgRect rect  ) 

Definition at line 44 of file SgRect.cpp.

References m_bottom, m_left, m_right, and m_top.

void SgRect::IncTop (  ) 

Definition at line 144 of file SgRect.h.

References m_top.

bool SgRect::InRect ( SgPoint  p  )  const

Definition at line 70 of file SgRect.cpp.

References SgPointUtil::Col(), m_bottom, m_left, m_top, and SgPointUtil::Row().

Referenced by Contains().

void SgRect::Intersect ( const SgRect rect  ) 

Definition at line 56 of file SgRect.cpp.

References m_bottom, m_left, m_right, and m_top.

bool SgRect::IsEmpty (  )  const

Definition at line 76 of file SgRect.h.

References m_left, and m_right.

Referenced by Center(), SgPointSet::Center(), Height(), and Width().

int SgRect::Left (  )  const

Definition at line 97 of file SgRect.h.

References m_left.

Referenced by SgRectIterator::operator++(), and operator<<().

void SgRect::MirrorX ( int  boardSize  ) 

Definition at line 50 of file SgRect.h.

References m_left, and m_right.

void SgRect::MirrorY ( int  boardSize  ) 

Definition at line 57 of file SgRect.h.

References m_bottom, and m_top.

bool SgRect::operator== ( const SgRect rhs  )  const

Definition at line 34 of file SgRect.h.

References m_bottom, m_left, m_right, and m_top.

bool SgRect::Overlaps ( const SgRect rect  )  const

Definition at line 84 of file SgRect.cpp.

References m_bottom, m_left, m_right, and m_top.

int SgRect::Right (  )  const

Definition at line 102 of file SgRect.h.

References m_right.

Referenced by SgRectIterator::operator++(), and operator<<().

void SgRect::Set ( int  left,
int  right,
int  top,
int  bottom 
)

Definition at line 42 of file SgRect.h.

References m_bottom, m_left, m_right, and m_top.

void SgRect::SetBottom ( int  value  ) 

Definition at line 169 of file SgRect.h.

References m_bottom.

void SgRect::SetLeft ( int  value  ) 

Definition at line 154 of file SgRect.h.

References m_left.

void SgRect::SetRight ( int  value  ) 

Definition at line 159 of file SgRect.h.

References m_right.

void SgRect::SetTop ( int  value  ) 

Definition at line 164 of file SgRect.h.

References m_top.

void SgRect::SwapXY (  ) 

Definition at line 64 of file SgRect.h.

References m_bottom, m_left, m_right, and m_top.

int SgRect::Top (  )  const

Definition at line 107 of file SgRect.h.

References m_top.

Referenced by operator<<().

int SgRect::Width (  )  const

Definition at line 117 of file SgRect.h.

References IsEmpty(), m_left, m_right, and SG_ASSERT.

Referenced by Area().


Member Data Documentation

int SgRect::m_bottom [private]
int SgRect::m_left [private]
int SgRect::m_right [private]
int SgRect::m_top [private]

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


Sun Mar 13 2011 Doxygen 1.7.1