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

GLC_PrimitiveGroup : Triangles, Strip and fan index. More...

#include <glc_primitivegroup.h>

Public Member Functions

Constructor / Destructor
 GLC_PrimitiveGroup (GLC_uint id=0)
 Default constructor.
 
 GLC_PrimitiveGroup (const GLC_PrimitiveGroup &)
 Copy constructor.
 
 GLC_PrimitiveGroup (const GLC_PrimitiveGroup &, GLC_uint)
 Copy constructor.
 
GLC_PrimitiveGroupoperator= (const GLC_PrimitiveGroup &)
 = operator
 
 ~GLC_PrimitiveGroup ()
 
Set Functions
void setId (GLC_uint id)
 Set the group id.
 
void addTriangles (const IndexList &input, GLC_uint id=0)
 Add triangles to the group.
 
void setTrianglesOffset (GLvoid *pOffset)
 Set the triangle index offset.
 
void setTrianglesOffseti (int offset)
 Set the triangle index offset.
 
void addTrianglesStrip (const IndexList &, GLC_uint id=0)
 Add triangle strip to the group.
 
void setBaseTrianglesStripOffset (GLvoid *)
 Set base triangle strip offset.
 
void setBaseTrianglesStripOffseti (int)
 Set base triangle strip offset.
 
void addTrianglesFan (const IndexList &, GLC_uint id=0)
 Add triangle fan to the group.
 
void setBaseTrianglesFanOffset (GLvoid *)
 Set base triangle fan offset.
 
void setBaseTrianglesFanOffseti (int)
 Set base triangle fan offset.
 
void computeVboOffset ()
 Compute VBO offset.
 
void finish ()
 The mesh wich use this group is finished.
 
void clear ()
 Clear the group.
 

Private Attributes

GLC_uint m_Id
 Grouped material id.
 
IndexList m_TrianglesIndex
 Triangles index list.
 
IndexSizes m_TrianglesGroupsSizes
 Triangles groups index size.
 
OffsetVector m_TrianglesGroupOffset
 Vector of triangles group offset.
 
OffsetVectori m_TrianglesGroupOffseti
 
QList< GLC_uintm_TrianglesId
 Triangles groups id.
 
IndexList m_StripsIndex
 Strips index list.
 
IndexSizes m_StripIndexSizes
 Strips index size.
 
OffsetVector m_StripIndexOffset
 Vector of strips offset.
 
OffsetVectori m_StripIndexOffseti
 
QList< GLC_uintm_StripsId
 Strips id.
 
IndexList m_FansIndex
 Fans index list.
 
IndexSizes m_FansIndexSizes
 Fans index size.
 
OffsetVector m_FanIndexOffset
 Vector of fan Offset.
 
OffsetVectori m_FanIndexOffseti
 
QList< GLC_uintm_FansId
 Fans id.
 
int m_IsFinished
 Flag to know if the group is finish.
 
int m_TrianglesIndexSize
 Flag to know if there is triangles.
 
int m_TrianglesStripSize
 Flag to know if there is triangles strip.
 
int m_TrianglesFanSize
 Flag to know if there is triangles fan.
 

Static Private Attributes

static quint32 m_ChunkId = 0xA700
 Class chunk id.
 

Friends

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

Get Functions

bool isFinished () const
 Return true if the group is finished.
 
GLC_uint id () const
 Return the group id.
 
bool containsTriangles () const
 Return true if the group contains triangles.
 
bool containsTrianglesGroupId () const
 Return true if the group contains triangles group id.
 
QList< GLC_uinttriangleGroupId () const
 Return the triangle group ID.
 
GLC_uint triangleGroupId (int index) const
 Return the Triangle group ID at the given index.
 
int trianglesIndexSize () const
 Return the size of list of triangles index of the group.
 
const IndexSizestrianglesIndexSizes () const
 Return the size of list of triangles index of the group.
 
const IndexListtrianglesIndex () const
 Return the list of triangles index of the group.
 
const GLvoid * trianglesIndexOffset () const
 Return the offset of triangles index.
 
int trianglesIndexOffseti () const
 Return the offset of triangles index.
 
const OffsetVectortrianglesGroupOffset () const
 Return the offset of triangles index.
 
const OffsetVectoritrianglesGroupOffseti () const
 Return the offset of triangles index.
 
bool containsStrip () const
 Return true if the group contains strips.
 
bool containsStripGroupId () const
 Return true if the group contains strips group id.
 
QList< GLC_uintstripGroupId () const
 Return the strip ID.
 
GLC_uint stripGroupId (int index) const
 Return the strip ID at the given index.
 
int stripsIndexSize () const
 Return the size of index of strips.
 
const IndexListstripsIndex () const
 Return the list of index of strips.
 
const IndexSizesstripsSizes () const
 Return the vector of strips sizes.
 
const OffsetVectorstripsOffset () const
 Return the vector of strip offset.
 
const OffsetVectoristripsOffseti () const
 Return the vector of strip offset.
 
bool containsFan () const
 Return true if the group contains fans.
 
bool containsFanGroupId () const
 Return true if the group contains fans group id.
 
QList< GLC_uintfanGroupId () const
 Return the fan ID.
 
GLC_uint fanGroupId (int index) const
 Return the fan ID at the given index.
 
int fansIndexSize () const
 Return the size of index of fans.
 
const IndexListfansIndex () const
 Return the list of index of fans.
 
const IndexSizesfansSizes () const
 Return the vector of fans sizes.
 
const OffsetVectorfansOffset () const
 Return the vector of strip offset.
 
const OffsetVectorifansOffseti () const
 Return the vector of strip offset.
 
static quint32 chunckID ()
 Return the class Chunk ID.
 

Detailed Description

GLC_PrimitiveGroup : Triangles, Strip and fan index.

An GLC_PrimitiveGroup is used to stored Triangles, strips and fans index Grouped by material

Definition at line 40 of file glc_primitivegroup.h.

Constructor & Destructor Documentation

GLC_PrimitiveGroup::GLC_PrimitiveGroup ( GLC_uint  id = 0)

Default constructor.

Definition at line 32 of file glc_primitivegroup.cpp.

GLC_PrimitiveGroup::GLC_PrimitiveGroup ( const GLC_PrimitiveGroup group)

Copy constructor.

Definition at line 58 of file glc_primitivegroup.cpp.

GLC_PrimitiveGroup::GLC_PrimitiveGroup ( const GLC_PrimitiveGroup group,
GLC_uint  id 
)

Copy constructor.

Definition at line 85 of file glc_primitivegroup.cpp.

GLC_PrimitiveGroup::~GLC_PrimitiveGroup ( )

Definition at line 140 of file glc_primitivegroup.cpp.

Member Function Documentation

void GLC_PrimitiveGroup::addTriangles ( const IndexList input,
GLC_uint  id = 0 
)

Add triangles to the group.

Definition at line 151 of file glc_primitivegroup.cpp.

References m_TrianglesGroupOffseti, m_TrianglesGroupsSizes, m_TrianglesId, m_TrianglesIndex, and m_TrianglesIndexSize.

void GLC_PrimitiveGroup::addTrianglesFan ( const IndexList input,
GLC_uint  id = 0 
)

Add triangle fan to the group.

Definition at line 234 of file glc_primitivegroup.cpp.

References m_FanIndexOffseti, m_FansId, m_FansIndex, m_FansIndexSizes, and m_TrianglesFanSize.

void GLC_PrimitiveGroup::addTrianglesStrip ( const IndexList input,
GLC_uint  id = 0 
)

Add triangle strip to the group.

Definition at line 171 of file glc_primitivegroup.cpp.

References m_StripIndexOffseti, m_StripIndexSizes, m_StripsId, m_StripsIndex, and m_TrianglesStripSize.

quint32 GLC_PrimitiveGroup::chunckID ( )
static

Return the class Chunk ID.

Definition at line 145 of file glc_primitivegroup.cpp.

References m_ChunkId.

void GLC_PrimitiveGroup::clear ( )
void GLC_PrimitiveGroup::computeVboOffset ( )
bool GLC_PrimitiveGroup::containsFan ( ) const
inline
bool GLC_PrimitiveGroup::containsFanGroupId ( ) const
inline
bool GLC_PrimitiveGroup::containsStrip ( ) const
inline
bool GLC_PrimitiveGroup::containsStripGroupId ( ) const
inline
bool GLC_PrimitiveGroup::containsTriangles ( ) const
inline
bool GLC_PrimitiveGroup::containsTrianglesGroupId ( ) const
inline
QList<GLC_uint> GLC_PrimitiveGroup::fanGroupId ( ) const
inline
GLC_uint GLC_PrimitiveGroup::fanGroupId ( int  index) const
inline

Return the fan ID at the given index.

Definition at line 182 of file glc_primitivegroup.h.

const IndexList& GLC_PrimitiveGroup::fansIndex ( ) const
inline

Return the list of index of fans.

Definition at line 190 of file glc_primitivegroup.h.

int GLC_PrimitiveGroup::fansIndexSize ( ) const
inline

Return the size of index of fans.

Definition at line 186 of file glc_primitivegroup.h.

const OffsetVector& GLC_PrimitiveGroup::fansOffset ( ) const
inline
const OffsetVectori& GLC_PrimitiveGroup::fansOffseti ( ) const
inline
const IndexSizes& GLC_PrimitiveGroup::fansSizes ( ) const
inline
void GLC_PrimitiveGroup::finish ( )
inline

The mesh wich use this group is finished.

Definition at line 250 of file glc_primitivegroup.h.

Referenced by operator>>().

GLC_uint GLC_PrimitiveGroup::id ( ) const
inline
bool GLC_PrimitiveGroup::isFinished ( ) const
inline

Return true if the group is finished.

Definition at line 76 of file glc_primitivegroup.h.

Referenced by operator<<().

GLC_PrimitiveGroup & GLC_PrimitiveGroup::operator= ( const GLC_PrimitiveGroup group)
void GLC_PrimitiveGroup::setBaseTrianglesFanOffset ( GLvoid *  pOffset)

Set base triangle fan offset.

Definition at line 256 of file glc_primitivegroup.cpp.

References BUFFER_OFFSET, m_FanIndexOffset, and m_FanIndexOffseti.

void GLC_PrimitiveGroup::setBaseTrianglesFanOffseti ( int  offset)

Set base triangle fan offset.

Definition at line 267 of file glc_primitivegroup.cpp.

References m_FanIndexOffseti.

void GLC_PrimitiveGroup::setBaseTrianglesStripOffset ( GLvoid *  pOffset)

Set base triangle strip offset.

Definition at line 212 of file glc_primitivegroup.cpp.

References BUFFER_OFFSET, m_StripIndexOffset, and m_StripIndexOffseti.

void GLC_PrimitiveGroup::setBaseTrianglesStripOffseti ( int  offset)

Set base triangle strip offset.

Definition at line 223 of file glc_primitivegroup.cpp.

References m_StripIndexOffseti.

void GLC_PrimitiveGroup::setId ( GLC_uint  id)
inline

Set the group id.

Definition at line 216 of file glc_primitivegroup.h.

Referenced by GLC_Mesh::replaceMaterial().

void GLC_PrimitiveGroup::setTrianglesOffset ( GLvoid *  pOffset)

Set the triangle index offset.

Definition at line 190 of file glc_primitivegroup.cpp.

References BUFFER_OFFSET, m_TrianglesGroupOffset, and m_TrianglesGroupOffseti.

void GLC_PrimitiveGroup::setTrianglesOffseti ( int  offset)

Set the triangle index offset.

Definition at line 201 of file glc_primitivegroup.cpp.

References m_TrianglesGroupOffseti.

QList<GLC_uint> GLC_PrimitiveGroup::stripGroupId ( ) const
inline
GLC_uint GLC_PrimitiveGroup::stripGroupId ( int  index) const
inline

Return the strip ID at the given index.

Definition at line 143 of file glc_primitivegroup.h.

const IndexList& GLC_PrimitiveGroup::stripsIndex ( ) const
inline

Return the list of index of strips.

Definition at line 151 of file glc_primitivegroup.h.

int GLC_PrimitiveGroup::stripsIndexSize ( ) const
inline

Return the size of index of strips.

Definition at line 147 of file glc_primitivegroup.h.

const OffsetVector& GLC_PrimitiveGroup::stripsOffset ( ) const
inline
const OffsetVectori& GLC_PrimitiveGroup::stripsOffseti ( ) const
inline
const IndexSizes& GLC_PrimitiveGroup::stripsSizes ( ) const
inline
QList<GLC_uint> GLC_PrimitiveGroup::triangleGroupId ( ) const
inline
GLC_uint GLC_PrimitiveGroup::triangleGroupId ( int  index) const
inline

Return the Triangle group ID at the given index.

Definition at line 96 of file glc_primitivegroup.h.

const OffsetVector& GLC_PrimitiveGroup::trianglesGroupOffset ( ) const
inline
const OffsetVectori& GLC_PrimitiveGroup::trianglesGroupOffseti ( ) const
inline
const IndexList& GLC_PrimitiveGroup::trianglesIndex ( ) const
inline

Return the list of triangles index of the group.

Definition at line 108 of file glc_primitivegroup.h.

const GLvoid* GLC_PrimitiveGroup::trianglesIndexOffset ( ) const
inline

Return the offset of triangles index.

Definition at line 115 of file glc_primitivegroup.h.

Referenced by GLC_Mesh::getTrianglesIndex(), and GLC_Mesh::vboDrawPrimitivesOf().

int GLC_PrimitiveGroup::trianglesIndexOffseti ( ) const
inline
int GLC_PrimitiveGroup::trianglesIndexSize ( ) const
inline
const IndexSizes& GLC_PrimitiveGroup::trianglesIndexSizes ( ) const
inline

Friends And Related Function Documentation

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

Non-member stream operator.

Definition at line 326 of file glc_primitivegroup.cpp.

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

Definition at line 365 of file glc_primitivegroup.cpp.

Member Data Documentation

quint32 GLC_PrimitiveGroup::m_ChunkId = 0xA700
staticprivate

Class chunk id.

Definition at line 322 of file glc_primitivegroup.h.

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

OffsetVector GLC_PrimitiveGroup::m_FanIndexOffset
private

Vector of fan Offset.

Definition at line 303 of file glc_primitivegroup.h.

Referenced by clear(), computeVboOffset(), operator=(), and setBaseTrianglesFanOffset().

OffsetVectori GLC_PrimitiveGroup::m_FanIndexOffseti
private
QList<GLC_uint> GLC_PrimitiveGroup::m_FansId
private

Fans id.

Definition at line 307 of file glc_primitivegroup.h.

Referenced by addTrianglesFan(), operator<<(), operator=(), and operator>>().

IndexList GLC_PrimitiveGroup::m_FansIndex
private

Fans index list.

Definition at line 297 of file glc_primitivegroup.h.

Referenced by addTrianglesFan(), clear(), and operator=().

IndexSizes GLC_PrimitiveGroup::m_FansIndexSizes
private

Fans index size.

Definition at line 300 of file glc_primitivegroup.h.

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

GLC_uint GLC_PrimitiveGroup::m_Id
private

Grouped material id.

Definition at line 268 of file glc_primitivegroup.h.

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

int GLC_PrimitiveGroup::m_IsFinished
private

Flag to know if the group is finish.

Definition at line 310 of file glc_primitivegroup.h.

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

OffsetVector GLC_PrimitiveGroup::m_StripIndexOffset
private

Vector of strips offset.

Definition at line 290 of file glc_primitivegroup.h.

Referenced by clear(), computeVboOffset(), operator=(), and setBaseTrianglesStripOffset().

OffsetVectori GLC_PrimitiveGroup::m_StripIndexOffseti
private
IndexSizes GLC_PrimitiveGroup::m_StripIndexSizes
private

Strips index size.

Definition at line 287 of file glc_primitivegroup.h.

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

QList<GLC_uint> GLC_PrimitiveGroup::m_StripsId
private

Strips id.

Definition at line 294 of file glc_primitivegroup.h.

Referenced by addTrianglesStrip(), operator<<(), operator=(), and operator>>().

IndexList GLC_PrimitiveGroup::m_StripsIndex
private

Strips index list.

Definition at line 284 of file glc_primitivegroup.h.

Referenced by addTrianglesStrip(), clear(), and operator=().

int GLC_PrimitiveGroup::m_TrianglesFanSize
private

Flag to know if there is triangles fan.

Definition at line 319 of file glc_primitivegroup.h.

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

OffsetVector GLC_PrimitiveGroup::m_TrianglesGroupOffset
private

Vector of triangles group offset.

Definition at line 277 of file glc_primitivegroup.h.

Referenced by clear(), computeVboOffset(), operator=(), and setTrianglesOffset().

OffsetVectori GLC_PrimitiveGroup::m_TrianglesGroupOffseti
private
IndexSizes GLC_PrimitiveGroup::m_TrianglesGroupsSizes
private

Triangles groups index size.

Definition at line 274 of file glc_primitivegroup.h.

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

QList<GLC_uint> GLC_PrimitiveGroup::m_TrianglesId
private

Triangles groups id.

Definition at line 281 of file glc_primitivegroup.h.

Referenced by addTriangles(), operator<<(), operator=(), and operator>>().

IndexList GLC_PrimitiveGroup::m_TrianglesIndex
private

Triangles index list.

Definition at line 271 of file glc_primitivegroup.h.

Referenced by addTriangles(), clear(), and operator=().

int GLC_PrimitiveGroup::m_TrianglesIndexSize
private

Flag to know if there is triangles.

Definition at line 313 of file glc_primitivegroup.h.

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

int GLC_PrimitiveGroup::m_TrianglesStripSize
private

Flag to know if there is triangles strip.

Definition at line 316 of file glc_primitivegroup.h.

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


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

©2005-2013 Laurent Ribon