FineKernelToolKit 4.3.0
読み取り中…
検索中…
一致する文字列を見つけられません
IndexFace.h
[詳解]
1#if !defined(__FK_INDEXFACE_HEADER__)
2#define __FK_INDEXFACE_HEADER__
3
4#include <FK/FVecArray.h>
5#include <FK/ParserBase.hh>
6#include <FK/ParserData.h>
7#include <list>
8
9namespace FK {
10
11 class fk_D3DXAnimation;
12 class fk_BVHBase;
13 class fk_Solid;
14
16
67
69
70#if !defined(FK_DOXYGEN_USER_PROCESS)
71 class Member {
72 public:
73 fk_FVecArray vertexPosition;
74 fk_FVecArray timeOrgPosition;
75 fk_FVecArray vertexNormal;
76 fk_FVecArray faceNormal;
77 std::vector<GLuint> edgeIndex;
78 std::vector<GLuint> faceIndex;
79 std::vector< std::vector<int> > loopStack;
80 std::vector<int> modifyList;
81 std::shared_ptr<fk_D3DXAnimation> anim;
82 std::vector< std::vector<int> > vertexMap;
83
84 bool cloneFlg;
85 std::list<fk_IndexFaceSet *> cloneList;
86 fk_IndexFaceSet *orgIFS;
87
88 // 編集があった場合に true, ない場合 false
89 bool edgeIndexFlg, faceIndexFlg;
90 std::vector<char> faceNormFlg;
91 std::vector<char> vertexNormFlg;
92
93 GLuint edgeIBO, faceIBO;
94 bool smoothMode;
95
96 Member(void);
97 };
98#endif
99
100 public:
101
104
107
108
110
117
120
122
129 bool readSMFFile(std::string fileName);
130
132
165 bool readVRMLFile(std::string fileName, bool materialFlg = true, bool solidFlg = true);
166
168
191 bool readSTLFile(std::string fileName, bool solidFlg = true, double tolerance = 1.0e-08);
192
194
201 bool readHRCFile(std::string fileName);
202
204
217 bool readRDSFile(std::string fileName, bool solidFlg = true);
218
220
232 bool readDXFFile(std::string fileName, bool solidFlg = true);
233
235
270 bool readMQOFile(std::string fileName,
271 std::string objName,
272 bool solidFlg = true,
273 bool contFlg = true,
274 bool materialFlg = false);
275
277
322 bool readMQOFile(std::string fileName,
323 std::string objName,
324 int materialID,
325 bool solidFlg = true,
326 bool contFlg = true,
327 bool materialFlg = false);
328
330
372 bool readMQOData(unsigned char *buffer,
373 std::string objName,
374 bool solidFlg = true,
375 bool contFlg = true,
376 bool materialFlg = false);
377
379
427 bool readMQOData(unsigned char *buffer,
428 std::string objName,
429 int materialID,
430 bool solidFlg = true,
431 bool contFlg = true,
432 bool materialFlg = false);
433
435
463 bool readD3DXFile(std::string fileName,
464 std::string objName,
465 bool solidFlg = true);
466
468
502 bool readD3DXFile(std::string fileName,
503 std::string objName,
504 int materialID,
505 bool solidFlg = true);
506
508
511
513
527 bool writeVRMLFile(std::string fileName,
528 fk_Material *material = nullptr,
529 bool triFlg = false);
530
532
555 bool writeVRMLFile(std::string fileName,
556 std::vector<double> *time,
557 std::vector<fk_Vector> *pos,
558 fk_Material *material = nullptr,
559 bool triFlg = false);
560
562
569 bool writeSTLFile(std::string fileName);
570
572
583 bool writeDXFFile(std::string fileName, bool triFlg = false);
584
586
593 bool writeMQOFile(std::string fileName);
595
598
600
605 int getPosSize(void);
606
608
613 int getEdgeSize(void);
614
616
621 int getFaceSize(void);
622
624
635 fk_Vector getPosVec(int vertexID);
636
638
647 std::vector<int> getFaceData(int faceID);
648
650
665 int getFaceData(int faceID, int vertexNum);
666
667
669
681 fk_Vector getFaceNorm(int faceID, int order = 0);
682
684
696 fk_Vector getVertexNorm(int vertexID, int order = 0);
697
699
702
704
721 bool moveVPosition(int vertexID, const fk_Vector &pos, int order = 0);
722
724
742 bool moveVPosition(int vertexID, double x, double y, double z, int order = 0);
743
745
763 bool moveVPosition(int vertexID, double *array, int order = 0);
764
766
797 void makeIFSet(int faceNum,
798 int polyNum,
799 int *IFSet,
800 int vertexNum,
801 fk_Vector *posArray,
802 bool smoothMode = false,
803 int order = 0);
804
806
833 void makeIFSet(int faceNum,
834 int polyNum,
835 int *IFSet,
836 int vertexNum,
837 fk_Vector *posArray,
838 int order);
839
841
867 void makeIFSet(std::vector< std::vector<int> > *faceArray,
868 std::vector<fk_Vector> *posArray,
869 bool smoothMode = false,
870 int order = 0);
871
873
895 void makeIFSet(std::vector< std::vector<int> > *faceArray,
896 std::vector<fk_Vector> *posArray,
897 int order);
898
900
925 bool setFaceNorm(int faceID, const fk_Vector &norm, int order = 0);
926
928
953 bool setVertexNorm(int vertexID, const fk_Vector &norm, int order = 0);
954
956
971 void flush(void);
972
974
977
979
989 void makePolygon(std::vector<fk_Vector> *posArray);
990
992
1003 void makePolygon(int num, fk_Vector *posArray);
1005
1008
1010
1033 void makeBlock(double x, double y, double z);
1034
1036
1048 void setBlockSize(double x, double y, double z);
1049
1051
1065 void setBlockSize(double length, fk_Axis axis);
1066
1068
1078 void setBlockScale(double scale);
1079
1081
1095 void setBlockScale(double scale, fk_Axis axis);
1096
1098
1110 void setBlockScale(double x, double y, double z);
1112
1115
1117
1136 void makeCircle(int div, double rad);
1137
1139
1149 void setCircleRadius(double rad);
1150
1152
1162 void setCircleDivide(int div);
1163
1165
1175 void setCircleScale(double scale);
1177
1180
1182
1200 void makeSphere(int div, double rad);
1201
1203
1213 void setSphereRadius(double rad);
1214
1216
1226 void setSphereDivide(int div);
1227
1229
1239 void setSphereScale(double scale);
1241
1244
1246
1271 void makePrism(int div, double top,
1272 double bottom, double height, bool smoothMode = false);
1273
1275
1285 void setPrismDivide(int div);
1286
1288
1298 void setPrismTopRadius(double top);
1299
1301
1311 void setPrismBottomRadius(double bottom);
1312
1314
1324 void setPrismHeight(double height);
1326
1329
1331
1355 void makeCone(int div, double rad, double height, bool smoothMode = true);
1356
1358
1368 void setConeDivide(int div);
1369
1371
1381 void setConeRadius(double rad);
1382
1384
1394 void setConeHeight(double height);
1396
1399
1401
1418 void makeCapsule(int div, double len, double rad);
1419
1421
1432 void setCapsuleSize(double len, double rad);
1434
1437
1439
1449 void putSolid(fk_Solid *solid);
1450
1452
1461 void setAnimationTime(double time);
1462
1464
1471 void setBVHMotion(fk_BVHBase *bvh);
1473
1474#if !defined(FK_DOXYGEN_USER_PROCESS)
1475
1476 bool MakeMesh(std::vector<fk_Vector> *,
1477 std::vector< std::vector<int> > *, bool = true);
1478
1479
1480 fk_D3DXAnimation * GetAnimation(void);
1481
1482 void DataPrint(void);
1483
1484 void EdgeIBOSetup(void);
1485 void FaceIBOSetup(void);
1486
1487 int getElemMaterialID(int);
1488 bool setElemMaterialID(int, int);
1489 void ForceUpdateAttr(void);
1490
1491 fk_Vector getPNorm(int faceID, int order = 0);
1492 fk_Vector getVNorm(int vertexID, int order = 0);
1493 bool setPNorm(int faceID, const fk_Vector &norm, int order = 0);
1494 bool setVNorm(int vertexID, const fk_Vector &norm, int order = 0);
1495
1496 void updateAttr(void);
1497
1498 std::vector<float> * GetVertexP(void);
1499 std::vector<float> * GetNormP(void);
1500
1501#endif
1502
1503 private:
1504 std::unique_ptr<Member> _m;
1505
1506 void InitFaceNorm(void);
1507 void InitVertexNorm(void);
1508
1509 void ModifyFaceNorm(void);
1510 void ModifyVertexNorm(void);
1511
1512 void MakeFaceNorm(int);
1513
1514 void ResetFaceFlg(void);
1515
1516 fk_FVector CalcTriNorm(GLuint *);
1517 fk_FVector CalcPolyNorm(int, int *);
1518 void MakeLoopTable(void);
1519 void MakeEdgeSet(std::vector< std::vector<int> > *);
1520
1521 void Init(void);
1522
1523 void DeleteCloneLink(fk_IndexFaceSet *);
1524
1525 void MakeCapsuleVec(std::vector<fk_Vector> *, int, double, double);
1526 void MakeCapsuleIFSet(std::vector< std::vector<int> > *, int);
1527 };
1528}
1529
1530#endif // !__FK_INDEXFACE_HEADER__
1531
1532/****************************************************************************
1533 *
1534 * Copyright (c) 1999-2024, Fine Kernel Project, All rights reserved.
1535 *
1536 * Redistribution and use in source and binary forms,
1537 * with or without modification, are permitted provided that the
1538 * following conditions are met:
1539 *
1540 * - Redistributions of source code must retain the above
1541 * copyright notice, this list of conditions and the
1542 * following disclaimer.
1543 *
1544 * - Redistributions in binary form must reproduce the above
1545 * copyright notice, this list of conditions and the
1546 * following disclaimer in the documentation and/or
1547 * other materials provided with the distribution.
1548 *
1549 * - Neither the name of the copyright holders nor the names
1550 * of its contributors may be used to endorse or promote
1551 * products derived from this software without specific
1552 * prior written permission.
1553 *
1554 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1555 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1556 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
1557 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
1558 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
1559 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
1560 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
1561 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
1562 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
1563 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
1564 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
1565 * POSSIBILITY OF SUCH DAMAGE.
1566 *
1567 ****************************************************************************/
1568/****************************************************************************
1569 *
1570 * Copyright (c) 1999-2024, Fine Kernel Project, All rights reserved.
1571 *
1572 * 本ソフトウェアおよびソースコードのライセンスは、基本的に
1573 * 「修正 BSD ライセンス」に従います。以下にその詳細を記します。
1574 *
1575 * ソースコード形式かバイナリ形式か、変更するかしないかを問わず、
1576 * 以下の条件を満たす場合に限り、再頒布および使用が許可されます。
1577 *
1578 * - ソースコードを再頒布する場合、上記の著作権表示、本条件一覧、
1579 * および下記免責条項を含めること。
1580 *
1581 * - バイナリ形式で再頒布する場合、頒布物に付属のドキュメント等の
1582 * 資料に、上記の著作権表示、本条件一覧、および下記免責条項を
1583 * 含めること。
1584 *
1585 * - 書面による特別の許可なしに、本ソフトウェアから派生した製品の
1586 * 宣伝または販売促進に、本ソフトウェアの著作権者の名前または
1587 * コントリビューターの名前を使用してはならない。
1588 *
1589 * 本ソフトウェアは、著作権者およびコントリビューターによって「現
1590 * 状のまま」提供されており、明示黙示を問わず、商業的な使用可能性、
1591 * および特定の目的に対する適合性に関す暗黙の保証も含め、またそれ
1592 * に限定されない、いかなる保証もないものとします。著作権者もコン
1593 * トリビューターも、事由のいかんを問わず、損害発生の原因いかんを
1594 * 問わず、かつ責任の根拠が契約であるか厳格責任であるか(過失その
1595 * 他の)不法行為であるかを問わず、仮にそのような損害が発生する可
1596 * 能性を知らされていたとしても、本ソフトウェアの使用によって発生
1597 * した(代替品または代用サービスの調達、使用の喪失、データの喪失、
1598 * 利益の喪失、業務の中断も含め、またそれに限定されない)直接損害、
1599 * 間接損害、偶発的な損害、特別損害、懲罰的損害、または結果損害に
1600 * ついて、一切責任を負わないものとします。
1601 *
1602 ****************************************************************************/
シェーダー内 attribute 変数用ベクトル管理クラス
Definition FVecArray.h:31
単精度浮動小数点型3次元ベクトルを管理するクラス
Definition Vector.h:760
void setCircleScale(double scale)
円形状拡大縮小関数
int getPosSize(void)
頂点数参照関数
bool readMQOFile(std::string fileName, std::string objName, int materialID, bool solidFlg=true, bool contFlg=true, bool materialFlg=false)
MQOファイル入力関数2
void setBVHMotion(fk_BVHBase *bvh)
BVHデータ設定関数
bool readMQOData(unsigned char *buffer, std::string objName, int materialID, bool solidFlg=true, bool contFlg=true, bool materialFlg=false)
MQOデータ入力関数2
void putSolid(fk_Solid *solid)
fk_Solid 出力関数
fk_Vector getPosVec(int vertexID)
頂点位置ベクトル参照関数
void makePolygon(std::vector< fk_Vector > *posArray)
多角形生成関数1
void setAnimationTime(double time)
アニメーション時間設定関数
void flush(void)
法線ベクトル強制計算関数
void cloneShape(fk_IndexFaceSet *ifs)
形状コピー関数
int getFaceSize(void)
面数参照関数
void setSphereDivide(int div)
球形状分割数設定関数
bool readD3DXFile(std::string fileName, std::string objName, bool solidFlg=true)
DirectX (D3DX) ファイル入力関数1
bool readMQOFile(std::string fileName, std::string objName, bool solidFlg=true, bool contFlg=true, bool materialFlg=false)
MQOファイル入力関数1
void setBlockScale(double scale, fk_Axis axis)
直方体軸方向拡大縮小関数
bool moveVPosition(int vertexID, const fk_Vector &pos, int order=0)
頂点移動関数1
bool readVRMLFile(std::string fileName, bool materialFlg=true, bool solidFlg=true)
VRML ファイル入力関数
bool setFaceNorm(int faceID, const fk_Vector &norm, int order=0)
面法線ベクトル設定関数
bool writeSTLFile(std::string fileName)
STL ファイル出力関数
void makeCapsule(int div, double len, double rad)
カプセル型形状生成関数
void setBlockSize(double x, double y, double z)
直方体辺長変更関数
bool readRDSFile(std::string fileName, bool solidFlg=true)
RDSファイル入力関数
void setConeRadius(double rad)
正多角錐(円錐)底面半径設定関数
bool writeVRMLFile(std::string fileName, fk_Material *material=nullptr, bool triFlg=false)
VRML ファイル出力関数1
virtual ~fk_IndexFaceSet()
デストラクタ
void makeCone(int div, double rad, double height, bool smoothMode=true)
正多角錐(円錐)形状生成関数
void setPrismTopRadius(double top)
正多角柱(円柱)上面半径設定関数
bool readDXFFile(std::string fileName, bool solidFlg=true)
DXFファイル入力関数
void setPrismBottomRadius(double bottom)
正多角柱(円柱)角数設定関数
int getEdgeSize(void)
稜線数参照関数
void setBlockSize(double length, fk_Axis axis)
直方体個別辺長設定関数
bool readMQOData(unsigned char *buffer, std::string objName, bool solidFlg=true, bool contFlg=true, bool materialFlg=false)
MQOデータ入力関数1
int getFaceData(int faceID, int vertexNum)
頂点 ID 参照関数
bool readHRCFile(std::string fileName)
HRCファイル入力関数
bool writeMQOFile(std::string fileName)
MQO ファイル出力関数
bool readSTLFile(std::string fileName, bool solidFlg=true, double tolerance=1.0e-08)
STL ファイル入力関数
bool writeVRMLFile(std::string fileName, std::vector< double > *time, std::vector< fk_Vector > *pos, fk_Material *material=nullptr, bool triFlg=false)
VRML ファイル出力関数2
void setCapsuleSize(double len, double rad)
カプセル型形状寸法設定関数
void setSphereScale(double scale)
球形状拡大縮小関数
void setPrismHeight(double height)
正多角柱(円柱)高さ設定関数
bool readD3DXFile(std::string fileName, std::string objName, int materialID, bool solidFlg=true)
DirectX (D3DX) ファイル入力関数2
bool writeDXFFile(std::string fileName, bool triFlg=false)
DXF ファイル出力関数
bool readSMFFile(std::string fileName)
SMFファイル入力関数
void makePrism(int div, double top, double bottom, double height, bool smoothMode=false)
正多角柱(円柱)形状生成関数
void makeCircle(int div, double rad)
円形状生成関数
fk_Vector getVertexNorm(int vertexID, int order=0)
頂点法線ベクトル取得関数
fk_IndexFaceSet(void)
コンストラクタ
void setBlockScale(double x, double y, double z)
直方体軸方向個別拡大縮小関数
std::vector< int > getFaceData(int faceID)
頂点 ID 配列参照関数
void makePolygon(int num, fk_Vector *posArray)
多角形生成関数2
void setBlockScale(double scale)
直方体全体拡大縮小関数
void makeIFSet(std::vector< std::vector< int > > *faceArray, std::vector< fk_Vector > *posArray, bool smoothMode=false, int order=0)
任意形状生成関数3
fk_Vector getFaceNorm(int faceID, int order=0)
面法線ベクトル取得関数
void makeIFSet(int faceNum, int polyNum, int *IFSet, int vertexNum, fk_Vector *posArray, bool smoothMode=false, int order=0)
任意形状生成関数1
bool moveVPosition(int vertexID, double x, double y, double z, int order=0)
頂点移動関数2
void setCircleDivide(int div)
円形状分割数設定関数
void setConeDivide(int div)
正多角錐(円錐)角数設定関数
void setPrismDivide(int div)
正多角柱(円柱)角数設定関数
void setConeHeight(double height)
正多角錐(円錐)高さ設定関数
bool moveVPosition(int vertexID, double *array, int order=0)
頂点移動関数3
void makeIFSet(std::vector< std::vector< int > > *faceArray, std::vector< fk_Vector > *posArray, int order)
任意形状生成関数4
void setCircleRadius(double rad)
円形状半径設定関数
void makeSphere(int div, double rad)
球形状生成関数
void setSphereRadius(double rad)
球形状半径設定関数
void makeIFSet(int faceNum, int polyNum, int *IFSet, int vertexNum, fk_Vector *posArray, int order)
任意形状生成関数2
void makeBlock(double x, double y, double z)
直方体生成関数
bool setVertexNorm(int vertexID, const fk_Vector &norm, int order=0)
頂点法線ベクトル設定関数
マテリアル(質感)を管理するクラス
Definition Material.h:40
ファイル入出力機能用抽象クラス
Definition ParserData.h:15
半稜線構造 (Half-Edge Structure) による任意形状を生成、管理するクラス
Definition Solid.h:66
3次元ベクトルを管理するクラス
Definition Vector.h:45
Fine Kernel Toolkit 名前空間
Definition Angle.h:6
fk_Axis
座標軸を表す列挙型
Definition Vector.h:16