![]() ![]() ![]()
|
SophiaFramework 2.2 |
#include <SFUPolygon.hpp>
class SFUPolygon : public AEEPolygon;
typedef SFUPolygon& SFUPolygonRef; typedef SFUPolygon* SFUPolygonPtr; typedef SFUPolygon** SFUPolygonHandle; typedef const SFUPolygon ConstSFUPolygon; typedef const SFUPolygon& ConstSFUPolygonRef; typedef const SFUPolygon* ConstSFUPolygonPtr; typedef const SFUPolygon** ConstSFUPolygonHandle;
SFUPolygon は多角形を表すクラスです。 多角形は内部的には点配列です。
| コンストラクタ/デストラクタ | ||
|---|---|---|
| public |
SFUPolygon | SFUPolygon クラスのコンストラクタです。 |
| public |
~SFUPolygon | SFUPolygon クラスのデストラクタです。 |
| パブリック変数 | ||
|---|---|---|
| public |
len | 多角形の点の数です。 |
| public |
points | 多角形の点配列へのポインタです。 |
| パブリック関数 | ||
|---|---|---|
| public |
Append | 多角形の点を追加します。 |
| public |
Clear | 多角形をクリアします。 |
| public |
Equal | 2 つの多角形が等しいか判定します。 |
| public |
Get | 多角形の点配列内の点を取得します。 |
| public |
Insert | 多角形の点配列に点を挿入します。 |
| public |
Length | 多角形の点の数を返します。 |
| public |
Offset | 多角形を移動します。 |
| public |
Points | 多角形の点配列のポインタを返します。 |
| public |
Remove | 多角形の点配列から点を削除します。 |
| public |
Set | 点配列をコピーします。 |
| public |
operator+ | 多角形を移動します。 |
| public |
operator- | 多角形を逆移動します。 |
| public |
operator== | 2 つの多角形を比較します。 |
[ public ] SFUPolygon(Void);
[ public ]
SFUPolygon(
ConstAEEPolygonRef polygon // コピー元の AEEPolygon 構造体
);
[ public ]
SFUPolygon(
SInt16 size // points 引数に格納されている点の個数
ConstSFUPointPtr points // 点の配列へのポインタ
);
[ public ] ~SFUPolygon(Void);
[ public ] Bool Append( ConstSFUPointRef point // 追加する点 );
追加に成功すると TRUE を返します。 失敗すると FALSE を返します。
[ public ] Void Clear(Void);
多角形をクリアすると、 Length() で返される点の数は 0 になり、 Points() で返される点配列ポインタは NULL になります。
[ public, const ] Bool Equal( ConstSFUPolygonRef polygon // 比較対象の多角形 );
2 つの多角形の点配列に格納された点の座標が、 すべて一致すれば TRUE を返します。 そうでなければ FALSE を返します。 この比較においては、点配列に格納される点の順序が意味をもちます。 点配列の同じインデックスに格納された点が比較されます。
[ public ] Bool Insert( SIntN index // 挿入位置のインデックス ConstSFUPointRef point // 挿入する点 );
挿入に成功すると TRUE を返します。
[ public ] SIntN Length(Void);
[ public ] ConstSFUPolygonRef Offset( SInt16 dx // X 方向の移動量 SInt16 dy // Y 方向の移動量 );
[ public ] ConstSFUPolygonRef Offset( ConstSFUPointRef vector // 移動する方向 );
[ public ] SFUPointPtr Points(Void);
返される配列ポインタは、 多角形に点を追加したり削除したりすると、 無効なポインタになる可能性があります。 そのため、ポインタを記録して使いまわすことはしないでください。
[ public ] ConstSFUPolygonRef Set( ConstAEEPolygonRef polygon // コピーする AEEPolygon 構造体 );
[ public ] ConstSFUPolygonRef Set( SInt16 size // 点の数 ConstSFUPointPtr points // 点配列へのポインタ );
自分自身を返します。
[ public, friend ] Bool operator==( ConstSFUPolygonRef polygon1 ConstSFUPolygonRef polygon2 );
[ public, friend ] Bool operator!=( ConstSFUPolygonRef polygon1 ConstSFUPolygonRef polygon2 );
2 つの多角形の点配列に格納された点の座標が、 すべて一致すれば TRUE を返します。 そうでなければ FALSE を返します。 この比較においては、点配列に格納される点の順序が意味をもちます。 点配列の同じインデックスに格納された点が比較されます。
[ public, friend ] SFUPolygon operator-( ConstSFUPolygonRef polygon // 逆移動する多角形 ConstSFUPointRef vector // 逆移動する方向 );
[ public ] ConstSFUPolygonRef operator-=( ConstSFUPointRef vector // 逆移動する方向 );
[ public, friend ] SFUPolygon operator+( ConstSFUPolygonRef polygon // 移動する多角形 ConstSFUPointRef vector // 移動する方向 );
[ public ] ConstSFUPolygonRef operator+=( ConstSFUPointRef vector // 移動する方向 );
[ public ] SInt16 len;
[ public ] AEEPoint* points;
| Copyright(C) 2003-2004 Sophia Cradle Inc., All Rights Reserved. |
![]() ![]() ![]()
|