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
| Public Member Function Name | Description |
|---|---|
| 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. |
| Rect (const Rect &other) | A constructor used to create a Rect instance by copying another rectangle. |
| Rect (const Rect &&other) | 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) | void Sets the coordinates of the four boundaries of a rectangle. |
| GetWidth () const | int16_t Obtains the rectangle width. |
| GetHeight () const | int16_t Obtains the rectangle height. |
| GetX () const | int16_t Obtains the left boundary coordinate of the rectangle. |
| GetY () const | int16_t Obtains the top boundary coordinate of the rectangle. |
| GetLeft () const | int16_t Obtains the left boundary coordinate of the rectangle. |
| GetTop () const | int16_t Obtains the top boundary coordinate of the rectangle. |
| GetRight () const | int16_t Obtains the right boundary coordinate of the rectangle. |
| GetBottom () const | int16_t Obtains the bottom boundary coordinate of the rectangle. |
| SetX (int16_t x) | void Changes the left boundary coordinate of the rectangle without changing the rectangle width. |
| SetY (int16_t y) | void Changes the top boundary coordinate of the rectangle without changing the rectangle height. |
| SetPosition (int16_t x, int16_t y) | void Changes the coordinates of the left and top boundaries of the rectangle without changing the rectangle width and height. |
| SetWidth (int16_t width) | void Changes the width of the rectangle without changing the coordinate of the left boundary. |
| SetHeight (int16_t height) | void Changes the height of the rectangle without changing the coordinate of the top boundary. |
| SetLeft (int16_t left) | void Sets the coordinate of the left boundary of a rectangle. |
| SetTop (int16_t top) | void Sets the coordinate of the top boundary of a rectangle. |
| SetRight (int16_t right) | void Sets the coordinate of the right boundary of a rectangle. |
| SetBottom (int16_t bottom) | void Sets the coordinate of the bottom boundary of a rectangle. |
| Resize (int16_t width, int16_t height) | void Sets the width and height of a rectangle. |
| GetSize () const | uint32_t Obtains the area of a rectangle. |
| Intersect (const Rect &rect1, const Rect &rect2) | bool Checks whether two rectangles intersect. |
| Join (const Rect &rect1, const Rect &rect2) | void Obtains the minimum rectangle that contains another two rectangles. |
| IsContains (const Vector2< int16_t > &point) const | bool Checks whether the rectangle contains a coordinate point. |
| IsContains (const Point &point) const | bool Checks whether the rectangle contains a coordinate point. |
| IsExtends (const Rect &other) const | bool Checks whether the rectangle is adjacent to another rectangle horizontally or vertically. |
| IsIntersect (const Rect &other) const | bool Checks whether the rectangle intersects with another rectangle. |
| IsContains (const Rect &other) const | bool Checks whether the rectangle contains another rectangle. |
| operator new (size_t size) | void Overrides the new function. |
| operator delete (void p) | void Overrides the delete function. |
