glc_wiredata.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00023
00024 #ifndef GLC_WIREDATA_H_
00025 #define GLC_WIREDATA_H_
00026
00027 #include <QColor>
00028 #include "../glc_global.h"
00029 #include "../glc_boundingbox.h"
00030 #include "../shading/glc_renderproperties.h"
00031
00032 #include "../glc_config.h"
00035
00037
00038 class GLC_LIB_EXPORT GLC_WireData
00039 {
00040 friend GLC_LIB_EXPORT QDataStream &operator<<(QDataStream &, const GLC_WireData &);
00041 friend GLC_LIB_EXPORT QDataStream &operator>>(QDataStream &, GLC_WireData &);
00042
00044
00046
00047 public:
00049 GLC_WireData();
00050
00052 GLC_WireData(const GLC_WireData&);
00053
00055 GLC_WireData& operator=(const GLC_WireData&);
00056
00058 virtual ~GLC_WireData();
00060
00062
00064
00065 public:
00067 static quint32 chunckID();
00068
00070 GLfloatVector positionVector() const;
00071
00073 inline bool isEmpty() const
00074 {return ((m_PositionSize == 0) && m_Positions.isEmpty());}
00075
00077 GLC_BoundingBox& boundingBox();
00078
00080 inline int verticeGroupCount() const
00081 {return m_VerticeGroupCount;}
00082
00084 inline GLuint verticeGroupOffset(int index) const
00085 {return m_VerticeGroupOffset.at(index);}
00086
00088 inline GLsizei verticeGroupSize(int index) const
00089 {return m_VerticeGrouprSizes.at(index);}
00090
00092
00094
00096
00097 public:
00099 GLC_uint addVerticeGroup(const GLfloatVector&);
00100
00102 void clear();
00103
00105 void copyVboToClientSide();
00106
00108 void releaseVboClientSide(bool update= false);
00109
00111
00113
00115
00116 public:
00118 void finishVbo();
00119
00121 void useVBO(bool usage);
00122
00124
00125 void glDraw(const GLC_RenderProperties&, GLenum mode);
00126
00127 private:
00129 void createVBOs();
00130
00132 void fillVBOs();
00134
00136
00138 private:
00140 GLuint m_VboId;
00141
00143 GLC_uint m_NextPrimitiveLocalId;
00144
00146 GLfloatVector m_Positions;
00147
00149 int m_PositionSize;
00150
00152 GLC_BoundingBox* m_pBoundingBox;
00153
00155 IndexSizes m_VerticeGrouprSizes;
00156
00158 OffsetVectori m_VerticeGroupOffset;
00159
00161 QList<GLC_uint> m_VerticeGroupId;
00162
00164 int m_VerticeGroupCount;
00165
00167 static quint32 m_ChunkId;
00168 };
00169
00171 GLC_LIB_EXPORT QDataStream &operator<<(QDataStream &, const GLC_WireData &);
00172 GLC_LIB_EXPORT QDataStream &operator>>(QDataStream &, GLC_WireData &);
00173
00174 #endif