FineKernelToolKit 4.2.13
|
多角形を生成、管理するクラス [詳解]
#include <FK/Polygon.h>
公開メンバ関数 | |
fk_Polygon (std::vector< fk_Vector > *posArray=nullptr) | |
コンストラクタ | |
virtual | ~fk_Polygon () |
デストラクタ | |
void | setVertex (std::vector< fk_Vector > *posArray) |
形状生成関数1 | |
void | setVertex (int num, fk_Vector *posArray) |
形状生成関数2 | |
![]() | |
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_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 |
タイプ取得関数 | |
多角形を生成、管理するクラス
このクラスは、形状として多角形を制御する機能を提供します。 このクラスによる形状は、多角形の内部も描画します。 もし辺のみを描画したい場合は fk_Closedline クラスを利用して下さい。
描画される面は、基本的には多角形の頂点順番が向かって 反時計回りになっている側になります。 両面を描画したい場合は fk_Model の setDrawMode() 関数を参照して下さい。 また、本クラスの多角形の角数は 3 以上であれば制限はありませんが、 同一平面上にある凸多角形を前提としています。 その条件を満たしていない場合の描画結果は保証されません。
FK::fk_Polygon::fk_Polygon | ( | std::vector< fk_Vector > * | posArray = nullptr | ) |
コンストラクタ
詳細は setVertex(std::vector<fk_Vector> *) を参照して下さい。 引数を省略した場合、初期状態は空となります。
[in] | posArray | 多角形頂点配列 |
|
virtual |
デストラクタ
void FK::fk_Polygon::setVertex | ( | std::vector< fk_Vector > * | posArray | ) |
形状生成関数1
多角形 (ポリゴン) を生成します。 頂点を結ぶ境界線が反時計回りに見える側が表になります。 現時点では凸多角形のみサポートしており、 非凸多角形が入力された場合の動作は保証されません。
生成後、頂点を移動するには moveVPosition() を利用して下さい。
[in] | posArray | 多角形頂点配列 |
void FK::fk_Polygon::setVertex | ( | int | num, |
fk_Vector * | posArray | ||
) |
形状生成関数2
多角形 (ポリゴン) を生成します。 頂点を結ぶ境界線が反時計回りに見える側が表になります。 現時点では凸多角形のみサポートしており、 非凸多角形が入力された場合の動作は保証されません。
生成後、頂点を移動するには moveVPosition() を利用して下さい。
[in] | num | 頂点数 |
[in] | posArray | 多角形頂点配列 |