FineKernelToolKit 4.2.13
|
Bezier曲線を生成、管理するクラス [詳解]
#include <FK/BezCurve.h>
公開メンバ関数 | |
fk_BezCurve (void) | |
コンストラクタ | |
virtual | ~fk_BezCurve () |
デストラクタ | |
void | init (void) |
初期化用関数 | |
bool | setDegree (int deg) |
次数設定関数 | |
int | getDegree (void) |
次数参照関数 | |
fk_Vector | pos (double t) |
曲線算出関数 | |
fk_Vector | diff (double t) |
曲線1階微分ベクトル算出関数 | |
bool | split (double t, std::vector< fk_Vector > *C) |
曲線分割制御点算出関数 | |
void | calcCrossParam (fk_Vector S, fk_Vector E, std::vector< double > *A) |
直線交点算出関数 | |
void | calcCrossParam (fk_Matrix M, fk_Vector S, fk_Vector E, std::vector< double > *A) |
変換行列付直線交点算出関数 | |
![]() | |
fk_Curve (void) | |
コンストラクタ | |
virtual | ~fk_Curve () |
デストラクタ | |
virtual bool | setCtrl (int ID, fk_Vector pos) |
制御点設定関数2 | |
virtual bool | setWeight (int ID, double w) |
制御点重み値設定関数 | |
fk_Vector | getCtrl (int ID) |
制御点位置取得関数 | |
double | getWeight (int ID) |
制御点重み値取得関数 | |
int | getCtrlSize (void) |
制御点数取得関数 | |
void | setDiv (int num) |
分割数設定関数 | |
int | getDiv (void) |
分割数取得関数 | |
![]() | |
fk_Shape (fk_Type=fk_Type::SHAPE) | |
コンストラクタ | |
virtual | ~fk_Shape () |
デストラクタ | |
fk_RealShapeType | getRealShapeType (void) |
形状データ構造取得関数 | |
void | setShaderAttribute (std::string name, int dim, std::vector< int > *array, bool self=false) |
シェーダー内 attribute 変数設定関数1 | |
void | setShaderAttribute (std::string name, int dim, std::vector< float > *array, bool self=false) |
シェーダー内 attribute 変数設定関数2 | |
void | setShaderAttribute (std::string name, int dim, std::vector< fk_Vector > *array) |
シェーダー内 attribute 変数設定関数3 | |
void | setShaderAttribute (std::string name, int dim, std::vector< fk_TexCoord > *array) |
シェーダー内 attribute 変数設定関数4 | |
void | setShaderAttribute (std::string name, int dim, std::vector< fk_HVector > *array) |
シェーダー内 attribute 変数設定関数5 | |
void | modifyAttribute (std::string name) |
attribute 変数更新関数 | |
![]() | |
fk_Attribute (void) | |
コンストラクタ | |
virtual | ~fk_Attribute () |
デストラクタ | |
bool | setAttrII (const int key, const int value) |
キーが int 型、値が int 型である属性設定関数 | |
bool | setAttrID (const int key, const double value) |
キーが int 型、値が double 型である属性設定関数 | |
bool | setAttrIS (const int key, const std::string value) |
キーが int 型、値が std::string 型である属性設定関数 | |
bool | setAttrSI (const std::string key, const int value) |
キーが std::string 型、値が int 型である属性設定関数 | |
bool | setAttrSD (const std::string key, const double value) |
キーが std::string 型、値が double 型である属性設定関数 | |
bool | setAttrSS (const std::string key, const std::string value) |
キーが std::string 型、値が std::string 型である属性設定関数 | |
int | getAttrII (const int key) const |
キーが int 型、値が int 型である属性参照関数 | |
double | getAttrID (const int key) const |
キーが int 型、値が double 型である属性参照関数 | |
std::string | getAttrIS (const int key) const |
キーが int 型、値が std::string 型である属性参照関数 | |
int | getAttrSI (const std::string key) const |
キーが std::string 型、値が int 型である属性参照関数 | |
double | getAttrSD (const std::string key) const |
キーが std::string 型、値が double 型である属性参照関数 | |
std::string | getAttrSS (const std::string key) const |
キーが std::string 型、値が std::string 型である属性参照関数 | |
bool | existAttrII (const int key) const |
キーが int 型、値が int 型である属性存在参照関数 | |
bool | existAttrID (const int key) const |
キーが int 型、値が double 型である属性存在参照関数 | |
bool | existAttrIS (const int key) const |
キーが int 型、値が std::string 型である属性存在参照関数 | |
bool | existAttrSI (const std::string key) const |
キーが std::string 型、値が int 型である属性存在参照関数 | |
bool | existAttrSD (const std::string key) const |
キーが std::string 型、値が double 型である属性存在参照関数 | |
bool | existAttrSS (const std::string key) const |
キーが std::string 型、値が std::string 型である属性存在参照関数 | |
bool | deleteAttrII (const int key) |
キーが int 型、値が int 型である属性消去関数 | |
bool | deleteAttrID (const int key) |
キーが int 型、値が double 型である属性消去関数 | |
bool | deleteAttrIS (const int key) |
キーが int 型、値が std::string 型である属性消去関数 | |
bool | deleteAttrSI (const std::string key) |
キーが std::string 型、値が int 型である属性消去関数 | |
bool | deleteAttrSD (const std::string key) |
キーが std::string 型、値が double 型である属性消去関数 | |
bool | deleteAttrSS (const std::string key) |
キーが std::string 型、値が std::string 型である属性消去関数 | |
![]() | |
fk_BaseObject (fk_Type type=fk_Type::BASEOBJECT) | |
コンストラクタ | |
fk_Type | getObjectType (void) const |
タイプ取得関数 | |
その他の継承メンバ | |
![]() | |
void | setCtrlSize (int num) |
制御点数設定関数 | |
![]() | |
std::unique_ptr< fk_FVecArray > | _m_ctrlPos |
制御点配列 | |
Bezier曲線を生成、管理するクラス
このクラスは、形状として Bezier 曲線を制御する機能を提供します。 初期状態は 3 次式で、制御点が全て原点にある状態となります。 現状では、2,3,4次式のいずれかのみしか生成できません。
FK::fk_BezCurve::fk_BezCurve | ( | void | ) |
コンストラクタ
|
virtual |
デストラクタ
|
virtual |
bool FK::fk_BezCurve::setDegree | ( | int | deg | ) |
次数設定関数
この関数は、曲線の次数を設定します。 現状では、2,3,4のいずれかのみ以外は設定できません。 次数が増加した場合は、これまで保持されていた制御点位置ベクトルは保持され、 新たな制御点は原点に配置されます。 次数が減少した場合は、末尾の制御点が消失しますが、 存続している制御点の位置ベクトルは保持されます。
[in] | deg | 次数 |
int FK::fk_BezCurve::getDegree | ( | void | ) |
次数参照関数
曲線の次数を参照します。
|
virtual |
曲線算出関数
パラメータに対応する曲線上の点の位置ベクトルを返します。 Bezier 曲線の幾何的定義ではパラメータの定義域は 0 から 1 までですが、 本関数はそれ以外の範囲であっても式の演算結果を返します。
[in] | t | 曲線上のパラメータ |
FK::fk_Curveを実装しています。
|
virtual |
曲線1階微分ベクトル算出関数
パラメータに対応する曲線上の点の1階微分ベクトルを返します。 Bezier 曲線の幾何的定義ではパラメータの定義域は 0 から 1 までですが、 本関数はそれ以外の範囲であっても式の演算結果を返します。
[in] | t | 曲線上のパラメータ |
FK::fk_Curveを実装しています。
bool FK::fk_BezCurve::split | ( | double | t, |
std::vector< fk_Vector > * | C | ||
) |
曲線分割制御点算出関数
現在の曲線を任意のパラメータで2つに分割し、 その分割した曲線の制御点列を出力します。
[in] | t | 曲線上のパラメータ |
[out] | C | 分割した後の制御点配列。 元の曲線の次数を n としたとき、 出力配列は、0 〜 t までの部分の曲線制御点が C[0] 〜 C[n]、 t 〜 1 までの部分の曲線制御点が C[n] 〜 C[2n+1] となります。 |
直線交点算出関数
平面 (z = 0) 上にある Bezier 曲線と直線の交点パラメータを求めます。 等関数では、曲線や直線の全ての (z) 成分が無視されます。
[in] | S | 直線上の点。E とは異なる点である必要があります。 |
[in] | E | 直線上の点。S とは異なる点である必要があります。 |
[out] | A | 曲線上の交点パラメータ配列。 交点がない場合は空配列となります。 |
void FK::fk_BezCurve::calcCrossParam | ( | fk_Matrix | M, |
fk_Vector | S, | ||
fk_Vector | E, | ||
std::vector< double > * | A | ||
) |
変換行列付直線交点算出関数
平面 (z = 0) 上にある Bezier 曲線と直線の交点パラメータを求めます。 等関数では、曲線や直線の全ての (z) 成分が無視されます。
[in] | M | 曲線に対する変換行列。 fk_Model による移動や拡大縮小の反映後で交点を算出したい場合は、 ここに fk_MatAdmin::getMatrix() や fk_Model::getInhMatrix() で得た行列を代入します。 |
[in] | S | 直線上の点。E とは異なる点である必要があります。 |
[in] | E | 直線上の点。S とは異なる点である必要があります。 |
[out] | A | 曲線上の交点パラメータ配列。 交点がない場合は空配列となります。 |