V-ART
Public Member Functions | Static Public Member Functions | List of all members
VART::Material Class Reference

Material properties for graphical objects. More...

#include <material.h>

Public Member Functions

 Material ()
 
 Material (const Material &m)
 Creates a new material, creating a copy of another one. More...
 
 Material (const Color &c)
 Creates plastic-looking material of given color. More...
 
 Material (const Texture &t)
 Creates a Material, aplying a texture to it. More...
 
 Material (const Color &c, float spc, float amb, float ems, float shi)
 Sets all colors to be shades of one single color. More...
 
Materialoperator= (const Material &m)
 Copies all texture data from one to another. More...
 
void SetPlasticColor (const VART::Color &c)
 Makes the material to have a plastic-looking of given color. More...
 
void SetDiffuseColor (const Color &c)
 Sets the diffuse color (main color) of the material. More...
 
const ColorGetDiffuseColor () const
 Returns the diffuse color. More...
 
void SetSpecularColor (const Color &c)
 Sets the specular color (highlight color) of the material. More...
 
const ColorGetSpecularColor () const
 Returns the specular color of the material. More...
 
void SetAmbientColor (const Color &c)
 Sets the ambient color of the material. More...
 
const ColorGetAmbientColor () const
 Returns the ambient color of the material. More...
 
void SetEmissiveColor (const Color &c)
 Sets the emissive color of the material. More...
 
const ColorGetEmissiveColor () const
 Returns the emissive color of the material. More...
 
void SetTexture (const Texture &t)
 Sets the texture of material. More...
 
bool HasTexture () const
 Indicates if a material contains texture. More...
 
const VART::TextureGetTexture () const
 Returns the current texture of material. More...
 
void SetShininess (float newValue)
 Set the shininess of the material. More...
 
float GetShininess () const
 Return the shininess of the material. More...
 
bool DrawOGL () const
 Draws the material using OpenGL engine. More...
 

Static Public Member Functions

static const MaterialLIGHT_PLASTIC_GRAY ()
 
static const MaterialDARK_PLASTIC_GRAY ()
 
static const MaterialPLASTIC_WHITE ()
 
static const MaterialPLASTIC_RED ()
 
static const MaterialPLASTIC_GREEN ()
 
static const MaterialPLASTIC_BLUE ()
 
static const MaterialPLASTIC_BLACK ()
 

Detailed Description

Material properties for graphical objects.

FixMe: Put detailed description here.

Definition at line 16 of file material.h.

Constructor & Destructor Documentation

VART::Material::Material ( )

Definition at line 14 of file material.cpp.

VART::Material::Material ( const Material m)

Creates a new material, creating a copy of another one.

Definition at line 19 of file material.cpp.

VART::Material::Material ( const Color c)

Creates plastic-looking material of given color.

Definition at line 24 of file material.cpp.

VART::Material::Material ( const Texture t)

Creates a Material, aplying a texture to it.

Definition at line 29 of file material.cpp.

VART::Material::Material ( const Color c,
float  spc,
float  amb,
float  ems,
float  shi 
)

Sets all colors to be shades of one single color.

Definition at line 35 of file material.cpp.

References VART::Color::GetScaled().

Member Function Documentation

const VART::Material & VART::Material::DARK_PLASTIC_GRAY ( )
static

Definition at line 70 of file material.cpp.

Referenced by VART::Box::MakeBox(), and VART::MeshObject::MakeBox().

bool VART::Material::DrawOGL ( ) const

Draws the material using OpenGL engine.

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

Definition at line 111 of file material.cpp.

const Color& VART::Material::GetAmbientColor ( ) const
inline

Returns the ambient color of the material.

Definition at line 58 of file material.h.

const Color& VART::Material::GetDiffuseColor ( ) const
inline

Returns the diffuse color.

Definition at line 46 of file material.h.

const Color& VART::Material::GetEmissiveColor ( ) const
inline

Returns the emissive color of the material.

Definition at line 64 of file material.h.

float VART::Material::GetShininess ( ) const
inline

Return the shininess of the material.

Definition at line 82 of file material.h.

const Color& VART::Material::GetSpecularColor ( ) const
inline

Returns the specular color of the material.

Definition at line 52 of file material.h.

const VART::Texture& VART::Material::GetTexture ( ) const
inline

Returns the current texture of material.

Definition at line 73 of file material.h.

bool VART::Material::HasTexture ( ) const
inline

Indicates if a material contains texture.

Definition at line 70 of file material.h.

References VART::Texture::HasData().

const VART::Material & VART::Material::LIGHT_PLASTIC_GRAY ( )
static

Definition at line 64 of file material.cpp.

VART::Material & VART::Material::operator= ( const Material m)

Copies all texture data from one to another.

Definition at line 44 of file material.cpp.

const VART::Material & VART::Material::PLASTIC_BLACK ( )
static

Definition at line 100 of file material.cpp.

References VART::Color::BLACK().

const VART::Material & VART::Material::PLASTIC_BLUE ( )
static

Definition at line 94 of file material.cpp.

References VART::Color::BLUE().

Referenced by VART::RefSystem::RefSystem().

const VART::Material & VART::Material::PLASTIC_GREEN ( )
static

Definition at line 88 of file material.cpp.

References VART::Color::GREEN().

Referenced by VART::RefSystem::RefSystem().

const VART::Material & VART::Material::PLASTIC_RED ( )
static

Definition at line 82 of file material.cpp.

References VART::Color::RED().

Referenced by VART::RefSystem::RefSystem().

const VART::Material & VART::Material::PLASTIC_WHITE ( )
static

Definition at line 76 of file material.cpp.

References VART::Color::WHITE().

void VART::Material::SetAmbientColor ( const Color c)
inline

Sets the ambient color of the material.

Definition at line 55 of file material.h.

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

void VART::Material::SetDiffuseColor ( const Color c)
inline

Sets the diffuse color (main color) of the material.

Definition at line 43 of file material.h.

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

void VART::Material::SetEmissiveColor ( const Color c)
inline

Sets the emissive color of the material.

Definition at line 61 of file material.h.

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

void VART::Material::SetPlasticColor ( const VART::Color c)

Makes the material to have a plastic-looking of given color.

Sets the diffuse, specular, ambient and emissive colors of the material, to make it to have a plastic-looking of a given color.

Definition at line 55 of file material.cpp.

References VART::Color::GetScaled().

void VART::Material::SetShininess ( float  newValue)
inline

Set the shininess of the material.

According to the "OpenGL programming guide" (red book), shininess should be in the range of 0.0 (no shininess) to 128.0 (very shiny).

Definition at line 79 of file material.h.

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

void VART::Material::SetSpecularColor ( const Color c)
inline

Sets the specular color (highlight color) of the material.

Definition at line 49 of file material.h.

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

void VART::Material::SetTexture ( const Texture t)

Sets the texture of material.

Definition at line 106 of file material.cpp.

Referenced by VART::MeshObject::ReadFromOBJ(), and VART::MeshObject::ReadMaterialTable().


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