GLC_lib  2.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
glc_3dstoworld.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  http://glc-lib.sourceforge.net
6 
7  GLC-lib is free software; you can redistribute it and/or modify
8  it under the terms of the GNU Lesser General Public License as published by
9  the Free Software Foundation; either version 3 of the License, or
10  (at your option) any later version.
11 
12  GLC-lib is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU Lesser General Public License for more details.
16 
17  You should have received a copy of the GNU Lesser General Public License
18  along with GLC-lib; if not, write to the Free Software
19  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 
21 *****************************************************************************/
22 
24 
25 #ifndef GLC_3DSTOWORLD_H_
26 #define GLC_3DSTOWORLD_H_
27 
28 #include <QObject>
29 #include <QFile>
30 #include <QDataStream>
31 #include <QString>
32 #include <QHash>
33 #include <QSet>
34 #include <QStringList>
35 
36 #include "../sceneGraph/glc_3dviewinstance.h"
37 
38 #include "../glc_config.h"
39 
40 class GLC_World;
41 class QGLContext;
42 class GLC_Mesh;
44 class GLC_Material;
45 
46 struct Lib3dsFile;
47 struct Lib3dsNode;
48 struct Lib3dsMesh;
49 struct Lib3dsMaterial;
50 
53 
63 
64 
65 class GLC_LIB_EXPORT GLC_3dsToWorld : public QObject
66 {
67  Q_OBJECT
68 
70 
72 
73 
74 public:
76  virtual ~GLC_3dsToWorld();
78 
80 
82 
83 public:
85  GLC_World* CreateWorldFrom3ds(QFile &file);
86 
88  inline QStringList listOfAttachedFileName() const
89  {return m_ListOfAttachedFileName.toList();}
90 
92 
94 
96 
97 private:
99  void clear();
100 
102  void createMeshes(GLC_StructOccurence*, Lib3dsNode*);
103 
105  GLC_3DRep create3DRep(Lib3dsMesh*);
106 
108  void loadMaterial(Lib3dsMaterial*);
109 
111 
113 // Qt Signals
115  signals:
116  void currentQuantum(int);
117 
119  /* Private members */
121 private:
124 
126  QString m_FileName;
127 
130 
132  Lib3dsFile* m_pLib3dsFile;
133 
135  QHash<QString, GLC_Material*> m_Materials;
136 
139 
140  // The Hash of loaded meshes
141  QSet<QString> m_LoadedMeshes;
142 
143  // Initial quantum value
145 
146  // The current quantum value
148 
149  // The previous quantum value
151 
152  // The number of meshes
154 
155  // The Current mesh index
157 
160 
161 
162 
163 
164 
165 };
166 
167 #endif /*GLC_3DSTOWORLD_H_*/

©2005-2013 Laurent Ribon