"L. Spiro Engine"
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes

lsg::CStripAdjacency Class Reference

Creates adjacency information for the preparation of the conversion from a triangle list to a triangle strip. More...

#include <LSGStripAdjacency.h>

List of all members.

Classes

struct  LSG_ADJ_EDGE
struct  LSG_ADJ_TRI

Public Types

typedef struct
lsg::CStripAdjacency::LSG_ADJ_TRI
LPLSG_ADJ_TRI
typedef struct
lsg::CStripAdjacency::LSG_ADJ_TRI 
LPCLSG_ADJ_TRI
typedef struct
lsg::CStripAdjacency::LSG_ADJ_EDGE
LPLSG_ADJ_EDGE
typedef struct
lsg::CStripAdjacency::LSG_ADJ_EDGE 
LPCLSG_ADJ_EDGE

Public Member Functions

LSBOOL LSE_CALL InitStripAdjacency (LSUINT32 _ui32Faces=0UL, const LSUINT32 *_pui32Faces=NULL, const LSUINT16 *_pui16Faces=NULL)
LSBOOL LSE_CALL CreateDatabase ()
LSVOID LSE_CALL Reset ()
LSE_INLINE LSUINT32 LSE_CALL TotalFaces () const
LSE_INLINE LSUINT32 LSE_CALL TotalEdges () const
LSE_INLINE const LSG_ADJ_TRI
*LSE_CALL 
Faces () const
LSE_INLINE const LSG_ADJ_EDGE
*LSE_CALL 
Edges () const

Static Public Member Functions

static LSE_INLINE LSUINT32 LSE_CALL FindEdge (const LSG_ADJ_TRI &_atAdjInfo, LSUINT32 _ui32Ref0, LSUINT32 _ui32Ref1)
static LSE_INLINE LSUINT32 LSE_CALL OppositeVertex (const LSG_ADJ_TRI &_atAdjInfo, LSUINT32 _ui32Ref0, LSUINT32 _ui32Ref1)

Protected Member Functions

LSVOID LSE_CALL AddTriangle (LSUINT32 _ui32Vert0, LSUINT32 _ui32Vert1, LSUINT32 _ui32Vert2)
LSVOID LSE_CALL AddEdge (LSUINT32 _ui32Edge0, LSUINT32 _ui32Edge1, LSUINT32 _ui32Face)
LSBOOL LSE_CALL UpdateLink (LSUINT32 _ui32Tri0, LSUINT32 _ui32Tri1, LSUINT32 _ui32Ref0, LSUINT32 _ui32Ref1)

Protected Attributes

LSG_ADJ_TRIm_patFaces
LSG_ADJ_EDGEm_paeEdges
LSUINT32 m_ui32Faces
LSUINT32 m_ui32Edges

Detailed Description

Creates adjacency information for the preparation of the conversion from a triangle list to a triangle strip.

Class CStripAdjacency Description: Creates adjacency information for the preparation of the conversion from a triangle list to a triangle strip. Code based on Pierre Terdiman's original work.


Member Typedef Documentation

An adjacent edge.

Adjacency information. Indices of triangles adjacent to each other.


Member Function Documentation

LSVOID LSE_CALL lsg::CStripAdjacency::AddEdge ( LSUINT32  _ui32Edge0,
LSUINT32  _ui32Edge1,
LSUINT32  _ui32Face 
) [protected]

Add an edge to the database.

Parameters:
_ui32Edge0Edge index 0.
_ui32Edge1Edge index 1.
_ui32FaceFace index.
LSVOID LSE_CALL lsg::CStripAdjacency::AddTriangle ( LSUINT32  _ui32Vert0,
LSUINT32  _ui32Vert1,
LSUINT32  _ui32Vert2 
) [protected]

Add a triangle to the database.

Parameters:
_ui32Vert0Vertex 0.
_ui32Vert1Vertex 1.
_ui32Vert2Vertex 2.
LSBOOL LSE_CALL lsg::CStripAdjacency::CreateDatabase ( )

Create the adjency data.

Returns:
Returns false for non-manifold meshes. If any edge is shared by more than 2 triangles, this returns false. Most meshes are manifold, and non-manifold meshes are still easy to handle without triangle stripping.
LSE_INLINE const CStripAdjacency::LSG_ADJ_EDGE *LSE_CALL lsg::CStripAdjacency::Edges ( ) const

Get the pointer to the start of the edge array.

Returns:
Return the pointer to the start of the edge array.
LSE_INLINE const CStripAdjacency::LSG_ADJ_TRI *LSE_CALL lsg::CStripAdjacency::Faces ( ) const

Get the pointer to the start of the face array.

Returns:
Return the pointer to the start of the face array.
LSE_INLINE LSUINT32 LSE_CALL lsg::CStripAdjacency::FindEdge ( const LSG_ADJ_TRI _atAdjInfo,
LSUINT32  _ui32Ref0,
LSUINT32  _ui32Ref1 
) [static]

Find an edge on a triangle given two vertex references.

Parameters:
_atAdjInfoAdjacency information.
_ui32Ref0First reference.
_ui32Ref1Second reference.
Returns:
Returns the edge number between 0 and 2 or 0xFF if the references are wrong.
LSBOOL LSE_CALL lsg::CStripAdjacency::InitStripAdjacency ( LSUINT32  _ui32Faces = 0UL,
const LSUINT32 *  _pui32Faces = NULL,
const LSUINT16 *  _pui16Faces = NULL 
)

Initialize adjacency information. _pui32Faces and _pui16Faces cannot both be valid. One or the other must be NULL, but not both.

Parameters:
_ui32FacesNumber of triangles.
_pui32FacesPointer to the triangles with 32-bit indices or NULL.
_pui16FacesPointer to the triangles with 16-bit indices or NULL.
Returns:
Returns false if there are not enough resources to complete the setup.
LSE_INLINE LSUINT32 LSE_CALL lsg::CStripAdjacency::OppositeVertex ( const LSG_ADJ_TRI _atAdjInfo,
LSUINT32  _ui32Ref0,
LSUINT32  _ui32Ref1 
) [static]

Gets the last vertex reference given the first two.

Parameters:
_atAdjInfoAdjacency information.
_ui32Ref0First reference.
_ui32Ref1Second reference.
Returns:
Returns the last vertex reference given the first two or ~0UL on invalid input.
LSVOID LSE_CALL lsg::CStripAdjacency::Reset ( )

Reset the object back to default.

LSE_INLINE LSUINT32 LSE_CALL lsg::CStripAdjacency::TotalEdges ( ) const

Get the number of edges.

Returns:
Returns the number of edges.
LSE_INLINE LSUINT32 LSE_CALL lsg::CStripAdjacency::TotalFaces ( ) const

Get the number of faces.

Returns:
Returns the number of faces.
LSBOOL LSE_CALL lsg::CStripAdjacency::UpdateLink ( LSUINT32  _ui32Tri0,
LSUINT32  _ui32Tri1,
LSUINT32  _ui32Ref0,
LSUINT32  _ui32Ref1 
) [protected]

Update links between two triangles that share the same edge.

Parameters:
_ui32Tri0First triangle sharing the edge.
_ui32Tri1Second triangle sharing the edge.
_ui32Ref0Common edge index 0.
_ui32Ref1Common edge index 1.
Returns:
Returns false if the input is invalid.

Member Data Documentation

Array of edges.

Array of triangles.

LSUINT32 lsg::CStripAdjacency::m_ui32Edges [protected]

Total edges.

LSUINT32 lsg::CStripAdjacency::m_ui32Faces [protected]

Total faces.


The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator