前のページ次のページ上に戻るホーム SophiaFramework 2.2
SFUCircle
円を表現するクラスです。
#include <SFUCircle.hpp>
class SFUCircle : public AEECircle;
typedef SFUCircle&          SFUCircleRef;
typedef SFUCircle*          SFUCirclePtr;
typedef SFUCircle**         SFUCircleHandle;
typedef const SFUCircle     ConstSFUCircle;
typedef const SFUCircle&    ConstSFUCircleRef;
typedef const SFUCircle*    ConstSFUCirclePtr;
typedef const SFUCircle**   ConstSFUCircleHandle;

解説

SFUCircle は円を表現するクラスです。 円を操作するためのさまざまな関数が用意されています。

参照

SFUArc | SFUPie

メンバ

コンストラクタ/デストラクタ
public
SFUCircle SFUCircle クラスのコンストラクタです。
public
~SFUCircle SFUCircle クラスのデストラクタです。
パブリック変数
public
cx 円の中心の X 座標です。
public
cy 円の中心の Y 座標です。
public
r 円の半径です。
パブリック関数
public
Empty 半径が 0 であるか判定します。
public
Equal 円が等しいか判定します。
public
Inset 円の半径を縮小します。
public
Offset 円の中心を移動します。
public
Origin 円の中心を設定します。
public
Radius 円の半径を取得/設定します。
public
Set 円の中心と半径を設定します。
public
operator+ 円の中心を移動します。
public
operator- 円の中心を逆方向に移動します。
public
operator== 2 つの円が等しいか判定します。

SFUCircle::SFUCircle
SFUCircle クラスのコンストラクタです。
[ public ]
SFUCircle(Void);
[ public ]
SFUCircle(
    ConstSFUCircleRef circle   // コピー元の円
);
[ public ]
SFUCircle(
    ConstAEECircleRef circle   // コピー元の円
);
[ public ]
SFUCircle(
    SInt16 x   // 中心の X 座標
    SInt16 y   // 中心の Y 座標
    SInt16 r   // 半径
);
[ public ]
SFUCircle(
    ConstSFUPointRef point   // 中心
    SInt16 r                 // 半径
);

SFUCircle::~SFUCircle
SFUCircle クラスのデストラクタです。
[ public ]
~SFUCircle(Void);

SFUCircle::Empty
半径が 0 であるか判定します。
[ public, const ]
Bool Empty(Void);

戻り値

円の半径が 0 であれば TRUE、そうでなければ FALSE を返します。


SFUCircle::Equal
円が等しいか判定します。
[ public, const ]
Bool Equal(
    ConstSFUCircleRef circle   // 比較対象となる円
);

戻り値

2 つの円の中心と半径がともに等しい場合 TRUE を返します。 そうでなければ FALSE を返します。

参照

SFUCircle::operator==


SFUCircle::Inset
円の半径を縮小します。
[ public ]
ConstSFUCircleRef Inset(
    SInt16 dr   // 半径を縮める値
);

使用例

次の例では円の半径が 5 だけ縮みます。

SFUCircle c(20,20,15);
c.Inset(5);

SFUCircle::Offset
円の中心を移動します。
[ public ]
ConstSFUCircleRef Offset(
    SInt16 x   // X 方向の移動距離
    SInt16 y   // Y 方向の移動距離
);
[ public ]
ConstSFUCircleRef Offset(
    ConstSFUPointRef point   // 移動する方向
);

戻り値

自分自身を返します。

使用例

次の例では円を移動しています。

SFUCircle c(100, 100, 20);
SFUPoint point(5, 10);
c.Offset(point);       // c は 中心 (105, 110) になります。

参照

SFUCircle::operator+ | SFUCircle::operator-


SFUCircle::Origin
円の中心を設定します。
[ public ]
ConstSFUCircleRef Origin(
    SInt16 x   // 中心の X 座標
    SInt16 y   // 中心の Y 座標
);
[ public ]
ConstSFUCircleRef Origin(
    ConstSFUPointRef point   // 中心
);
[ public, const ]
SFUPoint Origin(Void);

戻り値

自分自身を返します。


SFUCircle::Radius
円の半径を取得/設定します。
[ public ]
ConstSFUCircleRef Radius(
    SInt16 r   // 設定する半径
);
[ public, const ]
SInt16 Radius(Void);

参照

SFUCircle::Set


SFUCircle::Set
円の中心と半径を設定します。
[ public ]
ConstSFUCircleRef Set(
    SInt16 x   // 中心の X 座標
    SInt16 y   // 中心の Y 座標
    SInt16 r   // 半径
);
[ public ]
ConstSFUCircleRef Set(
    ConstSFUPointRef point   // 中心
    SInt16 r                 // 半径
);

参照

SFUCircle::Origin | SFUCircle::Radius


SFUCircle::operator==
2 つの円が等しいか判定します。
[ public, friend ]
Bool operator==(
    ConstSFUCircleRef circle1   
    ConstSFUCircleRef circle2   
);
[ public, friend ]
Bool operator!=(
    ConstSFUCircleRef circle1   
    ConstSFUCircleRef circle2   
);

参照

SFUCircle::Equal


SFUCircle::operator-
円の中心を逆方向に移動します。
[ public, friend ]
SFUCircle operator-(
    ConstSFUCircleRef circle   // 移動する円
    ConstSFUPointRef point     // 移動する方向
);
[ public ]
ConstSFUCircleRef operator-=(
    ConstSFUPointRef point   // 移動する方向
);

参照

SFUCircle::Offset | SFUCircle::operator+


SFUCircle::operator+
円の中心を移動します。
[ public, friend ]
SFUCircle operator+(
    ConstSFUCircleRef cirlce   // 移動する円
    ConstSFUPointRef point     // 移動する方向
);
[ public ]
ConstSFUCircleRef operator+=(
    ConstSFUPointRef point   // 移動する方向
);

参照

SFUCircle::Offset | SFUCircle::operator-


SFUCircle::cx
円の中心の X 座標です。
[ public ]
SInt16 cx;

SFUCircle::cy
円の中心の Y 座標です。
[ public ]
SInt16 cy;

SFUCircle::r
円の半径です。
[ public ]
SInt16 r;