GLC_3DRep : A referrence 3D Representation. More...
#include <glc_3drep.h>
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_3DRep & | operator= (const GLC_3DRep &) |
| Assignement operator. | |
| virtual GLC_Rep * | clone () const |
| Clone the representation. | |
| virtual GLC_Rep * | deepCopy () 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 (GLC_3DRep *) |
| Merge this 3Drep with another 3DRep. | |
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 | |
| QDataStream & | operator<< (QDataStream &, const GLC_3DRep &) |
| Non-member stream operator. | |
| QDataStream & | operator>> (QDataStream &, GLC_3DRep &) |
Get Functions | |
|
| |
| virtual int | type () const |
| Return the type of representation. | |
| GLC_Geometry * | geomAt (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. | |
GLC_3DRep : A referrence 3D Representation.
Definition at line 38 of file glc_3drep.h.
| GLC_3DRep::GLC_3DRep | ( | ) |
| GLC_3DRep::GLC_3DRep | ( | GLC_Geometry * | pGeom | ) |
Construct a 3DRep with a geometry.
Definition at line 42 of file glc_3drep.cpp.
References m_pGeomList, 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] |
| void GLC_3DRep::addGeom | ( | GLC_Geometry * | pGeom | ) | [inline] |
Add Geometry to the 3DRep.
Definition at line 134 of file glc_3drep.h.
Referenced by GLC_CuttingPlane::create3DviewInstance(), GLC_3dxmlToWorld::createReferenceRep(), deepCopy(), GLC_3dxmlToWorld::loadCurrentExtRep(), merge(), operator>>(), and GLC_3DViewInstance::setGeometry().
| GLC_BoundingBox GLC_3DRep::boundingBox | ( | ) | const |
Return the 3DRep bounding Box.
Definition at line 133 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 119 of file glc_3drep.cpp.
References m_pGeomList.
| quint32 GLC_3DRep::chunckID | ( | ) | [static] |
| void GLC_3DRep::clean | ( | ) |
Remove empty geometries and factorise materials.
Definition at line 209 of file glc_3drep.cpp.
References m_pGeomList.
Referenced by GLC_3dxmlToWorld::create3DrepFrom3dxmlRep(), GLC_ColladaToWorld::createMesh(), GLC_3dxmlToWorld::createReferenceRep(), GLC_3dxmlToWorld::loadCurrentExtRep(), and GLC_3dxmlToWorld::loadExternRepresentations().
| void GLC_3DRep::clear | ( | ) | [private] |
Clear current representation.
Reimplemented from GLC_Rep.
Definition at line 340 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 72 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 111 of file glc_3drep.h.
Referenced by GLC_3DViewInstance::setGeometry().
| GLC_Rep * GLC_3DRep::deepCopy | ( | ) | const [virtual] |
Make a deep copy of the 3DRep.
Implements GLC_Rep.
Definition at line 78 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 145 of file glc_3drep.cpp.
References m_pGeomList.
Referenced by GLC_StructReference::numberOfFaces().
| GLC_Geometry* GLC_3DRep::geomAt | ( | int | index | ) | const [inline] |
Get Geometry.
Definition at line 83 of file glc_3drep.h.
Referenced by GLC_3DViewInstance::computeBoundingBox(), GLC_3DViewInstance::hasTransparentMaterials(), GLC_3DViewInstance::isTransparent(), merge(), GLC_3DViewInstance::render(), GLC_3DViewInstance::renderForBodySelection(), GLC_3DViewInstance::renderForPrimitiveSelection(), and GLC_WorldTo3dxml::write3DRep().
| virtual bool GLC_3DRep::isEmpty | ( | void | ) | const [inline, virtual] |
Return true if the representation is empty.
Implements GLC_Rep.
Definition at line 98 of file glc_3drep.h.
Referenced by GLC_3DViewInstance::boundingBox(), GLC_3DViewInstance::computeBoundingBox(), GLC_ColladaToWorld::createOccurenceFromNode(), GLC_3dxmlToWorld::createReferenceRep(), GLC_3DViewInstance::hasTransparentMaterials(), GLC_3DViewInstance::isTransparent(), load(), GLC_3dxmlToWorld::loadExternRepresentations(), operator>>(), GLC_3DViewInstance::render(), GLC_3DViewInstance::renderForBodySelection(), GLC_3DViewInstance::renderForPrimitiveSelection(), and replace().
| bool GLC_3DRep::load | ( | ) | [virtual] |
Load the representation and return true if success.
Implements GLC_Rep.
Definition at line 238 of file glc_3drep.cpp.
References GLC_Factory::create3DRepFromFile(), GLC_Rep::fileName(), GLC_Factory::instance(), isEmpty(), m_pGeomList, and GLC_Rep::m_pIsLoaded.
| unsigned int GLC_3DRep::materialCount | ( | ) | const |
Return number of materials of this 3DRep.
Definition at line 177 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 193 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 | ( | GLC_3DRep * | pRep | ) |
Merge this 3Drep with another 3DRep.
Definition at line 305 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] |
Return the number of body.
Definition at line 91 of file glc_3drep.h.
Referenced by GLC_3DViewInstance::computeBoundingBox(), GLC_3DViewInstance::hasTransparentMaterials(), GLC_3DViewInstance::isTransparent(), GLC_StructReference::numberOfBody(), GLC_3DViewInstance::render(), GLC_3DViewInstance::renderForBodySelection(), GLC_3DViewInstance::renderForPrimitiveSelection(), GLC_3DViewInstance::setViewable(), and GLC_WorldTo3dxml::write3DRep().
Assignement operator.
Definition at line 61 of file glc_3drep.cpp.
References clear(), m_pGeomList, and m_pType.
| void GLC_3DRep::replace | ( | GLC_Rep * | pRep | ) | [virtual] |
Replace the representation.
Implements GLC_Rep.
Definition at line 264 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 285 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 | ( | ) |
| int GLC_3DRep::type | ( | ) | const [virtual] |
Return the type of representation.
Implements GLC_Rep.
Definition at line 109 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 316 of file glc_3drep.cpp.
References GLC_Rep::fileName(), m_pGeomList, and GLC_Rep::m_pIsLoaded.
| unsigned int GLC_3DRep::vertexCount | ( | ) | const |
Return number of vertex of this 3DRep.
Definition at line 161 of file glc_3drep.cpp.
References m_pGeomList.
Referenced by GLC_3dsToWorld::createMeshes(), and GLC_StructReference::numberOfVertex().
| QDataStream& operator<< | ( | QDataStream & | , | |
| const GLC_3DRep & | ||||
| ) | [friend] |
Non-member stream operator.
Definition at line 358 of file glc_3drep.cpp.
| QDataStream& operator>> | ( | QDataStream & | , | |
| GLC_3DRep & | ||||
| ) | [friend] |
Definition at line 392 of file glc_3drep.cpp.
quint32 GLC_3DRep::m_ChunkId = 0xA702 [static, private] |
Class chunk id.
Definition at line 179 of file glc_3drep.h.
Referenced by chunckID(), operator<<(), and operator>>().
QList<GLC_Geometry*>* GLC_3DRep::m_pGeomList [private] |
Geometries of the 3D representation.
Definition at line 173 of file glc_3drep.h.
Referenced by boundingBox(), boundingBoxIsValid(), clean(), clear(), deepCopy(), faceCount(), GLC_3DRep(), load(), materialCount(), materialSet(), merge(), operator<<(), operator=(), replace(), replaceMaterial(), reverseNormals(), unload(), and vertexCount().
int* GLC_3DRep::m_pType [private] |
The Type of representation.
Definition at line 176 of file glc_3drep.h.
Referenced by clear(), operator=(), and type().