V-ART
Public Types | Public Member Functions | Public Attributes | Friends | List of all members
VART::Mesh 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 <mesh.h>

Public Types

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

Public Member Functions

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

Public Attributes

std::vector< unsigned int > indexVec
 indexes of the vertices (start at 0) defining faces More...
 
std::vector< unsigned int > normIndVec
 indexes of the normals (for unoptimized meshes) More...
 
Material material
 
MeshType type
 

Friends

std::ostream & operator<< (std::ostream &output, const Mesh &mesh)
 
std::ostream & operator<< (std::ostream &output, const 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 (MeshObject). 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 30 of file mesh.h.

Member Enumeration Documentation

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

Definition at line 34 of file mesh.h.

Constructor & Destructor Documentation

VART::Mesh::Mesh ( )

Creates an uninitialized mesh.

Definition at line 9 of file mesh.cpp.

VART::Mesh::Mesh ( const Mesh mesh)

Definition at line 12 of file mesh.cpp.

References indexVec, material, normIndVec, and type.

Member Function Documentation

bool VART::Mesh::DrawInstanceOGL ( ) const

Draws the mesh assuming that its MeshObject is optimized.

Returns
false if V-ART was not compiled with OpenGL support.

Definition at line 60 of file mesh.cpp.

void VART::Mesh::IncrementIndices ( unsigned int  increment)

Returns the mesh type as OpenGL enum.

Definition at line 27 of file mesh.cpp.

Referenced by VART::MeshObject::MergeWith().

VART::Mesh & VART::Mesh::operator= ( const Mesh mesh)

Definition at line 19 of file mesh.cpp.

References indexVec, material, normIndVec, and type.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  output,
const Mesh mesh 
)
friend
std::ostream& operator<< ( std::ostream &  output,
const MeshType  mt 
)
friend

Member Data Documentation

std::vector<unsigned int> VART::Mesh::indexVec

indexes of the vertices (start at 0) defining faces

Definition at line 62 of file mesh.h.

Referenced by VART::MeshObject::AddFace(), VART::Box::MakeBox(), VART::MeshObject::MakeBox(), Mesh(), VART::operator<<(), operator=(), and VART::MeshObject::ReadFromOBJ().

Material VART::Mesh::material
std::vector<unsigned int> VART::Mesh::normIndVec

indexes of the normals (for unoptimized meshes)

Definition at line 64 of file mesh.h.

Referenced by VART::MeshObject::AddFace(), Mesh(), operator=(), and VART::MeshObject::ReadFromOBJ().

MeshType VART::Mesh::type

The documentation for this class was generated from the following files: