OHOS::Rect
Overview
Related Modules:
Description:
Defines a rectangle, including the position data of the four boundaries of the rectangle, and provides functions for rectangle inclusion, intersection, and aggregation.
Since:
1.0
Version:
1.0
Summary
Public Member Functions
Rect () |
A constructor used to create a Rect instance. |
~Rect () |
A destructor used to delete the Rect instance. |
Rect (int16_t left, int16_t top, int16_t right, int16_t bottom) |
A constructor used to create a Rect instance based on the coordinates of the four boundaries. |
A constructor used to create a Rect instance by copying another rectangle. |
|
A constructor used to create a Rect instance by copying another rectangle. |
|
SetRect (int16_t left, int16_t top, int16_t right, int16_t bottom) |
|
GetWidth () const |
|
GetHeight () const |
|
GetX () const |
|
GetY () const |
|
GetLeft () const |
|
GetTop () const |
|
GetRight () const |
|
GetBottom () const |
|
SetX (int16_t x) |
Changes the left boundary coordinate of the rectangle without changing the rectangle width. |
SetY (int16_t y) |
Changes the top boundary coordinate of the rectangle without changing the rectangle height. |
SetPosition (int16_t x, int16_t y) |
Changes the coordinates of the left and top boundaries of the rectangle without changing the rectangle width and height. |
SetWidth (int16_t width) |
Changes the width of the rectangle without changing the coordinate of the left boundary. |
SetHeight (int16_t height) |
Changes the height of the rectangle without changing the coordinate of the top boundary. |
SetLeft (int16_t left) |
|
SetTop (int16_t top) |
|
SetRight (int16_t right) |
|
SetBottom (int16_t bottom) |
|
Resize (int16_t width, int16_t height) |
|
GetSize () const |
|
Obtains the minimum rectangle that contains another two rectangles. |
|
IsContains (const Vector2< int16_t > &point) const |
|
IsContains (const Point &point) const |
|
Checks whether the rectangle is adjacent to another rectangle horizontally or vertically. |
|
IsIntersect (const Rect &other) const |
Checks whether the rectangle intersects with another rectangle. |
IsContains (const Rect &other) const |
|
operator new (size_t size) |
|
operator delete (void p) |