#include <TriangleExtractor.h>
Public Member Functions | |
void | execute (const SbVec3f &transvec=SbVec3f(0.0f, 0.0f, 0.0f)) |
VertexStorage< odeVertexType > * | getResult () |
TriangleExtractor (SoNode *object=NULL) | |
~TriangleExtractor () | |
Static Private Member Functions | |
static void | TriangleCB (void *data, SoCallbackAction *action, const SoPrimitiveVertex *v1, const SoPrimitiveVertex *v2, const SoPrimitiveVertex *v3) |
Private Attributes | |
SoNode * | ivModel |
TriangleCallbackResult * | result |
This TriangleExtractor is used to extract all triangles from a given Inventor model.
Definition at line 59 of file TriangleExtractor.h.
TriangleExtractor::TriangleExtractor | ( | SoNode * | object = NULL |
) |
The constructor of TriangleExtractor. It sets the ivModel and creates a TriangleCallbackResult object.
object | iv model to extract triangles from (stored in TriangleExtractor::ivModel) |
Definition at line 72 of file TriangleExtractor.cpp.
TriangleExtractor::~TriangleExtractor | ( | ) |
The destructor of the TriangleExtractor. It deletes the result object.
Definition at line 82 of file TriangleExtractor.cpp.
References result.
void TriangleExtractor::execute | ( | const SbVec3f & | transvec = SbVec3f(0.0f, 0.0f, 0.0f) |
) |
This method transforms the TriangleExtractor::ivModel by the values from parameter transvec
and creates an SoComplexity node to reduce the polygon count of the given Inventor model. Afterwards it creates an SoCallbackAction with the given triangle callback and TriangleExtractor::result to extract the triangles from the model. Only the nodes of the type SoShape get visited.
transvec | vector used to translate TriangleExtractor::ivModel before triangle extraction |
Definition at line 98 of file TriangleExtractor.cpp.
References ivModel, result, and TriangleCB().
Referenced by SoCollisionShapeTriMesh::cGeom().
VertexStorage< odeVertexType > * TriangleExtractor::getResult | ( | ) |
This method transforms the result of TriangleExtractor::execute() into the desired format.
Definition at line 124 of file TriangleExtractor.cpp.
References VertexStorage< T >::appendVertex(), VertexStorage< T >::appendVertexIndices(), TriangleCallbackResult::coord3, TriangleCallbackResult::coord3idx, TriangleCallbackResult::ifs, and result.
Referenced by SoCollisionShapeTriMesh::cGeom().
void TriangleExtractor::TriangleCB | ( | void * | data, | |
SoCallbackAction * | action, | |||
const SoPrimitiveVertex * | v1, | |||
const SoPrimitiveVertex * | v2, | |||
const SoPrimitiveVertex * | v3 | |||
) | [static, private] |
The triangle callback is used by an SoCallbackAction to extract the triangles from the given Inventor model. Degenerated vertices are skipped.
data | the passed in TriangleExtractor::result object to store the extracted vertex in | |
action | used to get the current model matrix | |
v1 | first point of the vertex | |
v2 | second point of the vertex | |
v3 | third point of the vertex |
Definition at line 167 of file TriangleExtractor.cpp.
References TriangleCallbackResult::coord3, TriangleCallbackResult::coord3idx, and TriangleCallbackResult::ifs.
Referenced by execute().
TriangleExtractor::ivModel [private] |
This SoNode is a pointer to the Inventor model whose triangles are to be extracted.
Definition at line 66 of file TriangleExtractor.h.
Referenced by execute(), and TriangleExtractor().
TriangleExtractor::result [private] |
The result object is used as the data pointer for the triangle callback. The resulting vertex set and indexed face set are stored in it.
Definition at line 67 of file TriangleExtractor.h.
Referenced by execute(), getResult(), TriangleExtractor(), and ~TriangleExtractor().
Generated on Sat Mar 10 20:00:21 2012 for IPSA by 1.5.8 |