GLC_ObjMtlLoader Class Reference

GLC_ObjMtlLoader : Load the mtl file associated to a OBJ File. More...

#include <glc_objmtlloader.h>

List of all members.

Public Member Functions

Constructor / Destructor

 GLC_ObjMtlLoader (const QString &)
virtual ~GLC_ObjMtlLoader ()
Get Functions

bool contains (const QString &name) const
 Return true if the material name is found.
GLC_Materialmaterial (const QString &)
 Get a material from is name.
QStringList listOfAttachedFileName () const
 Get the list of attached files.
Set Functions

bool loadMaterials ()
 Load the materials.

Private Member Functions

Private services functions

bool extractMaterialName (QString &)
 Extract the material name.
void extractTextureFileName (QString &)
 Extract the texture file name.
bool extractRGBValue (QString &)
 Extract RGB value.
bool extractOneValue (QString &)
 Extract One value.
QString getTextureName (QTextStream &, const QString &)
 Get texture file name without parameters.
void processMayaSpecific ()
 Process Maya specific obj.

Private Attributes

QString m_FileName
 The mtl file name.
GLC_Materialm_pCurrentMaterial
 Current material.
QHash< QString, GLC_Material * > m_Materials
 The GLC_Material Hash Table.
QString m_LoadStatus
 the Load status
QSet< QString > m_ListOfAttachedFileName
 The list of attached file name.

Detailed Description

GLC_ObjMtlLoader : Load the mtl file associated to a OBJ File.

An GLC_ObjMtlLoader create GLC_Material from the .mtl file

Definition at line 45 of file glc_objmtlloader.h.


Constructor & Destructor Documentation

GLC_ObjMtlLoader::GLC_ObjMtlLoader ( const QString &  fileName  ) 

Definition at line 35 of file glc_objmtlloader.cpp.

GLC_ObjMtlLoader::~GLC_ObjMtlLoader (  )  [virtual]

Definition at line 44 of file glc_objmtlloader.cpp.

References m_ListOfAttachedFileName, and m_Materials.


Member Function Documentation

bool GLC_ObjMtlLoader::contains ( const QString &  name  )  const [inline]

Return true if the material name is found.

Definition at line 63 of file glc_objmtlloader.h.

Referenced by GLC_ObjToWorld::addCurrentObjMeshToWorld(), and GLC_ObjToWorld::setCurrentMaterial().

bool GLC_ObjMtlLoader::extractMaterialName ( QString &  ligne  )  [private]

Extract the material name.

Definition at line 157 of file glc_objmtlloader.cpp.

References m_LoadStatus, m_pCurrentMaterial, and GLC_Object::setName().

Referenced by loadMaterials().

bool GLC_ObjMtlLoader::extractOneValue ( QString &  ligne  )  [private]
bool GLC_ObjMtlLoader::extractRGBValue ( QString &  ligne  )  [private]
void GLC_ObjMtlLoader::extractTextureFileName ( QString &  ligne  )  [private]

Extract the texture file name.

Definition at line 184 of file glc_objmtlloader.cpp.

References GLC_ErrorLog::addError(), getTextureName(), m_FileName, m_ListOfAttachedFileName, m_pCurrentMaterial, and GLC_Material::setTexture().

Referenced by loadMaterials().

QString GLC_ObjMtlLoader::getTextureName ( QTextStream &  inputStream,
const QString &  input 
) [private]

Get texture file name without parameters.

Definition at line 342 of file glc_objmtlloader.cpp.

References m_FileName, m_LoadStatus, and GLC_FileFormatException::WrongFileFormat.

Referenced by extractTextureFileName().

QStringList GLC_ObjMtlLoader::listOfAttachedFileName (  )  const [inline]

Get the list of attached files.

Definition at line 70 of file glc_objmtlloader.h.

Referenced by GLC_ObjToWorld::CreateWorldFromObj().

bool GLC_ObjMtlLoader::loadMaterials (  ) 
GLC_Material * GLC_ObjMtlLoader::material ( const QString &  materialName  ) 

Get a material from is name.

Definition at line 59 of file glc_objmtlloader.cpp.

References m_Materials.

Referenced by GLC_ObjToWorld::addCurrentObjMeshToWorld().

void GLC_ObjMtlLoader::processMayaSpecific (  )  [private]

Process Maya specific obj.

Definition at line 383 of file glc_objmtlloader.cpp.

References GLC_Material::diffuseColor(), GLC_Material::hasTexture(), m_pCurrentMaterial, and GLC_Material::setDiffuseColor().

Referenced by loadMaterials().


Member Data Documentation

QString GLC_ObjMtlLoader::m_FileName [private]

The mtl file name.

Definition at line 115 of file glc_objmtlloader.h.

Referenced by extractOneValue(), extractTextureFileName(), getTextureName(), and loadMaterials().

The list of attached file name.

Definition at line 127 of file glc_objmtlloader.h.

Referenced by extractTextureFileName(), and ~GLC_ObjMtlLoader().

QString GLC_ObjMtlLoader::m_LoadStatus [private]

the Load status

Definition at line 124 of file glc_objmtlloader.h.

Referenced by extractMaterialName(), extractOneValue(), extractRGBValue(), and getTextureName().

QHash<QString, GLC_Material*> GLC_ObjMtlLoader::m_Materials [private]

The GLC_Material Hash Table.

Definition at line 121 of file glc_objmtlloader.h.

Referenced by loadMaterials(), material(), and ~GLC_ObjMtlLoader().


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

SourceForge.net Logo

©2005-2011 Laurent Ribon