GLC_WireData : Contains geometries's wire data. More...
#include <glc_wiredata.h>
Public Member Functions | |
Constructor / Destructor | |
| GLC_WireData () | |
| Construct a empty wire data. | |
| GLC_WireData (const GLC_WireData &) | |
| Construct wire data from the given wire data. | |
| GLC_WireData & | operator= (const GLC_WireData &) |
| Copy the given wire data in this wire data. | |
| virtual | ~GLC_WireData () |
| Destructor. | |
Set Functions | |
| GLC_uint | addPolyline (const GLfloatVector &) |
| Add a Polyline to this wire and returns its id if id are managed. | |
| void | clear () |
| Clear the content of this wire Data and makes it empty. | |
| void | copyVboToClientSide () |
| Copy VBO to the Client Side. | |
| void | releaseVboClientSide (bool update=false) |
| Release client VBO. | |
Private Attributes | |
| GLuint | m_VboId |
| VBO ID. | |
| GLC_uint | m_NextPrimitiveLocalId |
| The next primitive local id. | |
| GLfloatVector | m_Positions |
| Vertex Position Vector. | |
| int | m_PositionSize |
| The size of the VBO. | |
| GLC_BoundingBox * | m_pBoundingBox |
| Wire data bounding box. | |
| IndexSizes | m_PolylinesSizes |
| Polylines size. | |
| OffsetVectori | m_PolylinesOffset |
| Vector of polyline group offset. | |
| QList< GLC_uint > | m_PolylinesId |
| Polyline groups id. | |
| int | m_PolylinesCount |
| The number of polylines. | |
Static Private Attributes | |
| static quint32 | m_ChunkId = 0xA706 |
| Class chunk id. | |
Friends | |
| QDataStream & | operator<< (QDataStream &, const GLC_WireData &) |
| Non-member stream operator. | |
| QDataStream & | operator>> (QDataStream &, GLC_WireData &) |
Get Functions | |
|
| |
| GLfloatVector | positionVector () const |
| Return this wire data Position Vector. | |
| bool | isEmpty () const |
| Return true if this wire data is empty. | |
| GLC_BoundingBox & | boundingBox () |
| Return this wire data bounding box. | |
| int | polylineCount () const |
| Return the number of polylines. | |
| GLuint | polylineOffset (int index) const |
| Return the polyline offset from the given index. | |
| GLsizei | polylineSize (int index) const |
| Return the polyline size from the given index. | |
| static quint32 | chunckID () |
| Return this wire data class Chunk ID. | |
OpenGL Functions | |
|
| |
| void | finishVbo () |
| Make this wire data a VBO. | |
| void | useVBO (bool usage) |
| Set vbo usage of this wire data. | |
| void | glDraw (const GLC_RenderProperties &) |
| Render this wire data using Opengl. | |
| void | createVBOs () |
| Create this wire data VBO id. | |
| void | fillVBOs () |
| Fill this wire data VBO from memmory. | |
GLC_WireData : Contains geometries's wire data.
Definition at line 40 of file glc_wiredata.h.
| GLC_WireData::GLC_WireData | ( | ) |
Construct a empty wire data.
Definition at line 35 of file glc_wiredata.cpp.
| GLC_WireData::GLC_WireData | ( | const GLC_WireData & | data | ) |
Construct wire data from the given wire data.
Definition at line 50 of file glc_wiredata.cpp.
References m_pBoundingBox.
| GLC_WireData::~GLC_WireData | ( | ) | [virtual] |
Destructor.
Definition at line 88 of file glc_wiredata.cpp.
References clear(), glDeleteBuffers, and m_VboId.
| GLC_uint GLC_WireData::addPolyline | ( | const GLfloatVector & | floatVector | ) |
Add a Polyline to this wire and returns its id if id are managed.
Definition at line 162 of file glc_wiredata.cpp.
References m_NextPrimitiveLocalId, m_PolylinesCount, m_PolylinesId, m_PolylinesOffset, m_PolylinesSizes, and m_Positions.
Referenced by GLC_Polylines::addPolyline().
| GLC_BoundingBox & GLC_WireData::boundingBox | ( | void | ) |
Return this wire data bounding box.
Definition at line 133 of file glc_wiredata.cpp.
References GLC_BoundingBox::combine(), m_pBoundingBox, and m_Positions.
Referenced by GLC_Polylines::boundingBox(), GLC_Mesh::boundingBox(), GLC_Circle::boundingBox(), and GLC_Arrow::boundingBox().
| quint32 GLC_WireData::chunckID | ( | ) | [static] |
Return this wire data class Chunk ID.
Definition at line 104 of file glc_wiredata.cpp.
References m_ChunkId.
| void GLC_WireData::clear | ( | ) |
Clear the content of this wire Data and makes it empty.
Definition at line 183 of file glc_wiredata.cpp.
References m_NextPrimitiveLocalId, m_pBoundingBox, m_PolylinesCount, m_PolylinesId, m_PolylinesOffset, m_PolylinesSizes, m_Positions, and m_PositionSize.
Referenced by GLC_Polylines::clear(), GLC_Geometry::clearGeometry(), operator=(), operator>>(), and ~GLC_WireData().
| void GLC_WireData::copyVboToClientSide | ( | ) |
Copy VBO to the Client Side.
Definition at line 197 of file glc_wiredata.cpp.
References m_Positions, m_VboId, and positionVector().
Referenced by GLC_Geometry::copyVboToClientSide().
| void GLC_WireData::createVBOs | ( | ) | [private] |
Create this wire data VBO id.
Definition at line 282 of file glc_wiredata.cpp.
References glGenBuffers, and m_VboId.
Referenced by finishVbo().
| void GLC_WireData::fillVBOs | ( | ) | [private] |
Fill this wire data VBO from memmory.
Definition at line 291 of file glc_wiredata.cpp.
References glBufferData, and m_Positions.
Referenced by finishVbo().
| void GLC_WireData::finishVbo | ( | ) |
Make this wire data a VBO.
Definition at line 218 of file glc_wiredata.cpp.
References createVBOs(), fillVBOs(), m_Positions, m_PositionSize, and useVBO().
Referenced by glDraw(), and releaseVboClientSide().
| void GLC_WireData::glDraw | ( | const GLC_RenderProperties & | ) |
Render this wire data using Opengl.
Definition at line 241 of file glc_wiredata.cpp.
References finishVbo(), isEmpty(), m_PolylinesCount, m_PolylinesOffset, m_PolylinesSizes, m_Positions, m_PositionSize, m_VboId, useVBO(), and GLC_State::vboUsed().
Referenced by GLC_Polylines::glDraw(), GLC_Mesh::glDraw(), GLC_Circle::glDraw(), and GLC_Arrow::glDraw().
| bool GLC_WireData::isEmpty | ( | void | ) | const [inline] |
Return true if this wire data is empty.
Definition at line 75 of file glc_wiredata.h.
Referenced by GLC_Polylines::boundingBox(), GLC_Circle::boundingBox(), GLC_Arrow::boundingBox(), GLC_Disc::createMeshAndWire(), GLC_Cylinder::createMeshAndWire(), GLC_Cone::createMeshAndWire(), GLC_Circle::createWire(), GLC_Box::createWire(), GLC_Arrow::createWire(), glDraw(), GLC_Mesh::glDraw(), GLC_Circle::glDraw(), GLC_Arrow::glDraw(), and GLC_Polylines::isEmpty().
| GLC_WireData & GLC_WireData::operator= | ( | const GLC_WireData & | data | ) |
Copy the given wire data in this wire data.
Definition at line 68 of file glc_wiredata.cpp.
References clear(), m_NextPrimitiveLocalId, m_pBoundingBox, m_PolylinesCount, m_PolylinesId, m_PolylinesOffset, m_PolylinesSizes, m_Positions, m_PositionSize, and positionVector().
| int GLC_WireData::polylineCount | ( | ) | const [inline] |
Return the number of polylines.
Definition at line 82 of file glc_wiredata.h.
| GLuint GLC_WireData::polylineOffset | ( | int | index | ) | const [inline] |
Return the polyline offset from the given index.
Definition at line 86 of file glc_wiredata.h.
| GLsizei GLC_WireData::polylineSize | ( | int | index | ) | const [inline] |
Return the polyline size from the given index.
Definition at line 90 of file glc_wiredata.h.
| GLfloatVector GLC_WireData::positionVector | ( | ) | const |
Return this wire data Position Vector.
Definition at line 110 of file glc_wiredata.cpp.
References glBindBuffer, glMapBuffer, glUnmapBuffer, m_Positions, m_PositionSize, and m_VboId.
Referenced by copyVboToClientSide(), operator<<(), and operator=().
| void GLC_WireData::releaseVboClientSide | ( | bool | update = false |
) |
Release client VBO.
Definition at line 205 of file glc_wiredata.cpp.
References finishVbo(), m_Positions, and m_VboId.
Referenced by GLC_Geometry::releaseVboClientSide().
| void GLC_WireData::useVBO | ( | bool | usage | ) |
Set vbo usage of this wire data.
Definition at line 229 of file glc_wiredata.cpp.
References glBindBuffer, and m_VboId.
Referenced by finishVbo(), and glDraw().
| QDataStream& operator<< | ( | QDataStream & | , | |
| const GLC_WireData & | ||||
| ) | [friend] |
Non-member stream operator.
Definition at line 298 of file glc_wiredata.cpp.
| QDataStream& operator>> | ( | QDataStream & | , | |
| GLC_WireData & | ||||
| ) | [friend] |
Definition at line 315 of file glc_wiredata.cpp.
quint32 GLC_WireData::m_ChunkId = 0xA706 [static, private] |
Class chunk id.
Definition at line 168 of file glc_wiredata.h.
Referenced by chunckID(), operator<<(), and operator>>().
GLC_uint GLC_WireData::m_NextPrimitiveLocalId [private] |
The next primitive local id.
Definition at line 144 of file glc_wiredata.h.
Referenced by addPolyline(), clear(), operator<<(), operator=(), and operator>>().
GLC_BoundingBox* GLC_WireData::m_pBoundingBox [private] |
Wire data bounding box.
Definition at line 153 of file glc_wiredata.h.
Referenced by boundingBox(), clear(), GLC_WireData(), and operator=().
int GLC_WireData::m_PolylinesCount [private] |
The number of polylines.
Definition at line 165 of file glc_wiredata.h.
Referenced by addPolyline(), clear(), glDraw(), operator<<(), operator=(), and operator>>().
QList<GLC_uint> GLC_WireData::m_PolylinesId [private] |
Polyline groups id.
Definition at line 162 of file glc_wiredata.h.
Referenced by addPolyline(), clear(), operator<<(), operator=(), and operator>>().
OffsetVectori GLC_WireData::m_PolylinesOffset [private] |
Vector of polyline group offset.
Definition at line 159 of file glc_wiredata.h.
Referenced by addPolyline(), clear(), glDraw(), operator<<(), operator=(), and operator>>().
IndexSizes GLC_WireData::m_PolylinesSizes [private] |
Polylines size.
Definition at line 156 of file glc_wiredata.h.
Referenced by addPolyline(), clear(), glDraw(), operator<<(), operator=(), and operator>>().
GLfloatVector GLC_WireData::m_Positions [private] |
Vertex Position Vector.
Definition at line 147 of file glc_wiredata.h.
Referenced by addPolyline(), boundingBox(), clear(), copyVboToClientSide(), fillVBOs(), finishVbo(), glDraw(), operator=(), operator>>(), positionVector(), and releaseVboClientSide().
int GLC_WireData::m_PositionSize [private] |
The size of the VBO.
Definition at line 150 of file glc_wiredata.h.
Referenced by clear(), finishVbo(), glDraw(), operator<<(), operator=(), operator>>(), and positionVector().
GLuint GLC_WireData::m_VboId [private] |
VBO ID.
Definition at line 141 of file glc_wiredata.h.
Referenced by copyVboToClientSide(), createVBOs(), glDraw(), positionVector(), releaseVboClientSide(), useVBO(), and ~GLC_WireData().