Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

Model Class Reference

Defines a Milkshape3D Model. More...

#include <Model.h>

List of all members.

Public Methods

 Model ()
 Initialize the Model.

 ~Model ()
 Destroy the Model (free all Meshes, Triangles, Vertices and Materials.

void loadModel (const char *fileName)
 Load the Model from the given Milkshape3D file.

const std::vector< Mesh * > & getMeshes () const
 Retrieve the list of Meshes comprising this Model.

const MeshgetMesh (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 TrianglegetTriangle (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 VertexgetVertex (unsigned int index) const
 Retrieve a specific Vertex from this Model.

const MaterialgetMaterial (unsigned int index) const
 Retrieve a specific Material from this Model.

const MatrixgetMatrix () 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 draw (const Vector &eye, const Vector &light) const
 Draw this model using the current m_painter.


Private Methods

 Model (const Model &copy)
 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.

Painterm_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.


Detailed Description

Defines a Milkshape3D Model.


Constructor & Destructor Documentation

Model::~Model  
 

Destroy the Model (free all Meshes, Triangles, Vertices and Materials.


Member Function Documentation

void Model::replacePainter Painter   painter
 

Free the existing Painter used to draw this Model (if any) and replace it with a new one.

void Model::draw const Vector   eye,
const Vector   light
const
 

Draw this model using the current m_painter.


Friends And Related Function Documentation

std::ostream& operator<< std::ostream &    out,
const Model &    model
[friend]
 

Insertion operator for this Model into an output stream.


Member Data Documentation

std::map<const Triangle*, std::map<int, const Triangle*> > Model::m_neighbors [private]
 

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


The documentation for this class was generated from the following files:
Generated on Sat Mar 22 15:12:08 2003 for Bumpmap by doxygen1.3-rc2