glc_3dstoworld.h

Go to the documentation of this file.
00001 /****************************************************************************
00002 
00003  This file is part of the GLC-lib library.
00004  Copyright (C) 2005-2008 Laurent Ribon (laumaya@users.sourceforge.net)
00005  http://glc-lib.sourceforge.net
00006 
00007  GLC-lib is free software; you can redistribute it and/or modify
00008  it under the terms of the GNU Lesser General Public License as published by
00009  the Free Software Foundation; either version 3 of the License, or
00010  (at your option) any later version.
00011 
00012  GLC-lib is distributed in the hope that it will be useful,
00013  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  GNU Lesser General Public License for more details.
00016 
00017  You should have received a copy of the GNU Lesser General Public License
00018  along with GLC-lib; if not, write to the Free Software
00019  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00020 
00021 *****************************************************************************/
00022 
00024 
00025 #ifndef GLC_3DSTOWORLD_H_
00026 #define GLC_3DSTOWORLD_H_
00027 
00028 #include <QObject>
00029 #include <QFile>
00030 #include <QDataStream>
00031 #include <QString>
00032 #include <QHash>
00033 #include <QSet>
00034 #include <QStringList>
00035 
00036 #include "../sceneGraph/glc_3dviewinstance.h"
00037 
00038 #include "../glc_config.h"
00039 
00040 class GLC_World;
00041 class QGLContext;
00042 class GLC_Mesh;
00043 class GLC_StructOccurence;
00044 class GLC_Material;
00045 
00046 struct Lib3dsFile;
00047 struct Lib3dsNode;
00048 struct Lib3dsMesh;
00049 struct Lib3dsMaterial;
00050 
00053 
00063 
00064 
00065 class GLC_LIB_EXPORT GLC_3dsToWorld : public QObject
00066 {
00067         Q_OBJECT
00068 
00070 
00072 
00073 
00074 public:
00075         GLC_3dsToWorld();
00076         virtual ~GLC_3dsToWorld();
00078 
00080 
00082 
00083 public:
00085         GLC_World* CreateWorldFrom3ds(QFile &file);
00086 
00088         inline QStringList listOfAttachedFileName() const
00089         {return m_ListOfAttachedFileName.toList();}
00090 
00092 
00094 
00096 
00097 private:
00099         void clear();
00100 
00102         void createMeshes(GLC_StructOccurence*, Lib3dsNode*);
00103 
00105         GLC_3DRep create3DRep(Lib3dsMesh*);
00106 
00108         void loadMaterial(Lib3dsMaterial*);
00109 
00111 
00113 // Qt Signals
00115         signals:
00116         void currentQuantum(int);
00117 
00119         /* Private members */
00121 private:
00123         GLC_World* m_pWorld;
00124 
00126         QString m_FileName;
00127 
00129         GLC_Mesh* m_pCurrentMesh;
00130 
00132         Lib3dsFile* m_pLib3dsFile;
00133 
00135         QHash<QString, GLC_Material*> m_Materials;
00136 
00138         int m_NextMaterialIndex;
00139 
00140         // The Hash of loaded meshes
00141         QSet<QString> m_LoadedMeshes;
00142 
00143         // Initial quantum value
00144         const int m_InitQuantumValue;
00145 
00146         // The current quantum value
00147         int m_CurrentQuantumValue;
00148 
00149         // The previous quantum value
00150         int m_PreviousQuantumValue;
00151 
00152         // The number of meshes
00153         int m_NumberOfMeshes;
00154 
00155         // The Current mesh index
00156         int m_CurrentMeshNumber;
00157 
00159         QSet<QString> m_ListOfAttachedFileName;
00160 
00161 
00162 
00163 
00164 
00165 };
00166 
00167 #endif /*GLC_3DSTOWORLD_H_*/

SourceForge.net Logo

©2005-2011 Laurent Ribon