GLC_PrimitiveGroup Class Reference

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

#include <glc_primitivegroup.h>

List of all members.

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.
GLC_uint triangleGroupId (int index)
 Return the Triangle group ID.
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.
GLC_uint stripGroupId (int index)
 Return the strip ID.
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.
GLC_uint fanGroupId (int index)
 Return the fan ID.
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]
GLC_uint GLC_PrimitiveGroup::fanGroupId ( int  index  )  [inline]
const IndexList& GLC_PrimitiveGroup::fansIndex (  )  const [inline]

Return the list of index of fans.

Definition at line 178 of file glc_primitivegroup.h.

int GLC_PrimitiveGroup::fansIndexSize (  )  const [inline]

Return the size of index of fans.

Definition at line 174 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 238 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 204 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.

GLC_uint GLC_PrimitiveGroup::stripGroupId ( int  index  )  [inline]
const IndexList& GLC_PrimitiveGroup::stripsIndex (  )  const [inline]

Return the list of index of strips.

Definition at line 143 of file glc_primitivegroup.h.

int GLC_PrimitiveGroup::stripsIndexSize (  )  const [inline]

Return the size of index of strips.

Definition at line 139 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]
GLC_uint GLC_PrimitiveGroup::triangleGroupId ( int  index  )  [inline]
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 104 of file glc_primitivegroup.h.

const GLvoid* GLC_PrimitiveGroup::trianglesIndexOffset (  )  const [inline]

Return the offset of triangles index.

Definition at line 111 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 [static, private]

Class chunk id.

Definition at line 310 of file glc_primitivegroup.h.

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

Vector of fan Offset.

Definition at line 291 of file glc_primitivegroup.h.

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

Fans id.

Definition at line 295 of file glc_primitivegroup.h.

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

Fans index list.

Definition at line 285 of file glc_primitivegroup.h.

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

Fans index size.

Definition at line 288 of file glc_primitivegroup.h.

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

Grouped material id.

Definition at line 256 of file glc_primitivegroup.h.

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

Flag to know if the group is finish.

Definition at line 298 of file glc_primitivegroup.h.

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

Vector of strips offset.

Definition at line 278 of file glc_primitivegroup.h.

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

Strips index size.

Definition at line 275 of file glc_primitivegroup.h.

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

Strips id.

Definition at line 282 of file glc_primitivegroup.h.

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

Strips index list.

Definition at line 272 of file glc_primitivegroup.h.

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

Flag to know if there is triangles fan.

Definition at line 307 of file glc_primitivegroup.h.

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

Vector of triangles group offset.

Definition at line 265 of file glc_primitivegroup.h.

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

Triangles groups index size.

Definition at line 262 of file glc_primitivegroup.h.

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

Triangles groups id.

Definition at line 269 of file glc_primitivegroup.h.

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

Triangles index list.

Definition at line 259 of file glc_primitivegroup.h.

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

Flag to know if there is triangles.

Definition at line 301 of file glc_primitivegroup.h.

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

Flag to know if there is triangles strip.

Definition at line 304 of file glc_primitivegroup.h.

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


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

SourceForge.net Logo

©2005-2011 Laurent Ribon