class MASKING_DLL_DECLSPEC Rect
A simple class that represents a rectangle in 2D space.
Inheritance:
Rect
Public Methods
-
Rect()
- Default constructor
-
Rect(int x, int y, int w, int h)
- Constructor for making a rectangle from coordinates of origin, width and height
-
Rect(const Point &p, const Size &s)
- Constructor for making a rectangle from the origin point and size
-
bool operator==(const Rect &r) const
- Operator for comparing two Rects.
-
void operator+=(const Point &p)
-
void operator-=(const Point &p)
-
Rect operator+(const Point &p) const
-
Rect operator-(const Point &p) const
- Operators for doing simple arithmetic with Rects (ie.
-
bool Intersects(const Rect &r) const
- Returns true if this rectangle intersects with the passed rectangle (excluding the edges)
-
Point topLeft() const
-
Point bottomRight() const
-
Size size() const
-
int x() const
-
int y() const
-
int x2() const
-
int y2() const
-
int w() const
-
int h() const
-
void topLeft(const Point& p)
-
void bottomRight(const Point& p)
-
void size(const Size& s)
-
void x(int v)
-
void y(int v)
-
void x2(int v)
-
void y2(int v)
-
void w(int v)
-
void h(int v)
- Bsic get and set functions
Protected Fields
-
Point origin
- Top left point (origin)
-
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.
Point origin
-
Top left point (origin)
Size dim
-
The size of the rectangle
Rect()
-
Default constructor
Rect(int x, int y, int w, int h)
-
Constructor for making a rectangle from coordinates of origin, width and height
Rect(const Point &p, const Size &s)
-
Constructor for making a rectangle from the origin point and size
bool operator==(const Rect &r) const
-
Operator for comparing two Rects.
Two rectangles are equal if they have the same origin point and size.
void operator+=(const Point &p)
void operator-=(const Point &p)
Rect operator+(const Point &p) const
Rect operator-(const Point &p) const
-
Operators for doing simple arithmetic with Rects (ie. moving).
bool Intersects(const Rect &r) const
-
Returns true if this rectangle intersects with the passed rectangle (excluding the edges)
Point topLeft() const
Point bottomRight() const
Size size() const
int x() const
int y() const
int x2() const
int y2() const
int w() const
int h() const
void topLeft(const Point& p)
void bottomRight(const Point& p)
void size(const Size& s)
void x(int v)
void y(int v)
void x2(int v)
void y2(int v)
void w(int v)
void 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++