Keos::CMeshGeom Class Reference

Defines a part of a complete mesh. More...

#include <KeosMeshGeom.h>

List of all members.

Public Types

typedef ushort TIndex
 Indice type for MeshGeom.

Public Member Functions

 CMeshGeom (const TVertex *pVertices, ulong nVerticesCount, const TIndex *pIndices, ulong nIndicesCount, TPrimitiveType PrimitiveType=PT_TRIANGLELIST)
 Default constructor.
 ~CMeshGeom ()
 Destructor.
uint GetTrianglesCount (void)
 Return the number of triangles/faces in the MeshGeom.
void SetMaterialIndex (int nIndex)
 Set the material index (The parent mesh holds the list of materials).
int GetMaterialIndex (void)
 Get the material index (The parent mesh holds the list of materials).
void AssignMaterialColor ()
 Assign the material diffuse color to all the vertices of meshgeom.
void AssignColor (const CColor &Color)
 Assign a color to all the vertices of meshgeom.

Protected Member Functions

int GetPrimitivesCount (TPrimitiveType PrimitiveType)
 Return the number of primitives for a primitive type.

Protected Attributes

CDeclarationPtr m_pDeclaration
 Vertex declaration.
CBuffer< TVertexm_VertexBuffer
 Vertex buffer.
CBuffer< TIndexm_IndexBuffer
 Index buffer.
TPrimitiveType m_PrimitiveType
 Primitive type (use to draw the meshgeom).
int m_nPrimitivesCount
 Number of primitives (use to draw the meshgeom).
CMeshm_pParentMesh
 Reference to parent Mesh.
int m_nMaterialIndex
 Material index (The parent mesh holds the list of materials).
bool m_bUseSharedVertexBuffer
 The meshgeom use shared vertex buffer ?

Friends

class CMesh
class CAnimatedMeshKF

Classes

struct  TVertex
 Vertex type for MeshGeom. More...


Detailed Description

Defines a part of a complete mesh.

Class for holding a mesh with a single material.

Definition at line 36 of file KeosMeshGeom.h.


Member Typedef Documentation

typedef ushort Keos::CMeshGeom::TIndex

Indice type for MeshGeom.

Definition at line 52 of file KeosMeshGeom.h.


Constructor & Destructor Documentation

Keos::CMeshGeom::CMeshGeom ( const TVertex pVertices,
ulong  nVerticesCount,
const TIndex pIndices,
ulong  nIndicesCount,
TPrimitiveType  PrimitiveType = PT_TRIANGLELIST 
)

Default constructor.

Parameters:
pVertices Pointer on vertex array.
nVerticesCount Number of vertices.
pIndices Pointer on index array.
nIndicesCount Number of indices.

Definition at line 35 of file KeosMeshGeom.cpp.

References Assert, Keos::IRenderSystem::CreateIndexBuffer(), Keos::IRenderSystem::CreateVertexBuffer(), Keos::IRenderSystem::CreateVertexDeclaration(), Keos::ELT_TYPE_COLOR, Keos::ELT_TYPE_FLOAT2, Keos::ELT_TYPE_FLOAT3, Keos::ELT_USAGE_DIFFUSE, Keos::ELT_USAGE_NORMAL, Keos::ELT_USAGE_POSITION, Keos::ELT_USAGE_TEXCOORD0, GetPrimitivesCount(), Keos::CSingleton< T >::Instance(), m_bUseSharedVertexBuffer, m_IndexBuffer, m_nMaterialIndex, m_nPrimitivesCount, m_pDeclaration, m_PrimitiveType, and m_VertexBuffer.

Keos::CMeshGeom::~CMeshGeom (  ) 

Destructor.

Definition at line 90 of file KeosMeshGeom.cpp.


Member Function Documentation

uint Keos::CMeshGeom::GetTrianglesCount ( void   )  [inline]

Return the number of triangles/faces in the MeshGeom.

Todo:
à voir suivant le type de primitive

Definition at line 80 of file KeosMeshGeom.h.

Referenced by Keos::CMesh::ComputeNormals().

void Keos::CMeshGeom::SetMaterialIndex ( int  nIndex  )  [inline]

Set the material index (The parent mesh holds the list of materials).

Definition at line 92 of file KeosMeshGeom.h.

int Keos::CMeshGeom::GetMaterialIndex ( void   )  [inline]

Get the material index (The parent mesh holds the list of materials).

Definition at line 100 of file KeosMeshGeom.h.

Referenced by Keos::CMesh::Render().

void Keos::CMeshGeom::AssignMaterialColor (  ) 

Assign the material diffuse color to all the vertices of meshgeom.

Definition at line 150 of file KeosMeshGeom.cpp.

References Assert, AssignColor(), Keos::CMaterial::GetDiffuseColor(), Keos::CMesh::GetMaterial(), Keos::CMesh::GetMaterialsCount(), m_nMaterialIndex, and m_pParentMesh.

void Keos::CMeshGeom::AssignColor ( const CColor Color  ) 

Assign a color to all the vertices of meshgeom.

Definition at line 125 of file KeosMeshGeom.cpp.

References Keos::IRenderSystem::ConvertColor(), Keos::CSingleton< T >::Instance(), Keos::LOCK_WRITEONLY, m_bUseSharedVertexBuffer, m_pParentMesh, Keos::CMesh::m_SharedVertexBuffer, and m_VertexBuffer.

Referenced by AssignMaterialColor().

int Keos::CMeshGeom::GetPrimitivesCount ( TPrimitiveType  PrimitiveType  )  [protected]

Return the number of primitives for a primitive type.

Todo:
Check the next

Definition at line 104 of file KeosMeshGeom.cpp.

References m_IndexBuffer, Keos::PT_LINELIST, Keos::PT_LINESTRIP, Keos::PT_POINTLIST, Keos::PT_TRIANGLELIST, and Keos::PT_TRIANGLESTRIP.

Referenced by CMeshGeom().


Friends And Related Function Documentation

friend class CMesh [friend]

Definition at line 38 of file KeosMeshGeom.h.

friend class CAnimatedMeshKF [friend]

Definition at line 39 of file KeosMeshGeom.h.


Member Data Documentation

CDeclarationPtr Keos::CMeshGeom::m_pDeclaration [protected]

Vertex declaration.

Definition at line 116 of file KeosMeshGeom.h.

Referenced by CMeshGeom(), and Keos::CMesh::Render().

CBuffer<TVertex> Keos::CMeshGeom::m_VertexBuffer [protected]

Vertex buffer.

Definition at line 118 of file KeosMeshGeom.h.

Referenced by AssignColor(), CMeshGeom(), Keos::CMesh::ComputeNormals(), and Keos::CMesh::Render().

CBuffer<TIndex> Keos::CMeshGeom::m_IndexBuffer [protected]

Index buffer.

Definition at line 120 of file KeosMeshGeom.h.

Referenced by CMeshGeom(), Keos::CMesh::ComputeNormals(), GetPrimitivesCount(), and Keos::CMesh::Render().

TPrimitiveType Keos::CMeshGeom::m_PrimitiveType [protected]

Primitive type (use to draw the meshgeom).

Definition at line 123 of file KeosMeshGeom.h.

Referenced by CMeshGeom(), and Keos::CMesh::Render().

int Keos::CMeshGeom::m_nPrimitivesCount [protected]

Number of primitives (use to draw the meshgeom).

Definition at line 125 of file KeosMeshGeom.h.

Referenced by CMeshGeom(), and Keos::CMesh::Render().

CMesh* Keos::CMeshGeom::m_pParentMesh [protected]

Reference to parent Mesh.

Definition at line 130 of file KeosMeshGeom.h.

Referenced by Keos::CMesh::AddMeshGeom(), AssignColor(), and AssignMaterialColor().

int Keos::CMeshGeom::m_nMaterialIndex [protected]

Material index (The parent mesh holds the list of materials).

Definition at line 133 of file KeosMeshGeom.h.

Referenced by AssignMaterialColor(), and CMeshGeom().

bool Keos::CMeshGeom::m_bUseSharedVertexBuffer [protected]

The meshgeom use shared vertex buffer ?

Definition at line 136 of file KeosMeshGeom.h.

Referenced by AssignColor(), CMeshGeom(), Keos::CMesh::ComputeNormals(), and Keos::CMesh::Render().


The documentation for this class was generated from the following files:
Generated on Fri Mar 9 14:29:26 2007 for Keos by  doxygen 1.5.1-p1