Xterminal Home Page Main page

class XRect

Geometrical two-dimensional rectangle

Public Fields

XPoint a
Upper left corner
XPoint b
Lower right corner

Public Methods

void Assign(unsigned __xa, unsigned __ya, unsigned __xb, unsigned __yb)
Assigns the specified coordinates to the rectangle
void Assign(XPoint __a, XPoint __b)
Assigns the specified corners to the rectangle
int Contains(XPoint __p)
Returns true if the rectangle contains the specified point
void Grow(int __dx, int __dy)
Grows the rectangle by the specified coordinates
void Intersect(XRect __r)
Assigns the rectangle the intersection with another rectangle
void Move(int __dx, int __dy)
Moves the rectangle relatively by the specified coordinates
int operator != (XRect __r)
Compares to rectangles and returns false if they are equal
XRect& operator = (XRect __r)
Assigns the rectangle the corners of the specified rectangle
int operator == (XRect __r)
Compares to rectangles and returns true if they are equal
void Union(XRect __r)
Assigns the rectangle the union with another rectangle
XRect(XPoint __a, XPoint __b)
Constructs a new point with the specified corners
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)

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(int __dx, int __dy)
Moves the rectangle relatively by the specified coordinates
Parameters:
__dx - translation in x
__dy - and y direction

void Grow(int __dx, int __dy)
Grows the rectangle by the specified coordinates
Parameters:
__dx - growth in x direction
__dy - growth in y direction

void Intersect(XRect __r)
Assigns the rectangle the intersection with another rectangle
Parameters:
__r - other rectangle

void Union(XRect __r)
Assigns the rectangle the union with another rectangle
Parameters:
__r - other rectangle

int Contains(XPoint __p)
Returns true if the rectangle contains the specified point
Returns:
non zero 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

int operator == (XRect __r)
Compares to rectangles and returns true if they are equal
Returns:
non zero if equal
Parameters:
__r - right operand

int operator != (XRect __r)
Compares to rectangles and returns false if they are equal
Returns:
zero if equal
Parameters:
__r - right operand


This class has no child classes.

Go to the hierarchy of classes.


Copyright ©1998 Dragos Acostachioaie, Bernd Kalbfuss
Last update on April 17, 1998

This page was generated with the help of doc++.