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 changeToVboMode ()
 Change index to VBO mode.
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

QDataStream & operator<< (QDataStream &, const GLC_PrimitiveGroup &)
 Non-member stream operator.
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 42 of file glc_primitivegroup.h.


Constructor & Destructor Documentation

GLC_PrimitiveGroup::GLC_PrimitiveGroup ( GLC_uint  id = 0  ) 

Default constructor.

Definition at line 34 of file glc_primitivegroup.cpp.

GLC_PrimitiveGroup::GLC_PrimitiveGroup ( const GLC_PrimitiveGroup group  ) 

Copy constructor.

Definition at line 60 of file glc_primitivegroup.cpp.

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

Copy constructor.

Definition at line 87 of file glc_primitivegroup.cpp.

GLC_PrimitiveGroup::~GLC_PrimitiveGroup (  ) 

Definition at line 142 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 153 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 238 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 173 of file glc_primitivegroup.cpp.

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

void GLC_PrimitiveGroup::changeToVboMode (  ) 
quint32 GLC_PrimitiveGroup::chunckID (  )  [static]

Return the class Chunk ID.

Definition at line 147 of file glc_primitivegroup.cpp.

References m_ChunkId.

void GLC_PrimitiveGroup::clear (  ) 
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 180 of file glc_primitivegroup.h.

int GLC_PrimitiveGroup::fansIndexSize (  )  const [inline]

Return the size of index of fans.

Definition at line 176 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 240 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 78 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 260 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 272 of file glc_primitivegroup.cpp.

References m_FanIndexOffseti.

void GLC_PrimitiveGroup::setBaseTrianglesStripOffset ( GLvoid *  pOffset  ) 

Set base triangle strip offset.

Definition at line 215 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 227 of file glc_primitivegroup.cpp.

References m_StripIndexOffseti.

void GLC_PrimitiveGroup::setId ( GLC_uint  id  )  [inline]

Set the group id.

Definition at line 206 of file glc_primitivegroup.h.

Referenced by GLC_Mesh::replaceMaterial().

void GLC_PrimitiveGroup::setTrianglesOffset ( GLvoid *  pOffset  ) 

Set the triangle index offset.

Definition at line 192 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 204 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 145 of file glc_primitivegroup.h.

int GLC_PrimitiveGroup::stripsIndexSize (  )  const [inline]

Return the size of index of strips.

Definition at line 141 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 106 of file glc_primitivegroup.h.

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

Return the offset of triangles index.

Definition at line 113 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

QDataStream& operator<< ( QDataStream &  ,
const GLC_PrimitiveGroup  
) [friend]

Non-member stream operator.

Definition at line 335 of file glc_primitivegroup.cpp.

QDataStream& operator>> ( QDataStream &  ,
GLC_PrimitiveGroup  
) [friend]

Definition at line 399 of file glc_primitivegroup.cpp.


Member Data Documentation

quint32 GLC_PrimitiveGroup::m_ChunkId = 0xA700 [static, private]

Class chunk id.

Definition at line 312 of file glc_primitivegroup.h.

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

Vector of fan Offset.

Definition at line 293 of file glc_primitivegroup.h.

Referenced by changeToVboMode(), clear(), operator<<(), operator=(), and setBaseTrianglesFanOffset().

Fans id.

Definition at line 297 of file glc_primitivegroup.h.

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

Fans index list.

Definition at line 287 of file glc_primitivegroup.h.

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

Fans index size.

Definition at line 290 of file glc_primitivegroup.h.

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

Grouped material id.

Definition at line 258 of file glc_primitivegroup.h.

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

Flag to know if the group is finish.

Definition at line 300 of file glc_primitivegroup.h.

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

Vector of strips offset.

Definition at line 280 of file glc_primitivegroup.h.

Referenced by changeToVboMode(), clear(), operator<<(), operator=(), and setBaseTrianglesStripOffset().

Strips index size.

Definition at line 277 of file glc_primitivegroup.h.

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

Strips id.

Definition at line 284 of file glc_primitivegroup.h.

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

Strips index list.

Definition at line 274 of file glc_primitivegroup.h.

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

Flag to know if there is triangles fan.

Definition at line 309 of file glc_primitivegroup.h.

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

Vector of triangles group offset.

Definition at line 267 of file glc_primitivegroup.h.

Referenced by changeToVboMode(), clear(), operator<<(), operator=(), and setTrianglesOffset().

Triangles groups index size.

Definition at line 264 of file glc_primitivegroup.h.

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

Triangles groups id.

Definition at line 271 of file glc_primitivegroup.h.

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

Triangles index list.

Definition at line 261 of file glc_primitivegroup.h.

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

Flag to know if there is triangles.

Definition at line 303 of file glc_primitivegroup.h.

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

Flag to know if there is triangles strip.

Definition at line 306 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-2010 Laurent Ribon