FineKernelToolKit 4.2.13
読み取り中…
検索中…
一致する文字列を見つけられません
公開メンバ関数 | 全メンバ一覧
FK::fk_Block クラス

直方体を生成、管理するクラス [詳解]

#include <FK/Block.h>

+ FK::fk_Block の継承関係図
+ FK::fk_Block 連携図

公開メンバ関数

 fk_Block (double x=1.0, double y=1.0, double z=1.0)
 コンストラクタ
 
virtual ~fk_Block ()
 デストラクタ
 
void setSize (double x, double y, double z)
 各辺長設定関数
 
void setSize (double length, fk_Axis axis)
 個別辺長設定関数
 
void setScale (double scale)
 全体拡大縮小関数
 
void setScale (double scale, fk_Axis axis)
 軸方向拡大縮小関数
 
void setScale (double x, double y, double z)
 軸方向個別拡大縮小関数
 
- 基底クラス FK::fk_IndexFaceSet に属する継承公開メンバ関数
 fk_IndexFaceSet (void)
 コンストラクタ
 
virtual ~fk_IndexFaceSet ()
 デストラクタ
 
void cloneShape (fk_IndexFaceSet *ifs)
 形状コピー関数
 
bool readSMFFile (std::string fileName)
 SMFファイル入力関数
 
bool readVRMLFile (std::string fileName, bool materialFlg=true, bool solidFlg=true)
 VRML ファイル入力関数
 
bool readSTLFile (std::string fileName, bool solidFlg=true, double tolerance=1.0e-08)
 STL ファイル入力関数
 
bool readHRCFile (std::string fileName)
 HRCファイル入力関数
 
bool readRDSFile (std::string fileName, bool solidFlg=true)
 RDSファイル入力関数
 
bool readDXFFile (std::string fileName, bool solidFlg=true)
 DXFファイル入力関数
 
bool readMQOFile (std::string fileName, std::string objName, bool solidFlg=true, bool contFlg=true, bool materialFlg=false)
 MQOファイル入力関数1
 
bool readMQOFile (std::string fileName, std::string objName, int materialID, bool solidFlg=true, bool contFlg=true, bool materialFlg=false)
 MQOファイル入力関数2
 
bool readMQOData (unsigned char *buffer, std::string objName, bool solidFlg=true, bool contFlg=true, bool materialFlg=false)
 MQOデータ入力関数1
 
bool readMQOData (unsigned char *buffer, std::string objName, int materialID, bool solidFlg=true, bool contFlg=true, bool materialFlg=false)
 MQOデータ入力関数2
 
bool readD3DXFile (std::string fileName, std::string objName, bool solidFlg=true)
 DirectX (D3DX) ファイル入力関数1
 
bool readD3DXFile (std::string fileName, std::string objName, int materialID, bool solidFlg=true)
 DirectX (D3DX) ファイル入力関数2
 
bool writeVRMLFile (std::string fileName, fk_Material *material=nullptr, bool triFlg=false)
 VRML ファイル出力関数1
 
bool writeVRMLFile (std::string fileName, std::vector< double > *time, std::vector< fk_Vector > *pos, fk_Material *material=nullptr, bool triFlg=false)
 VRML ファイル出力関数2
 
bool writeSTLFile (std::string fileName)
 STL ファイル出力関数
 
bool writeDXFFile (std::string fileName, bool triFlg=false)
 DXF ファイル出力関数
 
bool writeMQOFile (std::string fileName)
 MQO ファイル出力関数
 
int getPosSize (void)
 頂点数参照関数
 
int getEdgeSize (void)
 稜線数参照関数
 
int getFaceSize (void)
 面数参照関数
 
fk_Vector getPosVec (int vertexID)
 頂点位置ベクトル参照関数
 
std::vector< int > getFaceData (int faceID)
 頂点 ID 配列参照関数
 
int getFaceData (int faceID, int vertexNum)
 頂点 ID 参照関数
 
fk_Vector getFaceNorm (int faceID, int order=0)
 面法線ベクトル取得関数
 
fk_Vector getVertexNorm (int vertexID, int order=0)
 頂点法線ベクトル取得関数
 
bool moveVPosition (int vertexID, const fk_Vector &pos, int order=0)
 頂点移動関数1
 
bool moveVPosition (int vertexID, double x, double y, double z, int order=0)
 頂点移動関数2
 
bool moveVPosition (int vertexID, double *array, int order=0)
 頂点移動関数3
 
void makeIFSet (int faceNum, int polyNum, int *IFSet, int vertexNum, fk_Vector *posArray, bool smoothMode=false, int order=0)
 任意形状生成関数1
 
void makeIFSet (int faceNum, int polyNum, int *IFSet, int vertexNum, fk_Vector *posArray, int order)
 任意形状生成関数2
 
void makeIFSet (std::vector< std::vector< int > > *faceArray, std::vector< fk_Vector > *posArray, bool smoothMode=false, int order=0)
 任意形状生成関数3
 
void makeIFSet (std::vector< std::vector< int > > *faceArray, std::vector< fk_Vector > *posArray, int order)
 任意形状生成関数4
 
bool setFaceNorm (int faceID, const fk_Vector &norm, int order=0)
 面法線ベクトル設定関数
 
bool setVertexNorm (int vertexID, const fk_Vector &norm, int order=0)
 頂点法線ベクトル設定関数
 
void flush (void)
 法線ベクトル強制計算関数
 
void makePolygon (std::vector< fk_Vector > *posArray)
 多角形生成関数1
 
void makePolygon (int num, fk_Vector *posArray)
 多角形生成関数2
 
void makeBlock (double x, double y, double z)
 直方体生成関数
 
void setBlockSize (double x, double y, double z)
 直方体辺長変更関数
 
void setBlockSize (double length, fk_Axis axis)
 直方体個別辺長設定関数
 
void setBlockScale (double scale)
 直方体全体拡大縮小関数
 
void setBlockScale (double scale, fk_Axis axis)
 直方体軸方向拡大縮小関数
 
void setBlockScale (double x, double y, double z)
 直方体軸方向個別拡大縮小関数
 
void makeCircle (int div, double rad)
 円形状生成関数
 
void setCircleRadius (double rad)
 円形状半径設定関数
 
void setCircleDivide (int div)
 円形状分割数設定関数
 
void setCircleScale (double scale)
 円形状拡大縮小関数
 
void makeSphere (int div, double rad)
 球形状生成関数
 
void setSphereRadius (double rad)
 球形状半径設定関数
 
void setSphereDivide (int div)
 球形状分割数設定関数
 
void setSphereScale (double scale)
 球形状拡大縮小関数
 
void makePrism (int div, double top, double bottom, double height, bool smoothMode=false)
 正多角柱(円柱)形状生成関数
 
void setPrismDivide (int div)
 正多角柱(円柱)角数設定関数
 
void setPrismTopRadius (double top)
 正多角柱(円柱)上面半径設定関数
 
void setPrismBottomRadius (double bottom)
 正多角柱(円柱)角数設定関数
 
void setPrismHeight (double height)
 正多角柱(円柱)高さ設定関数
 
void makeCone (int div, double rad, double height, bool smoothMode=true)
 正多角錐(円錐)形状生成関数
 
void setConeDivide (int div)
 正多角錐(円錐)角数設定関数
 
void setConeRadius (double rad)
 正多角錐(円錐)底面半径設定関数
 
void setConeHeight (double height)
 正多角錐(円錐)高さ設定関数
 
void makeCapsule (int div, double len, double rad)
 カプセル型形状生成関数
 
void setCapsuleSize (double len, double rad)
 カプセル型形状寸法設定関数
 
void putSolid (fk_Solid *solid)
 fk_Solid 出力関数
 
void setAnimationTime (double time)
 アニメーション時間設定関数
 
void setBVHMotion (fk_BVHBase *bvh)
 BVHデータ設定関数
 
- 基底クラス 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
 タイプ取得関数
 

詳解

直方体を生成、管理するクラス

このクラスは、形状として直方体を制御する機能を提供します。 直方体は、物体の中心が原点に来るように配置されます。 従って、(x, y, z) という大きさで直方体を生成した場合、 各頂点の位置ベクトルは以下のようになります。

このクラスは、実質的には fk_IndexFaceSet クラスの派生クラスであり、 生成後に fk_IndexFaceSet クラスの機能によって頂点を移動することが可能です。

参照
fk_IndexFaceSet, fk_Shape, fk_Model

構築子と解体子

◆ fk_Block()

FK::fk_Block::fk_Block ( double  x = 1.0,
double  y = 1.0,
double  z = 1.0 
)

コンストラクタ

引数として、各軸方向の幅を入力できます。 引数を省略した場合は、辺長が 1 の立方体を生成します。

引数
[in]xx方向の辺長
[in]yy方向の辺長
[in]zz方向の辺長

◆ ~fk_Block()

virtual FK::fk_Block::~fk_Block ( )
virtual

デストラクタ

関数詳解

◆ setSize() [1/2]

void FK::fk_Block::setSize ( double  x,
double  y,
double  z 
)

各辺長設定関数

直方体の各軸方向の辺長を一括して設定します。

引数
[in]xx方向の辺長
[in]yy方向の辺長
[in]zz方向の辺長

◆ setSize() [2/2]

void FK::fk_Block::setSize ( double  length,
fk_Axis  axis 
)

個別辺長設定関数

直方体の辺長を個別に設定します。

引数
[in]length辺長
[in]axis軸方向。以下のいずれかを指定します。
  • fk_X x方向
  • fk_Y y方向
  • fk_Z z方向

◆ setScale() [1/3]

void FK::fk_Block::setScale ( double  scale)

全体拡大縮小関数

直方体全体を、指定された倍率で拡大・縮小します。

引数
[in]scale倍率

◆ setScale() [2/3]

void FK::fk_Block::setScale ( double  scale,
fk_Axis  axis 
)

軸方向拡大縮小関数

直方体を、指定された軸方向についてのみ拡大・縮小します。

引数
[in]scale倍率
[in]axis軸方向。以下のいずれかを指定します。
  • fk_X x方向
  • fk_Y y方向
  • fk_Z z方向

◆ setScale() [3/3]

void FK::fk_Block::setScale ( double  x,
double  y,
double  z 
)

軸方向個別拡大縮小関数

直方体を、各軸方向に対し個別の倍率で拡大・縮小します。

引数
[in]xx方向の倍率
[in]yy方向の倍率
[in]zz方向の倍率