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

VPMesh Class Reference

A mesh is part of an graphical object, in which faces are made of vertices according to some rule of formation. More...

#include <vpmesh.h>

Inheritance diagram for VPMesh:

VPGraphicObj VPSceneNode VPMemoryObj List of all members.

Public Types

enum  MeshType {
  POINTS, LINES, LINE_STRIP, LINE_LOOP,
  TRIANGLES, TRIANGLE_STRIP, TRIANGLE_FAN, QUADS,
  QUAD_STRIP, POLYGON
}

Public Member Functions

 VPMesh ()
 Creates an uninitialized mesh.
 VPMesh (const VPMesh &mesh)
VPMeshoperator= (const VPMesh &mesh)
bool DrawInstanceOGL () const
 Draws the mesh assuming that its MeshObject is optimized.
void IncrementIndices (unsigned int increment)
 Returns the mesh type as OpenGL enum.
 VPMesh (void)

Public Attributes

std::vector< unsigned int > indexVec
std::vector< unsigned int > normIndVec
VPMaterial material
MeshType type

Friends

std::ostream & operator<< (std::ostream &output, MeshType mt)

Detailed Description

A mesh is part of an graphical object, in which faces are made of vertices according to some rule of formation.

The mesh is the basic building block of an mesh object (VPMeshObject). It has a single material, and indexes to vertices that define faces according to a rule (on a triangle strip, for instance, the first 3 indexes from a face, and then each new index from a new face together with the last 2 indexes). A mesh degenerates to a single polygon if the mesh object has no pratical rule of formation.

Definition at line 27 of file vpmesh.h.


Member Enumeration Documentation

enum VPMesh::MeshType
 

Enumerator:
POINTS 
LINES 
LINE_STRIP 
LINE_LOOP 
TRIANGLES 
TRIANGLE_STRIP 
TRIANGLE_FAN 
QUADS 
QUAD_STRIP 
POLYGON 

Definition at line 30 of file vpmesh.h.


Constructor & Destructor Documentation

VPMesh::VPMesh  ) 
 

Creates an uninitialized mesh.

Definition at line 28 of file vpmesh.cpp.

VPMesh::VPMesh const VPMesh mesh  ) 
 

Definition at line 31 of file vpmesh.cpp.

References indexVec, material, normIndVec, and type.

VPMesh::VPMesh void   )  [inline]
 

Definition at line 28 of file vpmymesh.h.


Member Function Documentation

bool VPMesh::DrawInstanceOGL  )  const [virtual]
 

Draws the mesh assuming that its MeshObject is optimized.

Returns:
false if VPAT was not compiled with OpenGL support.

Reimplemented from VPSceneNode.

Definition at line 82 of file vpmesh.cpp.

References VPMaterial::DrawOGL(), indexVec, and material.

void VPMesh::IncrementIndices unsigned int  increment  ) 
 

Returns the mesh type as OpenGL enum.

Definition at line 49 of file vpmesh.cpp.

References indexVec.

Referenced by VPMeshObject::MergeWith().

VPMesh & VPMesh::operator= const VPMesh mesh  ) 
 

Definition at line 41 of file vpmesh.cpp.

References indexVec, material, normIndVec, and type.


Friends And Related Function Documentation

std::ostream& operator<< std::ostream &  output,
MeshType  mt
[friend]
 


Member Data Documentation

std::vector<unsigned int> VPMesh::indexVec
 

Definition at line 57 of file vpmesh.h.

Referenced by VPMeshObject::AddFace(), DrawInstanceOGL(), IncrementIndices(), VPMeshObject::MakeBox(), operator=(), and VPMesh().

VPMaterial VPMesh::material
 

Definition at line 59 of file vpmesh.h.

Referenced by DrawInstanceOGL(), VPMeshObject::MakeBox(), operator=(), and VPMesh().

std::vector<unsigned int> VPMesh::normIndVec
 

Definition at line 58 of file vpmesh.h.

Referenced by VPMeshObject::AddFace(), operator=(), and VPMesh().

MeshType VPMesh::type
 

Definition at line 60 of file vpmesh.h.

Referenced by VPMeshObject::AddFace(), VPMeshObject::MakeBox(), operator=(), and VPMesh().


The documentation for this class was generated from the following files:
Generated on Tue Sep 6 10:00:17 2005 for VPAT by  doxygen 1.4.4