FineKernelToolKit 4.3.0
読み取り中…
検索中…
一致する文字列を見つけられません
FK::fk_Point クラス

点群を生成、管理するクラス [詳解]

#include <FK/Point.h>

FK::fk_Point の継承関係図
FK::fk_Point 連携図

公開メンバ関数

 fk_Point (std::vector< fk_Vector > *array=nullptr)
 コンストラクタ
virtual ~fk_Point ()
 デストラクタ
int pushVertex (const fk_Vector &pos)
 頂点追加関数
bool setVertex (int ID, const fk_Vector &pos)
 頂点位置設定関数
bool setVertex (std::vector< fk_Vector > *array)
 点群生成関数
bool removeVertex (int ID)
 頂点削除関数
fk_Vector getVertex (int ID)
 頂点位置ベクトル取得関数
int getSize (void)
 頂点数取得関数
void setDrawMode (int ID, bool mode)
 頂点描画制御関数
bool getDrawMode (int ID)
 個別頂点描画状態参照関数
void setColor (int vID, fk_Color col)
 個別色設定関数1
void setColor (int vID, fk_Color *col)
 個別色設定関数2
fk_Color getColor (int vID)
 個別色取得関数
void allClear (void)
 点群全消去関数
基底クラス FK::fk_Shape に属する継承公開メンバ関数
 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::fk_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::fk_BaseObject に属する継承公開メンバ関数
 fk_BaseObject (fk_Type type=fk_Type::BASEOBJECT)
 コンストラクタ
fk_Type getObjectType (void) const
 タイプ取得関数

詳解

点群を生成、管理するクラス

このクラスは、形状として点群を制御する機能を提供します。 1つのインスタンスで、複数の点を制御することが可能です。

このクラスの機能は大きく以下のようなものとなります。

  • 点の生成や消去
  • 点の移動
  • 各点の描画有無の設定
  • 各店の描画色の設定

このクラスと同様に点群を扱うクラスとして、 fk_Particlefk_ParticleSet があります。 fk_Point が点の制御を直接的に行うのに対し、 fk_Particlefk_ParticleSet では 法則を記述することが主であるという特徴があります。

参照
fk_Shape, fk_Particle, fk_ParticleSet

構築子と解体子

◆ fk_Point()

FK::fk_Point::fk_Point ( std::vector< fk_Vector > * array = nullptr)

コンストラクタ

引数として vector による fk_Vector 型の配列を与えることによって、 最初から点群を生成することができます。

引数
[in]array点群位置ベクトル配列。nullptr の場合は何も生成しません。

◆ ~fk_Point()

virtual FK::fk_Point::~fk_Point ( )
virtual

デストラクタ

関数詳解

◆ pushVertex()

int FK::fk_Point::pushVertex ( const fk_Vector & pos)

頂点追加関数

頂点を新たに追加します。

引数
[in]pos追加する頂点の位置ベクトル
戻り値
新しい頂点の ID

◆ setVertex() [1/2]

bool FK::fk_Point::setVertex ( int ID,
const fk_Vector & pos )

頂点位置設定関数

点群中の任意の頂点に対し、位置を設定します。

引数
[in]ID頂点ID
[in]pos移動先の位置ベクトル
戻り値
移動に成功すれば true を、失敗すれば false を返します。

◆ setVertex() [2/2]

bool FK::fk_Point::setVertex ( std::vector< fk_Vector > * array)

点群生成関数

◆ removeVertex()

bool FK::fk_Point::removeVertex ( int ID)

頂点削除関数

◆ getVertex()

fk_Vector FK::fk_Point::getVertex ( int ID)

頂点位置ベクトル取得関数

指定した頂点の位置ベクトルを返します。

引数
[in]ID頂点ID
戻り値
頂点の位置ベクトル 指定した頂点が存在しない場合はゼロベクトルを返します。

◆ getSize()

int FK::fk_Point::getSize ( void )

頂点数取得関数

点群の頂点数を返します。

戻り値
頂点数

◆ setDrawMode()

void FK::fk_Point::setDrawMode ( int ID,
bool mode )

頂点描画制御関数

個別の頂点に対し、描画の有無を設定します。

引数
[in]ID頂点ID
[in]modetrue であれば描画を有効に、false であれば無効にします。

◆ getDrawMode()

bool FK::fk_Point::getDrawMode ( int ID)

個別頂点描画状態参照関数

個別の頂点に対し、描画状況を取得します。

引数
[in]ID頂点ID
戻り値
描画が有効であれば true を、無効であれば false を返します。 指定した ID を持つ頂点が存在しなかった場合も false を返します。

◆ setColor() [1/2]

void FK::fk_Point::setColor ( int vID,
fk_Color col )

個別色設定関数1

点の色を個別に設定します。 この色設定によって表示するには、 fk_Model::setElementMode()fk_ElementMode::ELEMENT を設定しておく必要があります。

引数
[in]vID要素ID
[in]col色値

◆ setColor() [2/2]

void FK::fk_Point::setColor ( int vID,
fk_Color * col )

個別色設定関数2

点の色を個別に設定します。 この色設定によって表示するには、 fk_Model::setElementMode()fk_ElementMode::ELEMENT を設定しておく必要があります。

引数
[in]vID要素ID
[in]col色値

◆ getColor()

fk_Color FK::fk_Point::getColor ( int vID)

個別色取得関数

個別に登録されている点の色を取得します。

引数
[in]vID要素ID
戻り値
色値

◆ allClear()

void FK::fk_Point::allClear ( void )

点群全消去関数

全ての頂点に関するデータを消去します。