C
Qul::PlatformInterface::RectF Class
class Qul::PlatformInterface::RectFRectFクラスは、平面上の矩形を浮動小数点精度で定義します。詳細...
| Header: | #include <platforminterface/rect.h> |
| Since: | Qt Quick Ultralite (Platform) 1.5 |
パブリック関数
| RectF() | |
| RectF(const Qul::PlatformInterface::Rect &rectangle) | |
| RectF(const Qul::PlatformInterface::PointF &topLeft, const Qul::PlatformInterface::PointF &bottomRight) | |
| RectF(const Qul::PlatformInterface::PointF &topLeft, const Qul::PlatformInterface::SizeF &size) | |
| RectF(float x, float y, float width, float height) | |
| void | adjust(float dx1, float dy1, float dx2, float dy2) |
| Qul::PlatformInterface::RectF | adjusted(float dx1, float dy1, float dx2, float dy2) const |
| float | bottom() const |
| Qul::PlatformInterface::PointF | bottomLeft() const |
| Qul::PlatformInterface::PointF | bottomRight() const |
| Qul::PlatformInterface::PointF | center() const |
| bool | contains(const Qul::PlatformInterface::PointF &point) const |
| bool | contains(const Qul::PlatformInterface::RectF &rectangle) const |
| bool | contains(float x, float y) const |
| void | getCoords(float *x1, float *y1, float *x2, float *y2) const |
| void | getRect(float *x, float *y, float *width, float *height) const |
| float | height() const |
| Qul::PlatformInterface::RectF | intersected(const Qul::PlatformInterface::RectF &rectangle) const |
| bool | intersects(const Qul::PlatformInterface::RectF &rectangle) const |
| bool | isEmpty() const |
| bool | isNull() const |
| bool | isValid() const |
| float | left() const |
| void | moveBottom(float y) |
| void | moveBottomLeft(const Qul::PlatformInterface::PointF &position) |
| void | moveBottomRight(const Qul::PlatformInterface::PointF &position) |
| void | moveCenter(const Qul::PlatformInterface::PointF &position) |
| void | moveLeft(float x) |
| void | moveRight(float x) |
| void | moveTo(const Qul::PlatformInterface::PointF &position) |
| void | moveTo(float x, float y) |
| void | moveTop(float y) |
| void | moveTopLeft(const Qul::PlatformInterface::PointF &position) |
| void | moveTopRight(const Qul::PlatformInterface::PointF &position) |
| Qul::PlatformInterface::RectF | normalized() const |
| float | right() const |
| void | setBottom(float y) |
| void | setBottomLeft(const Qul::PlatformInterface::PointF &position) |
| void | setBottomRight(const Qul::PlatformInterface::PointF &position) |
| void | setCoords(float x1, float y1, float x2, float y2) |
| void | setHeight(float height) |
| void | setLeft(float x) |
| void | setRect(float x, float y, float width, float height) |
| void | setRight(float x) |
| void | setSize(const Qul::PlatformInterface::SizeF &size) |
| void | setTop(float y) |
| void | setTopLeft(const Qul::PlatformInterface::PointF &position) |
| void | setTopRight(const Qul::PlatformInterface::PointF &position) |
| void | setWidth(float width) |
| void | setX(float x) |
| void | setY(float y) |
| Qul::PlatformInterface::SizeF | size() const |
| Qul::PlatformInterface::Rect | toAlignedRect() const |
| Qul::PlatformInterface::Rect | toRect() const |
| float | top() const |
| Qul::PlatformInterface::PointF | topLeft() const |
| Qul::PlatformInterface::PointF | topRight() const |
| void | translate(const Qul::PlatformInterface::PointF &offset) |
| void | translate(float dx, float dy) |
| Qul::PlatformInterface::RectF | translated(const Qul::PlatformInterface::PointF &offset) const |
| Qul::PlatformInterface::RectF | translated(float dx, float dy) const |
| Qul::PlatformInterface::RectF | transposed() const |
| Qul::PlatformInterface::RectF | united(const Qul::PlatformInterface::RectF &rectangle) const |
| float | width() const |
| float | x() const |
| float | y() const |
| Qul::PlatformInterface::RectF | operator&(const Qul::PlatformInterface::RectF &rectangle) const |
| Qul::PlatformInterface::RectF & | operator&=(const Qul::PlatformInterface::RectF &rectangle) |
| Qul::PlatformInterface::RectF | operator|(const Qul::PlatformInterface::RectF &rectangle) const |
| Qul::PlatformInterface::RectF & | operator|=(const Qul::PlatformInterface::RectF &rectangle) |
関連する非メンバー
| bool | operator!=(const Qul::PlatformInterface::RectF &r1, const Qul::PlatformInterface::RectF &r2) |
| bool | operator==(const Qul::PlatformInterface::RectF &r1, const Qul::PlatformInterface::RectF &r2) |
詳細な説明
矩形は通常、左上隅とサイズで表される。RectFのサイズ(幅と高さ)は常に、そのレンダリングの基礎となる数学的な矩形と等価である。
RectF は、左、上、幅、高さの座標セット、またはPointF とSizeF から構築することができます。
また、RectからRectFを生成する3番目のコンストラクタと、この矩形の値に基づいてRectオブジェクトを返す対応するtoRect ()関数があります(返される矩形の座標は、最も近い整数に丸められることに注意してください)。
RectFクラスは、さまざまな矩形座標を返す関数のコレクションを提供し、これらの操作を可能にします。RectF はまた、矩形をさまざまな座標に対して相対的に移動させる関数も提供します。さらに、moveTo ()関数があり、矩形を移動させ、その左上端を与えられた座標に残します。あるいは、translate ()関数は、現在の位置から与えられたオフセットだけ矩形を移動させ、translated ()関数は、この矩形の変換されたコピーを返します。
size() 関数は、矩形の寸法をSizeF として返します。寸法は、width() およびheight() 関数を用いて個別に取得することもできます。寸法を操作するには、setSize(),setWidth() またはsetHeight() 関数を使用します。あるいは、矩形の座標を設定する関数、たとえばsetBottom() やsetRight() を適用して、サイズを変更することもできます。
contains() 関数は、与えられた点が矩形の内側にあるかどうかを示します。また、intersects() 関数は、この矩形が与えられた矩形と交差していればtrue を返します(そうでなければ false)。RectF クラスはまた、交差矩形を返すintersected() 関数と、与えられた矩形と this を囲む矩形を返すunited() 関数も提供します:
isEmpty() 関数は、矩形の幅または高さが 0 以下の場合にtrue を返します。空の矩形は無効であることに注意してください:isValid() 関数は、幅と高さの両方が 0 より大きい場合にtrue を返します。一方、ヌル矩形 (isNull() == true) は、幅と高さの両方が 0 に設定されます。
RectとRectFの定義方法によって、空のRectFは基本的にRectと同じように定義されることに注意してください。
RectFオブジェクトは比較できます。
座標
RectFクラスは、さまざまな矩形座標を返す関数のコレクションを提供し、これらの操作を可能にします。RectFはまた、矩形をさまざまな座標に対して相対的に移動させる関数も提供します。
たとえば、bottom(),setBottom(),moveBottom() 関数。bottom() は矩形の下辺の y 座標を返し、setBottom() は矩形の下辺を与えられた y 座標に設定します(高さは変更されるかもしれませんが、矩形の上辺は決して変更されません)。moveBottom() は矩形全体を垂直に移動し、矩形の下辺は与えられた y 座標のままでサイズは変更されません。

また、adjust() 関数を使ってこの矩形の座標にオフセットを追加したり、adjusted() 関数を使って元の矩形を調整して新しい矩形を取得したりすることも可能です。幅と高さのどちらかが負の場合は、normalized() 関数を使用して、角が入れ替わった矩形を取得します。
さらに RectF には、矩形の左上隅と右下隅の位置を抽出するgetCoords() 関数と、矩形の左上隅、幅、高さを抽出するgetRect() 関数が用意されています。setCoords() とsetRect() 関数を使用して、矩形の座標と寸法を一度に操作します。
Rectも参照して ください。
メンバ関数ドキュメント
RectF::RectF()
null 矩形を構築します。
isNull()も参照してください 。
RectF::RectF(const Qul::PlatformInterface::Rect &rectangle)
与えられた Rectrectangle から RectF 矩形を構築します。
toRect()も参照してください 。
RectF::RectF(const Qul::PlatformInterface::PointF &topLeft, const Qul::PlatformInterface::PointF &bottomRight)
与えられたtopLeft とbottomRight のコーナーを持つ矩形を構築します。
setTopLeft() およびsetBottomRight()も参照 ください。
RectF::RectF(const Qul::PlatformInterface::PointF &topLeft, const Qul::PlatformInterface::SizeF &size)
与えられたtopLeft コーナーと与えられたsize を持つ矩形を構築します。
setTopLeft() およびsetSize()も参照 ください。
RectF::RectF(float x, float y, float width, float height)
(x,y) を左上隅とし、与えられたwidth とheight を持つ矩形を構築します。
setRect()も参照してください 。
void RectF::adjust(float dx1, float dy1, float dx2, float dy2)
既存の矩形の座標に、それぞれdx1,dy1,dx2 およびdy2 を追加する。
Qul::PlatformInterface::RectF RectF::adjusted(float dx1, float dy1, float dx2, float dy2) const
この矩形の既存の座標に、dx1,dy1,dx2 およびdy2 をそれぞれ加えた新しい矩形を返します。
adjust()も参照 。
float RectF::bottom() const
矩形の底辺の y 座標を返します。
setBottom()、bottomLeft() およびbottomRight()も参照 。
Qul::PlatformInterface::PointF RectF::bottomLeft() const
矩形の左下隅の位置を返します。
setBottomLeft()、bottom() およびleft()も参照 。
Qul::PlatformInterface::PointF RectF::bottomRight() const
矩形の右下隅の位置を返します。
setBottomRight()、bottom() およびright()も参照 。
Qul::PlatformInterface::PointF RectF::center() const
矩形の中心点を返します。
moveCenter()も参照 。
bool RectF::contains(const Qul::PlatformInterface::PointF &point) const
与えられたpoint が矩形の内側または端にある場合はtrue を返し、そうでない場合はfalse を返す。
これはオーバーロードされた関数です。
intersects()も参照してください 。
bool RectF::contains(const Qul::PlatformInterface::RectF &rectangle) const
与えられたrectangle がこの矩形の内側にある場合はtrue を返し、そうでない場合はfalse を返す。
これはオーバーロードされた関数である。
bool RectF::contains(float x, float y) const
点 (x,y) が矩形の内側または端にある場合はtrue を返し、そうでない場合はfalse を返す。
これはオーバーロードされた関数です。
void RectF::getCoords(float *x1, float *y1, float *x2, float *y2) const
矩形の左上隅の位置を *x1 と *y1 に,右下隅の位置を *x2 と *y2 に抽出します.
setCoords() およびgetRect()も参照してください 。
void RectF::getRect(float *x, float *y, float *width, float *height) const
矩形の左上隅の位置を *x および *y に、その寸法を *width および *height に抽出します。
setRect() およびgetCoords()も参照してください 。
float RectF::height() const
矩形の高さを返します。
setHeight()、width() およびsize()も参照 ください。
Qul::PlatformInterface::RectF RectF::intersected(const Qul::PlatformInterface::RectF &rectangle) const
この矩形と与えられたrectangle との交点を返す。r.intersected(s) はr & s と等価であることに注意。

intersects()、united() およびoperator&=()も参照 。
bool RectF::intersects(const Qul::PlatformInterface::RectF &rectangle) const
この矩形が、与えられたrectangle と交差する(つまり、両者の間に空ではない重なり領域がある)場合はtrue を返し、そうでない場合はfalse を返します。
交差矩形は,intersected() 関数を用いて取得することができます.
contains()も参照してください 。
bool RectF::isEmpty() const
矩形が空の場合はtrue を返し,そうでない場合はfalse を返す。
空の矩形は、width() <= 0 またはheight() <= 0 となります。空の矩形は有効ではありません(すなわち、 isEmpty() == !isValid() )。
角が入れ替わった矩形を取得するにはnormalized() 関数を使用します。
isNull(),isValid(),normalized()も参照 。
bool RectF::isNull() const
矩形がヌル矩形の場合はtrue を返し、そうでない場合はfalse を返します。
ヌル矩形は、幅と高さの両方が 0 に設定されます。ヌル矩形も空であり、したがって無効です。
isEmpty() およびisValid()も参照してください 。
bool RectF::isValid() const
矩形が有効な場合はtrue を返し、そうでない場合はfalse を返す。
有効な矩形は,width() > 0 かつheight() > 0 を持つ.なお,無効な矩形に対しては,交点のような非自明な操作は定義されない.有効な矩形は空ではない(すなわち, isValid() == !isEmpty() ).
isNull(),isEmpty(),normalized()も参照 。
float RectF::left() const
矩形の左端の x 座標を返す。x() と同等。
setLeft()、topLeft() およびbottomLeft()も参照 。
void RectF::moveBottom(float y)
矩形を垂直方向に移動し、矩形の下辺を与えられたy 座標に残します。矩形のサイズは変更されません。
bottom()、setBottom()、moveTop()も参照 。
void RectF::moveBottomLeft(const Qul::PlatformInterface::PointF &position)
矩形を移動し、左下隅を与えられたposition に残す。矩形のサイズは変更されません。
setBottomLeft()、moveBottom() およびmoveLeft()も参照 。
void RectF::moveBottomRight(const Qul::PlatformInterface::PointF &position)
矩形を移動し、右下隅を与えられたposition に残す。矩形のサイズは変更されません。
setBottomRight()、moveBottom() およびmoveRight()も参照 。
void RectF::moveCenter(const Qul::PlatformInterface::PointF &position)
矩形を移動し,中心点を与えられたposition に残す。矩形のサイズは変更されません。
center()も参照してください 。
void RectF::moveLeft(float x)
矩形を水平に移動し、矩形の左端を与えられたx 座標に残します。矩形のサイズは変更されません。
left()、setLeft()、moveRight()も参照 。
void RectF::moveRight(float x)
矩形を水平に移動し、矩形の右端を与えられたx 座標に残します。矩形のサイズは変更されません。
right()、setRight()、moveLeft()も参照 。
void RectF::moveTo(const Qul::PlatformInterface::PointF &position)
矩形を移動し、左上端を与えられたposition に残す。
これはオーバーロードされた関数です。
void RectF::moveTo(float x, float y)
矩形を移動し、左上隅を与えられた位置 (x,y) に残す。矩形のサイズは変更されません。
これはオーバーロードされた関数です。
translate() およびmoveTopLeft()も参照 。
void RectF::moveTop(float y)
矩形を垂直に移動し、矩形の上端線を与えられたy 座標に残します。矩形のサイズは変更されません。
top()、setTop()、moveBottom()も参照 。
void RectF::moveTopLeft(const Qul::PlatformInterface::PointF &position)
矩形を移動し、左上端を与えられたposition に残す。矩形のサイズは変更されません。
setTopLeft()、moveTop() およびmoveLeft()も参照 。
void RectF::moveTopRight(const Qul::PlatformInterface::PointF &position)
矩形を移動し、右上隅を与えられたposition に残す。矩形のサイズは変更されません。
setTopRight()、moveTop() およびmoveRight()も参照 。
Qul::PlatformInterface::RectF RectF::normalized() const
正規化された矩形,つまり,幅と高さが負でない矩形を返す。
width() < 0 の場合は左右の角を入れ替え、height() < 0 の場合は上下の角を入れ替えます。
float RectF::right() const
矩形の右端の x 座標を返します。
setRight(),topRight(),bottomRight()も参照 。
void RectF::setBottom(float y)
矩形の下辺を、与えられたy 座標に設定します。高さを変更することはできますが、矩形の上辺を変更することはありません。
bottom() およびmoveBottom()も参照 。
void RectF::setBottomLeft(const Qul::PlatformInterface::PointF &position)
矩形の左下隅を、与えられたposition に設定します。サイズを変更することはできますが、矩形の右上隅を変更することはありません。
bottomLeft() およびmoveBottomLeft()も参照 。
void RectF::setBottomRight(const Qul::PlatformInterface::PointF &position)
矩形の右下隅を、与えられたposition に設定します。サイズは変更されるかもしれませんが、矩形の左上隅が変更されることはありません。
bottomRight() およびmoveBottomRight()も参照 。
void RectF::setCoords(float x1, float y1, float x2, float y2)
矩形の左上隅の座標を (x1,y1) に、右下隅の座標を (x2,y2) に設定します。
void RectF::setHeight(float height)
矩形の高さを与えられたheight に設定します。下辺は変更されますが、上辺は変更されません。
void RectF::setLeft(float x)
矩形の左端を、与えられたx 座標に設定します。幅を変更することはできますが、矩形の右端を変更することはありません。
setX() と同等。
void RectF::setRect(float x, float y, float width, float height)
矩形の左上隅の座標を (x,y) に、サイズを指定されたwidth とheight に設定します。
void RectF::setRight(float x)
矩形の右端を、与えられたx 座標に設定します。幅を変更することはできますが、矩形の左端を変更することはありません。
void RectF::setSize(const Qul::PlatformInterface::SizeF &size)
矩形のサイズを与えられたsize に設定します。左上の角は移動しません。
size()、setWidth() およびsetHeight()も参照 。
void RectF::setTop(float y)
矩形の上辺を、与えられたy 座標に設定します。高さを変更することはできますが、矩形の下辺を変更することはありません。
setY() と同等。
void RectF::setTopLeft(const Qul::PlatformInterface::PointF &position)
矩形の左上隅を、与えられたposition に設定します。サイズを変更することはできますが、矩形の右下隅を変更することはありません。
topLeft() およびmoveTopLeft()も参照 。
void RectF::setTopRight(const Qul::PlatformInterface::PointF &position)
矩形の右上隅を、与えられたposition に設定します。サイズを変更することはできますが、矩形の左下隅を変更することはありません。
topRight() およびmoveTopRight()も参照 。
void RectF::setWidth(float width)
矩形の幅を、与えられたwidth に設定する。右端は変更されますが、左端は変更されません。
void RectF::setX(float x)
矩形の左端を、与えられたx 座標に設定します。幅を変更することはできますが、矩形の右端を変更することはありません。
setLeft() と同等。
x()、setY() およびsetTopLeft()も参照 。
void RectF::setY(float y)
矩形の上辺を、与えられたy 座標に設定します。高さを変更することはできますが、矩形の下辺を変更することはありません。
setTop() と同等。
y()、setX() およびsetTopLeft()も参照 。
Qul::PlatformInterface::SizeF RectF::size() const
矩形のサイズを返します。
setSize()、width() およびheight()も参照 。
Qul::PlatformInterface::Rect RectF::toAlignedRect() const
この矩形を完全に含む最小の整数矩形である、この矩形の値に基づく Rect を返します。
toRect()も参照してください 。
Qul::PlatformInterface::Rect RectF::toRect() const
この矩形の値に基づいて Rect を返します。返される矩形の座標は、最も近い整数に丸められることに注意しましょう。
RectF() およびtoAlignedRect()も参照 ください。
float RectF::top() const
矩形の上辺の y 座標を返す。y() と同等。
setTop()、topLeft() およびtopRight()も参照 。
Qul::PlatformInterface::PointF RectF::topLeft() const
矩形の左上隅の位置を返します。
setTopLeft()、top() およびleft()も参照 。
Qul::PlatformInterface::PointF RectF::topRight() const
矩形の右上隅の位置を返します。
setTopRight()、top() およびright()も参照 。
void RectF::translate(const Qul::PlatformInterface::PointF &offset)
矩形offset.x() を x 軸方向に、offset.y() を y 軸方向に、現在の位置から相対的に移動する。
これはオーバーロードされた関数です。
void RectF::translate(float dx, float dy)
矩形を、 現在の位置を基準に、 x 軸に沿っ てdx に、 y 軸に沿っ てdy に移動する。正の値を指定すると、矩形は右と下に移動する。
これはオーバーロードされた関数です。
moveTopLeft()、moveTo()、translated()も参照 。
Qul::PlatformInterface::RectF RectF::translated(const Qul::PlatformInterface::PointF &offset) const
offset.x() を x 軸に沿って、offset.y() を y 軸に沿って、現在の位置から相対的に変換した矩形のコピーを返します。
これはオーバーロードされた関数です。
Qul::PlatformInterface::RectF RectF::translated(float dx, float dy) const
現在の位置を基準に、x 軸に沿ってdx 、y 軸に沿ってdy に移動した矩形のコピーを返します。正の値を指定すると、矩形は右と下に移動します。
これはオーバーロードされた関数です。
translate()も参照してください 。
Qul::PlatformInterface::RectF RectF::transposed() const
幅と高さを交換した矩形のコピーを返します。
SizeF::transposed()も参照 ください。
Qul::PlatformInterface::RectF RectF::united(const Qul::PlatformInterface::RectF &rectangle) const
この矩形と与えられたrectangle の外接矩形を返します。

intersected()も参照してください 。
float RectF::width() const
矩形の幅を返します。
setWidth()、height() およびsize()も参照 。
float RectF::x() const
矩形の左端の x 座標を返す。left() と同等。
float RectF::y() const
矩形の上辺の y 座標を返す。top() と同等。
Qul::PlatformInterface::RectF RectF::operator&(const Qul::PlatformInterface::RectF &rectangle) const
この矩形と与えられたrectangle との交点を返します。交点がない場合は空の矩形を返します。
operator&=() およびintersected()も参照してください 。
Qul::PlatformInterface::RectF &RectF::operator&=(const Qul::PlatformInterface::RectF &rectangle)
この矩形を、与えられたrectangle と交差させる。
intersected() およびoperator|=()も参照 。
Qul::PlatformInterface::RectF RectF::operator|(const Qul::PlatformInterface::RectF &rectangle) const
この矩形と与えられたrectangle の外接矩形を返します。
united() およびoperator|=()も参照 。
Qul::PlatformInterface::RectF &RectF::operator|=(const Qul::PlatformInterface::RectF &rectangle)
この矩形を、与えられたrectangle と結合します。
関連する非会員
bool operator!=(const Qul::PlatformInterface::RectF &r1, const Qul::PlatformInterface::RectF &r2)
長方形r1 r2 が異なる場合はtrue を返し、そうでない場合はfalse を返す。
bool operator==(const Qul::PlatformInterface::RectF &r1, const Qul::PlatformInterface::RectF &r2)
長方形r1 とr2 が等しい場合はtrue を返し、そうでない場合はfalse を返します。
特定の Qt ライセンスの下で利用可能です。
詳細を見る。