CrystalSpace

Public API Reference

Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

csSingleIndexVertexSet Class Reference

This class can be used to construct objects which use a single index for vertex. More...

#include <cstool/mdltool.h>

List of all members.

Public Member Functions

 csSingleIndexVertexSet (bool ver=true, bool nrm=true, bool col=true, bool tex=true)
 Create a new set.
 csSingleIndexVertexSet (csDirtyAccessArray< int > *Vertices, csDirtyAccessArray< int > *Normals, csDirtyAccessArray< int > *Colors, csDirtyAccessArray< int > *Texels, bool DeleteLists)
 Create a set from existing lists.
 ~csSingleIndexVertexSet ()
 Destructor.
size_t Add (int Vertex, int Normal, int Color, int Texel)
 Add a vertex to the set.
void Add (int num, int *Vertices, int *Normal, int *Colors, int *Texels)
 Add several vertices at once.
size_t GetVertexCount () const
 Return the number of contained vertices.
int GetVertex (size_t n) const
 Get a vertex index.
int GetNormal (size_t n) const
 Get a normal index.
int GetColor (size_t n) const
 Get a color index.
int GetTexel (size_t n) const
 Get a texel index.


Detailed Description

This class can be used to construct objects which use a single index for vertex.

normal, color and texel lists, from objects that don't.

Definition at line 43 of file mdltool.h.


Constructor & Destructor Documentation

csSingleIndexVertexSet::csSingleIndexVertexSet bool  ver = true,
bool  nrm = true,
bool  col = true,
bool  tex = true
 

Create a new set.

You can chosse which lists to use. For example, if you choose not to use a color list then colors will not be used when searching for a vertex, and calls to GetColor() are not allowed.

csSingleIndexVertexSet::csSingleIndexVertexSet csDirtyAccessArray< int > *  Vertices,
csDirtyAccessArray< int > *  Normals,
csDirtyAccessArray< int > *  Colors,
csDirtyAccessArray< int > *  Texels,
bool  DeleteLists
 

Create a set from existing lists.

If 0 is passed for a list then that list will not be used. Note that this is different from adding all elements of the given lists because the lists will be kept and modified every time a vertex is added to the set.

csSingleIndexVertexSet::~csSingleIndexVertexSet  ) 
 

Destructor.


Member Function Documentation

void csSingleIndexVertexSet::Add int  num,
int *  Vertices,
int *  Normal,
int *  Colors,
int *  Texels
 

Add several vertices at once.

size_t csSingleIndexVertexSet::Add int  Vertex,
int  Normal,
int  Color,
int  Texel
 

Add a vertex to the set.

This function accepts the four separate indices and returns the single index. Certain elements are ignored if no lists exist for them (if demanded so at construction of the set).

int csSingleIndexVertexSet::GetColor size_t  n  )  const
 

Get a color index.

int csSingleIndexVertexSet::GetNormal size_t  n  )  const
 

Get a normal index.

int csSingleIndexVertexSet::GetTexel size_t  n  )  const
 

Get a texel index.

int csSingleIndexVertexSet::GetVertex size_t  n  )  const
 

Get a vertex index.

size_t csSingleIndexVertexSet::GetVertexCount  )  const
 

Return the number of contained vertices.


The documentation for this class was generated from the following file:
Generated for Crystal Space by doxygen 1.3.9.1