![]() |
Lumino
|
2次元の矩形を表すクラスです。 More...
#include <GeometryStructs.hpp>
Public Member Functions | |
Rect () | |
すべての要素を 0 で初期化します。 | |
Rect (float x, float y, float width, float height) | |
位置とサイズを指定して初期化します。 | |
Rect (const Point &point, const Size &size) | |
位置とサイズを指定して初期化します。 | |
Rect (float x, float y, const Size &size) | |
位置とサイズを指定して初期化します。 | |
Rect (const Point &point, float width, float height) | |
位置とサイズを指定して初期化します。 | |
Rect (const Rect &rect) | |
指定した矩形をコピーして初期化します。 | |
void | set (float x_, float y_, float width_, float height_) |
各要素を設定します。 | |
void | set (float x_, float y_, const Size &size) |
各要素を設定します。 | |
float | getLeft () const |
左辺の x 軸の値を取得します。 | |
float | getTop () const |
上辺の y 軸の位置を取得します。 | |
float | getRight () const |
右辺の x 軸の値を取得します。 | |
float | getBottom () const |
底辺の y 軸の値を取得します。 | |
Point | getTopLeft () const |
左上隅の位置を取得します。 | |
Point | getTopRight () const |
右上隅の位置を取得します。 | |
Point | getBottomLeft () const |
左下隅の位置を取得します。 | |
Point | getBottomRight () const |
右下隅の位置を取得します。 | |
void | setSize (const Size &size) |
幅と高さを設定します。 | |
Size | getSize () const |
幅と高さを取得します。 | |
bool | isEmpty () const |
幅または高さを持たないかを判定します。 | |
bool | isZero () const |
要素がすべて 0 かを判定します。 | |
bool | contains (const Point point) const |
矩形内に指定した点が含まれているかどうかを判定します。 | |
bool | contains (float x_, float y_) const |
矩形内に指定した点が含まれているかどうかを判定します。 | |
bool | contains (const Rect &rect) const |
指定した矩形全体が、この矩形内部に含まれているかを判定します。 | |
void | clip (const Rect &rect) |
指定した矩形に収まるように、この矩形をクリッピングします。 | |
void | inflate (float width_, float height_) |
四角形を拡大または縮小します。 | |
Rect | makeInflate (const Thickness &thickness) const |
指定した厚さだけ、この矩形から拡大した矩形を作成します。 | |
Rect | makeDeflate (const Thickness &thickness) const |
指定した厚さだけ、この矩形から縮小した矩形を作成します。 | |
Public Attributes | |
float | x |
左辺の X 座標 | |
float | y |
上辺の Y 座標 | |
float | width |
幅 | |
float | height |
高さ | |
Static Public Attributes | |
static const Rect | Zero |
(0, 0, 0, 0) | |
static const Rect | Empty |
(0, 0, -1, -1) | |
2次元の矩形を表すクラスです。