version 3.3

VRS::Mesh Class Reference

#include <vrs/mesh.h>

Inheritance diagram for VRS::Mesh:

VRS::PolygonSet VRS::Shape VRS::RenderObj VRS::SharedObj VRS::Visitable

List of all members.

Public Member Functions

 Mesh (unsigned int columns=0, unsigned int rows=0, Iterator< Vector > *vertexitr=0, Iterator< Vector > *normalitr=0, Iterator< Color > *coloritr=0, Iterator< Vector > *texture0itr=0, Iterator< Vector > *texture1itr=0, Iterator< Vector > *texture2itr=0, Iterator< Vector > *texture3itr=0)
void setVertexIterator (unsigned int columns, unsigned int rows, Iterator< Vector > *iter)
virtual void setType (PolygonSet::PrimitiveType primitiveType)
virtual void setIndexIterator (Iterator< unsigned int > *iter)
 the indices of a mesh are fixed, you cannot change them.
virtual void setRangeIterator (Iterator< unsigned int > *iter)
 the ranges of a mesh are fixed, you cannot change them.
virtual void setPrimitiveIterator (Iterator< PrimitiveType > *iter)
 the primitive type of a mesh are fixed, you cannot change them.
Iterator< Vector > * constructNormalIterator (bool wrapX, bool wrapY)
unsigned int columns () const
 Return the number of mesh columns.
unsigned int rows () const
 Return the number of mesh rows.
 VRS_TYPEINFO (Mesh, PolygonSet)
 VRS_SERIALIZABLE (Mesh)


Constructor & Destructor Documentation

VRS::Mesh::Mesh ( unsigned int  columns = 0,
unsigned int  rows = 0,
Iterator< Vector > *  vertexitr = 0,
Iterator< Vector > *  normalitr = 0,
Iterator< Color > *  coloritr = 0,
Iterator< Vector > *  texture0itr = 0,
Iterator< Vector > *  texture1itr = 0,
Iterator< Vector > *  texture2itr = 0,
Iterator< Vector > *  texture3itr = 0 
)

A mesh is specified by a grid of `columns' x `rows' vertices. Each grid cell represents a surface element with a vertex position. Additionally, at each position the normal, 4 texture coordinates and a vertex color can be supplied.

It is allowed to construct a mesh with an empty vertex iterator; in this case, columns or rows must be also zero, otherwise an assertion will occur.


Member Function Documentation

void VRS::Mesh::setVertexIterator ( unsigned int  columns,
unsigned int  rows,
Iterator< Vector > *  iter 
)

The mesh vertex data is specified by 'setVertexIterator'. This argument iterator must not be empty. The Mesh assumes that the other iterators (from PolygonSet) represent `columns' x `rows' data values. All iterators are expected to provide the values row by row. For standard OpenGL/VRS cullface settings (counter clockwise), vertices should be given from left to right and bottom to top, i.e.:
7 8 9
4 5 6
1 2 3

virtual void VRS::Mesh::setType ( PolygonSet::PrimitiveType  primitiveType  )  [virtual]

the primitive type of a mesh is PolygonSet::TriangleStrip, and you cannot change that.

Reimplemented from VRS::PolygonSet.

virtual void VRS::Mesh::setIndexIterator ( Iterator< unsigned int > *  iter  )  [virtual]

the indices of a mesh are fixed, you cannot change them.

Reimplemented from VRS::PolygonSet.

virtual void VRS::Mesh::setRangeIterator ( Iterator< unsigned int > *  iter  )  [virtual]

the ranges of a mesh are fixed, you cannot change them.

Reimplemented from VRS::PolygonSet.

virtual void VRS::Mesh::setPrimitiveIterator ( Iterator< PrimitiveType > *  iter  )  [virtual]

the primitive type of a mesh are fixed, you cannot change them.

Reimplemented from VRS::PolygonSet.

Iterator<Vector>* VRS::Mesh::constructNormalIterator ( bool  wrapX,
bool  wrapY 
)

This method constructs a normal iterator calculating surface normals for the mesh based on the current vertex iterator. If the mesh surface is conceptually closed, i.e., x borders and/or y borders are attached, the wrapping is set to 'true'.

unsigned int VRS::Mesh::columns (  )  const

Return the number of mesh columns.

unsigned int VRS::Mesh::rows (  )  const

Return the number of mesh rows.

VRS::Mesh::VRS_TYPEINFO ( Mesh  ,
PolygonSet   
)

VRS::Mesh::VRS_SERIALIZABLE ( Mesh   ) 


The documentation for this class was generated from the following file:

Generated on Tue May 22 06:00:22 2012 by Doxygen 1.5.6
© 2001-2010 Hasso-Plattner-Institut | Impressum | Contact