|
CoreComponents 3.0.0
A Modern C++ Toolkit
|
Rectangle. More...
#include <cc/Rect>
Public Member Functions | |
| Rect ()=default | |
| Create an empty rectangle. | |
| Rect (const Size &size) | |
| Create a rectangle of given size. | |
| Rect (const Point &pos, const Size &size) | |
| Create a rectangle of given size located at pos. | |
| Rect (double x0, double y0, double x1, double y1) | |
| Create a rectangle covering the ranges [x0, x1) and [y0, y1) | |
| operator bool () const | |
| Area is greate than zero. | |
| Point | pos () const |
| Get position. | |
| void | pos (Point newValue) |
| Set position | |
| void | pos (double x, double y) |
| Set position | |
| Size | size () const |
| Get size. | |
| void | size (Size newValue) |
| Set size | |
| void | size (double w, double h) |
| Set size | |
| double | x () const |
| Get pos()[0]. | |
| double | y () const |
| Get pos()[1]. | |
| double | width () const |
| Get size()[0]. | |
| double | height () const |
| Get size()[1]. | |
| double | x0 () const |
| Get pos()[0]. | |
| double | y0 () const |
| Get pos()[1];. | |
| double | x1 () const |
| Get pos()[0] + size()[0]. | |
| double | y1 () const |
| Get pos()[1] + size()[1]. | |
| bool | operator== (const Rect &b) |
| Equal to operator. | |
| bool | operator!= (const Rect &b) |
| Not equal to operator. | |
| bool | contains (const Rect &b) const |
| Check if b is covered by this rectangle. | |
| bool | contains (const Point &b) const |
| Check if b is covered by this rectangle. | |
Rectangle.
|
default |
Create an empty rectangle.
| Rect | ( | double | x0, |
| double | y0, | ||
| double | x1, | ||
| double | y1 ) |
Create a rectangle covering the ranges [x0, x1) and [y0, y1)
|
explicit |
Area is greate than zero.
| Point pos | ( | ) | const |
Get position.
| void pos | ( | Point | newValue | ) |
Set position
| void pos | ( | double | x, |
| double | y ) |
Set position
| Size size | ( | ) | const |
Get size.
| void size | ( | Size | newValue | ) |
Set size
| void size | ( | double | w, |
| double | h ) |
Set size
| double x | ( | ) | const |
Get pos()[0].
| double y | ( | ) | const |
Get pos()[1].
| double width | ( | ) | const |
Get size()[0].
| double height | ( | ) | const |
Get size()[1].
| double x0 | ( | ) | const |
Get pos()[0].
| double y0 | ( | ) | const |
Get pos()[1];.
| bool operator== | ( | const Rect & | b | ) |
Equal to operator.
| bool operator!= | ( | const Rect & | b | ) |
Not equal to operator.
| bool contains | ( | const Rect & | b | ) | const |
Check if b is covered by this rectangle.
| bool contains | ( | const Point & | b | ) | const |
Check if b is covered by this rectangle.