Geometrical two-dimensional rectangle
Public Fields
-
XPoint a
- Upper left corner
-
XPoint b
- Lower right corner
Public Methods
-
XRect()
- Constructs a clean rectangle with the corners a(0, 0), b(0, 0)
-
XRect(unsigned __xa, unsigned __ya, unsigned __xb, unsigned __yb)
- Constructs a new point with the corners a(__xa, __ya), b(__xb, __yb)
-
XRect(XPoint __a, XPoint __b)
- Constructs a new point with the specified corners
-
void Assign(XPoint __a, XPoint __b)
- Assigns the specified corners to the rectangle
-
void Assign(unsigned __xa, unsigned __ya, unsigned __xb, unsigned __yb)
- Assigns the specified coordinates to the rectangle
-
void Move(XPoint __delta)
- Moves the rectangle relatively by the specified coordinates
-
void Grow(XPoint __delta)
- Grows the rectangle by adjusting the lower-right corner with the specified coordinates
-
void Intersect(XRect __r)
- Assigns the rectangle the intersection with another rectangle
-
bool IsValid()
- Checks if the coordinates can form a rectangle
-
void Union(XRect __r)
- Assigns the rectangle the union with another rectangle
-
bool Contains(XPoint __p)
- Returns true if the rectangle contains the specified point
-
XRect& operator = (XRect __r)
- Assigns the rectangle the corners of the specified rectangle
-
bool operator == (XRect __r)
- Compares to rectangles and returns true if they are equal
-
bool operator != (XRect __r)
- Compares to rectangles and returns false if they are equal
-
XRect& operator += (XPoint __delta)
- Positively translates the rectangle by adjusting the lower-right corner with the specified coordinates
-
XRect& operator -= (XPoint __delta)
- Negatively translates the rectangle by adjusting the lower-right corner with the specified coordinates
Documentation
The XRect class is the two dimensional representation of a geometrical
rectangle with the upper left corner a and the lower left corner b.
Methods to assign corners and operators for mathematical calculation
are included.
XPoint a
- Upper left corner
XPoint b
- Lower right corner
XRect()
- Constructs a clean rectangle with the corners a(0, 0), b(0, 0)
XRect(unsigned __xa, unsigned __ya, unsigned __xb, unsigned __yb)
- Constructs a new point with the corners a(__xa, __ya), b(__xb, __yb)
- Parameters:
- __xa - x and
__ya - y coordinate of upper left corner
__xb - x and
__yb - y coordinate of lower right corner
XRect(XPoint __a, XPoint __b)
- Constructs a new point with the specified corners
- Parameters:
- __a - upper left corner
__b - lower right corner
void Assign(XPoint __a, XPoint __b)
- Assigns the specified corners to the rectangle
- Parameters:
- __a - upper left corner
__b - lower right corner
void Assign(unsigned __xa, unsigned __ya, unsigned __xb, unsigned __yb)
- Assigns the specified coordinates to the rectangle
- Parameters:
- __xa - x and
__ya - y coordinate of upper left corner
__xb - x and
__yb - y coordinate of lower right corner
void Move(XPoint __delta)
- Moves the rectangle relatively by the specified coordinates
- Parameters:
- __delta - translation vector
void Grow(XPoint __delta)
- Grows the rectangle by adjusting the lower-right corner with the
specified coordinates
- Parameters:
- __delta - translation vector
void Intersect(XRect __r)
- Assigns the rectangle the intersection with another rectangle
- Parameters:
- __r - other rectangle
bool IsValid()
- Checks if the coordinates can form a rectangle
- Parameters:
- true - if coordinates are valid
void Union(XRect __r)
- Assigns the rectangle the union with another rectangle
- Parameters:
- __r - other rectangle
bool Contains(XPoint __p)
- Returns true if the rectangle contains the specified point
- Returns:
- true if point in rectangle
- Parameters:
- __p - point
XRect& operator = (XRect __r)
- Assigns the rectangle the corners of the specified rectangle
- Returns:
- assigned rectangle
- Parameters:
- __r - value to assign
bool operator == (XRect __r)
- Compares to rectangles and returns true if they are equal
- Returns:
- true if equal
- Parameters:
- __r - right operand
bool operator != (XRect __r)
- Compares to rectangles and returns false if they are equal
- Returns:
- false if equal
- Parameters:
- __r - right operand
XRect& operator += (XPoint __delta)
- Positively translates the rectangle by adjusting the lower-right
corner with the specified coordinates
- Returns:
- translated rectangle
- Parameters:
- __delta - translation vector
XRect& operator -= (XPoint __delta)
- Negatively translates the rectangle by adjusting the lower-right
corner with the specified coordinates
- Returns:
- translated rectangle
- Parameters:
- __delta - translation vector
- This class has no child classes.
Go to the hierarchy of classes.
Copyright ©1998 Bernd Kalbfuss
Last update on October 27, 2001
This page was generated with the help of DOC++.