glc_stltoworld.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_STLTOWORLD_H_
00026 #define GLC_STLTOWORLD_H_
00027 
00028 #include <QString>
00029 #include <QObject>
00030 #include <QFile>
00031 #include <QTextStream>
00032 
00033 #include "../geometry/glc_mesh.h"
00034 #include "../maths/glc_vector3df.h"
00035 
00036 #include "../glc_config.h"
00037 
00038 class GLC_World;
00039 class QGLContext;
00040 
00043 
00051 
00052 
00053 class GLC_LIB_EXPORT GLC_StlToWorld : public QObject
00054 {
00055         Q_OBJECT
00057 
00059 
00060 public:
00061         GLC_StlToWorld();
00062         virtual ~GLC_StlToWorld();
00064 
00065 
00067 
00068 public:
00070         GLC_World* CreateWorldFromStl(QFile &file);
00072 
00074 
00076 
00077 private:
00079         void clear();
00081         void scanFacet();
00083         GLC_Vector3df extract3dVect(QString &);
00085         void LoadBinariStl(QFile &);
00086 
00087 
00088 
00090 
00092 // Qt Signals
00094         signals:
00095         void currentQuantum(int);
00096 
00098         /* Private members */
00100 private:
00102         GLC_World* m_pWorld;
00103 
00105         QString m_FileName;
00106 
00108         int m_CurrentLineNumber;
00109 
00111         QTextStream m_StlStream;
00112 
00114         GLC_Mesh* m_pCurrentMesh;
00115 
00117         IndexList m_CurrentFace;
00118 
00120         QList<float> m_VertexBulk;
00121 
00123         QList<float> m_NormalBulk;
00124 
00126         GLuint m_CurrentIndex;
00127 };
00128 
00129 #endif /*GLC_STLTOWORLD_H_*/

SourceForge.net Logo

©2005-2011 Laurent Ribon