Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages  

sglTriStripper Class Template Reference

#include <sglTriStripper.hpp>

List of all members.

Public Methods

 sglTriStripper ()
virtual ~sglTriStripper ()
unsigned int getNumTriangles () const
void addTriangleFace (sglTriStruct< T > *tri)
void addPolyFace (const vector< T > &vertList)
void computeSmoothNormals (const sglVec3f *verts, unsigned int(*addNormal)(void *,sglVec3f &), void *passThrough)
void computeFacetedNormals (const sglVec3f *verts, unsigned int(*addNormal)(void *,sglVec3f &), void *passThrough)
void triStripify (bool verbose=true)
void reset ()
void copyTriangleIndexLists (unsigned int *index_vlist, unsigned int *index_nlist, unsigned int *index_tlist, unsigned int *index_clist)
unsigned int getNumStrips () const
vector<T>* getStrip (unsigned int index)
void copyStrip (unsigned int index, unsigned int *index_vlist, unsigned int *index_nlist, unsigned int *index_tlist, unsigned int *index_clist)

Static Public Methods

void computeFaceNormal (const sglVec3f &v0, const sglVec3f &v1, const sglVec3f &v2, sglVec3f &normal)


Detailed Description

template<class T> class sglTriStripper

Grouped by material state.

To make for efficient processing all faces with the same material type are grouped together. This class contains the repository for a single material definition and all associated face data (vertex, normal and texcoord indices). It also contains the function used to convert the triangle face data into more efficient triangle strips.

Definition at line 49 of file sglTriStripper.hpp.


Constructor & Destructor Documentation

template<class T>
sglTriStripper< T >::sglTriStripper<T> ( ) [inline]
 

constructor initializes object as a black (empty) material.

Definition at line 198 of file sglTriStripper.hpp.

template<class T>
sglTriStripper< T >::~sglTriStripper<T> ( ) [inline, virtual]
 

Destructor.

Definition at line 209 of file sglTriStripper.hpp.


Member Function Documentation

template<class T>
unsigned int sglTriStripper<T>::getNumTriangles ( ) const [inline]
 

return number of triangles loaded.

Definition at line 58 of file sglTriStripper.hpp.

template<class T>
void sglTriStripper< T >::addTriangleFace ( sglTriStruct< T > * tri ) [inline]
 

sglObjModel passes absolute index list for current triangle (n-gons and relative indices are converted to triangles and absolute indices by the parser in sglObjModel

Definition at line 299 of file sglTriStripper.hpp.

template<class T>
void sglTriStripper< T >::computeFaceNormal ( const sglVec3f & v0,
const sglVec3f & v1,
const sglVec3f & v2,
sglVec3f & normal ) [inline, static]
 

Computes the normal for the given triangle face.

Definition at line 362 of file sglTriStripper.hpp.

template<class T>
void sglTriStripper<T>::computeSmoothNormals ( const sglVec3f * verts,
unsigned int(* addNormal)(void *,sglVec3f &),
void * passThrough )
 

Computes smooth (not faceted) normals for vertices with invalid normal indices (UINT_MAX). As each normal is calculated the given addNormal function is called to compute its index.

template<class T>
void sglTriStripper<T>::computeFacetedNormals ( const sglVec3f * verts,
unsigned int(* addNormal)(void *,sglVec3f &),
void * passThrough )
 

Computes faceted normals for vertices with invalid normal indices (UINT_MAX). As each normal is calculated the given addNormal function is called to compute its index.

template<class T>
void sglTriStripper< T >::triStripify ( bool verbose = true ) [inline]
 

create tri-strips from the original triangle data.

Definition at line 474 of file sglTriStripper.hpp.

template<class T>
void sglTriStripper< T >::reset ( ) [inline]
 

reset the tri-stripper to the initial state. (allows the stripper to be used more than once).

Definition at line 216 of file sglTriStripper.hpp.

template<>
void sglTriStripper< sglVertStructV >::copyTriangleIndexLists ( unsigned int * index_vlist,
unsigned int * index_nlist,
unsigned int * index_tlist,
unsigned int * index_clist ) [inline]
 

copy the index lists for the isolated triangles.

Definition at line 925 of file sglTriStripper.hpp.

template<class T>
unsigned int sglTriStripper<T>::getNumStrips ( ) const [inline]
 

get number of tstrips.

Definition at line 105 of file sglTriStripper.hpp.

template<class T>
vector< T > * sglTriStripper< T >::getStrip ( unsigned int index ) [inline]
 

get a handle to each strip based on index.

Definition at line 914 of file sglTriStripper.hpp.


The documentation for this class was generated from the following file:
Generated at Mon Jul 1 18:00:11 2002 for SGL by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001