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

Represents a mesh material corresponding to Assimp's aiMaterial. More...

#include <Material.h>

Public Member Functions

 Material (const aiMaterial *const material, size_t id, const std::string &dir)
 Constructor. More...
 
virtual ~Material ()
 Destructor.
 
const float * getAmbient () const
 Returns the ambient material color. More...
 
const float * getDiffuse () const
 Returns the diffuse material color. More...
 
const float * getSpecular () const
 Returns the specular material color. More...
 
float getShininess () const
 Returns the material's shininess coefficient. More...
 
const std::string & getName () const
 Returns the name of this material for logging. More...
 
bool hasTexture () const
 Returns true if a diffuse texture is assigned to the material. More...
 
const TexturegetTexture () const
 Returns the diffuse texture if present, NULL otherwise. More...
 
void setTexture (const Texture *const texture)
 Sets the texture. More...
 
const size_t & getId () const
 Returns the unique ID of this material. More...
 

Static Public Member Functions

static void loadMaterialsFile (const char *const filename)
 Loads a supplement file mapping material names to texture images. More...
 

Protected Attributes

const size_t id
 Unique ID, see getId().
 
const std::string name
 Name of this animation, see getName().
 
float ambient [4]
 Ambient color RGBA.
 
float diffuse [4]
 Diffuse color RGBA.
 
float specular [4]
 Specular color RGBA.
 
float shininess
 Shininess factor.
 
const TexturediffuseTexture
 Diffuse texture if available, NULL otherwise.
 
bool allocatedDiffuseTexture
 True if this instance has allocated the texture and is responsible for deleting it later.
 

Detailed Description

Represents a mesh material corresponding to Assimp's aiMaterial.

Constructor & Destructor Documentation

gpu_coverage::Material::Material ( const aiMaterial *const  material,
size_t  id,
const std::string &  dir 
)

Constructor.

Parameters
[in]materialAssimp material structure.
[in]idUnique ID of this material.
[in]dirDirectory for loading texture images.

Member Function Documentation

const float* gpu_coverage::Material::getAmbient ( ) const
inline

Returns the ambient material color.

Returns
Ambient material color.
const float* gpu_coverage::Material::getDiffuse ( ) const
inline

Returns the diffuse material color.

Returns
Diffuse material color.
const size_t& gpu_coverage::Material::getId ( ) const
inline

Returns the unique ID of this material.

Returns
ID.
const std::string& gpu_coverage::Material::getName ( ) const
inline

Returns the name of this material for logging.

Returns
Name of this material.

If available, the name included in the input file read by Assimp is used.

float gpu_coverage::Material::getShininess ( ) const
inline

Returns the material's shininess coefficient.

Returns
Shininess coefficient.
const float* gpu_coverage::Material::getSpecular ( ) const
inline

Returns the specular material color.

Returns
Specular material color.
const Texture* gpu_coverage::Material::getTexture ( ) const
inline

Returns the diffuse texture if present, NULL otherwise.

Returns
Diffuse texture.
bool gpu_coverage::Material::hasTexture ( ) const
inline

Returns true if a diffuse texture is assigned to the material.

Returns
True if diffuse texture is assigned.
static void gpu_coverage::Material::loadMaterialsFile ( const char *const  filename)
static

Loads a supplement file mapping material names to texture images.

Parameters
[in]filenameFile name.
void gpu_coverage::Material::setTexture ( const Texture *const  texture)
inline

Sets the texture.

Parameters
[in]textureNew texture.

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