KiCad PCB EDA Suite
|
#include <wrlfacet.h>
Public Member Functions | |
FACET () | |
void | Init () |
bool | HasMinPoints () |
bool | HasColors () |
void | AddVertex (WRLVEC3F &aVertex, int aIndex) |
Add the vertex and its associated index to the internal list of polygon vertices. | |
void | AddColor (const SGCOLOR &aColor) |
Add the given RGB color to the internal list. | |
float | CalcFaceNormal () |
Calculate the normal to the facet assuming a CCW orientation and perform the calculation of the angle weighted vertex normals. | |
void | Renormalize (float aMaxValue) |
void | CalcVertexNormal (int aIndex, std::list< FACET * > &aFacetList, float aCreaseAngle) |
Calculate the weighted normal for the given vertex. | |
bool | GetWeightedNormal (int aIndex, WRLVEC3F &aNorm) |
Retrieve the angle weighted normal for the given vertex index. | |
bool | GetFaceNormal (WRLVEC3F &aNorm) |
Retrieve the normal for this facet. | |
bool | GetData (std::vector< WRLVEC3F > &aVertexList, std::vector< WRLVEC3F > &aNormalsList, std::vector< SGCOLOR > &aColorsList, WRL1_ORDER aVertexOrder) |
Package the internal data as triangles with corresponding per-vertex normals. | |
int | GetMaxIndex () |
void | CollectVertices (std::vector< std::list< FACET * > > &aFacetList) |
Add a pointer to this object at each position within aFacetList referenced by the internal vertex indices. | |
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 42 of file wrlfacet.h.
FACET::FACET | ( | ) |
Definition at line 149 of file wrlfacet.cpp.
References face_normal, and maxIdx.
void FACET::AddColor | ( | const SGCOLOR & | aColor | ) |
Add 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 204 of file wrlfacet.cpp.
References colors.
Referenced by WRL2FACESET::TranslateToSG(), and WRL1FACESET::TranslateToSG().
void FACET::AddVertex | ( | WRLVEC3F & | aVertex, |
int | aIndex | ||
) |
Add the vertex and its associated index to the internal list of polygon vertices.
Definition at line 191 of file wrlfacet.cpp.
References indices, maxIdx, and vertices.
Referenced by WRL2FACESET::TranslateToSG(), X3DIFACESET::TranslateToSG(), and WRL1FACESET::TranslateToSG().
float FACET::CalcFaceNormal | ( | ) |
Calculate the normal to the facet assuming a CCW orientation and perform the calculation of the angle weighted vertex normals.
Definition at line 212 of file wrlfacet.cpp.
References face_normal, VCalcCosAngle(), VCalcTriNorm(), vertices, and vnweight.
void FACET::CalcVertexNormal | ( | int | aIndex, |
std::list< FACET * > & | aFacetList, | ||
float | aCreaseAngle | ||
) |
Calculate 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 329 of file wrlfacet.cpp.
References face_normal, indices, LOWER_LIMIT, norms, VCalcCosAngle(), vertices, and vnweight.
void FACET::CollectVertices | ( | std::vector< std::list< FACET * > > & | aFacetList | ) |
Add a pointer to this object at each position within aFacetList referenced by the internal vertex indices.
Definition at line 642 of file wrlfacet.cpp.
bool FACET::GetData | ( | std::vector< WRLVEC3F > & | aVertexList, |
std::vector< WRLVEC3F > & | aNormalsList, | ||
std::vector< SGCOLOR > & | aColorsList, | ||
WRL1_ORDER | aVertexOrder | ||
) |
Package 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 462 of file wrlfacet.cpp.
bool FACET::GetFaceNormal | ( | WRLVEC3F & | aNorm | ) |
Retrieve the normal for this facet.
aNorm | will hold the result. |
Definition at line 445 of file wrlfacet.cpp.
References face_normal, vertices, and vnweight.
|
inline |
Definition at line 109 of file wrlfacet.h.
References maxIdx.
bool FACET::GetWeightedNormal | ( | int | aIndex, |
WRLVEC3F & | aNorm | ||
) |
Retrieve 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 412 of file wrlfacet.cpp.
bool FACET::HasColors | ( | ) |
Definition at line 182 of file wrlfacet.cpp.
References colors.
Referenced by WRL1FACESET::TranslateToSG().
bool FACET::HasMinPoints | ( | ) |
Definition at line 173 of file wrlfacet.cpp.
References vertices.
Referenced by WRL2FACESET::TranslateToSG(), X3DIFACESET::TranslateToSG(), and WRL1FACESET::TranslateToSG().
void FACET::Init | ( | ) |
Definition at line 158 of file wrlfacet.cpp.
References colors, face_normal, indices, maxIdx, norms, vertices, and vnweight.
Referenced by WRL2FACESET::TranslateToSG(), X3DIFACESET::TranslateToSG(), and WRL1FACESET::TranslateToSG().
void FACET::Renormalize | ( | float | aMaxValue | ) |
Definition at line 663 of file wrlfacet.cpp.
References LOWER_LIMIT, and vnweight.
|
private |
Definition at line 122 of file wrlfacet.h.
Referenced by AddColor(), GetData(), HasColors(), and Init().
|
private |
Definition at line 125 of file wrlfacet.h.
Referenced by CalcFaceNormal(), CalcVertexNormal(), FACET(), GetFaceNormal(), and Init().
|
private |
Definition at line 123 of file wrlfacet.h.
Referenced by AddVertex(), CalcVertexNormal(), CollectVertices(), GetWeightedNormal(), and Init().
|
private |
Definition at line 129 of file wrlfacet.h.
Referenced by AddVertex(), CollectVertices(), FACET(), GetMaxIndex(), and Init().
|
private |
Definition at line 126 of file wrlfacet.h.
Referenced by CalcVertexNormal(), GetData(), and Init().
|
private |
Definition at line 121 of file wrlfacet.h.
Referenced by AddVertex(), CalcFaceNormal(), CalcVertexNormal(), CollectVertices(), GetData(), GetFaceNormal(), GetWeightedNormal(), HasMinPoints(), and Init().
|
private |
Definition at line 127 of file wrlfacet.h.
Referenced by CalcFaceNormal(), CalcVertexNormal(), GetFaceNormal(), GetWeightedNormal(), Init(), and Renormalize().