Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

M3DTriangleMesh Class Reference

#include <3dsmodel.h>

Collaboration diagram for M3DTriangleMesh:

Collaboration graph
List of all members.

Public Member Functions

void addFace (uint16, uint16, uint16)
void addSmoothingGroups (uint32)
void addTexCoord (Point2f)
void addVertex (Point3f)
void getFace (uint16, uint16 &, uint16 &, uint16 &) const
uint16 getFaceCount () const
std::string getMaterialName () const
Mat4f getMatrix () const
uint16 getSmoothingGroupCount () const
uint32 getSmoothingGroups (uint16) const
Point2f getTexCoord (uint16) const
uint16 getTexCoordCount () const
Point3f getVertex (uint16) const
uint16 getVertexCount () const
 M3DTriangleMesh ()
void setMaterialName (std::string)
void setMatrix (const Mat4f &)
 ~M3DTriangleMesh ()

Private Attributes

std::vector< uint16faces
std::string materialName
Mat4f matrix
std::vector< Point3fpoints
std::vector< uint32smoothingGroups
std::vector< Point2ftexCoords

Constructor & Destructor Documentation

M3DTriangleMesh::M3DTriangleMesh  ) 
 

Definition at line 105 of file 3dsmodel.cpp.

References Matrix4< float >::identity(), and matrix.

00106 {
00107     matrix = Mat4f::identity();
00108 }

M3DTriangleMesh::~M3DTriangleMesh  ) 
 

Definition at line 110 of file 3dsmodel.cpp.

00111 {
00112 }


Member Function Documentation

void M3DTriangleMesh::addFace uint16  ,
uint16  ,
uint16 
 

Definition at line 167 of file 3dsmodel.cpp.

References faces.

Referenced by readFaceArray().

00168 {
00169     faces.insert(faces.end(), v0);
00170     faces.insert(faces.end(), v1);
00171     faces.insert(faces.end(), v2);
00172 }

void M3DTriangleMesh::addSmoothingGroups uint32   ) 
 

Definition at line 182 of file 3dsmodel.cpp.

References smoothingGroups.

Referenced by processFaceArrayChunk().

00183 {
00184     smoothingGroups.insert(smoothingGroups.end(), smGroups);
00185 }

void M3DTriangleMesh::addTexCoord Point2f   ) 
 

Definition at line 149 of file 3dsmodel.cpp.

References texCoords.

00150 {
00151     texCoords.insert(texCoords.end(), p);
00152 }

void M3DTriangleMesh::addVertex Point3f   ) 
 

Definition at line 134 of file 3dsmodel.cpp.

References points.

00135 {
00136     points.insert(points.end(), p);
00137 }

void M3DTriangleMesh::getFace uint16  ,
uint16 ,
uint16 ,
uint16
const
 

Definition at line 154 of file 3dsmodel.cpp.

References faces.

00155 {
00156     int m = (int) n * 3;
00157     v0 = faces[m];
00158     v1 = faces[m + 1];
00159     v2 = faces[m + 2];
00160 }

uint16 M3DTriangleMesh::getFaceCount  )  const
 

Definition at line 162 of file 3dsmodel.cpp.

References faces.

Referenced by Convert3DSModel(), and processFaceArrayChunk().

00163 {
00164     return (uint16) (faces.size() / 3);
00165 }

string M3DTriangleMesh::getMaterialName  )  const
 

Definition at line 192 of file 3dsmodel.cpp.

References materialName.

00193 {
00194     return materialName;
00195 }

Mat4f M3DTriangleMesh::getMatrix  )  const
 

Definition at line 114 of file 3dsmodel.cpp.

References matrix.

00115 {
00116     return matrix;
00117 }

uint16 M3DTriangleMesh::getSmoothingGroupCount  )  const
 

Definition at line 187 of file 3dsmodel.cpp.

References smoothingGroups.

00188 {
00189     return (uint16) (smoothingGroups.size());
00190 }

uint32 M3DTriangleMesh::getSmoothingGroups uint16   )  const
 

Definition at line 174 of file 3dsmodel.cpp.

References smoothingGroups.

00175 {
00176     if (face < smoothingGroups.size())
00177         return smoothingGroups[face];
00178     else
00179         return 0;
00180 }

Point2f M3DTriangleMesh::getTexCoord uint16   )  const
 

Definition at line 139 of file 3dsmodel.cpp.

References texCoords.

00140 {
00141     return texCoords[n];
00142 }

uint16 M3DTriangleMesh::getTexCoordCount  )  const
 

Definition at line 144 of file 3dsmodel.cpp.

References texCoords.

00145 {
00146     return (uint16) (texCoords.size());
00147 }

Point3f M3DTriangleMesh::getVertex uint16   )  const
 

Definition at line 124 of file 3dsmodel.cpp.

References points.

00125 {
00126     return points[n];
00127 }

uint16 M3DTriangleMesh::getVertexCount  )  const
 

Definition at line 129 of file 3dsmodel.cpp.

References points.

00130 {
00131     return (uint16) (points.size());
00132 }

void M3DTriangleMesh::setMaterialName std::string   ) 
 

Definition at line 197 of file 3dsmodel.cpp.

References materialName.

Referenced by processFaceArrayChunk().

00198 {
00199     materialName = _materialName;
00200 }

void M3DTriangleMesh::setMatrix const Mat4f  ) 
 

Definition at line 119 of file 3dsmodel.cpp.

References matrix.

Referenced by processTriMeshChunk().

00120 {
00121     matrix = m;
00122 }


Member Data Documentation

std::vector<uint16> M3DTriangleMesh::faces [private]
 

Definition at line 91 of file 3dsmodel.h.

Referenced by addFace(), getFace(), and getFaceCount().

std::string M3DTriangleMesh::materialName [private]
 

Definition at line 94 of file 3dsmodel.h.

Referenced by getMaterialName(), and setMaterialName().

Mat4f M3DTriangleMesh::matrix [private]
 

Definition at line 93 of file 3dsmodel.h.

Referenced by getMatrix(), M3DTriangleMesh(), and setMatrix().

std::vector<Point3f> M3DTriangleMesh::points [private]
 

Definition at line 89 of file 3dsmodel.h.

Referenced by addVertex(), getVertex(), and getVertexCount().

std::vector<uint32> M3DTriangleMesh::smoothingGroups [private]
 

Definition at line 92 of file 3dsmodel.h.

Referenced by addSmoothingGroups(), getSmoothingGroupCount(), and getSmoothingGroups().

std::vector<Point2f> M3DTriangleMesh::texCoords [private]
 

Definition at line 90 of file 3dsmodel.h.

Referenced by addTexCoord(), getTexCoord(), and getTexCoordCount().


The documentation for this class was generated from the following files:
Generated on Sat Jan 14 22:33:27 2006 for Celestia by  doxygen 1.4.1