![]() |
KiCad PCB EDA Suite
|
#include <wrlfacet.h>
Public Member Functions | |
FACET () | |
void | Init () |
bool | HasMinPoints () |
bool | HasColors () |
void | AddVertex (WRLVEC3F &aVertex, int aIndex) |
Function AddVertex adds the vertex and its associated index to the internal list of polygon vertices. More... | |
void | AddColor (const SGCOLOR &aColor) |
Function AddColor adds the given RGB color to the internal list. More... | |
float | CalcFaceNormal () |
Function CalcFaceNormal calculates the normal to the facet assuming a CCW orientation and performs the calculation of the angle weighted vertex normals. More... | |
void | Renormalize (float aMaxValue) |
void | CalcVertexNormal (int aIndex, std::list< FACET * > &aFacetList, float aCreaseAngle) |
Function CalcVertexNormal calculates the weighted normal for the given vertex. More... | |
bool | GetWeightedNormal (int aIndex, WRLVEC3F &aNorm) |
Function GetWeightedNormal retrieves the angle weighted normal for the given vertex index. More... | |
bool | GetFaceNormal (WRLVEC3F &aNorm) |
Function GetFaceNormal retrieves the normal for this facet. More... | |
bool | GetData (std::vector< WRLVEC3F > &aVertexList, std::vector< WRLVEC3F > &aNormalsList, std::vector< SGCOLOR > &aColorsList, WRL1_ORDER aVertexOrder) |
Function GetData packages the internal data as triangles with corresponding per-vertex normals. More... | |
int | GetMaxIndex () |
void | CollectVertices (std::vector< std::list< FACET * > > &aFacetList) |
Function CollectVertices adds a pointer to this object at each position within aFacetList referenced by the internal vertex indices. More... | |
Private Attributes | |
std::vector< WRLVEC3F > | vertices |
std::vector< SGCOLOR > | colors |
std::vector< int > | indices |
WRLVEC3F | face_normal |
std::vector< WRLVEC3F > | norms |
std::vector< WRLVEC3F > | vnweight |
int | maxIdx |
Definition at line 41 of file wrlfacet.h.
FACET::FACET | ( | ) |
void FACET::AddColor | ( | const SGCOLOR & | aColor | ) |
Function AddColor adds the given RGB color to the internal list.
For per-face coloring only a single color needs to be specified; for a per-vertex coloring the color must be specified for each vertex
Definition at line 208 of file wrlfacet.cpp.
References colors.
Referenced by WRL1FACESET::TranslateToSG(), and WRL2FACESET::TranslateToSG().
void FACET::AddVertex | ( | WRLVEC3F & | aVertex, |
int | aIndex | ||
) |
Function AddVertex adds the vertex and its associated index to the internal list of polygon vertices.
Definition at line 193 of file wrlfacet.cpp.
References indices, maxIdx, and vertices.
Referenced by WRL1FACESET::TranslateToSG(), X3DIFACESET::TranslateToSG(), and WRL2FACESET::TranslateToSG().
float FACET::CalcFaceNormal | ( | ) |
Function CalcFaceNormal calculates the normal to the facet assuming a CCW orientation and performs the calculation of the angle weighted vertex normals.
Definition at line 216 of file wrlfacet.cpp.
References face_normal, VCalcCosAngle(), VCalcTriNorm(), vertices, and vnweight.
void FACET::CalcVertexNormal | ( | int | aIndex, |
std::list< FACET * > & | aFacetList, | ||
float | aCreaseAngle | ||
) |
Function CalcVertexNormal calculates the weighted normal for the given vertex.
aIndex | is the VRML file's Vertex Index for the vertex to be processed |
aFacetList | is the list of all faces which share this vertex |
Definition at line 333 of file wrlfacet.cpp.
References face_normal, indices, LOWER_LIMIT, norms, VCalcCosAngle(), vertices, and vnweight.
void FACET::CollectVertices | ( | std::vector< std::list< FACET * > > & | aFacetList | ) |
Function CollectVertices adds a pointer to this object at each position within aFacetList referenced by the internal vertex indices.
Definition at line 648 of file wrlfacet.cpp.
bool FACET::GetData | ( | std::vector< WRLVEC3F > & | aVertexList, |
std::vector< WRLVEC3F > & | aNormalsList, | ||
std::vector< SGCOLOR > & | aColorsList, | ||
WRL1_ORDER | aVertexOrder | ||
) |
Function GetData packages the internal data as triangles with corresponding per-vertex normals.
aVertexList | is the list of vertices to add to |
aNormalsList | is the list of per-vertex normals to add to |
aColorsList | is the list of per-vertex colors (if any) to add to |
aVertexOrder | informs the function of the vertex winding order |
Definition at line 468 of file wrlfacet.cpp.
References colors, norms, ORD_CCW, ORD_CLOCKWISE, and vertices.
bool FACET::GetFaceNormal | ( | WRLVEC3F & | aNorm | ) |
Function GetFaceNormal retrieves the normal for this facet.
aNorm | will hold the result |
Definition at line 451 of file wrlfacet.cpp.
References face_normal, vertices, and vnweight.
|
inline |
Definition at line 127 of file wrlfacet.h.
References maxIdx.
bool FACET::GetWeightedNormal | ( | int | aIndex, |
WRLVEC3F & | aNorm | ||
) |
Function GetWeightedNormal retrieves the angle weighted normal for the given vertex index.
aIndex | is the VRML file's Vertex Index for the vertex to be processed |
aNorm | will hold the result |
Definition at line 418 of file wrlfacet.cpp.
bool FACET::HasColors | ( | void | ) |
Definition at line 184 of file wrlfacet.cpp.
References colors.
Referenced by WRL1FACESET::TranslateToSG().
bool FACET::HasMinPoints | ( | ) |
Definition at line 175 of file wrlfacet.cpp.
References vertices.
Referenced by WRL1FACESET::TranslateToSG(), X3DIFACESET::TranslateToSG(), and WRL2FACESET::TranslateToSG().
void FACET::Init | ( | void | ) |
Definition at line 158 of file wrlfacet.cpp.
References colors, face_normal, indices, maxIdx, norms, vertices, and vnweight.
Referenced by WRL1FACESET::TranslateToSG(), X3DIFACESET::TranslateToSG(), and WRL2FACESET::TranslateToSG().
void FACET::Renormalize | ( | float | aMaxValue | ) |
|
private |
Definition at line 45 of file wrlfacet.h.
Referenced by AddColor(), GetData(), HasColors(), and Init().
|
private |
Definition at line 48 of file wrlfacet.h.
Referenced by CalcFaceNormal(), CalcVertexNormal(), FACET(), GetFaceNormal(), and Init().
|
private |
Definition at line 46 of file wrlfacet.h.
Referenced by AddVertex(), CalcVertexNormal(), CollectVertices(), GetWeightedNormal(), and Init().
|
private |
Definition at line 52 of file wrlfacet.h.
Referenced by AddVertex(), CollectVertices(), FACET(), GetMaxIndex(), and Init().
|
private |
Definition at line 49 of file wrlfacet.h.
Referenced by CalcVertexNormal(), GetData(), and Init().
|
private |
Definition at line 44 of file wrlfacet.h.
Referenced by AddVertex(), CalcFaceNormal(), CalcVertexNormal(), CollectVertices(), GetData(), GetFaceNormal(), GetWeightedNormal(), HasMinPoints(), and Init().
|
private |
Definition at line 50 of file wrlfacet.h.
Referenced by CalcFaceNormal(), CalcVertexNormal(), GetFaceNormal(), GetWeightedNormal(), Init(), and Renormalize().