![]() ![]() ![]()
|
SophiaFramework 2.2 |
#include <SFURect.hpp>
class SFURect : public AEERect;
typedef SFURect& SFURectRef; typedef SFURect* SFURectPtr; typedef SFURect** SFURectHandle; typedef const SFURect ConstSFURect; typedef const SFURect& ConstSFURectRef; typedef const SFURect* ConstSFURectPtr; typedef const SFURect** ConstSFURectHandle;
長方形を表すクラスです。 長方形を操作するためのさまざまな関数が用意されています。 長方形は格子点座標で表現されます。
| コンストラクタ/デストラクタ | ||
|---|---|---|
| public |
SFURect | SFURect クラスのコンストラクタです。 |
| public |
~SFURect | SFURect クラスのデストラクタです。 |
| パブリック変数 | ||
|---|---|---|
| public |
dx | 長方形の幅です。 |
| public |
dy | 長方形の高さです。 |
| public |
x | 長方形の左上の頂点の X 座標です。 |
| public |
y | 長方形の左上の頂点の Y 座標です。 |
| パブリック関数 | ||
|---|---|---|
| public |
Empty | 長方形の幅または高さが 0 であるか判定します。 |
| public |
Equal | 2 つの長方形が等しいか判定します。 |
| public |
Inset | 長方形を両端から縮小します。 |
| public |
Inside | 長方形が別の長方形の中に含まれるか判定します。 |
| public |
LineB | 下辺を取得します。 |
| public |
LineL | 左辺を取得します。 |
| public |
LineR | 右辺を取得します。 |
| public |
LineT | 上辺を取得します。 |
| public |
Offset | 長方形を移動します。 |
| public |
Origin | 左上の座標を取得/設定します。 |
| public |
PointLB | 左下の座標を取得します。 |
| public |
PointRB | 右下の座標を取得します。 |
| public |
PointRT | 右上の座標を取得します。 |
| public |
Sect | 2 つの長方形の共通部分を返します。 |
| public |
Set | 長方形の位置とサイズを設定します。 |
| public |
Size | 長方形のサイズを取得/設定します。 |
| public |
Union | 2 つの長方形を包含する長方形を返します。 |
| public |
operator & | 2 つの長方形の共通部分を返します。 |
| public |
operator+ | 長方形を移動します。 |
| public |
operator- | 長方形を逆移動します。 |
| public |
operator== | 2 つの長方形が等しいか判定します。 |
| public |
operator| | 2 つの長方形を包含する長方形を返します。 |
[ public ] SFURect(Void);
[ public ]
SFURect(
ConstAEERectRef aeeRect // コピーする AEERect 構造体
);
[ public ]
SFURect(
SInt16 x // 左上の X 座標
SInt16 y // 左上の Y 座標
SInt16 dx // 幅
SInt16 dy // 高さ
);
[ public ]
SFURect(
SInt16 x // 左上の X 座標
SInt16 y // 左上の Y 座標
ConstSFUSizeRef size // 幅と高さ
);
[ public ]
SFURect(
ConstSFUPointRef point // 左上の座標
SInt16 dx // 幅
SInt16 dy // 高さ
);
[ public ]
SFURect(
ConstSFUPointRef point // 左上の座標
ConstSFUSizeRef size // 幅と高さ
);
[ public ]
SFURect(
ConstSFUPointRef leftTop // 左上の座標
ConstSFUPointRef rightBottom // 右下の座標
);
SFURect クラスのコンストラクタでは、 SFURect クラスの位置とサイズを設定します。
デフォルト コンストラクタでは、メンバは初期化されません。
[ public ] ~SFURect(Void);
[ public, const ] Bool Empty(Void);
長方形の幅または高さが 0 であれば TRUE を返します。 そうでなければ FALSE を返します。
[ public, const ] Bool Equal( ConstSFURectRef rect // 比較対象の長方形 );
2 つの長方形の左上の座標と幅と高さがすべて等しければ TRUE を返します。 そうでなければ FALSE を返します。
[ public ] ConstSFURectRef Inset( SInt16 left // 左辺を縮小するサイズ SInt16 top // 上辺を縮小するサイズ SInt16 right // 右辺を縮小するサイズ SInt16 bottom // 下辺を縮小するサイズ );
[ public ] ConstSFURectRef Inset( ConstSFUSizeRef dsize // 上下左右を縮小するサイズ );
[ public ] ConstSFURectRef Inset( ConstSFUMarginRef margin // 上下左右を縮小するサイズ );
[ public ] ConstSFURectRef Inset( SInt16 dx // 左右を縮小するサイズ SInt16 dy // 上下を縮小するサイズ );
[ public, const ] Bool Inside( ConstSFURectRef rect // 別の長方形 );
この長方形が rect 引数で指定された長方形に含まれる場合 TRUE を返します。 そうでなければ FALSE を返します。
[ public, const ] SFULine LineB(Void);
SFURect rect(0, 0, 50, 60); SFULine line = rect.LineB(); // line = (0, 59)-(49, 59) となります。
[ public, const ] SFULine LineL(Void);
SFURect rect(0, 0, 50, 60); SFULine line = rect.LineL(); // line = (0, 0)-(0, 59) となります。
[ public, const ] SFULine LineR(Void);
SFURect rect(0, 0, 50, 60); SFULine line = rect.LineR(); // line = (49, 0)-(49, 59) となります。
[ public, const ] SFULine LineT(Void);
SFURect rect(0, 0, 50, 60); SFULine line = rect.LineT(); // line = (0, 0)-(49, 0) となります。
[ public ] ConstSFURectRef Offset( SInt16 dx // X 方向の移動量 SInt16 dy // Y 方向の移動量 );
[ public ] ConstSFURectRef Offset( ConstSFUPointRef vector // 移動する方向 );
[ public ] ConstSFURectRef Origin( SInt16 x // 左上の X 座標 SInt16 y // 左上の Y 座標 );
[ public ] ConstSFURectRef Origin( ConstSFUPointRef leftTop // 左上の座標 );
[ public, const ] SFUPoint Origin(Void);
[ public, const ] SFUPoint PointLB(Void);
SFURect rect(0, 0, 100, 100); SFUPoint pt = rect.PointLB(); // pt = (0, 99) となります。
SFURect rect(0, 0, 100, 100); SFUPoint pt = rect.PointLT(); // pt = (0, 0) となります。
[ public, const ] SFUPoint PointRB(Void);
SFURect rect(0, 0, 100, 100); SFUPoint pt = rect.PointRB(); // pt = (99, 99) となります。
[ public, const ] SFUPoint PointRT(Void);
SFURect rect(0, 0, 100, 100); SFUPoint pt = rect.PointRT(); // pt = (99, 0) となります。
[ public ] ConstSFURectRef Sect( ConstSFURectRef rect );
2 つの長方形の共通部分の長方形を計算します。 共通部分がない場合は、幅または高さが 0 の長方形が返されますので、 Empty() 関数により 共通部分がないか判定できます。
[ public ] ConstSFURectRef Set( SInt16 x // 左上の X 座標 SInt16 y // 左上の Y 座標 SInt16 dx // 幅 SInt16 dy // 高さ );
[ public ] ConstSFURectRef Set( SInt16 x // 左上の X 座標 SInt16 y // 左上の Y 座標 ConstSFUSizeRef size // 幅と高さ );
[ public ] ConstSFURectRef Set( ConstSFUPointRef leftTop // 左上の座標 SInt16 dx // 幅 SInt16 dy // 高さ );
[ public ] ConstSFURectRef Set( ConstSFUPointRef leftTop // 左上の座標 ConstSFUSizeRef size // 幅と高さ );
[ public ] ConstSFURectRef Set( ConstSFUPointRef leftTop // 左上の座標 ConstSFUPointRef rightBottom // 右下の座標 );
[ public ] ConstSFURectRef Size( SInt16 dx // 幅 SInt16 dy // 高さ );
[ public ] ConstSFURectRef Size( ConstSFUSizeRef size // 幅と高さ );
[ public, const ] SFUSize Size(Void);
[ public ] ConstSFURectRef Union( ConstSFURectRef rect );
2 つの長方形を包含する長方形を返します。
[ public, friend ] SFURect operator &( ConstSFURectRef rect1 ConstSFURectRef rect2 );
[ public ] ConstSFURectRef operator &=( ConstSFURectRef rect );
2 つの長方形の共通部分の長方形を計算します。 共通部分がない場合は、幅または高さが 0 の長方形が返されますので、 Empty() 関数により 共通部分がないか判定できます。
[ public, friend ] Bool operator==( ConstSFURectRef rect1 ConstSFURectRef rect2 );
[ public, friend ] Bool operator!=( ConstSFURectRef rect1 ConstSFURectRef rect2 );
2 つの長方形の左上の座標と幅と高さがすべて等しければ TRUE を返します。 そうでなければ FALSE を返します。
[ public, friend ] SFURect operator-( ConstSFURectRef rect // 逆移動する長方形 ConstSFUPointRef vector // 逆移動する方向 );
[ public ] ConstSFURectRef operator-=( ConstSFUPointRef vector // 逆移動する方向 );
[ public, friend ] SFURect operator|( ConstSFURectRef rect1 ConstSFURectRef rect2 );
[ public ] ConstSFURectRef operator|=( ConstSFURectRef rect );
2 つの長方形を包含する長方形を返します。
[ public, friend ] SFURect operator+( ConstSFURectRef rect // 移動する長方形 ConstSFUPointRef vector // 移動する方向 );
[ public ] ConstSFURectRef operator+=( ConstSFUPointRef vector // 移動する方向 );
[ public ] SInt16 dx;
[ public ] SInt16 dy;
[ public ] SInt16 x;
[ public ] SInt16 y;
| Copyright(C) 2003-2004 Sophia Cradle Inc., All Rights Reserved. |
![]() ![]() ![]()
|