GLC_ObjMtlLoader : Load the mtl file associated to a OBJ File. More...
#include <glc_objmtlloader.h>
Public Member Functions | |
Constructor / Destructor | |
| GLC_ObjMtlLoader (const QGLContext *, const QString &) | |
| virtual | ~GLC_ObjMtlLoader () |
Get Functions | |
| bool | contains (const QString &name) const |
| Return true if the material name is found. | |
| GLC_Material * | material (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_Material * | m_pCurrentMaterial |
| Current material. | |
| QHash< QString, GLC_Material * > | m_Materials |
| The GLC_Material Hash Table. | |
| QString | m_LoadStatus |
| the Load status | |
| const QGLContext * | m_pQGLContext |
| OpenGL Context. | |
| QSet< QString > | m_ListOfAttachedFileName |
| The list of attached file name. | |
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.
| GLC_ObjMtlLoader::GLC_ObjMtlLoader | ( | const QGLContext * | pContext, | |
| const QString & | fileName | |||
| ) |
Definition at line 35 of file glc_objmtlloader.cpp.
| GLC_ObjMtlLoader::~GLC_ObjMtlLoader | ( | ) | [virtual] |
Definition at line 45 of file glc_objmtlloader.cpp.
References m_ListOfAttachedFileName, and m_Materials.
| 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 158 of file glc_objmtlloader.cpp.
References m_LoadStatus, m_pCurrentMaterial, and GLC_Object::setName().
Referenced by loadMaterials().
| bool GLC_ObjMtlLoader::extractOneValue | ( | QString & | ligne | ) | [private] |
Extract One value.
Definition at line 283 of file glc_objmtlloader.cpp.
References m_FileName, m_LoadStatus, m_pCurrentMaterial, GLC_Material::setOpacity(), GLC_Material::setShininess(), and GLC_FileFormatException::WrongFileFormat.
Referenced by loadMaterials().
| bool GLC_ObjMtlLoader::extractRGBValue | ( | QString & | ligne | ) | [private] |
Extract RGB value.
Definition at line 220 of file glc_objmtlloader.cpp.
References m_LoadStatus, m_pCurrentMaterial, GLC_Material::setAmbientColor(), GLC_Material::setDiffuseColor(), and GLC_Material::setSpecularColor().
Referenced by loadMaterials().
| void GLC_ObjMtlLoader::extractTextureFileName | ( | QString & | ligne | ) | [private] |
Extract the texture file name.
Definition at line 185 of file glc_objmtlloader.cpp.
References getTextureName(), m_FileName, m_ListOfAttachedFileName, m_LoadStatus, m_pCurrentMaterial, m_pQGLContext, 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 337 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 | ( | ) |
Load the materials.
Definition at line 76 of file glc_objmtlloader.cpp.
References extractMaterialName(), extractOneValue(), extractRGBValue(), extractTextureFileName(), m_FileName, m_Materials, m_pCurrentMaterial, GLC_Object::name(), and processMayaSpecific().
Referenced by GLC_ObjToWorld::CreateWorldFromObj().
| GLC_Material * GLC_ObjMtlLoader::material | ( | const QString & | materialName | ) |
Get a material from is name.
Definition at line 60 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 378 of file glc_objmtlloader.cpp.
References GLC_Material::diffuseColor(), GLC_Material::hasTexture(), m_pCurrentMaterial, and GLC_Material::setDiffuseColor().
Referenced by loadMaterials().
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().
QSet<QString> GLC_ObjMtlLoader::m_ListOfAttachedFileName [private] |
The list of attached file name.
Definition at line 130 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(), extractTextureFileName(), 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().
GLC_Material* GLC_ObjMtlLoader::m_pCurrentMaterial [private] |
Current material.
Definition at line 118 of file glc_objmtlloader.h.
Referenced by extractMaterialName(), extractOneValue(), extractRGBValue(), extractTextureFileName(), loadMaterials(), and processMayaSpecific().
const QGLContext* GLC_ObjMtlLoader::m_pQGLContext [private] |
OpenGL Context.
Definition at line 127 of file glc_objmtlloader.h.
Referenced by extractTextureFileName().