class osncore::CRect |
Defines a two dimensional rectangle data type.
Public Member Functions | |
---|---|
CRect () | |
CRect ( int32 , int32 , int32 , int32 ) | |
CRect (const CPoint &, const CSize &) | |
CRect (const CSize &) | |
CRect (const CRect &) | |
void | FastIntersection (const CRect &) |
bool32 | FastIntersects (const CRect &) |
void | Intersection ( CRect ) |
bool32 | Intersects ( CRect ) |
bool32 | IsEmpty () |
bool32 | IsNormalized () |
void | Normalize () |
bool32 | operator!= (const CRect &) |
CRect & | operator+= (const CPoint &) |
CRect & | operator+= (const CSize &) |
CRect & | operator-= (const CPoint &) |
CRect & | operator-= (const CSize &) |
bool32 | operator== (const CRect &) |
Public Attributes | |
---|---|
int32 | mHeight |
int32 | mWidth |
int32 | mX |
int32 | mY |
CRect | ( | ) | [inline] |
Default constructor, initializing the coordinates of the top left corner and the size to ( 0,0 ).
CRect | ( | int32 | aX, |
int32 | aY, | ||
int32 | aWidth, | ||
int32 | aHeight | ||
) | [inline] |
Parameterized constructor.
int32 aX | The first coordinate of the rectangle's top left point. |
int32 aY | The second coordinate of the rectangle's top left point. |
int32 aWidth | The width of the rectangle. |
int32 aHeight | The height of the rectangle. |
CRect | ( | const CPoint & | aTopLeft, |
const CSize & | aSize | ||
) | [inline] |
Parameterized constructor.
Constructs the rectangle with a point ( top left corner ) and a size.
CRect | ( | const CSize & | aSize | ) | [inline] |
Parameterized constructor.
Constructs the rectangle with a size. The top left corner is set to (0,0).
const CSize & aSize | The size of the rectangle. |
CRect | ( | const CRect & | aRect | ) | [inline] |
Copy constructor.
const CRect & aRect | The rectangle object to be copied. |
void | FastIntersection | ( | const CRect & | aRect | ) | [inline] |
Gets the normalized area of intersection between this normalized rectangle and the specified normalized rectangle, and assigns it to this rectangle.
If the two rectangles do not intersect or are not normalized, then, on return, this rectangle is set to be empty.
Because of performance reasons this function should be favored over the Intersection() function, when it is certain that both rectangles are normalized.
const CRect & aRect | The rectangle to be used with this rectangle to get the area of intersection. |
bool32 | FastIntersects | ( | const CRect & | aRect | ) | const [inline] |
Tests whether this normalized rectangle overlaps with the specified normalized rectangle.
Two rectangles overlap if any point is located within both rectangles. There is no intersection if two adjacent sides touch without overlapping, or if either rectangle is empty. If one of the rectangles isn't normalized, then the function also returns FALSE,
Because of performance reasons this function should favored over the Intersects function, when it is certain that both rectangles are normalized.
const CRect & aRect | The rectangle to compare with this rectangle for an intersection. |
void | Intersection | ( | CRect | aRect | ) | [inline] |
Gets the normalized area of intersection between this rectangle and the specified rectangle, and assigns it to this rectangle.
If the two rectangles do not intersect, then, on return, this rectangle is set to be empty.
CRect aRect | The rectangle to be used with this rectangle to get the area of intersection. |
bool32 | Intersects | ( | CRect | aRect | ) | const [inline] |
Tests whether this rectangle overlaps with the specified rectangle.
Two rectangles overlap if any point is located within both rectangles. There is no intersection if two adjacent sides touch without overlapping, or if either rectangle is empty.
CRect aRect | The rectangle to compare with this rectangle for an intersection. |
bool32 | IsEmpty | ( | ) | const [inline] |
Determines whether the area covered by the rectangle is zero.
bool32 | IsNormalized | ( | ) | const [inline] |
Tests whether the rectangle is normalized.
A rectangle is normalized, when its width and height are both greater than or equal to zero.
void | Normalize | ( | ) | [inline] |
Ensures that the rectangle's width and height have positive values.
For example, if the rectangle's co-ordinates are such that the top is below the bottom, or the right hand side is to the left of the left hand side, normalisation swaps the co-ordinates of the top and bottom or of the left and right.
bool32 | operator!= | ( | const CRect & | aRect | ) | const [inline] |
Compares two rectangles for inequality.
Two rectangles are unequal if the coordinates of their top left corners or their sizes differ.
const CRect & aRect | The rectangle to compare with this rectangle. |
CRect & | operator+= | ( | const CPoint & | aPoint | ) | [inline] |
CPoint addition assignment operator.
The operator moves this CRect's offset by the given point's coordinates.
const CPoint & aPoint | The CPoint to be added. |
CRect & | operator+= | ( | const CSize & | aSize | ) | [inline] |
const CSize & aSize | The CSize to be added. |
CRect & | operator-= | ( | const CPoint & | aPoint | ) | [inline] |
CPoint subtraction assignment operator.
The operator moves this CRect's offset by the given point's coordinates.
const CPoint & aPoint | The CPoint to be substracted. |
CRect & | operator-= | ( | const CSize & | aSize | ) | [inline] |
const CSize & aSize | The CSize to be substracted. |
bool32 | operator== | ( | const CRect & | aRect | ) | const [inline] |
Compares two rectangles for equality.
For two rectangles to be equal, the coordinates of their top left corners and their sizes must be equal.
const CRect & aRect | The rectangle to compare with this rectangle. |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.