GLC_lib  2.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
glc_objmtlloader.h
Go to the documentation of this file.
1 /****************************************************************************
2 
3  This file is part of the GLC-lib library.
4  Copyright (C) 2005-2008 Laurent Ribon (laumaya@users.sourceforge.net)
5  Version 2.0.0, packaged on July 2010.
6 
7  http://glc-lib.sourceforge.net
8 
9  GLC-lib is free software; you can redistribute it and/or modify
10  it under the terms of the GNU Lesser General Public License as published by
11  the Free Software Foundation; either version 3 of the License, or
12  (at your option) any later version.
13 
14  GLC-lib is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU Lesser General Public License for more details.
18 
19  You should have received a copy of the GNU Lesser General Public License
20  along with GLC-lib; if not, write to the Free Software
21  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 
23 *****************************************************************************/
24 
26 
27 #ifndef GLC_OBJMTLLOADER_H_
28 #define GLC_OBJMTLLOADER_H_
29 
30 #include <QString>
31 #include <QHash>
32 #include <QTextStream>
33 #include "../shading/glc_material.h"
34 
35 #include "../glc_config.h"
36 
37 class QGLContext;
40 
44 
46 {
47 
49 
51 
52 public:
53  GLC_ObjMtlLoader(const QString&);
54 
55  virtual ~GLC_ObjMtlLoader();
57 
58 
60 
61 public:
63  inline bool contains(const QString &name) const
64  {return m_Materials.contains(name);}
65 
67  GLC_Material* material(const QString&);
68 
70  inline QStringList listOfAttachedFileName() const
71  {return m_ListOfAttachedFileName.toList();}
72 
74 
76 
78 
79 public:
81  bool loadMaterials();
82 
84 
85 
87 
88 private:
90  bool extractMaterialName(QString &);
91 
93  void extractTextureFileName(QString &);
94 
96  bool extractRGBValue(QString &);
97 
99  bool extractOneValue(QString &);
100 
102  QString getTextureName(QTextStream &, const QString &);
103 
105  void processMayaSpecific();
106 
107 
109 
111 // Private members
113 private:
115  QString m_FileName;
116 
119 
121  QHash<QString, GLC_Material*> m_Materials;
122 
124  QString m_LoadStatus;
125 
128 
129 
130 };
131 
132 #endif /*GLC_OBJMTLLOADER_H_*/

©2005-2013 Laurent Ribon