#include <Model.h>
Public Member Functions | |
Model () | |
Initialize the Model. | |
~Model () | |
Destroy the Model (free all Meshes, Triangles, Vertices and Materials. | |
void | loadModel (const char *fileName, bool smooth=true) |
Load the Model from the given Milkshape3D file. | |
const std::vector< Mesh * > & | getMeshes () const |
Retrieve the list of Meshes comprising this Model. | |
const Mesh & | getMesh (unsigned int index) const |
Retrieve a specific Mesh from this Model. | |
const std::vector< Triangle * > & | getTriangles () const |
Retrieve the list of Triangles comprising this Model. | |
const Triangle & | getTriangle (unsigned int index) const |
Retrieve a specific Triangle from this Model. | |
const std::map< int, const Triangle * > & | getNeighbors (const Triangle *triangle) const |
Retrieve the list of neighbors for a specific Triangle. | |
const Vertex & | getVertex (unsigned int index) const |
Retrieve a specific Vertex from this Model. | |
const Material & | getMaterial (unsigned int index) const |
Retrieve a specific Material from this Model. | |
const Matrix & | getMatrix () const |
Retrieve the Matrix modifying this Model. | |
void | setMatrix (const Matrix &matrix) |
Set the Matrix modifying this Model. | |
void | replacePainter (Painter *painter) |
Free the existing Painter used to draw this Model (if any) and replace it with a new one. | |
void | createEdgeTriangles () |
Create two triangles for every edge of every mesh in order to render the shadow volume faces in a Cg vertex shader. | |
void | draw (const Vector &eye, const Vector &light) const |
Draw this model using the current m_painter. | |
Private Member Functions | |
Model (const Model ©) | |
Do not allow this Model to be copied. | |
Model & | operator= (const Model &rhs) |
Do not allow this Model to be copied. | |
void | setupNeighborMap () |
Setup the m_neighbors neighbor map. | |
Private Attributes | |
std::vector< Mesh * > | m_meshes |
The list of Meshes that comprise this Model. | |
std::vector< Triangle * > | m_triangles |
The list of Triangles that comprise this Model. | |
std::vector< Vertex * > | m_vertices |
The list of Vertices that comprise this Model. | |
std::vector< Material * > | m_materials |
The list of Materials that comprise this Model. | |
std::map< const Triangle *, std::map< int, const Triangle * > > | m_neighbors |
The Triangle neighbor map for this Model. | |
Matrix | m_matrix |
The Matrix which transforms this Model. | |
Painter * | m_painter |
The Painter which is used to draw this Model. | |
Friends | |
std::ostream & | operator<< (std::ostream &out, const Model &model) |
Insertion operator for this Model into an output stream. |
|
The Triangle neighbor map for this Model. This map takes a Triangle and maps it to another map. The second map takes an edge of the original Triangle and maps it to the neighboring Triangle which shares that edge. The edge is an integer defined as described in Triangle::getEdgeIndex |