JunkBox_Lib++ (for Windows) 1.10.1
|
MeshObject の Polygonデータ(1面)を格納するクラス.リスト構造を取る. More...
#include <MeshFacetNode.h>
Public Member Functions | |
MeshFacetNode (void) | |
virtual | ~MeshFacetNode (void) |
void | init (void) |
void | free (void) |
void | free_value (void) |
void | del_nodes (MeshFacetNode *next) |
void | clear (void) |
void | set (int vertex, int polygon, int vcount=3) |
bool | getm (int vertex=0, int polygon=0, int vcount=0) |
メモリの確保 | |
void | setFacetNo (int no) |
void | setMaterialParam (MaterialParam param) |
ノードにマテリアルパラメータを設定し,他のノードに同じマテリアルが存在するかチャックする. | |
void | delMaterialParam (void) |
void | setMaterialID (const char *str) |
void * | getMaterialID (void) |
void | execAffineTransUVMap (UVMap< double > *uvmap=NULL, int num=-1) |
UVMap< double > * | generatePlanarUVMap (Vector< double > scale, UVMap< double > *uvmap=NULL) |
bool | computeVertexDirect (ContourBaseData *facetdata) |
bool | computeVertexByBREP (ContourBaseData *facetdata) |
bool | computeVertexDirect (Vector< double > *vtx, Vector< double > *nml, UVMap< double > *map, ArrayParam< int > *wgt, int num, int vcount=3) |
bool | computeVertexByBREP (Vector< double > *vtx, Vector< double > *nml, UVMap< double > *map, ArrayParam< int > *wgt, int num, int vcount=3) |
Public Attributes | |
Buffer | material_id |
マテリアルを識別するID.JBXL_MATERIAL_PREFIX で始まる. | |
bool | same_material |
他の Node が既に同じマテリアルを使用している. | |
int | facet_no |
面(Polygon)番号 | |
MaterialParam | material_param |
マテリアルパラメータ | |
int | num_index |
頂点の延べ数.num_polygon*MeshObjectData::num_vcount (num_polygon*3)(data_index の要素数) | |
int | num_polygon |
ポリゴンの数 | |
int | num_vertex |
頂点のデータ数.(vertex_value, normal_value の要素数) | |
int | num_texcrd |
テクスチャ画像の座標数.通常は num_vertex に等しい.(texcrd_value の要素数) | |
int * | data_index |
インデックスデータ.要素数は num_index | |
Vector< double > * | vertex_value |
頂点データの並び.要素数は num_vertex | |
Vector< double > * | normal_value |
法線ベクトルデータの並び.要素数は num_vertex | |
UVMap< double > * | texcrd_value |
テクスチャマップの並び.要素数は num_texcrd | |
ArrayParam< int > * | weight_value |
頂点の重み.Jointを持つデータに使用される.要素数は num_vertex. 各 weight_value[i] の値は トータルで正規化される必要がある. | |
MeshFacetNode * | next |
MeshFacetNode * | prev |
data_index[i*3], data_index[i*3+1], data_index[i*3+2] が示す vertex_value, normal_value, texcrd_value で一つの面(3角ポリゴン)を形成する. 例えば,vertex_value[data_index[i*3]], vertex_value[data_index[i*3+1]], vertex_value[data_index[i*3+2]] で3角ポリゴン座標を表す.
旧バージョンから名前変更:MeshObjectNode -> MeshFacetNode
Definition at line 33 of file MeshFacetNode.h.
|
inline |
Definition at line 57 of file MeshFacetNode.h.
References MeshFacetNode::init().
|
inlinevirtual |
Definition at line 58 of file MeshFacetNode.h.
References MeshFacetNode::free().
void clear | ( | void | ) |
Definition at line 149 of file MeshFacetNode.cpp.
References MeshFacetNode::free(), and MeshFacetNode::init().
bool computeVertexByBREP | ( | ContourBaseData * | facetdata | ) |
bool MeshFacetNode::computeVertexByBREP(ContourBaseData* facetdata)
BREPを使用して,頂点データを処理する.頂点データは再インデックス化される
データがインデックス化されていない場合,重複頂点を削除するのでデータサイズが小さくなる.
法線ベクトルが計算されていない場合(facetdata->normal がNULLの場合),法線ベクトルを計算する.
頂点数が多い場合は,処理に時間が掛かる.
facetdata | ContourBaseDataへのポインタ. |
Definition at line 247 of file MeshFacetNode.cpp.
References jbxl::BREP_SOLID, BREP_SOLID::contours, jbxl::CreateTriSolidFromVector(), MeshFacetNode::data_index, ArrayParam< T >::dup(), BREP_SOLID::facetno, MeshFacetNode::free(), jbxl::freeBrepSolid(), MeshFacetNode::getm(), jbxl::GetOctreeVertices(), BREP_VERTEX::index, ContourBaseData::index, BREP_WING::next, BREP_VERTEX::normal, ContourBaseData::normal, MeshFacetNode::normal_value, ContourBaseData::num_data, MeshFacetNode::num_vertex, BREP_SOLID::octree, BREP_VERTEX::point, MeshFacetNode::set(), ContourBaseData::texcrd, MeshFacetNode::texcrd_value, BREP_VERTEX::uvmap, ContourBaseData::vcount, BREP_WING::vertex, ContourBaseData::vertex, MeshFacetNode::vertex_value, ContourBaseData::weight, and MeshFacetNode::weight_value.
Referenced by MeshObjectData::addNode().
bool computeVertexByBREP | ( | Vector< double > * | impvtx, |
Vector< double > * | impnrm, | ||
UVMap< double > * | impmap, | ||
ArrayParam< int > * | impwgt, | ||
int | impnum, | ||
int | vcount = 3 ) |
BREPを使用して,頂点データを処理する.頂点データは再インデックス化される
データがインデックス化されていない場合,重複頂点を削除するのでデータサイズが小さくなる.
法線ベクトルが計算されていない場合(ipnrmがNULLの場合),法線ベクトルを計算する.
頂点数が多い場合は,処理に時間が掛かる.
impvtx | インポートする頂点の座標データ.(必須) |
impnrm | インポートする法線ベクトルデータ.NULLの場合,再計算が行われる.(オプション) |
impmap | インポートする頂点のUVマップデータ.(オプション) |
impmap | インポートする頂点の重みデータ.(オプション) |
impnum | インポートするデータの数 |
vcount | ポリゴンの頂点数.通常は 3 |
Definition at line 361 of file MeshFacetNode.cpp.
References jbxl::BREP_SOLID, BREP_SOLID::contours, jbxl::CreateTriSolidFromVector(), MeshFacetNode::data_index, ArrayParam< T >::dup(), BREP_SOLID::facetno, MeshFacetNode::free(), jbxl::freeBrepSolid(), MeshFacetNode::getm(), jbxl::GetOctreeVertices(), BREP_VERTEX::index, BREP_WING::next, BREP_VERTEX::normal, MeshFacetNode::normal_value, MeshFacetNode::num_vertex, BREP_SOLID::octree, BREP_VERTEX::point, MeshFacetNode::set(), MeshFacetNode::texcrd_value, BREP_VERTEX::uvmap, BREP_WING::vertex, MeshFacetNode::vertex_value, and MeshFacetNode::weight_value.
bool computeVertexDirect | ( | ContourBaseData * | facetdata | ) |
bool MeshFacetNode::computeVertexDirect(ContourBaseData* facetdata)
インデックス化された頂点データを直接 MeshObjectのデータとしてインポートする.
facetdata | ContourBaseDataへのポインタ. |
Definition at line 209 of file MeshFacetNode.cpp.
References MeshFacetNode::data_index, ArrayParam< T >::dup(), MeshFacetNode::getm(), ContourBaseData::index, ContourBaseData::normal, MeshFacetNode::normal_value, ContourBaseData::num_data, ContourBaseData::num_index, MeshFacetNode::num_texcrd, MeshFacetNode::num_vertex, MeshFacetNode::set(), ContourBaseData::texcrd, MeshFacetNode::texcrd_value, ContourBaseData::vcount, ContourBaseData::vertex, MeshFacetNode::vertex_value, ContourBaseData::weight, and MeshFacetNode::weight_value.
Referenced by MeshObjectData::addNode(), and MeshObjectData::addNode().
bool computeVertexDirect | ( | Vector< double > * | impvtx, |
Vector< double > * | impnrm, | ||
UVMap< double > * | impmap, | ||
ArrayParam< int > * | impwgt, | ||
int | impnum, | ||
int | vcount = 3 ) |
整列化(インデックス化ではない)された頂点データを直接 MeshObjectのデータとしてインポートする.
元のデータの再現性が良い.処理時間が早い.
法線ベクトルが必須.データサイズは大きくなる.
impvtx | インポートする頂点の座標データ(必須) |
impnrm | インポートする法線ベクトルデータ(必須) |
impmap | インポートする頂点のUVマップデータ(オプション) |
impwgt | インポートする頂点の重みデータ(オプション) |
impnum | インポートするデータの数 |
vcount | ポリゴンの頂点数.通常は 3 |
Definition at line 318 of file MeshFacetNode.cpp.
References MeshFacetNode::data_index, ArrayParam< T >::dup(), MeshFacetNode::getm(), MeshFacetNode::normal_value, MeshFacetNode::num_vertex, MeshFacetNode::set(), MeshFacetNode::texcrd_value, MeshFacetNode::vertex_value, and MeshFacetNode::weight_value.
void del_nodes | ( | MeshFacetNode * | next | ) |
|
inline |
Definition at line 73 of file MeshFacetNode.h.
References MaterialParam::clear(), and MeshFacetNode::material_param.
Referenced by MeshFacetNode::free().
void execAffineTransUVMap | ( | UVMap< double > * | uvmap = NULL, |
int | num = -1 ) |
Definition at line 414 of file MeshFacetNode.cpp.
References TextureParam::execTrans(), MeshFacetNode::material_param, MeshFacetNode::num_texcrd, MeshFacetNode::texcrd_value, and MaterialParam::texture.
Referenced by FBXData::addShell(), OBJData::addShell(), ColladaXML::addTexcrdSource(), and GLTFData::execAffineUVMap().
void free | ( | void | ) |
next 以降は freeMeshFacetList() で解放する.
Definition at line 125 of file MeshFacetNode.cpp.
References MeshFacetNode::delMaterialParam(), free_Buffer(), MeshFacetNode::free_value(), and MeshFacetNode::material_id.
Referenced by MeshFacetNode::clear(), MeshFacetNode::computeVertexByBREP(), MeshFacetNode::computeVertexByBREP(), jbxl::freeMeshFacetNode(), MeshFacetNode::getm(), and MeshFacetNode::~MeshFacetNode().
void free_value | ( | void | ) |
Definition at line 133 of file MeshFacetNode.cpp.
References MeshFacetNode::data_index, jbxl::freeNull(), MeshFacetNode::normal_value, MeshFacetNode::num_vertex, MeshFacetNode::texcrd_value, MeshFacetNode::vertex_value, and MeshFacetNode::weight_value.
Referenced by MeshFacetNode::free(), and MeshFacetNode::getm().
UVMap<double>* MeshFacetNode::generatePlanarUVMap(Vector<double> scale, UVMap<double>* uvmap)
頂点データから,各 nodeの Planar UVマップを生成する
頂点データ(vertex_value, normal_value) がインポート済みでなければならない.
scale | オブジェクトのサイズ |
uvmap | 生成したオブジェクトを格納する UVMapへのポインタ(サイズは num_texcrd). NULLの場合は領域を新たに確保する. |
Definition at line 437 of file MeshFacetNode.cpp.
References MeshFacetNode::normal_value, MeshFacetNode::num_texcrd, MeshFacetNode::num_vertex, Vector< T >::set(), UVMap< T >::u, UVMap< T >::v, MeshFacetNode::vertex_value, Vector< T >::x, Vector< T >::y, and Vector< T >::z.
Referenced by FBXData::addShell(), OBJData::addShell(), ColladaXML::addTexcrdSource(), and GLTFData::execAffineUVMap().
bool getm | ( | int | vertex = 0, |
int | polygon = 0, | ||
int | vcount = 0 ) |
bool MeshFacetNode::getm(int vertex, int polygon, int vcount)
必要なメモリを確保する. 失敗,成功に係らず,以前のメモリは開放される.
true | メモリの確保に成功. |
false | メモリの確保に失敗. |
vertex | 頂点の数 |
polygon | ポリゴンの数 |
vcount | 1ポリゴン当たりの頂点数(固定) |
Definition at line 169 of file MeshFacetNode.cpp.
References MeshFacetNode::data_index, MeshFacetNode::free(), MeshFacetNode::free_value(), MeshFacetNode::normal_value, MeshFacetNode::num_index, MeshFacetNode::num_polygon, MeshFacetNode::num_texcrd, MeshFacetNode::num_vertex, MeshFacetNode::texcrd_value, MeshFacetNode::vertex_value, and MeshFacetNode::weight_value.
Referenced by MeshFacetNode::computeVertexByBREP(), MeshFacetNode::computeVertexByBREP(), MeshFacetNode::computeVertexDirect(), and MeshFacetNode::computeVertexDirect().
|
inline |
Definition at line 76 of file MeshFacetNode.h.
References _tochar, Buffer::buf, and MeshFacetNode::material_id.
void init | ( | void | ) |
Definition at line 17 of file MeshFacetNode.cpp.
References MeshFacetNode::data_index, MeshFacetNode::facet_no, MaterialParam::init(), init_Buffer(), MeshFacetNode::material_id, MeshFacetNode::material_param, MeshFacetNode::next, MeshFacetNode::normal_value, MeshFacetNode::num_index, MeshFacetNode::num_polygon, MeshFacetNode::num_texcrd, MeshFacetNode::num_vertex, MeshFacetNode::prev, MeshFacetNode::same_material, MeshFacetNode::texcrd_value, MeshFacetNode::vertex_value, and MeshFacetNode::weight_value.
Referenced by MeshFacetNode::clear(), and MeshFacetNode::MeshFacetNode().
void set | ( | int | vertex, |
int | polygon, | ||
int | vcount = 3 ) |
Definition at line 111 of file MeshFacetNode.cpp.
References MeshFacetNode::num_index, MeshFacetNode::num_polygon, MeshFacetNode::num_texcrd, and MeshFacetNode::num_vertex.
Referenced by MeshFacetNode::computeVertexByBREP(), MeshFacetNode::computeVertexByBREP(), MeshFacetNode::computeVertexDirect(), and MeshFacetNode::computeVertexDirect().
|
inline |
Definition at line 71 of file MeshFacetNode.h.
References MeshFacetNode::facet_no.
Referenced by MeshObjectData::addData().
void setMaterialID | ( | const char * | str | ) |
Definition at line 72 of file MeshFacetNode.cpp.
References canonical_filename_Buffer(), cat_Buffer(), cat_s2Buffer, del_file_extension_Buffer(), free_Buffer(), MaterialParam::getName(), JBXL_MATERIAL_PREFIX, make_Buffer_bystr, make_Buffer_str, MeshFacetNode::material_id, MeshFacetNode::material_param, and TRUE.
Referenced by MeshObjectData::addNode(), MeshObjectData::addNode(), MeshFacetNode::setMaterialParam(), and MeshObjectData::setMaterialParam().
void setMaterialParam | ( | MaterialParam | param | ) |
Definition at line 43 of file MeshFacetNode.cpp.
References _tochar, Buffer::buf, MaterialParam::dup(), MaterialParam::enable, MaterialParam::free(), jbxl::isSameMaterial(), MeshFacetNode::material_id, MeshFacetNode::material_param, MeshFacetNode::next, MeshFacetNode::prev, MeshFacetNode::same_material, and MeshFacetNode::setMaterialID().
Referenced by MeshObjectData::addData(), MeshObjectData::addData(), MeshObjectData::addData(), MeshObjectData::addNode(), MeshObjectData::addNode(), and MeshObjectData::setMaterialParam().
int* data_index |
Definition at line 47 of file MeshFacetNode.h.
Referenced by ColladaXML::addPolylists(), OBJData::addShell(), BrepSolidList::addSolid(), MeshFacetNode::computeVertexByBREP(), MeshFacetNode::computeVertexByBREP(), MeshFacetNode::computeVertexDirect(), MeshFacetNode::computeVertexDirect(), GLTFData::createBinDataSeqAoS(), GLTFData::createBinDataSeqSoA(), GLTFData::createShellGeometryData(), MeshFacetNode::free_value(), MeshFacetNode::getm(), and MeshFacetNode::init().
int facet_no |
Definition at line 38 of file MeshFacetNode.h.
Referenced by MeshFacetNode::init(), MeshFacetNode::setFacetNo(), and MeshObjectData::setMaterialParam().
Buffer material_id |
Definition at line 36 of file MeshFacetNode.h.
Referenced by GLTFData::addMaterials(), GLTFData::addMeshes(), ColladaXML::addPolylists(), ColladaXML::addScene(), OBJData::addShell(), MeshFacetNode::free(), MeshFacetNode::getMaterialID(), MeshFacetNode::init(), MeshFacetNode::setMaterialID(), and MeshFacetNode::setMaterialParam().
MaterialParam material_param |
Definition at line 40 of file MeshFacetNode.h.
Referenced by GLTFData::addMaterialParameters(), GLTFData::addMaterials(), ColladaXML::addPolylists(), FBXData::addShell(), OBJData::addShell(), ColladaXML::addTexcrdSource(), GLTFData::addTextures(), MeshFacetNode::delMaterialParam(), MeshFacetNode::execAffineTransUVMap(), GLTFData::execAffineUVMap(), MeshFacetNode::init(), MeshFacetNode::setMaterialID(), MeshFacetNode::setMaterialParam(), and MeshObjectData::setMaterialParam().
MeshFacetNode* next |
Definition at line 53 of file MeshFacetNode.h.
Referenced by GLTFData::addAccessorsAoS(), GLTFData::addAccessorsSoA(), GLTFData::addBufferViewsAoS(), GLTFData::addBufferViewsSoA(), GLTFData::addMaterials(), GLTFData::addMeshes(), jbxl::AddMeshFacetNode(), ColladaXML::addNormalSource(), ColladaXML::addPolylists(), ColladaXML::addScene(), FBXData::addShell(), GLTFData::addShell(), OBJData::addShell(), BrepSolidList::addSolid(), ColladaXML::addTexcrdSource(), GLTFData::addTextures(), ColladaXML::addVertexSource(), ColladaXML::addWeightSource(), GLTFData::createBinDataSeqAoS(), GLTFData::createBinDataSeqSoA(), GLTFData::createShellGeometryData(), jbxl::DelMeshFacetNode(), GLTFData::execAffineUVMap(), jbxl::freeMeshFacetList(), MeshFacetNode::init(), MeshObjectData::joinData(), MeshFacetNode::setMaterialParam(), and MeshObjectData::setMaterialParam().
Vector<double>* normal_value |
Definition at line 49 of file MeshFacetNode.h.
Referenced by ColladaXML::addNormalSource(), OBJData::addShell(), BrepSolidList::addSolid(), MeshFacetNode::computeVertexByBREP(), MeshFacetNode::computeVertexByBREP(), MeshFacetNode::computeVertexDirect(), MeshFacetNode::computeVertexDirect(), GLTFData::createBinDataSeqAoS(), GLTFData::createBinDataSeqSoA(), GLTFData::createShellGeometryData(), MeshFacetNode::free_value(), MeshFacetNode::generatePlanarUVMap(), MeshFacetNode::getm(), and MeshFacetNode::init().
int num_index |
Definition at line 42 of file MeshFacetNode.h.
Referenced by GLTFData::addAccessorsAoS(), GLTFData::addAccessorsSoA(), GLTFData::addBufferViewsAoS(), GLTFData::addBufferViewsSoA(), MeshObjectData::addNode(), MeshObjectData::addNode(), GLTFData::addShell(), OBJData::addShell(), BrepSolidList::addSolid(), GLTFData::createBinDataSeqAoS(), GLTFData::createBinDataSeqSoA(), GLTFData::createShellGeometryData(), MeshFacetNode::getm(), MeshFacetNode::init(), and MeshFacetNode::set().
int num_polygon |
Definition at line 43 of file MeshFacetNode.h.
Referenced by ColladaXML::addPolylists(), MeshFacetNode::getm(), MeshFacetNode::init(), and MeshFacetNode::set().
int num_texcrd |
Definition at line 45 of file MeshFacetNode.h.
Referenced by MeshObjectData::addNode(), MeshObjectData::addNode(), FBXData::addShell(), OBJData::addShell(), ColladaXML::addTexcrdSource(), MeshFacetNode::computeVertexDirect(), GLTFData::createBinDataSeqSoA(), MeshFacetNode::execAffineTransUVMap(), GLTFData::execAffineUVMap(), MeshFacetNode::generatePlanarUVMap(), MeshFacetNode::getm(), MeshFacetNode::init(), and MeshFacetNode::set().
int num_vertex |
Definition at line 44 of file MeshFacetNode.h.
Referenced by GLTFData::addAccessorsAoS(), GLTFData::addAccessorsSoA(), GLTFData::addBufferViewsAoS(), GLTFData::addBufferViewsSoA(), MeshObjectData::addNode(), MeshObjectData::addNode(), ColladaXML::addNormalSource(), ColladaXML::addPolylists(), FBXData::addShell(), GLTFData::addShell(), OBJData::addShell(), ColladaXML::addVertexSource(), ColladaXML::addWeightSource(), MeshFacetNode::computeVertexByBREP(), MeshFacetNode::computeVertexByBREP(), MeshFacetNode::computeVertexDirect(), MeshFacetNode::computeVertexDirect(), GLTFData::createBinDataSeqAoS(), GLTFData::createBinDataSeqSoA(), GLTFData::createShellGeometryData(), MeshFacetNode::free_value(), MeshFacetNode::generatePlanarUVMap(), GLTFData::getFacetMinMax(), MeshFacetNode::getm(), MeshFacetNode::init(), and MeshFacetNode::set().
MeshFacetNode* prev |
Definition at line 54 of file MeshFacetNode.h.
Referenced by jbxl::AddMeshFacetNode(), jbxl::DelMeshFacetNode(), MeshFacetNode::init(), MeshObjectData::joinData(), and MeshFacetNode::setMaterialParam().
bool same_material |
Definition at line 37 of file MeshFacetNode.h.
Referenced by GLTFData::addMaterials(), ColladaXML::addPolylists(), ColladaXML::addScene(), OBJData::addShell(), GLTFData::addTextures(), MeshFacetNode::init(), and MeshFacetNode::setMaterialParam().
UVMap<double>* texcrd_value |
Definition at line 50 of file MeshFacetNode.h.
Referenced by FBXData::addShell(), OBJData::addShell(), ColladaXML::addTexcrdSource(), MeshFacetNode::computeVertexByBREP(), MeshFacetNode::computeVertexByBREP(), MeshFacetNode::computeVertexDirect(), MeshFacetNode::computeVertexDirect(), GLTFData::createBinDataSeqAoS(), GLTFData::createBinDataSeqSoA(), GLTFData::createShellGeometryData(), MeshFacetNode::execAffineTransUVMap(), GLTFData::execAffineUVMap(), MeshFacetNode::free_value(), MeshFacetNode::getm(), and MeshFacetNode::init().
Vector<double>* vertex_value |
Definition at line 48 of file MeshFacetNode.h.
Referenced by OBJData::addShell(), BrepSolidList::addSolid(), ColladaXML::addVertexSource(), MeshFacetNode::computeVertexByBREP(), MeshFacetNode::computeVertexByBREP(), MeshFacetNode::computeVertexDirect(), MeshFacetNode::computeVertexDirect(), GLTFData::createBinDataSeqAoS(), GLTFData::createBinDataSeqSoA(), GLTFData::createShellGeometryData(), MeshFacetNode::free_value(), MeshFacetNode::generatePlanarUVMap(), GLTFData::getFacetMinMax(), MeshFacetNode::getm(), and MeshFacetNode::init().
ArrayParam<int>* weight_value |
Definition at line 51 of file MeshFacetNode.h.
Referenced by ColladaXML::addWeightSource(), MeshFacetNode::computeVertexByBREP(), MeshFacetNode::computeVertexByBREP(), MeshFacetNode::computeVertexDirect(), MeshFacetNode::computeVertexDirect(), GLTFData::createBinDataSeqAoS(), GLTFData::createBinDataSeqSoA(), GLTFData::createShellGeometryData(), MeshFacetNode::free_value(), MeshFacetNode::getm(), and MeshFacetNode::init().