class MASKING_DLL_DECLSPEC Rect

A simple class that represents a rectangle in 2D space.

Inheritance:

Rect


Public Methods

[more] Rect()
Default constructor
[more] Rect(int x, int y, int w, int h)
Constructor for making a rectangle from coordinates of origin, width and height
[more] Rect(const Point &p, const Size &s)
Constructor for making a rectangle from the origin point and size
[more]bool operator==(const Rect &r) const
Operator for comparing two Rects.
[more]void operator+=(const Point &p)
[more]void operator-=(const Point &p)
[more]Rect operator+(const Point &p) const
[more]Rect operator-(const Point &p) const
Operators for doing simple arithmetic with Rects (ie.
[more]bool Intersects(const Rect &r) const
Returns true if this rectangle intersects with the passed rectangle (excluding the edges)
[more]Point topLeft() const
[more]Point bottomRight() const
[more]Size size() const
[more]int x() const
[more]int y() const
[more]int x2() const
[more]int y2() const
[more]int w() const
[more]int h() const
[more]void topLeft(const Point& p)
[more]void bottomRight(const Point& p)
[more]void size(const Size& s)
[more]void x(int v)
[more]void y(int v)
[more]void x2(int v)
[more]void y2(int v)
[more]void w(int v)
[more]void h(int v)
Bsic get and set functions

Protected Fields

[more]Point origin
Top left point (origin)
[more]Size dim
The size of the rectangle


Documentation

A simple class that represents a rectangle in 2D space. It also has some overloaded operators for manipulating rectangles.

oPoint origin
Top left point (origin)

oSize dim
The size of the rectangle

o Rect()
Default constructor

o Rect(int x, int y, int w, int h)
Constructor for making a rectangle from coordinates of origin, width and height

o Rect(const Point &p, const Size &s)
Constructor for making a rectangle from the origin point and size

obool operator==(const Rect &r) const
Operator for comparing two Rects. Two rectangles are equal if they have the same origin point and size.

ovoid operator+=(const Point &p)

ovoid operator-=(const Point &p)

oRect operator+(const Point &p) const

oRect operator-(const Point &p) const
Operators for doing simple arithmetic with Rects (ie. moving).

obool Intersects(const Rect &r) const
Returns true if this rectangle intersects with the passed rectangle (excluding the edges)

oPoint topLeft() const

oPoint bottomRight() const

oSize size() const

oint x() const

oint y() const

oint x2() const

oint y2() const

oint w() const

oint h() const

ovoid topLeft(const Point& p)

ovoid bottomRight(const Point& p)

ovoid size(const Size& s)

ovoid x(int v)

ovoid y(int v)

ovoid x2(int v)

ovoid y2(int v)

ovoid w(int v)

ovoid h(int v)
Bsic get and set functions


Direct child classes:
Widget
See Also:
Point, Size

Alphabetic index Hierarchy of classes


Back to front page   |   page generated with DOC++