GLC_lib  2.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Private Types | Private Attributes | Static Private Attributes | Friends | List of all members
GLC_WireData Class Reference

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_WireDataoperator= (const GLC_WireData &)
 Copy the given wire data in this wire data.
 
virtual ~GLC_WireData ()
 Destructor.
 
Set Functions
GLC_uint addVerticeGroup (const GLfloatVector &)
 Add a Polyline to this wire and returns its id if id are managed.
 
void addColors (const GLfloatVector &colors)
 Add Colors.
 
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.
 
void setVboUsage (bool usage)
 Set VBO usage.
 

Private Types

enum  VboType { GLC_Vertex = 30, GLC_Color, GLC_Index }
 Enum of VBO TYPE. More...
 

Private Attributes

QGLBuffer m_VerticeBuffer
 VBO ID.
 
GLC_uint m_NextPrimitiveLocalId
 The next primitive local id.
 
GLfloatVector m_Positions
 Vertex Position Vector.
 
QGLBuffer m_ColorBuffer
 Color Buffer.
 
GLfloatVector m_Colors
 Color index.
 
QGLBuffer m_IndexBuffer
 The Index Buffer.
 
QVector< GLuint > m_IndexVector
 The Index Vector.
 
int m_PositionSize
 The size of the VBO.
 
int m_ColorSize
 The size of Color VBO.
 
GLC_BoundingBoxm_pBoundingBox
 Wire data bounding box.
 
IndexSizes m_VerticeGrouprSizes
 Vector of Vertice group size.
 
OffsetVectori m_VerticeGroupOffseti
 Vector of vertice group offset.
 
OffsetVector m_VerticeGroupOffset
 VBO Vector of vertice group offset.
 
QList< GLC_uintm_VerticeGroupId
 Vertice groups id.
 
int m_VerticeGroupCount
 The number of vertice group.
 
bool m_UseVbo
 VBO usage.
 

Static Private Attributes

static quint32 m_ChunkId = 0xA711
 Class chunk id.
 

Friends

GLC_LIB_EXPORT QDataStream & operator<< (QDataStream &, const GLC_WireData &)
 Non-member stream operator.
 
GLC_LIB_EXPORT QDataStream & operator>> (QDataStream &, GLC_WireData &)
 

Get Functions

GLfloatVector positionVector () const
 Return this wire data Position Vector.
 
GLfloatVector colorVector () const
 Return the color Vector.
 
QVector< GLuint > indexVector () const
 Return the unique index vector.
 
bool isEmpty () const
 Return true if this wire data is empty.
 
GLC_BoundingBoxboundingBox ()
 Return this wire data bounding box.
 
int verticeGroupCount () const
 Return the number of vertice group.
 
GLuint verticeGroupOffset (int index) const
 Return the vertice group offset from the given index.
 
GLsizei verticeGroupSize (int index) const
 Return the vertice group size from the given index.
 
bool useIndexdColors () const
 Return true if this wire data use indexed colors.
 
static quint32 chunckID ()
 Return this wire data class Chunk ID.
 

OpenGL Functions

void finishVbo ()
 Make this wire data a VBO.
 
void useVBO (GLC_WireData::VboType type, bool usage)
 Set vbo usage of this wire data.
 
void glDraw (const GLC_RenderProperties &, GLenum mode)
 Render this wire data using Opengl.
 
void fillVBOs ()
 Fill this wire data VBO from memmory.
 
void buidIndex ()
 Built index.
 
void activateVboAndIbo ()
 Activate VBO and IBO.
 
void finishOffset ()
 Finish offset.
 

Detailed Description

GLC_WireData : Contains geometries's wire data.

Definition at line 40 of file glc_wiredata.h.

Member Enumeration Documentation

enum GLC_WireData::VboType
private

Enum of VBO TYPE.

Enumerator
GLC_Vertex 
GLC_Color 
GLC_Index 

Definition at line 46 of file glc_wiredata.h.

Constructor & Destructor Documentation

GLC_WireData::GLC_WireData ( )

Construct a empty wire data.

Definition at line 36 of file glc_wiredata.cpp.

GLC_WireData::GLC_WireData ( const GLC_WireData data)

Construct wire data from the given wire data.

Definition at line 58 of file glc_wiredata.cpp.

References m_pBoundingBox.

GLC_WireData::~GLC_WireData ( )
virtual

Destructor.

Definition at line 108 of file glc_wiredata.cpp.

References clear().

Member Function Documentation

void GLC_WireData::activateVboAndIbo ( )
private

Activate VBO and IBO.

Definition at line 499 of file glc_wiredata.cpp.

References GLC_Color, GLC_Index, GLC_Vertex, m_ColorSize, and useVBO().

Referenced by glDraw().

void GLC_WireData::addColors ( const GLfloatVector colors)
inline

Add Colors.

Definition at line 121 of file glc_wiredata.h.

Referenced by GLC_PointCloud::addColors().

GLC_uint GLC_WireData::addVerticeGroup ( const GLfloatVector floatVector)

Add a Polyline to this wire and returns its id if id are managed.

Definition at line 237 of file glc_wiredata.cpp.

References m_NextPrimitiveLocalId, m_Positions, m_VerticeGroupCount, m_VerticeGroupId, m_VerticeGroupOffseti, and m_VerticeGrouprSizes.

Referenced by GLC_PointCloud::addPoint(), and GLC_Polylines::addPolyline().

GLC_BoundingBox & GLC_WireData::boundingBox ( void  )
void GLC_WireData::buidIndex ( )
private

Built index.

Definition at line 489 of file glc_wiredata.cpp.

References m_IndexVector, and m_Positions.

Referenced by glDraw().

quint32 GLC_WireData::chunckID ( )
static

Return this wire data class Chunk ID.

Definition at line 117 of file glc_wiredata.cpp.

References m_ChunkId.

void GLC_WireData::clear ( )
GLfloatVector GLC_WireData::colorVector ( ) const

Return the color Vector.

Definition at line 147 of file glc_wiredata.cpp.

References m_ColorBuffer, m_Colors, and m_ColorSize.

Referenced by copyVboToClientSide(), operator<<(), operator=(), and setVboUsage().

void GLC_WireData::copyVboToClientSide ( )

Copy VBO to the Client Side.

Definition at line 273 of file glc_wiredata.cpp.

References colorVector(), indexVector(), m_ColorBuffer, m_Colors, m_IndexVector, m_Positions, m_VerticeBuffer, and positionVector().

Referenced by GLC_Geometry::copyVboToClientSide().

void GLC_WireData::fillVBOs ( )
private

Fill this wire data VBO from memmory.

Definition at line 462 of file glc_wiredata.cpp.

References GLC_Color, GLC_Index, GLC_Vertex, m_ColorBuffer, m_Colors, m_IndexBuffer, m_IndexVector, m_Positions, m_VerticeBuffer, and useVBO().

Referenced by finishVbo().

void GLC_WireData::finishOffset ( )
private

Finish offset.

Definition at line 520 of file glc_wiredata.cpp.

References BUFFER_OFFSET, m_VerticeGroupOffset, and m_VerticeGroupOffseti.

Referenced by glDraw().

void GLC_WireData::finishVbo ( )

Make this wire data a VBO.

Definition at line 321 of file glc_wiredata.cpp.

References fillVBOs(), m_ColorBuffer, m_Colors, m_ColorSize, m_IndexBuffer, m_IndexVector, m_Positions, m_PositionSize, and m_VerticeBuffer.

Referenced by glDraw(), releaseVboClientSide(), and setVboUsage().

void GLC_WireData::glDraw ( const GLC_RenderProperties ,
GLenum  mode 
)
QVector< GLuint > GLC_WireData::indexVector ( ) const

Return the unique index vector.

Definition at line 169 of file glc_wiredata.cpp.

References m_IndexBuffer, m_IndexVector, and m_PositionSize.

Referenced by copyVboToClientSide(), operator=(), and setVboUsage().

bool GLC_WireData::isEmpty ( void  ) const
inline
GLC_WireData & GLC_WireData::operator= ( const GLC_WireData data)
GLfloatVector GLC_WireData::positionVector ( ) const

Return this wire data Position Vector.

Definition at line 123 of file glc_wiredata.cpp.

References m_Positions, m_PositionSize, and m_VerticeBuffer.

Referenced by copyVboToClientSide(), operator<<(), operator=(), and setVboUsage().

void GLC_WireData::releaseVboClientSide ( bool  update = false)

Release client VBO.

Definition at line 288 of file glc_wiredata.cpp.

References finishVbo(), m_Positions, and m_VerticeBuffer.

Referenced by GLC_Geometry::releaseVboClientSide().

void GLC_WireData::setVboUsage ( bool  usage)
bool GLC_WireData::useIndexdColors ( ) const
inline

Return true if this wire data use indexed colors.

Definition at line 108 of file glc_wiredata.h.

void GLC_WireData::useVBO ( GLC_WireData::VboType  type,
bool  usage 
)

Set vbo usage of this wire data.

Definition at line 350 of file glc_wiredata.cpp.

References GLC_Color, GLC_Index, GLC_Vertex, m_ColorBuffer, m_ColorSize, m_IndexBuffer, and m_VerticeBuffer.

Referenced by activateVboAndIbo(), fillVBOs(), and glDraw().

int GLC_WireData::verticeGroupCount ( ) const
inline

Return the number of vertice group.

Definition at line 96 of file glc_wiredata.h.

GLuint GLC_WireData::verticeGroupOffset ( int  index) const
inline

Return the vertice group offset from the given index.

Definition at line 100 of file glc_wiredata.h.

GLsizei GLC_WireData::verticeGroupSize ( int  index) const
inline

Return the vertice group size from the given index.

Definition at line 104 of file glc_wiredata.h.

Friends And Related Function Documentation

GLC_LIB_EXPORT QDataStream& operator<< ( QDataStream &  ,
const GLC_WireData  
)
friend

Non-member stream operator.

Definition at line 531 of file glc_wiredata.cpp.

GLC_LIB_EXPORT QDataStream& operator>> ( QDataStream &  ,
GLC_WireData  
)
friend

Definition at line 552 of file glc_wiredata.cpp.

Member Data Documentation

quint32 GLC_WireData::m_ChunkId = 0xA711
staticprivate

Class chunk id.

Definition at line 221 of file glc_wiredata.h.

Referenced by chunckID(), operator<<(), and operator>>().

QGLBuffer GLC_WireData::m_ColorBuffer
private

Color Buffer.

Definition at line 182 of file glc_wiredata.h.

Referenced by colorVector(), copyVboToClientSide(), fillVBOs(), finishVbo(), setVboUsage(), and useVBO().

GLfloatVector GLC_WireData::m_Colors
private

Color index.

Definition at line 185 of file glc_wiredata.h.

Referenced by colorVector(), copyVboToClientSide(), fillVBOs(), finishVbo(), glDraw(), operator=(), operator>>(), and setVboUsage().

int GLC_WireData::m_ColorSize
private

The size of Color VBO.

Definition at line 197 of file glc_wiredata.h.

Referenced by activateVboAndIbo(), colorVector(), finishVbo(), glDraw(), operator<<(), operator=(), operator>>(), and useVBO().

QGLBuffer GLC_WireData::m_IndexBuffer
private

The Index Buffer.

Definition at line 188 of file glc_wiredata.h.

Referenced by fillVBOs(), finishVbo(), indexVector(), setVboUsage(), and useVBO().

QVector<GLuint> GLC_WireData::m_IndexVector
private

The Index Vector.

Definition at line 191 of file glc_wiredata.h.

Referenced by buidIndex(), copyVboToClientSide(), fillVBOs(), finishVbo(), glDraw(), indexVector(), operator=(), and setVboUsage().

GLC_uint GLC_WireData::m_NextPrimitiveLocalId
private

The next primitive local id.

Definition at line 176 of file glc_wiredata.h.

Referenced by addVerticeGroup(), clear(), operator<<(), operator=(), and operator>>().

GLC_BoundingBox* GLC_WireData::m_pBoundingBox
private

Wire data bounding box.

Definition at line 200 of file glc_wiredata.h.

Referenced by boundingBox(), clear(), GLC_WireData(), and operator=().

GLfloatVector GLC_WireData::m_Positions
private
int GLC_WireData::m_PositionSize
private

The size of the VBO.

Definition at line 194 of file glc_wiredata.h.

Referenced by clear(), finishVbo(), glDraw(), indexVector(), operator<<(), operator=(), operator>>(), positionVector(), and setVboUsage().

bool GLC_WireData::m_UseVbo
private

VBO usage.

Definition at line 218 of file glc_wiredata.h.

Referenced by glDraw(), operator=(), and setVboUsage().

QGLBuffer GLC_WireData::m_VerticeBuffer
private
int GLC_WireData::m_VerticeGroupCount
private

The number of vertice group.

Definition at line 215 of file glc_wiredata.h.

Referenced by addVerticeGroup(), clear(), glDraw(), operator<<(), operator=(), and operator>>().

QList<GLC_uint> GLC_WireData::m_VerticeGroupId
private

Vertice groups id.

Definition at line 212 of file glc_wiredata.h.

Referenced by addVerticeGroup(), clear(), operator<<(), operator=(), and operator>>().

OffsetVector GLC_WireData::m_VerticeGroupOffset
private

VBO Vector of vertice group offset.

Definition at line 209 of file glc_wiredata.h.

Referenced by finishOffset(), glDraw(), and operator=().

OffsetVectori GLC_WireData::m_VerticeGroupOffseti
private

Vector of vertice group offset.

Definition at line 206 of file glc_wiredata.h.

Referenced by addVerticeGroup(), clear(), finishOffset(), glDraw(), operator<<(), operator=(), and operator>>().

IndexSizes GLC_WireData::m_VerticeGrouprSizes
private

Vector of Vertice group size.

Definition at line 203 of file glc_wiredata.h.

Referenced by addVerticeGroup(), clear(), glDraw(), operator<<(), operator=(), and operator>>().


The documentation for this class was generated from the following files:

©2005-2013 Laurent Ribon