Keos::CMaterial Class Reference

Material (texture, . More...

#include <KeosMaterial.h>

List of all members.

Public Member Functions

 CMaterial ()
 Default constructor.
 CMaterial (const String &strTexture)
 Default constructor.
 ~CMaterial ()
 Destructor.
CTextureGetTexture (ushort nLayer=0)
 Get a texture.
bool CreateTexture (const String &strTexture, ushort nLayer=0)
 Create a texture.
bool CreateTexture (const CImage &Image, ushort nLayer=0)
 Create a texture.
void SetDiffuseColor (const CColor &Color)
 Assign a diffuse color.
CColor GetDiffuseColor ()
 Get the diffuse color.
bool HasTexture (ushort nLayer=0)
 Test if the material has a texture in the specified layer.
String GetName (void)
 Get the name of the material.
void SetName (const String &strName)
 Set the name of the material.

Protected Types

typedef std::vector< CTexture * > TTextureList
 List of the textures.

Protected Attributes

String m_strName
 Name of the material.
TTextureList m_Textures
CColor m_DiffuseColor
 Diffuse color.


Detailed Description

Material (texture, .

..).

Definition at line 33 of file KeosMaterial.h.


Member Typedef Documentation

typedef std::vector<CTexture*> Keos::CMaterial::TTextureList [protected]

List of the textures.

Definition at line 117 of file KeosMaterial.h.


Constructor & Destructor Documentation

Keos::CMaterial::CMaterial (  ) 

Default constructor.

Definition at line 34 of file KeosMaterial.cpp.

References m_DiffuseColor, m_strName, and Keos::CColor::White.

Keos::CMaterial::CMaterial ( const String strTexture  ) 

Default constructor.

Parameters:
strTexture Path of the texture.

Definition at line 41 of file KeosMaterial.cpp.

References CreateTexture(), m_DiffuseColor, m_strName, and Keos::CColor::White.

Keos::CMaterial::~CMaterial (  ) 

Destructor.

Definition at line 50 of file KeosMaterial.cpp.

References m_Textures.


Member Function Documentation

CTexture* Keos::CMaterial::GetTexture ( ushort  nLayer = 0  )  [inline]

Get a texture.

Parameters:
nLayer Layer of the texture, if there are more than one texture.
Returns:
The texture for the specified layer.

Definition at line 54 of file KeosMaterial.h.

References Assert.

bool Keos::CMaterial::CreateTexture ( const String strTexture,
ushort  nLayer = 0 
)

Create a texture.

If there is already a texture (for the specified layer), it will be automatically delete.

Parameters:
strTexture Path of the texture.
nLayer Layer where the texture will be created.
Returns:
True if the creation succeeded.

Definition at line 56 of file KeosMaterial.cpp.

References Keos::CTexture::CreateFromFile(), Keos::CSingleton< T >::Instance(), KEOS_DELETE, Keos::ILogger::Log(), m_Textures, and Keos::PXF_A8R8G8B8.

Referenced by CMaterial(), Keos::CMDLQ1Loader::LoadFromFile(), Keos::CMD2Loader::LoadFromFile(), and Keos::CMD2AnimatedLoader::LoadFromFile().

bool Keos::CMaterial::CreateTexture ( const CImage Image,
ushort  nLayer = 0 
)

Create a texture.

If there is already a texture (for the specified layer), it will be automatically delete.

Parameters:
Image Image of the texture.
nLayer Layer where the texture will be created.
Returns:
True if the creation succeeded.

Definition at line 83 of file KeosMaterial.cpp.

References Keos::CTexture::CreateFromImage(), Keos::CImage::GetFormat(), Keos::CSingleton< T >::Instance(), KEOS_DELETE, Keos::ILogger::Log(), and m_Textures.

void Keos::CMaterial::SetDiffuseColor ( const CColor Color  )  [inline]

Assign a diffuse color.

Definition at line 78 of file KeosMaterial.h.

CColor Keos::CMaterial::GetDiffuseColor ( void   )  [inline]

Get the diffuse color.

Definition at line 85 of file KeosMaterial.h.

Referenced by Keos::CMeshGeom::AssignMaterialColor().

bool Keos::CMaterial::HasTexture ( ushort  nLayer = 0  )  [inline]

Test if the material has a texture in the specified layer.

Definition at line 92 of file KeosMaterial.h.

String Keos::CMaterial::GetName ( void   )  [inline]

Get the name of the material.

Definition at line 99 of file KeosMaterial.h.

void Keos::CMaterial::SetName ( const String strName  )  [inline]

Set the name of the material.

Definition at line 106 of file KeosMaterial.h.


Member Data Documentation

String Keos::CMaterial::m_strName [protected]

Name of the material.

Definition at line 114 of file KeosMaterial.h.

Referenced by CMaterial().

TTextureList Keos::CMaterial::m_Textures [protected]

Definition at line 118 of file KeosMaterial.h.

Referenced by CreateTexture(), and ~CMaterial().

CColor Keos::CMaterial::m_DiffuseColor [protected]

Diffuse color.

Definition at line 121 of file KeosMaterial.h.

Referenced by CMaterial().


The documentation for this class was generated from the following files:
Generated on Fri Mar 9 14:29:24 2007 for Keos by  doxygen 1.5.1-p1