Tizen Native API
6.5
|
Template class to create and operate on rectangles. More...
Public Member Functions | |
Rect () | |
Constructor. | |
Rect (T x, T y, T width, T height) | |
Constructor. | |
Rect (const Rect< T > &rhs) | |
Copy constructor. | |
Rect< T > & | operator= (const Rect< T > &rhs) |
Assignment operator. | |
void | Set (T newX, T newY, T newWidth, T newHeight) |
Assignment from individual values. | |
bool | IsEmpty () const |
Determines whether or not this Rectangle is empty. | |
bool | IsValid () const |
Determines whether or not this Rectangle is valid. | |
T | Left () const |
Gets the left of the rectangle. | |
T | Right () const |
Gets the right of the rectangle. | |
T | Top () const |
Gets the top of the rectangle. | |
T | Bottom () const |
Gets the bottom of the rectangle. | |
T | Area () const |
Gets the area of the rectangle. | |
bool | Intersects (const Rect< T > &other) const |
Determines whether or not this rectangle and the specified rectangle intersect. | |
bool | Intersect (const Rect< T > &rect) |
Intersects this rectangle and the specified rectangle. The result of the intersection is stored in this rectangle. | |
void | Merge (const Rect< T > &rect) |
Merges this rectangle and the specified rectangle. The result of the merge is stored in this rectangle. | |
void | Inset (T dx, T dy) |
Inset the rectangle by (dx,dy). If dx is positive, then the sides are moved inwards. If dx is negative, then the sides are moved outwards. The result of the inset is stored in this rectangle. | |
bool | Contains (const Rect< T > &other) const |
Determines whether or not this Rectangle contains the specified rectangle. | |
template<> | |
bool | IsEmpty () const |
Detailed Description
template<typename T = float>
struct Dali::Rect< T >
Template class to create and operate on rectangles.
- Since:
- 3.0, DALi version 1.0.0
Constructor & Destructor Documentation
Dali::Rect< T >::Rect | ( | ) |
Constructor.
- Since:
- 3.0, DALi version 1.0.0
Dali::Rect< T >::Rect | ( | T | x, |
T | y, | ||
T | width, | ||
T | height | ||
) |
Constructor.
- Since:
- 3.0, DALi version 1.0.0
- Parameters:
-
[in] x X coordinate (or left) [in] y Y coordinate (or right) [in] width Width (or bottom) [in] height Height (or top)
Dali::Rect< T >::Rect | ( | const Rect< T > & | rhs | ) |
Copy constructor.
- Since:
- 3.0, DALi version 1.0.0
- Parameters:
-
[in] rhs The original object
Member Function Documentation
T Dali::Rect< T >::Area | ( | ) | const |
Gets the area of the rectangle.
- Since:
- 3.0, DALi version 1.0.0
- Returns:
- The area of the rectangle
T Dali::Rect< T >::Bottom | ( | ) | const |
Gets the bottom of the rectangle.
- Since:
- 3.0, DALi version 1.0.0
- Returns:
- The bottom of the rectangle
bool Dali::Rect< T >::Contains | ( | const Rect< T > & | other | ) | const |
Determines whether or not this Rectangle contains the specified rectangle.
- Since:
- 3.0, DALi version 1.0.0
- Parameters:
-
[in] other The other rectangle to test against this rectangle
- Returns:
- True if the specified rectangle is contained
void Dali::Rect< T >::Inset | ( | T | dx, |
T | dy | ||
) |
Inset the rectangle by (dx,dy). If dx is positive, then the sides are moved inwards. If dx is negative, then the sides are moved outwards. The result of the inset is stored in this rectangle.
- Since:
- 6.0, DALi version 1.5.18
bool Dali::Rect< T >::Intersect | ( | const Rect< T > & | rect | ) |
Intersects this rectangle and the specified rectangle. The result of the intersection is stored in this rectangle.
- Since:
- 6.0, DALi version 1.5.18
- Parameters:
-
[in] rect The other rectangle to intersect with
- Returns:
- True if the rectangles intersect
bool Dali::Rect< T >::Intersects | ( | const Rect< T > & | other | ) | const |
Determines whether or not this rectangle and the specified rectangle intersect.
- Since:
- 3.0, DALi version 1.0.0
- Parameters:
-
[in] other The other rectangle to test against this rectangle
- Returns:
- True if the rectangles intersect
bool Dali::Rect< T >::IsEmpty | ( | ) | const |
Determines whether or not this Rectangle is empty.
- Since:
- 3.0, DALi version 1.0.0
- Returns:
- True if width or height are zero
bool Dali::Rect< float >::IsEmpty | ( | ) | const |
- Since:
- 3.0, DALi version 1.0.0
- Returns:
- True if the rectangle has zero size
bool Dali::Rect< T >::IsValid | ( | ) | const |
Determines whether or not this Rectangle is valid.
- Since:
- 6.0, DALi version 1.5.18
- Returns:
- True if width and height are not negative
T Dali::Rect< T >::Left | ( | ) | const |
Gets the left of the rectangle.
- Since:
- 3.0, DALi version 1.0.0
- Returns:
- The left edge of the rectangle
void Dali::Rect< T >::Merge | ( | const Rect< T > & | rect | ) |
Merges this rectangle and the specified rectangle. The result of the merge is stored in this rectangle.
- Since:
- 6.0, DALi version 1.5.18
- Parameters:
-
[in] rect The other rectangle to merge with
Rect<T>& Dali::Rect< T >::operator= | ( | const Rect< T > & | rhs | ) |
Assignment operator.
- Since:
- 3.0, DALi version 1.0.0
- Parameters:
-
[in] rhs The original object
- Returns:
- Reference to this
T Dali::Rect< T >::Right | ( | ) | const |
Gets the right of the rectangle.
- Since:
- 3.0, DALi version 1.0.0
- Returns:
- The right edge of the rectangle
void Dali::Rect< T >::Set | ( | T | newX, |
T | newY, | ||
T | newWidth, | ||
T | newHeight | ||
) |
Assignment from individual values.
- Since:
- 3.0, DALi version 1.0.0
- Parameters:
-
[in] newX X coordinate [in] newY Y coordinate [in] newWidth Width [in] newHeight Height
T Dali::Rect< T >::Top | ( | ) | const |
Gets the top of the rectangle.
- Since:
- 3.0, DALi version 1.0.0
- Returns:
- The top of the rectangle