GLC_3DRep Class Reference

GLC_3DRep : A referrence 3D Representation. More...

#include <glc_3drep.h>

Inheritance diagram for GLC_3DRep:
GLC_Rep

List of all members.

Public Member Functions

Constructor / Destructor

 GLC_3DRep ()
 Default Constructor.
 GLC_3DRep (GLC_Geometry *)
 Construct a 3DRep with a geometry.
 GLC_3DRep (const GLC_3DRep &)
 Copy Constructor.
virtual GLC_3DRepoperator= (const GLC_Rep &)
 Assignement operator.
virtual GLC_Repclone () const
 Clone the representation.
virtual GLC_RepdeepCopy () const
 Make a deep copy of the 3DRep.
virtual ~GLC_3DRep ()
 Destructor.
Set Functions

void addGeom (GLC_Geometry *pGeom)
 Add Geometry to the 3DRep.
void clean ()
 Remove empty geometries and factorise materials.
void reverseNormals ()
 Reverse geometries normals.
virtual bool load ()
 Load the representation and return true if success.
virtual bool unload ()
 UnLoad the representation and return true if success.
virtual void replace (GLC_Rep *)
 Replace the representation.
void replaceMaterial (GLC_uint, GLC_Material *)
 Replace the specified material by a new one.
void merge (const GLC_3DRep *)
 Merge this 3Drep with another 3DRep.
void take (GLC_3DRep *pSource)
 Take the geometry of another 3DRep.
void copyVboToClientSide ()
 Copy VBO to the Client Side.
void releaseVboClientSide (bool update=false)
 Release client VBO.
void transformSubGeometries (const GLC_Matrix4x4 &matrix)
 Transform 3DRep sub mesh vertice with the given matrix.

Private Member Functions

void clear ()
 Clear current representation.

Private Attributes

QList< GLC_Geometry * > * m_pGeomList
 Geometries of the 3D representation.
int * m_pType
 The Type of representation.

Static Private Attributes

static quint32 m_ChunkId = 0xA702
 Class chunk id.

Friends

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

Get Functions



virtual int type () const
 Return the type of representation.
GLC_GeometrygeomAt (int index) const
 Get Geometry.
int numberOfBody () const
 Return the number of body.
virtual bool isEmpty () const
 Return true if the representation is empty.
bool boundingBoxIsValid () const
 Return true if the rep bounding box is valid.
GLC_BoundingBox boundingBox () const
 Return the 3DRep bounding Box.
bool contains (GLC_Geometry *pGeom)
 Return true if the 3DRep contains the geometry.
unsigned int faceCount () const
 Return the number of faces of this 3DRep.
unsigned int vertexCount () const
 Return number of vertex of this 3DRep.
unsigned int materialCount () const
 Return number of materials of this 3DRep.
QSet< GLC_Material * > materialSet () const
 Return materials Set of this 3DRep.
static quint32 chunckID ()
 Return the class Chunk ID.

Detailed Description

GLC_3DRep : A referrence 3D Representation.

Definition at line 36 of file glc_3drep.h.


Constructor & Destructor Documentation

GLC_3DRep::GLC_3DRep (  ) 

Default Constructor.

Definition at line 32 of file glc_3drep.cpp.

Referenced by clone().

GLC_3DRep::GLC_3DRep ( GLC_Geometry pGeom  ) 

Construct a 3DRep with a geometry.

Definition at line 41 of file glc_3drep.cpp.

References m_pGeomList, GLC_Rep::m_pIsLoaded, GLC_Geometry::name(), and GLC_Rep::setName().

GLC_3DRep::GLC_3DRep ( const GLC_3DRep rep  ) 

Copy Constructor.

Definition at line 52 of file glc_3drep.cpp.

GLC_3DRep::~GLC_3DRep (  )  [virtual]

Destructor.

Definition at line 99 of file glc_3drep.cpp.

References clear().


Member Function Documentation

void GLC_3DRep::addGeom ( GLC_Geometry pGeom  )  [inline]
GLC_BoundingBox GLC_3DRep::boundingBox (  )  const

Return the 3DRep bounding Box.

Definition at line 138 of file glc_3drep.cpp.

References GLC_BoundingBox::combine(), and m_pGeomList.

Referenced by GLC_BSRep::save().

bool GLC_3DRep::boundingBoxIsValid (  )  const

Return true if the rep bounding box is valid.

Definition at line 124 of file glc_3drep.cpp.

References m_pGeomList.

quint32 GLC_3DRep::chunckID (  )  [static]

Return the class Chunk ID.

Definition at line 108 of file glc_3drep.cpp.

References m_ChunkId.

void GLC_3DRep::clean (  ) 
void GLC_3DRep::clear (  )  [private]

Clear current representation.

Reimplemented from GLC_Rep.

Definition at line 408 of file glc_3drep.cpp.

References GLC_Rep::isTheLast(), m_pGeomList, and m_pType.

Referenced by operator=(), and ~GLC_3DRep().

GLC_Rep * GLC_3DRep::clone (  )  const [virtual]

Clone the representation.

Implements GLC_Rep.

Definition at line 77 of file glc_3drep.cpp.

References GLC_3DRep().

bool GLC_3DRep::contains ( GLC_Geometry pGeom  )  [inline]

Return true if the 3DRep contains the geometry.

Definition at line 109 of file glc_3drep.h.

Referenced by GLC_3DViewInstance::setGeometry().

void GLC_3DRep::copyVboToClientSide (  ) 

Copy VBO to the Client Side.

Definition at line 340 of file glc_3drep.cpp.

References GLC_Geometry::copyVboToClientSide(), geomAt(), and m_pGeomList.

GLC_Rep * GLC_3DRep::deepCopy (  )  const [virtual]

Make a deep copy of the 3DRep.

Implements GLC_Rep.

Definition at line 83 of file glc_3drep.cpp.

References addGeom(), GLC_Rep::fileName(), m_pGeomList, GLC_Rep::name(), GLC_Rep::setFileName(), and GLC_Rep::setName().

Referenced by GLC_3DViewInstance::deepCopy().

unsigned int GLC_3DRep::faceCount (  )  const

Return the number of faces of this 3DRep.

Definition at line 150 of file glc_3drep.cpp.

References m_pGeomList.

Referenced by GLC_StructReference::numberOfFaces(), and GLC_BSRep::save().

GLC_Geometry* GLC_3DRep::geomAt ( int  index  )  const [inline]
virtual bool GLC_3DRep::isEmpty ( void   )  const [inline, virtual]
bool GLC_3DRep::load (  )  [virtual]

Load the representation and return true if success.

Implements GLC_Rep.

Definition at line 243 of file glc_3drep.cpp.

References GLC_ErrorLog::addError(), GLC_Factory::create3DRepFromFile(), GLC_Rep::fileName(), GLC_Factory::instance(), isEmpty(), m_pGeomList, GLC_Rep::m_pIsLoaded, and GLC_Rep::name().

unsigned int GLC_3DRep::materialCount (  )  const

Return number of materials of this 3DRep.

Definition at line 182 of file glc_3drep.cpp.

References m_pGeomList.

Referenced by GLC_StructReference::numberOfMaterials().

QSet< GLC_Material * > GLC_3DRep::materialSet (  )  const

Return materials Set of this 3DRep.

Definition at line 198 of file glc_3drep.cpp.

References m_pGeomList.

Referenced by GLC_3dsToWorld::createMeshes(), GLC_3dxmlToWorld::factorizeMaterial(), GLC_StructReference::materialSet(), and operator<<().

void GLC_3DRep::merge ( const GLC_3DRep pRep  ) 

Merge this 3Drep with another 3DRep.

Definition at line 319 of file glc_3drep.cpp.

References addGeom(), GLC_Geometry::clone(), geomAt(), and m_pGeomList.

Referenced by GLC_ColladaToWorld::createOccurenceFromNode().

int GLC_3DRep::numberOfBody (  )  const [inline]
GLC_3DRep & GLC_3DRep::operator= ( const GLC_Rep rep  )  [virtual]

Assignement operator.

Reimplemented from GLC_Rep.

Definition at line 61 of file glc_3drep.cpp.

References clear(), m_pGeomList, and m_pType.

void GLC_3DRep::releaseVboClientSide ( bool  update = false  ) 

Release client VBO.

Definition at line 350 of file glc_3drep.cpp.

References geomAt(), m_pGeomList, and GLC_Geometry::releaseVboClientSide().

void GLC_3DRep::replace ( GLC_Rep pRep  )  [virtual]

Replace the representation.

Implements GLC_Rep.

Definition at line 278 of file glc_3drep.cpp.

References GLC_Rep::fileName(), isEmpty(), m_pGeomList, GLC_Rep::name(), GLC_Rep::setFileName(), and GLC_Rep::setName().

void GLC_3DRep::replaceMaterial ( GLC_uint  oldId,
GLC_Material pNewMaterial 
)

Replace the specified material by a new one.

Definition at line 299 of file glc_3drep.cpp.

References GLC_Geometry::containsMaterial(), GLC_Object::id(), m_pGeomList, and GLC_Mesh::replaceMaterial().

Referenced by GLC_3dxmlToWorld::factorizeMaterial().

void GLC_3DRep::reverseNormals (  ) 

Reverse geometries normals.

Definition at line 233 of file glc_3drep.cpp.

References m_pGeomList.

void GLC_3DRep::take ( GLC_3DRep pSource  ) 

Take the geometry of another 3DRep.

Definition at line 329 of file glc_3drep.cpp.

References addGeom(), geomAt(), and m_pGeomList.

Referenced by GLC_3dxmlToWorld::loadExternRepresentations().

void GLC_3DRep::transformSubGeometries ( const GLC_Matrix4x4 matrix  ) 

Transform 3DRep sub mesh vertice with the given matrix.

Definition at line 360 of file glc_3drep.cpp.

References geomAt(), m_pGeomList, and GLC_Mesh::transformVertice().

int GLC_3DRep::type (  )  const [virtual]

Return the type of representation.

Implements GLC_Rep.

Definition at line 114 of file glc_3drep.cpp.

References m_pType.

bool GLC_3DRep::unload (  )  [virtual]

UnLoad the representation and return true if success.

Implements GLC_Rep.

Definition at line 376 of file glc_3drep.cpp.

References GLC_ErrorLog::addError(), GLC_Rep::fileName(), and m_pGeomList.

unsigned int GLC_3DRep::vertexCount (  )  const

Return number of vertex of this 3DRep.

Definition at line 166 of file glc_3drep.cpp.

References m_pGeomList.

Referenced by GLC_3dsToWorld::createMeshes(), and GLC_StructReference::numberOfVertex().


Friends And Related Function Documentation

GLC_LIB_EXPORT QDataStream& operator<< ( QDataStream &  ,
const GLC_3DRep  
) [friend]

Non-member stream operator.

Definition at line 426 of file glc_3drep.cpp.

GLC_LIB_EXPORT QDataStream& operator>> ( QDataStream &  ,
GLC_3DRep  
) [friend]

Definition at line 460 of file glc_3drep.cpp.


Member Data Documentation

quint32 GLC_3DRep::m_ChunkId = 0xA702 [static, private]

Class chunk id.

Definition at line 192 of file glc_3drep.h.

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

int* GLC_3DRep::m_pType [private]

The Type of representation.

Definition at line 189 of file glc_3drep.h.

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


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

SourceForge.net Logo

©2005-2011 Laurent Ribon