ork::Mesh< vertex, index > Class Template Reference
[render]

A MeshBuffers wrapper that provides a convenient API to define the mesh content. More...

#include <Mesh.h>

Inheritance diagram for ork::Mesh< vertex, index >:
ork::Object

List of all members.

Public Member Functions

 Mesh (MeshMode m, MeshUsage usage, int vertexCount=4, int indiceCount=4)
 Creates a new mesh.
 Mesh (ptr< MeshBuffers > target, MeshMode m, MeshUsage usage, int vertexCount=4, int indiceCount=4)
 Creates a new mesh.
virtual ~Mesh ()
 Deletes this mesh.
MeshMode getMode () const
 Returns the interpretation mode of the vertices of this mesh.
int getVertexCount () const
 Returns the number of vertices in this mesh.
vertex getVertex (int i) const
 Returns a vertex of this mesh.
int getIndiceCount () const
 Returns the number of indices of this mesh.
GLint getPrimitiveRestart () const
 Returns the vertex index used for primitive restart.
GLint getPatchVertices () const
 Returns the number of vertices per patch in this mesh, if getMode() is PATCHES.
ptr< MeshBuffersgetBuffers () const
 Returns the MeshBuffers wrapped by this Mesh instance.
void addAttributeType (int id, int size, AttributeType type, bool norm)
 Declares an attribute of the vertices of this mesh.
void setCapacity (int vertexCount, int indiceCount)
 Sets the capacity of the vertex and indice array of this mesh.
void addVertex (const vertex &v)
 Adds a vertex to this mesh.
void addVertices (const vertex *v, int count)
 Adds vertices this mesh.
void addIndice (index i)
 Adds an indice to this mesh.
void setMode (MeshMode mode)
 Sets the interpretation mode of the vertices of this mesh.
void setVertex (int i, const vertex &v)
 Changes a vertex of this mesh.
void setIndice (int i, index ind)
 Changes an indice of this mesh.
void setPrimitiveRestart (GLint restart)
 Sets the vertex index used for primitive restart.
void setPatchVertices (GLint vertices)
 Sets the number of vertices per patch in this mesh, if getMode() is PATCHES.
void clear ()
 Removes all the vertices and indices of this mesh.
void clearBuffers ()
 Clears the MeshBuffers.

Detailed Description

template<class vertex, class index>
class ork::Mesh< vertex, index >

A MeshBuffers wrapper that provides a convenient API to define the mesh content.

Template Parameters:
vertex the type of the vertices of this mesh.
index the type of the indices of this mesh.

Constructor & Destructor Documentation

template<class vertex , class index >
ork::Mesh< vertex, index >::Mesh ( MeshMode  m,
MeshUsage  usage,
int  vertexCount = 4,
int  indiceCount = 4 
) [inline]

Creates a new mesh.

Parameters:
m how the list of vertices of this mesh must be interpreted.
usage how the data should be handled.
vertexCount the initial capacity of the vertex array.
indiceCount the initial capacity of the indice array.
template<class vertex , class index >
ork::Mesh< vertex, index >::Mesh ( ptr< MeshBuffers target,
MeshMode  m,
MeshUsage  usage,
int  vertexCount = 4,
int  indiceCount = 4 
) [inline]

Creates a new mesh.

Parameters:
target the mesh buffers wrapped by this mesh.
m how the list of vertices of this mesh must be interpreted.
usage how the data should be handled.
vertexCount the initial capacity of the vertex array.
indiceCount the initial capacity of the indice array.
template<class vertex , class index >
ork::Mesh< vertex, index >::~Mesh (  )  [inline, virtual]

Deletes this mesh.


Member Function Documentation

template<class vertex , class index >
void ork::Mesh< vertex, index >::addAttributeType ( int  id,
int  size,
AttributeType  type,
bool  norm 
) [inline]

Declares an attribute of the vertices of this mesh.

Parameters:
id a vertex attribute index.
size the number of components in attributes of this kind.
type the type of each component in attributes of this kind.
norm if the attribute components must be normalized to 0..1.
template<class vertex , class index>
void ork::Mesh< vertex, index >::addIndice ( index  i  )  [inline]

Adds an indice to this mesh.

Parameters:
i a vertex index.
template<class vertex, class index >
void ork::Mesh< vertex, index >::addVertex ( const vertex &  v  )  [inline]

Adds a vertex to this mesh.

Parameters:
v a vertex.
template<class vertex, class index >
void ork::Mesh< vertex, index >::addVertices ( const vertex *  v,
int  count 
) [inline]

Adds vertices this mesh.

Parameters:
v a pointer to a vertex array.
count number of vertices
template<class vertex , class index >
void ork::Mesh< vertex, index >::clear (  )  [inline]

Removes all the vertices and indices of this mesh.

template<class vertex , class index >
void ork::Mesh< vertex, index >::clearBuffers (  )  [inline]

Clears the MeshBuffers.

template<class vertex , class index >
ptr< MeshBuffers > ork::Mesh< vertex, index >::getBuffers (  )  const [inline]

Returns the MeshBuffers wrapped by this Mesh instance.

template<class vertex , class index >
int ork::Mesh< vertex, index >::getIndiceCount (  )  const [inline]

Returns the number of indices of this mesh.

template<class vertex , class index >
MeshMode ork::Mesh< vertex, index >::getMode (  )  const [inline]

Returns the interpretation mode of the vertices of this mesh.

template<class vertex , class index >
GLint ork::Mesh< vertex, index >::getPatchVertices (  )  const [inline]

Returns the number of vertices per patch in this mesh, if getMode() is PATCHES.

template<class vertex , class index >
GLint ork::Mesh< vertex, index >::getPrimitiveRestart (  )  const [inline]

Returns the vertex index used for primitive restart.

-1 means no restart.

template<class vertex , class index >
vertex ork::Mesh< vertex, index >::getVertex ( int  i  )  const [inline]

Returns a vertex of this mesh.

Parameters:
i a vertex index.
template<class vertex , class index >
int ork::Mesh< vertex, index >::getVertexCount (  )  const [inline]

Returns the number of vertices in this mesh.

template<class vertex , class index >
void ork::Mesh< vertex, index >::setCapacity ( int  vertexCount,
int  indiceCount 
) [inline]

Sets the capacity of the vertex and indice array of this mesh.

Does nothing if the provided sizes are smaller than the current ones.

Parameters:
vertexCount the new vertex array capacity.
indiceCount the new indice array capacity.
template<class vertex , class index>
void ork::Mesh< vertex, index >::setIndice ( int  i,
index  ind 
) [inline]

Changes an indice of this mesh.

template<class vertex , class index >
void ork::Mesh< vertex, index >::setMode ( MeshMode  mode  )  [inline]

Sets the interpretation mode of the vertices of this mesh.

template<class vertex , class index >
void ork::Mesh< vertex, index >::setPatchVertices ( GLint  vertices  )  [inline]

Sets the number of vertices per patch in this mesh, if getMode() is PATCHES.

template<class vertex , class index >
void ork::Mesh< vertex, index >::setPrimitiveRestart ( GLint  restart  )  [inline]

Sets the vertex index used for primitive restart.

-1 means no restart.

template<class vertex, class index >
void ork::Mesh< vertex, index >::setVertex ( int  i,
const vertex &  v 
) [inline]

Changes a vertex of this mesh.


Generated on Mon Oct 18 09:36:09 2010 for ork by  doxygen 1.6.1