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

sheep::GLMesh Class Reference

#include <glmesh.h>

Inheritance diagram for sheep::GLMesh:

sheep::SGNode List of all members.

Public Types

typedef std::vector< SubMesh * > SubMeshVector
typedef SubMeshVector::const_iterator SubMeshVectorConstIt
enum  RenderingMode { IMMEDIATE_MODE, DISPLAY_LIST }

Public Member Functions

 GLMesh ()
virtual ~GLMesh ()
void Insert (SubMesh *m)
int GetVertexCount () const
int GetFaceCount () const
const AABB3GetAABB () const
void FlipFaces ()
void SetupRendering (RenderingMode mode)
void Render () const
void DisplayNormals () const

Public Attributes

SubMeshVector m_sub_meshes

Private Attributes

int m_vertex_count
 Total number of vertices.

int m_face_count
 Total number of faces.

AABB3 m_aabb
 Axis-aligned bounding box.


Member Typedef Documentation

typedef std::vector<SubMesh *> sheep::GLMesh::SubMeshVector
 

Definition at line 90 of file glmesh.h.

typedef SubMeshVector::const_iterator sheep::GLMesh::SubMeshVectorConstIt
 

Definition at line 91 of file glmesh.h.

Referenced by DisplayNormals(), FlipFaces(), Render(), SetupRendering(), and ~GLMesh().


Member Enumeration Documentation

enum sheep::GLMesh::RenderingMode
 

Enumeration values:
IMMEDIATE_MODE 
DISPLAY_LIST 

Definition at line 40 of file glmesh.h.


Constructor & Destructor Documentation

GLMesh::GLMesh  ) 
 

Definition at line 220 of file glmesh.cpp.

References m_face_count, and m_vertex_count.

GLMesh::~GLMesh  )  [virtual]
 

Definition at line 226 of file glmesh.cpp.

References m_sub_meshes, and SubMeshVectorConstIt.


Member Function Documentation

void GLMesh::DisplayNormals  )  const
 

Definition at line 285 of file glmesh.cpp.

References m_sub_meshes, and SubMeshVectorConstIt.

void GLMesh::FlipFaces  ) 
 

Flip faces and normals. Don't forget to call SetupRendering() before rendering the mesh.

Definition at line 249 of file glmesh.cpp.

References sheep::GLMesh::SubMesh::FaceVectorIt, sheep::GLMesh::SubMesh::m_faces, sheep::GLMesh::SubMesh::Face::m_n1, sheep::GLMesh::SubMesh::Face::m_n2, sheep::GLMesh::SubMesh::m_normals, m_sub_meshes, sheep::GLMesh::SubMesh::Face::m_t1, sheep::GLMesh::SubMesh::Face::m_t2, sheep::GLMesh::SubMesh::Face::m_v1, sheep::GLMesh::SubMesh::Face::m_v2, SubMeshVectorConstIt, and sheep::GLMesh::SubMesh::Vector3VectorIt.

const AABB3 & GLMesh::GetAABB  )  const [inline]
 

Definition at line 166 of file glmesh.h.

int GLMesh::GetFaceCount  )  const [inline]
 

Definition at line 161 of file glmesh.h.

int GLMesh::GetVertexCount  )  const [inline]
 

Definition at line 156 of file glmesh.h.

void GLMesh::Insert SubMesh m  ) 
 

The submesh must be fully defined and ready to be rendered when it is inserted.

Definition at line 232 of file glmesh.cpp.

References sheep::AABB3::Include(), m_face_count, sheep::GLMesh::SubMesh::m_faces, m_sub_meshes, m_vertex_count, sheep::GLMesh::SubMesh::m_vertices, and sheep::GLMesh::SubMesh::Vector3VectorConstIt.

void GLMesh::Render  )  const
 

Definition at line 279 of file glmesh.cpp.

References m_sub_meshes, and SubMeshVectorConstIt.

void GLMesh::SetupRendering RenderingMode  mode  ) 
 

Changes the rendering mode of the mesh. Default rendering mode is IMMEDIATE. Call this method if the mesh has been modified since the last call (call it before calling the Render() method).

Definition at line 273 of file glmesh.cpp.

References m_sub_meshes, and SubMeshVectorConstIt.


Member Data Documentation

AABB3 sheep::GLMesh::m_aabb [private]
 

Axis-aligned bounding box.

Definition at line 125 of file glmesh.h.

int sheep::GLMesh::m_face_count [private]
 

Total number of faces.

Definition at line 124 of file glmesh.h.

Referenced by GLMesh(), and Insert().

SubMeshVector sheep::GLMesh::m_sub_meshes
 

Definition at line 93 of file glmesh.h.

Referenced by DisplayNormals(), FlipFaces(), Insert(), Render(), SetupRendering(), and ~GLMesh().

int sheep::GLMesh::m_vertex_count [private]
 

Total number of vertices.

Definition at line 123 of file glmesh.h.

Referenced by GLMesh(), and Insert().


The documentation for this class was generated from the following files:
Generated on Tue May 11 01:31:56 2004 for toxic by doxygen 1.3.6