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
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
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