glc_offtoworld.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_OFFTOWORLD_H_
00026 #define GLC_OFFTOWORLD_H_
00027 
00028 #include <QString>
00029 #include <QObject>
00030 #include <QFile>
00031 #include <QTextStream>
00032 #include <QColor>
00033 #include <QList>
00034 
00035 #include "../maths/glc_vector3d.h"
00036 #include "../maths/glc_vector2df.h"
00037 #include "../maths/glc_vector3df.h"
00038 #include "../geometry/glc_mesh.h"
00039 
00040 #include "../glc_config.h"
00041 
00042 class GLC_World;
00043 class QGLContext;
00044 
00047 
00057 
00058 
00059 class GLC_LIB_EXPORT GLC_OffToWorld : public QObject
00060 {
00061         Q_OBJECT
00063 
00065 
00066 
00067 public:
00068         GLC_OffToWorld();
00069         virtual ~GLC_OffToWorld();
00071 
00072 
00074 
00075 public:
00077         GLC_World* CreateWorldFromOff(QFile &file);
00079 
00081 
00083 
00084 private:
00086         void clear();
00087 
00089         void extractVertex(QString &);
00090 
00092         void extractNbrVertexsAndNbrFaces(QString &);
00093 
00095         void extractFaceIndex(QString &);
00096 
00098         void computeNormal();
00099 
00100 
00102 
00104 // Qt Signals
00106         signals:
00107         void currentQuantum(int);
00108 
00110         /* Private members */
00112 private:
00114         GLC_World* m_pWorld;
00115 
00117         QString m_FileName;
00118 
00120         int m_CurrentLineNumber;
00121 
00123         GLC_Mesh* m_pCurrentMesh;
00124 
00126         int m_CurVertexIndex;
00127 
00129         int m_NbrOfVertexs;
00130 
00132         int m_NbrOfFaces;
00133 
00135         bool m_IsCoff;
00136 
00138         bool m_Is4off;
00139 
00140         // The position bulk data
00141         QList<float> m_PositionBulk;
00142 
00144         QList<float> m_NormalBulk;
00145 
00147         QList<float> m_ColorBulk;
00148 
00150         IndexList m_IndexList;
00151 
00152 
00153 
00154 
00155 };
00156 
00157 #endif /*GLC_OFFTOWORLD_H_*/

SourceForge.net Logo

©2005-2011 Laurent Ribon