Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

salt::Rect Class Reference

this class provides rectangle in two dimensional space More...

#include <rect.h>

List of all members.

Public Member Functions

f_inline Rect ()
 constucts undefined Rect for performance reasons
f_inline Rect (const Rect &inOther)
 copy constructs a Rect from inOther
f_inline Rect (int inLeft, int inTop, int inRight, int inBottom)
 constructs a Rect from the coordinates inLeft, inTop, inRight and inBottom
f_inline void Set (int inLeft, int inTop, int inRight, int inBottom)
 sets up a Rect from the coordinates inLeft, inTop, inRight and inBottom
f_inline int Left () const
 returns the left boundary of the rectangle
f_inline int Right () const
 return the right boundary of the rectangle
f_inline int Top () const
 return the top boundary of the rectangle
f_inline int Bottom () const
 return the bottom boundary of the rectangle
f_inline int Width () const
 calculates the width of the rectangle
f_inline int Height () const
 calculates the height of the rectangle
f_inline void Normalize ()
 normalizes the rectangle coordinates, i.e.
f_inline void Widen (int inDelta)
 widens the rectangle about inDelta
f_inline void Widen (int inDeltaWidth, int inDeltaHeight)
 widens the rectangle horizontally about inDeltaWidth and vertically about inDeltaHeight
f_inline void Widen (int inDeltaLeft, int inDeltaTop, int inDeltaRight, int inDeltaBottom)
 widens the rectangles left boundary about inDeltaleft, the right boundary about inDeltaRigt, the top boundary about inDeltaTop and the bottom boundary about inDeltaBottom
f_inline void Shrink (int inDelta)
 shrinks the rectangle about inDelta
f_inline void Shrink (int inDeltaWidth, int inDeltaHeight)
 shrinks the rectangle horizontally about inDeltaWidth and vertically about inDeltaHeight
f_inline void Shrink (int inDeltaLeft, int inDeltaTop, int inDeltaRight, int inDeltaBottom)
 shrinks the rectangles left boundary about inDeltaleft, the right boundary about inDeltaRigt, the top boundary about inDeltaTop and the bottom boundary about inDeltaBottom
f_inline void Offset (int inDeltaX, int inDeltaY)
 moves the rectangle horizontally inDeltaX and vertically inDeltaY
f_inline bool Intersects (const Rect &b) const
 returns true if this rectangle intersects with the rectangle b
f_inline Rectoperator= (const Rect &inOther)
 sets up the rectangle from inOther
f_inline bool operator== (const Rect &inRHS) const
 returns true if inRhs is equal to this rectangle
f_inline bool operator!= (const Rect &inRHS) const
 returns true if inRhs differs from this rectangle

Private Attributes

int mLeft
 the left boundary
int mTop
 the top boundary
int mRight
 the right boundary
int mBottom
 the bottom boundary


Detailed Description

this class provides rectangle in two dimensional space

Definition at line 35 of file rect.h.


Constructor & Destructor Documentation

f_inline salt::Rect::Rect  )  [inline]
 

constucts undefined Rect for performance reasons

Definition at line 39 of file rect.h.

f_inline salt::Rect::Rect const Rect inOther  )  [inline]
 

copy constructs a Rect from inOther

Definition at line 41 of file rect.h.

f_inline salt::Rect::Rect int  inLeft,
int  inTop,
int  inRight,
int  inBottom
[inline]
 

constructs a Rect from the coordinates inLeft, inTop, inRight and inBottom

Definition at line 44 of file rect.h.


Member Function Documentation

f_inline int salt::Rect::Bottom  )  const [inline]
 

return the bottom boundary of the rectangle

Definition at line 60 of file rect.h.

References mBottom.

Referenced by operator!=(), operator=(), and operator==().

f_inline int salt::Rect::Height  )  const [inline]
 

calculates the height of the rectangle

Definition at line 66 of file rect.h.

References mBottom, and mTop.

f_inline bool salt::Rect::Intersects const Rect b  )  const [inline]
 

returns true if this rectangle intersects with the rectangle b

Definition at line 104 of file rect.h.

References mBottom, mLeft, mRight, and mTop.

f_inline int salt::Rect::Left  )  const [inline]
 

returns the left boundary of the rectangle

Definition at line 51 of file rect.h.

References mLeft.

Referenced by operator!=(), operator=(), and operator==().

f_inline void salt::Rect::Normalize  )  [inline]
 

normalizes the rectangle coordinates, i.e.

assures that right>left and top>bottom.

Definition at line 70 of file rect.h.

References salt::gSwap(), mBottom, mLeft, mRight, and mTop.

Here is the call graph for this function:

f_inline void salt::Rect::Offset int  inDeltaX,
int  inDeltaY
[inline]
 

moves the rectangle horizontally inDeltaX and vertically inDeltaY

Definition at line 101 of file rect.h.

References mBottom, mLeft, mRight, and mTop.

f_inline bool salt::Rect::operator!= const Rect inRHS  )  const [inline]
 

returns true if inRhs differs from this rectangle

Definition at line 117 of file rect.h.

References Bottom(), Left(), mBottom, mLeft, mRight, mTop, Right(), and Top().

Here is the call graph for this function:

f_inline Rect& salt::Rect::operator= const Rect inOther  )  [inline]
 

sets up the rectangle from inOther

Definition at line 109 of file rect.h.

References Bottom(), Left(), mBottom, mLeft, mRight, mTop, Right(), and Top().

Here is the call graph for this function:

f_inline bool salt::Rect::operator== const Rect inRHS  )  const [inline]
 

returns true if inRhs is equal to this rectangle

Definition at line 114 of file rect.h.

References Bottom(), Left(), mBottom, mLeft, mRight, mTop, Right(), and Top().

Here is the call graph for this function:

f_inline int salt::Rect::Right  )  const [inline]
 

return the right boundary of the rectangle

Definition at line 54 of file rect.h.

References mRight.

Referenced by operator!=(), operator=(), and operator==().

f_inline void salt::Rect::Set int  inLeft,
int  inTop,
int  inRight,
int  inBottom
[inline]
 

sets up a Rect from the coordinates inLeft, inTop, inRight and inBottom

Definition at line 47 of file rect.h.

References mBottom, mLeft, mRight, and mTop.

f_inline void salt::Rect::Shrink int  inDeltaLeft,
int  inDeltaTop,
int  inDeltaRight,
int  inDeltaBottom
[inline]
 

shrinks the rectangles left boundary about inDeltaleft, the right boundary about inDeltaRigt, the top boundary about inDeltaTop and the bottom boundary about inDeltaBottom

Definition at line 98 of file rect.h.

References mBottom, mLeft, mRight, and mTop.

f_inline void salt::Rect::Shrink int  inDeltaWidth,
int  inDeltaHeight
[inline]
 

shrinks the rectangle horizontally about inDeltaWidth and vertically about inDeltaHeight

Definition at line 92 of file rect.h.

References mBottom, and mRight.

f_inline void salt::Rect::Shrink int  inDelta  )  [inline]
 

shrinks the rectangle about inDelta

Definition at line 87 of file rect.h.

References mBottom, mLeft, mRight, and mTop.

f_inline int salt::Rect::Top  )  const [inline]
 

return the top boundary of the rectangle

Definition at line 57 of file rect.h.

References mTop.

Referenced by operator!=(), operator=(), and operator==().

f_inline void salt::Rect::Widen int  inDeltaLeft,
int  inDeltaTop,
int  inDeltaRight,
int  inDeltaBottom
[inline]
 

widens the rectangles left boundary about inDeltaleft, the right boundary about inDeltaRigt, the top boundary about inDeltaTop and the bottom boundary about inDeltaBottom

Definition at line 84 of file rect.h.

References mBottom, mLeft, mRight, and mTop.

f_inline void salt::Rect::Widen int  inDeltaWidth,
int  inDeltaHeight
[inline]
 

widens the rectangle horizontally about inDeltaWidth and vertically about inDeltaHeight

Definition at line 78 of file rect.h.

References mBottom, and mRight.

f_inline void salt::Rect::Widen int  inDelta  )  [inline]
 

widens the rectangle about inDelta

Definition at line 73 of file rect.h.

References mBottom, mLeft, mRight, and mTop.

f_inline int salt::Rect::Width  )  const [inline]
 

calculates the width of the rectangle

Definition at line 63 of file rect.h.

References mLeft, and mRight.


Member Data Documentation

int salt::Rect::mBottom [private]
 

the bottom boundary

Definition at line 130 of file rect.h.

Referenced by Bottom(), Height(), Intersects(), Normalize(), Offset(), operator!=(), operator=(), operator==(), Set(), Shrink(), and Widen().

int salt::Rect::mLeft [private]
 

the left boundary

Definition at line 121 of file rect.h.

Referenced by Intersects(), Left(), Normalize(), Offset(), operator!=(), operator=(), operator==(), Set(), Shrink(), Widen(), and Width().

int salt::Rect::mRight [private]
 

the right boundary

Definition at line 127 of file rect.h.

Referenced by Intersects(), Normalize(), Offset(), operator!=(), operator=(), operator==(), Right(), Set(), Shrink(), Widen(), and Width().

int salt::Rect::mTop [private]
 

the top boundary

Definition at line 124 of file rect.h.

Referenced by Height(), Intersects(), Normalize(), Offset(), operator!=(), operator=(), operator==(), Set(), Shrink(), Top(), and Widen().


The documentation for this class was generated from the following file:
Generated on Thu Apr 6 15:49:23 2006 for rcssserver3d by  doxygen 1.4.4