class csRect : public csBase Rectangle class: simple class for manipulating 2D rectangles
| | xmin Rectangle bounds. |
| | AddAdjanced (csRect &rect) Add an adjanced rectangle if resulting rectangle will have larger area. |
| | Area () Return area of this rectangle. |
| | Contains (int x, int y) Return true if a point lies within rectangle bounds. |
| | ContainsRel (int x, int y) Return true if a relative point lies within rectangle bounds. |
| | csRect () Create a empty rectangle. |
| | csRect (int ixmin, int iymin, int ixmax, int iymax) Create a new rectangle. |
| | csRect (csRect ©) Copy constructor. |
| | Equal (int ixmin, int iymin, int ixmax, int iymax) Return true if rectangle is the same. |
| | Exclude (int ixmin, int iymin, int ixmax, int iymax) Subtract rectangle: find the minimal rectangle which embeds all parts of this rectangle which are not covered by given rectangle |
| | Height () Return the height of rectangle. |
| | Intersect (csRect &target) Intersect with another rectangle; return false if resulting rectangle is empty |
| | Intersect (int ixmin, int iymin, int ixmax, int iymax) Intersect with another rectangle; return false if resulting rectangle is empty |
| | Intersects (csRect &target) Return true if rectangle intersects with target. |
| | IsEmpty () Return true if rectangle is empty. |
| | MakeEmpty () Make rectangle empty. |
| | Move (int dX, int dY) Move rectangle by deltaX, deltaY. |
| | Normalize () Normalize a rectangle such that xmin <= xmax and ymin <= ymax. |
| | operator != (csRect &rect) Test inequality of two rectangles. |
| | Set (csRect &target) Copy rectangle. |
| | Set (int ixmin, int iymin, int ixmax, int iymax) Set rectangle to given ixmin,iymin,ixmax,iymax position. |
| | SetPos (int x, int y) Set rectangle xmin,ymin position. |
| | SetSize (int w, int h) Set rectangle size. |
| | Subtract (csRect &rect) Alternative subtraction: find maximal area of this rectangle that is not covered by argument |
| | Union (csRect &target) Add a rectangle: find minimal rectangle that embeds both given rectangles |
| | Union (int ixmin, int iymin, int ixmax, int iymax) Add a rectangle: find minimal rectangle that embeds both given rectangles |
| | Width () Return the width of rectangle. |
Rectangle class: simple class for manipulating 2D rectangles. This class is somewhat similar to Box, but uses integer coordinates and is mostly used for CrystalSpace Windowing System.Example of a rectangle (xmin = 0, ymin = 0, xmax = 3, ymax = 2):
0 1 2 3 4 ... | | | | | | 0 --@@@@@@@@@@--+--+-- @//|//|//@ | | 1 --@--+--+--@--+--+-- @//|//|//@ | | 2 --@@@@@@@@@@--+--+-- | | | | | | 3 --+--+--+--+--+--+-- | | | | | | ...--+--+--+--+--+--+--Vertical line 'X=3' and horizontal line 'Y=2' does NOT belong to the rectangle.
csRect()
csRect(int ixmin, int iymin, int ixmax, int iymax)
csRect(csRect ©)
void Intersect(int ixmin, int iymin, int ixmax, int iymax)
void Intersect(csRect &target)
bool Intersects(csRect &target)
void Union(int ixmin, int iymin, int ixmax, int iymax)
void Union(csRect &target)
void Exclude(int ixmin, int iymin, int ixmax, int iymax)
void Subtract(csRect &rect)
inline bool IsEmpty()
inline void MakeEmpty()
inline void Set(int ixmin, int iymin, int ixmax, int iymax)
inline void Set(csRect &target)
inline void SetPos(int x, int y)
inline void SetSize(int w, int h)
inline void Move(int dX, int dY)
inline int Width()
inline int Height()
inline bool Contains(int x, int y)
inline bool ContainsRel(int x, int y)
inline bool Equal(int ixmin, int iymin, int ixmax, int iymax)
inline void Normalize()
inline int Area()
void AddAdjanced(csRect &rect)
inline bool operator != (csRect &rect)
this page has been generated automatically by doc++
(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de