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

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

#include <glc_3drep.h>

+ Inheritance diagram for GLC_3DRep:

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.
 
void setVboUsage (bool usage)
 Set VBO usage.
 
- Public Member Functions inherited from GLC_Rep
 GLC_Rep ()
 Default constructor.
 
 GLC_Rep (const GLC_Rep &)
 Copy constructor.
 
virtual ~GLC_Rep ()
 Destructor.
 
bool isTheLast () const
 Return true if the representation is the last.
 
bool operator== (const GLC_Rep &rep)
 Return true if representations are equals.
 
QString fileName () const
 Return the representation file name.
 
QString name () const
 Return the name of the rep.
 
bool isLoaded () const
 Return true if the representation as been loaded.
 
QDateTime lastModified () const
 Return the rep file las modified date and time.
 
void setFileName (const QString &fileName)
 Set the representation FileName.
 
void setName (const QString &name)
 Set the representation Name.
 
void setLastModified (const QDateTime &dateTime)
 Set the last modified date and time.
 

Private Member Functions

void clear3DRepGeom ()
 Clear current representation geometries.
 

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.
 
double volume () const
 Return the volume of this 3DRep.
 
static quint32 chunckID ()
 Return the class Chunk ID.
 

Additional Inherited Members

- Public Types inherited from GLC_Rep
enum  Type { GLC_VBOGEOM = 1 }
 
- Protected Attributes inherited from GLC_Rep
bool * m_pIsLoaded
 Flag to know if the representation has been loaded.
 

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 31 of file glc_3drep.cpp.

Referenced by clone(), and deepCopy().

GLC_3DRep::GLC_3DRep ( GLC_Geometry pGeom)

Construct a 3DRep with a geometry.

Definition at line 39 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 49 of file glc_3drep.cpp.

GLC_3DRep::~GLC_3DRep ( )
virtual

Destructor.

Definition at line 100 of file glc_3drep.cpp.

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

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 144 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 131 of file glc_3drep.cpp.

References m_pGeomList.

quint32 GLC_3DRep::chunckID ( )
static

Return the class Chunk ID.

Definition at line 117 of file glc_3drep.cpp.

References m_ChunkId.

void GLC_3DRep::clean ( )
void GLC_3DRep::clear3DRepGeom ( )
private

Clear current representation geometries.

Definition at line 427 of file glc_3drep.cpp.

References m_pGeomList.

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

GLC_Rep * GLC_3DRep::clone ( ) const
virtual

Clone the representation.

Implements GLC_Rep.

Definition at line 80 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::addGeometry().

void GLC_3DRep::copyVboToClientSide ( )

Copy VBO to the Client Side.

Definition at line 352 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 85 of file glc_3drep.cpp.

References addGeom(), GLC_Rep::fileName(), GLC_3DRep(), 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 155 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
inlinevirtual
bool GLC_3DRep::load ( )
virtual

Load the representation and return true if success.

Implements GLC_Rep.

Definition at line 254 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 185 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 200 of file glc_3drep.cpp.

References m_pGeomList.

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

void GLC_3DRep::merge ( const GLC_3DRep pRep)

Merge this 3Drep with another 3DRep.

Definition at line 331 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 57 of file glc_3drep.cpp.

References clear3DRepGeom(), GLC_Rep::isTheLast(), m_pGeomList, m_pType, and GLC_Rep::operator=().

void GLC_3DRep::releaseVboClientSide ( bool  update = false)

Release client VBO.

Definition at line 362 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 289 of file glc_3drep.cpp.

References clear3DRepGeom(), GLC_Rep::fileName(), isEmpty(), m_pGeomList, m_pType, 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 312 of file glc_3drep.cpp.

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

void GLC_3DRep::reverseNormals ( )

Reverse geometries normals.

Definition at line 245 of file glc_3drep.cpp.

References m_pGeomList.

void GLC_3DRep::setVboUsage ( bool  usage)

Set VBO usage.

Definition at line 386 of file glc_3drep.cpp.

References m_pGeomList.

Referenced by GLC_3DViewInstance::setVboUsage().

void GLC_3DRep::take ( GLC_3DRep pSource)

Take the geometry of another 3DRep.

Definition at line 341 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 372 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 122 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 396 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 170 of file glc_3drep.cpp.

References m_pGeomList.

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

double GLC_3DRep::volume ( ) const

Return the volume of this 3DRep.

Definition at line 215 of file glc_3drep.cpp.

References m_pGeomList.

Friends And Related Function Documentation

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

Non-member stream operator.

Definition at line 438 of file glc_3drep.cpp.

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

Definition at line 473 of file glc_3drep.cpp.

Member Data Documentation

quint32 GLC_3DRep::m_ChunkId = 0xA702
staticprivate

Class chunk id.

Definition at line 197 of file glc_3drep.h.

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

QList<GLC_Geometry*>* GLC_3DRep::m_pGeomList
private
int* GLC_3DRep::m_pType
private

The Type of representation.

Definition at line 194 of file glc_3drep.h.

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


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

©2005-2013 Laurent Ribon