Public Member Functions | Protected Attributes

lssr::TriangleMesh< VertexT, NormalT > Class Template Reference

An implementation of an indexed triangle mesh. More...

#include <TriangleMesh.hpp>

Inheritance diagram for lssr::TriangleMesh< VertexT, NormalT >:
Inheritance graph
[legend]
Collaboration diagram for lssr::TriangleMesh< VertexT, NormalT >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 TriangleMesh ()
 Constructor.
 TriangleMesh (const TriangleMesh &other)
 Copy ctor.
virtual void addTriangle (uint v0, uint v1, uint v2)
 Adds a triangle consisting of the given vertices (by by their index) into the mesh.
virtual void addVertex (VertexT v)
 Adds a new vertex into the mesh.
virtual void addNormal (NormalT n)
 Adds a new normal into the mesh. Vertices and normals should always by corresponding wrt. their indices.
virtual ~TriangleMesh ()
 Dtor.
VertexT getVertex (uint index)
 Returns the vertex at the given index.
VertexT getNormal (uint index)
 Returns the normal at the given index.
virtual void finalize ()
 Finalizes the mesh.
virtual void save (string filename)
 Save the mesh to the given file.

Protected Attributes

float * m_normalBuffer
 An interlaced buffer for vertex normals.
vector< VertexT > m_normals
 The vertex normals.
vector< VertexT > m_vertices
 The vertices.
list< uint > m_triangles
 The index list.
bool m_finalized
 True if mesh is finalized.
float * m_vertexBuffer
 The mesh's vertex buffer.
float * m_colorBuffer
 The vertex colors.
uint * m_indexBuffer
 The mesh's index buffer.
uint m_nVertices
 The number of vertices in the mesh.
uint m_nFaces
 The number of face in the mesh.

Detailed Description

template<typename VertexT, typename NormalT>
class lssr::TriangleMesh< VertexT, NormalT >

An implementation of an indexed triangle mesh.

Definition at line 25 of file TriangleMesh.hpp.


Constructor & Destructor Documentation

template<typename VertexT , typename NormalT >
lssr::TriangleMesh< VertexT, NormalT >::TriangleMesh (  ) 

Constructor.

template<typename VertexT , typename NormalT >
lssr::TriangleMesh< VertexT, NormalT >::TriangleMesh ( const TriangleMesh< VertexT, NormalT > &  other  ) 

Copy ctor.

template<typename VertexT , typename NormalT >
virtual lssr::TriangleMesh< VertexT, NormalT >::~TriangleMesh (  )  [virtual]

Dtor.


Member Function Documentation

template<typename VertexT , typename NormalT >
virtual void lssr::TriangleMesh< VertexT, NormalT >::addNormal ( NormalT  n  )  [inline, virtual]

Adds a new normal into the mesh. Vertices and normals should always by corresponding wrt. their indices.

Parameters:
n The new normal

Implements lssr::BaseMesh< VertexT, NormalT >.

Definition at line 61 of file TriangleMesh.hpp.

template<typename VertexT , typename NormalT >
virtual void lssr::TriangleMesh< VertexT, NormalT >::addTriangle ( uint  v0,
uint  v1,
uint  v2 
) [virtual]

Adds a triangle consisting of the given vertices (by by their index) into the mesh.

Parameters:
v0 The first vertex index
v1 The second vertex index
v2 The third vertex index

Implements lssr::BaseMesh< VertexT, NormalT >.

template<typename VertexT , typename NormalT >
virtual void lssr::TriangleMesh< VertexT, NormalT >::addVertex ( VertexT  v  )  [inline, virtual]

Adds a new vertex into the mesh.

Parameters:
v The new vertex

Implements lssr::BaseMesh< VertexT, NormalT >.

Definition at line 53 of file TriangleMesh.hpp.

template<typename VertexT , typename NormalT >
virtual void lssr::TriangleMesh< VertexT, NormalT >::finalize (  )  [virtual]

Finalizes the mesh.

Implements lssr::BaseMesh< VertexT, NormalT >.

template<typename VertexT , typename NormalT >
VertexT lssr::TriangleMesh< VertexT, NormalT >::getNormal ( uint  index  ) 

Returns the normal at the given index.

template<typename VertexT , typename NormalT >
VertexT lssr::TriangleMesh< VertexT, NormalT >::getVertex ( uint  index  ) 

Returns the vertex at the given index.

template<typename VertexT, typename NormalT>
virtual void lssr::BaseMesh< VertexT, NormalT >::save ( string  filename  )  [virtual, inherited]

Save the mesh to the given file.


Member Data Documentation

template<typename VertexT, typename NormalT>
float* lssr::BaseMesh< VertexT, NormalT >::m_colorBuffer [protected, inherited]

The vertex colors.

Definition at line 75 of file BaseMesh.hpp.

template<typename VertexT, typename NormalT>
bool lssr::BaseMesh< VertexT, NormalT >::m_finalized [protected, inherited]

True if mesh is finalized.

Definition at line 66 of file BaseMesh.hpp.

template<typename VertexT, typename NormalT>
uint* lssr::BaseMesh< VertexT, NormalT >::m_indexBuffer [protected, inherited]

The mesh's index buffer.

Definition at line 78 of file BaseMesh.hpp.

template<typename VertexT, typename NormalT>
uint lssr::BaseMesh< VertexT, NormalT >::m_nFaces [protected, inherited]

The number of face in the mesh.

Definition at line 84 of file BaseMesh.hpp.

template<typename VertexT , typename NormalT >
float* lssr::TriangleMesh< VertexT, NormalT >::m_normalBuffer [protected]

An interlaced buffer for vertex normals.

Reimplemented from lssr::BaseMesh< VertexT, NormalT >.

Definition at line 87 of file TriangleMesh.hpp.

template<typename VertexT , typename NormalT >
vector<VertexT> lssr::TriangleMesh< VertexT, NormalT >::m_normals [protected]

The vertex normals.

Definition at line 90 of file TriangleMesh.hpp.

template<typename VertexT, typename NormalT>
uint lssr::BaseMesh< VertexT, NormalT >::m_nVertices [protected, inherited]

The number of vertices in the mesh.

Definition at line 81 of file BaseMesh.hpp.

template<typename VertexT , typename NormalT >
list<uint> lssr::TriangleMesh< VertexT, NormalT >::m_triangles [protected]

The index list.

Definition at line 96 of file TriangleMesh.hpp.

template<typename VertexT, typename NormalT>
float* lssr::BaseMesh< VertexT, NormalT >::m_vertexBuffer [protected, inherited]

The mesh's vertex buffer.

Definition at line 69 of file BaseMesh.hpp.

template<typename VertexT , typename NormalT >
vector<VertexT> lssr::TriangleMesh< VertexT, NormalT >::m_vertices [protected]

The vertices.

Definition at line 93 of file TriangleMesh.hpp.


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Typedefs Defines