glc_wiredata.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  Version 2.0.0 Beta 1, packaged on April 2010.
00006 
00007  http://glc-lib.sourceforge.net
00008 
00009  GLC-lib is free software; you can redistribute it and/or modify
00010  it under the terms of the GNU General Public License as published by
00011  the Free Software Foundation; either version 2 of the License, or
00012  (at your option) any later version.
00013 
00014  GLC-lib is distributed in the hope that it will be useful,
00015  but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  GNU General Public License for more details.
00018 
00019  You should have received a copy of the GNU General Public License
00020  along with GLC-lib; if not, write to the Free Software
00021  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00022 
00023  *****************************************************************************/
00025 
00026 #ifndef GLC_WIREDATA_H_
00027 #define GLC_WIREDATA_H_
00028 
00029 #include <QColor>
00030 #include "../glc_global.h"
00031 #include "../glc_boundingbox.h"
00032 #include "../shading/glc_renderproperties.h"
00033 
00034 #include "../glc_config.h"
00037 
00039 
00040 class GLC_LIB_EXPORT GLC_WireData
00041 {
00042         friend QDataStream &operator<<(QDataStream &, const GLC_WireData &);
00043         friend QDataStream &operator>>(QDataStream &, GLC_WireData &);
00044 
00046 
00048 
00049 public:
00051         GLC_WireData();
00052 
00054         GLC_WireData(const GLC_WireData&);
00055 
00057         GLC_WireData& operator=(const GLC_WireData&);
00058 
00060         virtual ~GLC_WireData();
00062 
00064 
00066 
00067 public:
00069         static quint32 chunckID();
00070 
00072         GLfloatVector positionVector() const;
00073 
00075         inline bool isEmpty() const
00076         {return ((m_PositionSize == 0) && m_Positions.isEmpty());}
00077 
00079         GLC_BoundingBox& boundingBox();
00080 
00082         inline int polylineCount() const
00083         {return m_PolylinesCount;}
00084 
00086         inline GLuint polylineOffset(int index) const
00087         {return m_PolylinesOffset.at(index);}
00088 
00090         inline GLsizei polylineSize(int index) const
00091         {return m_PolylinesSizes.at(index);}
00092 
00094 
00096 
00098 
00099 public:
00101         GLC_uint addPolyline(const GLfloatVector&);
00102 
00104         void clear();
00105 
00107 
00109 
00111 
00112 public:
00114         void finishVbo();
00115 
00117         void useVBO(bool usage);
00118 
00120         void glDraw(const GLC_RenderProperties&);
00121 
00122 private:
00124         void createVBOs();
00125 
00127         void fillVBOs();
00129 
00131 // Private members
00133 private:
00135         GLuint m_VboId;
00136 
00138         GLC_uint m_NextPrimitiveLocalId;
00139 
00141         GLfloatVector m_Positions;
00142 
00144         int m_PositionSize;
00145 
00147         GLC_BoundingBox* m_pBoundingBox;
00148 
00150         IndexSizes m_PolylinesSizes;
00151 
00153         OffsetVectori m_PolylinesOffset;
00154 
00156         QList<GLC_uint> m_PolylinesId;
00157 
00159         int m_PolylinesCount;
00160 
00162         static quint32 m_ChunkId;
00163 };
00164 
00166 QDataStream &operator<<(QDataStream &, const GLC_WireData &);
00167 QDataStream &operator>>(QDataStream &, GLC_WireData &);
00168 
00169 #endif /* GLC_WIREDATA_H_ */

SourceForge.net Logo

©2005 Laurent Ribon