GPU-Accelerated Coverage  0.1.0
Compute coverage tours for known environment with articulated objects on GPU
Public Types | Public Member Functions | Protected Attributes | List of all members
gpu_coverage::Mesh Class Reference

Class representing a mesh, corresponding to Assimp's aiMesh. More...

#include <Mesh.h>

Public Types

enum  BUFFERS {
  VERTEX_BUFFER, COLOR_BUFFER, TEXCOORD_BUFFER, NORMAL_BUFFER,
  INDEX_BUFFER
}
 Buffer semantics. More...
 
typedef std::vector< Bone * > Bones
 Vector of bones attached to this mesh.
 

Public Member Functions

 Mesh (const aiMesh *const mesh, const size_t id, const std::vector< Material * > &materials)
 Constructor. More...
 
 ~Mesh ()
 Destructor.
 
void render (const LocationsMaterial *const locations, const bool hasTesselationShader) const
 Renders the mesh. More...
 
void toDot (FILE *dot) const
 Write Graphviz Dot node representing this mesh to file for debugging. More...
 
size_t getId ()
 Returns the unique ID of this mesh. More...
 
const std::string & getName ()
 Returns the name of this mesh for logging. More...
 
BonesgetBones ()
 
MaterialgetMaterial ()
 

Protected Attributes

const size_t id
 Unique ID, see getId().
 
const std::string name
 Name of this mesh, see getName().
 
Materialmaterial
 Material associated with this mesh, see getMaterial().
 
GLuint vao
 Vertex array object.
 
GLuint vbo [5]
 Vertex buffers (vertex position, color, texture coordinate, normal, index)
 
unsigned int elementCount
 Number of indices used in the primitives to draw.
 
Bones bones
 Bones associated with this mesh.
 

Detailed Description

Class representing a mesh, corresponding to Assimp's aiMesh.

Member Enumeration Documentation

Buffer semantics.

This enum is also used by other classes that render mesh-like visible objects, e.g. CoordinateAxes and Dot.

Constructor & Destructor Documentation

gpu_coverage::Mesh::Mesh ( const aiMesh *const  mesh,
const size_t  id,
const std::vector< Material * > &  materials 
)

Constructor.

Parameters
meshThe Assimp aiMesh for creating this mesh.
idUnique ID of this mesh.
materialsVector of materials loaded beforehand.

Member Function Documentation

Bones& gpu_coverage::Mesh::getBones ( )
inline

Returns the bones attached to this mesh.

Returns
Vector of bones.
size_t gpu_coverage::Mesh::getId ( )
inline

Returns the unique ID of this mesh.

Returns
ID.
Material* gpu_coverage::Mesh::getMaterial ( )
inline

Returns the material associated with this mesh if applicable, otherwise NULL

Returns
Material or NULL.
const std::string& gpu_coverage::Mesh::getName ( )
inline

Returns the name of this mesh for logging.

Returns
Name of this mesh.

If available, the name included in the input file read by Assimp is used, otherwise a generic string is constructed.

void gpu_coverage::Mesh::render ( const LocationsMaterial *const  locations,
const bool  hasTesselationShader 
) const

Renders the mesh.

Parameters
locationsLocation variables of the material variables in the current shader.
hasTesselationShaderTrue if a tesselation shader is active.
void gpu_coverage::Mesh::toDot ( FILE *  dot) const

Write Graphviz Dot node representing this mesh to file for debugging.

Parameters
[in]dotOutput Dot file.

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