GLC_ColladaToWorld : Create an GLC_World from dae file. More...
#include <glc_colladatoworld.h>
Classes | |
| struct | ColladaNode |
| struct | ColladaVertice |
| struct | InputData |
| struct | MatOffsetSize |
| struct | MeshInfo |
Signals | |
| void | currentQuantum (int) |
Public Member Functions | |
Constructor / Destructor | |
| GLC_ColladaToWorld (const QGLContext *) | |
| Default constructor. | |
| virtual | ~GLC_ColladaToWorld () |
| Destructor. | |
Set Functions | |
| GLC_World * | CreateWorldFromCollada (QFile &) |
| Create an GLC_World from an input Collada File. | |
| QStringList | listOfAttachedFileName () const |
| Get the list of attached files. | |
Private Types | |
| enum | Semantic { VERTEX = 0, NORMAL = 1, TEXCOORD = 2 } |
| typedef QHash< const QString, GLC_Material * > | MaterialHash |
| typedef QHash< const QString, QList< float > > | BulkDataHash |
Private Member Functions | |
Private services functions | |
| void | goToElement (const QString &) |
| Go to an Element of a xml. | |
| void | goToEndElement (const QString &) |
| Go to the end Element of a xml. | |
| QString | getContent (const QString &) |
| QString | readAttribute (const QString &, bool required=false) |
| Read the specified attribute. | |
| void | checkForXmlError (const QString &) |
| void | throwException (const QString &) |
| Throw an exception with the specified text. | |
| bool | endElementNotReached (const QString &element) |
| Return true if the end of specified element is not reached. | |
| bool | startElementNotReached (const QString &element) |
| Return true if the start of specified element is not reached. | |
| void | clear () |
| Clear memmory. | |
| void | loadLibraryImage () |
| Load library_images element. | |
| void | loadImage () |
| Load image element. | |
| void | loadLibraryMaterials () |
| Load library_materials element. | |
| void | loadMaterial () |
| Load a material. | |
| void | loadLibraryEffects () |
| Load library_effects element. | |
| void | loadEffect () |
| Load an effect. | |
| void | loadProfileCommon () |
| Load profile_COMMON. | |
| void | loadNewParam () |
| Load a new param. | |
| void | loadSurface (const QString &) |
| Load a surface. | |
| void | loadSampler2D (const QString &) |
| Load Sampler 2D. | |
| void | loadTechnique () |
| Load technique. | |
| void | loadMaterialTechnique (const QString &) |
| load material technique | |
| void | loadCommonColorOrTexture (const QString &) |
| load common color or texture | |
| void | loadTransparent () |
| Load transparent. | |
| void | loadTransparency (const QString &) |
| Load transparency. | |
| void | loadShininess (const QString &) |
| Load shininess. | |
| QColor | readXmlColor () |
| Read a xml Color. | |
| void | loadLibraryGeometries () |
| Load library_geometries element. | |
| void | loadGeometry () |
| Load an geometry element. | |
| void | loadMesh () |
| Load a mesh. | |
| void | loadVertexBulkData () |
| Load Vertex bulk data. | |
| void | loadVertices () |
| Load attributes and identity of mesh vertices. | |
| void | loadPolylist () |
| Load polylist. | |
| void | loadPolygons () |
| Load Polygons. | |
| void | addPolylistToCurrentMesh (const QList< InputData > &, const QList< int > &, const QList< int > &, const QString &) |
| Add the polylist to the current mesh. | |
| void | computeNormalOfCurrentPrimitiveOfCurrentMesh (int offset) |
| Compute Normals for the current primitive element of the current mesh from the specified offset. | |
| void | loadTriangles () |
| Load triangles. | |
| void | addTrianglesToCurrentMesh (const QList< InputData > &, const QList< int > &, const QString &) |
| Add the triangles to current mesh. | |
| void | loadLibraryNodes () |
| Load the library nodes. | |
| void | loadLibraryContollers () |
| Load the library controllers. | |
| void | loadVisualScenes () |
| Load library_visual_scenes element. | |
| void | loadInstanceGeometry (ColladaNode *) |
| Load an instance geometry. | |
| void | loadInstanceNode (ColladaNode *) |
| Load an instance geometry. | |
| void | loadInstanceController (ColladaNode *) |
| Load an instance Controller. | |
| void | loadController () |
| Load a collada controller node. | |
| ColladaNode * | loadNode (ColladaNode *) |
| Load a Collada Node element and return it. | |
| void | translateNode (ColladaNode *) |
| Translate the node. | |
| void | scaleNode (ColladaNode *) |
| Scale the node. | |
| void | rotateNode (ColladaNode *) |
| Rotate the node. | |
| void | composeMatrixNode (ColladaNode *) |
| Compose Node matrix. | |
| void | loadScene () |
| Load scene element. | |
| void | linkTexturesToMaterials () |
| Link texture to material. | |
| void | createMesh () |
| Create mesh and link them to material. | |
| void | createSceneGraph () |
| Create the scene graph struct. | |
| GLC_StructOccurence * | createOccurenceFromNode (ColladaNode *) |
| Create Occurence tree from node tree. | |
| void | updateProgressBar () |
| Update progress bar. | |
Private Attributes | |
| GLC_World * | m_pWorld |
| The world to built. | |
| const QGLContext * | m_pQGLContext |
| OpenGL Context. | |
| QXmlStreamReader * | m_pStreamReader |
| Xml Reader. | |
| QString | m_FileName |
| The collada fileName. | |
| QFile * | m_pFile |
| The collada file. | |
| QHash< QString, QString > | m_ImageFileHash |
| Map image id to image file name. | |
| QHash< QString, QString > | m_MaterialLibHash |
| Map materialInstance to material. | |
| QHash< QString, QString > | m_SurfaceImageHash |
| Map surface sid to image id. | |
| QHash< QString, QString > | m_Sampler2DSurfaceHash |
| Map sampler2D sid to surface sid. | |
| MaterialHash | m_MaterialEffectHash |
| Material Effect hash table. | |
| GLC_Material * | m_pCurrentMaterial |
| The current material. | |
| MaterialHash | m_TextureToMaterialHash |
| Texture to material link. | |
| BulkDataHash | m_BulkDataHash |
| Bulk data hash table. | |
| QHash< QString, QString > | m_VerticesSourceHash |
| Map vertices id to source data id. | |
| MeshInfo * | m_pMeshInfo |
| The current loadeed mesh. | |
| QHash< const QString, MeshInfo * > | m_GeometryHash |
| Hash table off geometry (MeshInfo*). | |
| QHash< const QString, ColladaNode * > | m_ColladaNodeHash |
| Hash table off collada node. | |
| QList< ColladaNode * > | m_TopLevelColladaNode |
| The list of top level node. | |
| QHash< const QString, QString > | m_MaterialInstanceMap |
| Mapping between material instance and material. | |
| QHash< const QString, GLC_3DRep * > | m_3DRepHash |
| 3DRep hash table | |
| QHash< const QString, GLC_StructInstance * > | m_StructInstanceHash |
| GLC instance Hash table. | |
| QString | m_CurrentId |
| The current Collada Element id. | |
| qint64 | m_FileSize |
| The Collada file size. | |
| int | m_CurrentOffset |
| The current offset in the collada file. | |
| QSet< QString > | m_ListOfAttachedFileName |
| The list of attached file name. | |
| bool | m_TransparentIsRgbZero |
| The transparent mode is RGB_ZERO. | |
GLC_ColladaToWorld : Create an GLC_World from dae file.
Definition at line 49 of file glc_colladatoworld.h.
typedef QHash<const QString, QList<float> > GLC_ColladaToWorld::BulkDataHash [private] |
Definition at line 144 of file glc_colladatoworld.h.
typedef QHash<const QString, GLC_Material*> GLC_ColladaToWorld::MaterialHash [private] |
Definition at line 143 of file glc_colladatoworld.h.
enum GLC_ColladaToWorld::Semantic [private] |
Definition at line 55 of file glc_colladatoworld.h.
| GLC_ColladaToWorld::GLC_ColladaToWorld | ( | const QGLContext * | pContext | ) |
Default constructor.
Definition at line 32 of file glc_colladatoworld.cpp.
| GLC_ColladaToWorld::~GLC_ColladaToWorld | ( | ) | [virtual] |
| void GLC_ColladaToWorld::addPolylistToCurrentMesh | ( | const QList< InputData > & | inputDataList, | |
| const QList< int > & | vcountList, | |||
| const QList< int > & | polyIndexList, | |||
| const QString & | materialId | |||
| ) | [private] |
Add the polylist to the current mesh.
Definition at line 993 of file glc_colladatoworld.cpp.
References computeNormalOfCurrentPrimitiveOfCurrentMesh(), m_BulkDataHash, GLC_ColladaToWorld::MeshInfo::m_Datas, GLC_ColladaToWorld::MeshInfo::m_FreeIndex, GLC_ColladaToWorld::MeshInfo::m_Index, GLC_ColladaToWorld::MeshInfo::m_Mapping, GLC_ColladaToWorld::MeshInfo::m_Materials, GLC_ColladaToWorld::MatOffsetSize::m_Offset, GLC_ColladaToWorld::InputData::m_Offset, GLC_ColladaToWorld::MeshInfo::m_pMesh, m_pMeshInfo, GLC_ColladaToWorld::InputData::m_Semantic, GLC_ColladaToWorld::MatOffsetSize::m_size, GLC_ColladaToWorld::InputData::m_Source, GLC_ColladaToWorld::ColladaVertice::m_Values, GLC_Geometry::name(), NORMAL, TEXCOORD, throwException(), glc::triangulatePolygon(), and VERTEX.
Referenced by loadPolygons(), and loadPolylist().
| void GLC_ColladaToWorld::addTrianglesToCurrentMesh | ( | const QList< InputData > & | inputDataList, | |
| const QList< int > & | trianglesIndexList, | |||
| const QString & | materialId | |||
| ) | [private] |
Add the triangles to current mesh.
Definition at line 1237 of file glc_colladatoworld.cpp.
References computeNormalOfCurrentPrimitiveOfCurrentMesh(), m_BulkDataHash, GLC_ColladaToWorld::MeshInfo::m_Datas, GLC_ColladaToWorld::MeshInfo::m_FreeIndex, GLC_ColladaToWorld::MeshInfo::m_Index, GLC_ColladaToWorld::MeshInfo::m_Mapping, GLC_ColladaToWorld::MeshInfo::m_Materials, GLC_ColladaToWorld::MatOffsetSize::m_Offset, GLC_ColladaToWorld::InputData::m_Offset, m_pMeshInfo, GLC_ColladaToWorld::InputData::m_Semantic, GLC_ColladaToWorld::MatOffsetSize::m_size, GLC_ColladaToWorld::InputData::m_Source, GLC_ColladaToWorld::ColladaVertice::m_Values, NORMAL, TEXCOORD, and throwException().
Referenced by loadTriangles().
| void GLC_ColladaToWorld::checkForXmlError | ( | const QString & | info | ) | [private] |
Check for XML error Throw ecxeption if error occur
Definition at line 209 of file glc_colladatoworld.cpp.
References clear(), m_FileName, m_pStreamReader, and GLC_FileFormatException::WrongFileFormat.
Referenced by goToElement(), goToEndElement(), loadCommonColorOrTexture(), loadController(), loadEffect(), loadGeometry(), loadImage(), loadInstanceController(), loadInstanceGeometry(), loadLibraryContollers(), loadLibraryEffects(), loadLibraryGeometries(), loadLibraryImage(), loadLibraryMaterials(), loadLibraryNodes(), loadMaterial(), loadMaterialTechnique(), loadMesh(), loadNewParam(), loadProfileCommon(), loadSampler2D(), loadShininess(), loadSurface(), loadTechnique(), loadTransparency(), loadVertexBulkData(), loadVertices(), and loadVisualScenes().
| void GLC_ColladaToWorld::clear | ( | ) | [private] |
Clear memmory.
Delete all 3DRep
Definition at line 229 of file glc_colladatoworld.cpp.
References m_3DRepHash, m_BulkDataHash, m_ColladaNodeHash, m_CurrentId, m_GeometryHash, m_ImageFileHash, m_ListOfAttachedFileName, m_MaterialEffectHash, m_MaterialInstanceMap, m_MaterialLibHash, m_pCurrentMaterial, m_pFile, m_pMeshInfo, m_pStreamReader, m_pWorld, m_StructInstanceHash, m_SurfaceImageHash, m_TextureToMaterialHash, m_TopLevelColladaNode, and m_VerticesSourceHash.
Referenced by checkForXmlError(), readAttribute(), readXmlColor(), throwException(), and ~GLC_ColladaToWorld().
| void GLC_ColladaToWorld::composeMatrixNode | ( | ColladaNode * | pNode | ) | [private] |
Compose Node matrix.
Definition at line 1637 of file glc_colladatoworld.cpp.
References getContent(), GLC_ColladaToWorld::ColladaNode::m_Matrix, and throwException().
Referenced by loadNode().
| void GLC_ColladaToWorld::computeNormalOfCurrentPrimitiveOfCurrentMesh | ( | int | offset | ) | [private] |
Compute Normals for the current primitive element of the current mesh from the specified offset.
Definition at line 1119 of file glc_colladatoworld.cpp.
References GLC_ColladaToWorld::MeshInfo::m_Datas, GLC_ColladaToWorld::MeshInfo::m_Index, m_pMeshInfo, NORMAL, GLC_Vector3d::normalize(), GLC_Vector3d::toVector3df(), VERTEX, GLC_Vector3df::X(), GLC_Vector3df::Y(), and GLC_Vector3df::Z().
Referenced by addPolylistToCurrentMesh(), and addTrianglesToCurrentMesh().
| void GLC_ColladaToWorld::createMesh | ( | ) | [private] |
Create mesh and link them to material.
Definition at line 1740 of file glc_colladatoworld.cpp.
References GLC_Mesh::addNormals(), GLC_Mesh::addTexels(), GLC_Mesh::addTriangles(), GLC_Mesh::addVertice(), GLC_3DRep::clean(), GLC_Mesh::finish(), m_3DRepHash, GLC_ColladaToWorld::MeshInfo::m_Datas, m_GeometryHash, GLC_ColladaToWorld::MeshInfo::m_Index, m_MaterialEffectHash, m_MaterialInstanceMap, m_MaterialLibHash, GLC_ColladaToWorld::MeshInfo::m_Materials, GLC_ColladaToWorld::MeshInfo::m_pMesh, NORMAL, TEXCOORD, and VERTEX.
Referenced by CreateWorldFromCollada().
| GLC_StructOccurence * GLC_ColladaToWorld::createOccurenceFromNode | ( | ColladaNode * | pNode | ) | [private] |
Create Occurence tree from node tree.
Definition at line 1842 of file glc_colladatoworld.cpp.
References GLC_StructOccurence::addChild(), GLC_3DRep::isEmpty(), m_3DRepHash, GLC_ColladaToWorld::ColladaNode::m_ChildNodes, m_ColladaNodeHash, GLC_ColladaToWorld::ColladaNode::m_Id, GLC_ColladaToWorld::ColladaNode::m_InstanceGeometryIDs, GLC_ColladaToWorld::ColladaNode::m_InstanceOffNodeIds, GLC_ColladaToWorld::ColladaNode::m_Matrix, m_StructInstanceHash, GLC_3DRep::merge(), GLC_StructInstance::move(), GLC_Rep::name(), and throwException().
Referenced by createSceneGraph().
| void GLC_ColladaToWorld::createSceneGraph | ( | ) | [private] |
Create the scene graph struct.
Definition at line 1821 of file glc_colladatoworld.cpp.
References GLC_StructOccurence::addChild(), createOccurenceFromNode(), m_pWorld, m_TopLevelColladaNode, GLC_StructOccurence::removeEmptyChildren(), GLC_World::rootOccurence(), and GLC_StructOccurence::updateChildrenAbsoluteMatrix().
Referenced by CreateWorldFromCollada().
| GLC_World * GLC_ColladaToWorld::CreateWorldFromCollada | ( | QFile & | file | ) |
Create an GLC_World from an input Collada File.
Definition at line 75 of file glc_colladatoworld.cpp.
References createMesh(), createSceneGraph(), currentQuantum(), endElementNotReached(), GLC_FileFormatException::FileNotFound, getContent(), goToElement(), linkTexturesToMaterials(), loadLibraryContollers(), loadLibraryEffects(), loadLibraryGeometries(), loadLibraryImage(), loadLibraryMaterials(), loadLibraryNodes(), loadScene(), loadVisualScenes(), m_FileName, m_FileSize, m_pFile, m_pStreamReader, m_pWorld, readAttribute(), GLC_World::setUpVector(), glc::X_AXIS(), glc::Y_AXIS(), and glc::Z_AXIS().
Referenced by GLC_Factory::createWorldFromFile().
| void GLC_ColladaToWorld::currentQuantum | ( | int | ) | [signal] |
Referenced by CreateWorldFromCollada(), and updateProgressBar().
| bool GLC_ColladaToWorld::endElementNotReached | ( | const QString & | element | ) | [inline, private] |
Return true if the end of specified element is not reached.
Definition at line 202 of file glc_colladatoworld.h.
Referenced by CreateWorldFromCollada(), getContent(), goToEndElement(), loadCommonColorOrTexture(), loadController(), loadEffect(), loadGeometry(), loadImage(), loadInstanceController(), loadInstanceGeometry(), loadLibraryContollers(), loadLibraryEffects(), loadLibraryGeometries(), loadLibraryImage(), loadLibraryMaterials(), loadLibraryNodes(), loadMaterial(), loadMaterialTechnique(), loadMesh(), loadNewParam(), loadNode(), loadPolygons(), loadPolylist(), loadProfileCommon(), loadSampler2D(), loadScene(), loadShininess(), loadSurface(), loadTechnique(), loadTransparency(), loadTriangles(), loadVertexBulkData(), and loadVisualScenes().
| QString GLC_ColladaToWorld::getContent | ( | const QString & | element | ) | [private] |
Definition at line 174 of file glc_colladatoworld.cpp.
References endElementNotReached(), and m_pStreamReader.
Referenced by composeMatrixNode(), CreateWorldFromCollada(), loadImage(), loadPolygons(), loadPolylist(), loadSampler2D(), loadShininess(), loadSurface(), loadTransparency(), loadTriangles(), loadVertexBulkData(), readXmlColor(), rotateNode(), scaleNode(), and translateNode().
| void GLC_ColladaToWorld::goToElement | ( | const QString & | elementName | ) | [private] |
Go to an Element of a xml.
Definition at line 154 of file glc_colladatoworld.cpp.
References checkForXmlError(), m_pStreamReader, and startElementNotReached().
Referenced by CreateWorldFromCollada(), loadMaterial(), loadVertices(), and loadVisualScenes().
| void GLC_ColladaToWorld::goToEndElement | ( | const QString & | elementName | ) | [private] |
Go to the end Element of a xml.
Definition at line 164 of file glc_colladatoworld.cpp.
References checkForXmlError(), endElementNotReached(), and m_pStreamReader.
| void GLC_ColladaToWorld::linkTexturesToMaterials | ( | ) | [private] |
Link texture to material.
Definition at line 1682 of file glc_colladatoworld.cpp.
References m_FileName, m_ImageFileHash, m_ListOfAttachedFileName, m_pQGLContext, m_Sampler2DSurfaceHash, m_SurfaceImageHash, m_TextureToMaterialHash, and GLC_Material::setTexture().
Referenced by CreateWorldFromCollada().
| QStringList GLC_ColladaToWorld::listOfAttachedFileName | ( | ) | const [inline] |
Get the list of attached files.
Definition at line 166 of file glc_colladatoworld.h.
Referenced by GLC_Factory::createWorldFromFile().
| void GLC_ColladaToWorld::loadCommonColorOrTexture | ( | const QString & | name | ) | [private] |
load common color or texture
Definition at line 571 of file glc_colladatoworld.cpp.
References checkForXmlError(), endElementNotReached(), m_CurrentId, m_pCurrentMaterial, m_pStreamReader, m_TextureToMaterialHash, readAttribute(), readXmlColor(), GLC_Material::setAmbientColor(), GLC_Material::setDiffuseColor(), GLC_Material::setLightEmission(), and GLC_Material::setSpecularColor().
Referenced by loadMaterialTechnique().
| void GLC_ColladaToWorld::loadController | ( | ) | [private] |
Load a collada controller node.
Definition at line 1469 of file glc_colladatoworld.cpp.
References checkForXmlError(), endElementNotReached(), m_ColladaNodeHash, m_CurrentId, GLC_ColladaToWorld::ColladaNode::m_InstanceGeometryIDs, m_pStreamReader, and readAttribute().
Referenced by loadLibraryContollers().
| void GLC_ColladaToWorld::loadEffect | ( | ) | [private] |
Load an effect.
Definition at line 427 of file glc_colladatoworld.cpp.
References checkForXmlError(), endElementNotReached(), loadProfileCommon(), m_CurrentId, m_MaterialEffectHash, m_pCurrentMaterial, m_pStreamReader, readAttribute(), and GLC_Object::setName().
Referenced by loadLibraryEffects().
| void GLC_ColladaToWorld::loadGeometry | ( | ) | [private] |
Load an geometry element.
Definition at line 729 of file glc_colladatoworld.cpp.
References checkForXmlError(), endElementNotReached(), loadMesh(), m_CurrentId, m_GeometryHash, GLC_ColladaToWorld::MeshInfo::m_pMesh, m_pMeshInfo, m_pStreamReader, readAttribute(), and GLC_Geometry::setName().
Referenced by loadLibraryGeometries().
| void GLC_ColladaToWorld::loadImage | ( | ) | [private] |
Load image element.
Definition at line 324 of file glc_colladatoworld.cpp.
References checkForXmlError(), endElementNotReached(), getContent(), m_CurrentId, m_ImageFileHash, m_pStreamReader, and readAttribute().
Referenced by loadLibraryImage(), and loadProfileCommon().
| void GLC_ColladaToWorld::loadInstanceController | ( | ColladaNode * | pNode | ) | [private] |
Load an instance Controller.
Definition at line 1446 of file glc_colladatoworld.cpp.
References checkForXmlError(), endElementNotReached(), GLC_ColladaToWorld::ColladaNode::m_InstanceOffNodeIds, m_MaterialInstanceMap, m_pStreamReader, and readAttribute().
Referenced by loadNode().
| void GLC_ColladaToWorld::loadInstanceGeometry | ( | ColladaNode * | pNode | ) | [private] |
Load an instance geometry.
Definition at line 1412 of file glc_colladatoworld.cpp.
References checkForXmlError(), endElementNotReached(), GLC_ColladaToWorld::ColladaNode::m_InstanceGeometryIDs, m_MaterialInstanceMap, m_pStreamReader, and readAttribute().
Referenced by loadNode().
| void GLC_ColladaToWorld::loadInstanceNode | ( | ColladaNode * | pNode | ) | [private] |
Load an instance geometry.
Definition at line 1438 of file glc_colladatoworld.cpp.
References GLC_ColladaToWorld::ColladaNode::m_InstanceOffNodeIds, and readAttribute().
Referenced by loadNode().
| void GLC_ColladaToWorld::loadLibraryContollers | ( | ) | [private] |
Load the library controllers.
Definition at line 1363 of file glc_colladatoworld.cpp.
References checkForXmlError(), endElementNotReached(), loadController(), m_pStreamReader, and updateProgressBar().
Referenced by CreateWorldFromCollada().
| void GLC_ColladaToWorld::loadLibraryEffects | ( | ) | [private] |
Load library_effects element.
Definition at line 409 of file glc_colladatoworld.cpp.
References checkForXmlError(), endElementNotReached(), loadEffect(), m_pStreamReader, and updateProgressBar().
Referenced by CreateWorldFromCollada().
| void GLC_ColladaToWorld::loadLibraryGeometries | ( | ) | [private] |
Load library_geometries element.
Definition at line 711 of file glc_colladatoworld.cpp.
References checkForXmlError(), endElementNotReached(), loadGeometry(), m_pStreamReader, and updateProgressBar().
Referenced by CreateWorldFromCollada().
| void GLC_ColladaToWorld::loadLibraryImage | ( | ) | [private] |
Load library_images element.
Definition at line 307 of file glc_colladatoworld.cpp.
References checkForXmlError(), endElementNotReached(), loadImage(), m_pStreamReader, and updateProgressBar().
Referenced by CreateWorldFromCollada().
| void GLC_ColladaToWorld::loadLibraryMaterials | ( | ) | [private] |
Load library_materials element.
Definition at line 354 of file glc_colladatoworld.cpp.
References checkForXmlError(), endElementNotReached(), loadMaterial(), m_pStreamReader, and updateProgressBar().
Referenced by CreateWorldFromCollada().
| void GLC_ColladaToWorld::loadLibraryNodes | ( | ) | [private] |
Load the library nodes.
Definition at line 1336 of file glc_colladatoworld.cpp.
References checkForXmlError(), endElementNotReached(), loadNode(), m_pStreamReader, and updateProgressBar().
Referenced by CreateWorldFromCollada().
| void GLC_ColladaToWorld::loadMaterial | ( | ) | [private] |
Load a material.
Definition at line 372 of file glc_colladatoworld.cpp.
References checkForXmlError(), endElementNotReached(), goToElement(), m_CurrentId, m_MaterialLibHash, m_pStreamReader, and readAttribute().
Referenced by loadLibraryMaterials().
| void GLC_ColladaToWorld::loadMaterialTechnique | ( | const QString & | elementName | ) | [private] |
load material technique
Definition at line 548 of file glc_colladatoworld.cpp.
References checkForXmlError(), endElementNotReached(), loadCommonColorOrTexture(), loadShininess(), loadTransparency(), loadTransparent(), and m_pStreamReader.
Referenced by loadTechnique().
| void GLC_ColladaToWorld::loadMesh | ( | ) | [private] |
Load a mesh.
Definition at line 768 of file glc_colladatoworld.cpp.
References checkForXmlError(), endElementNotReached(), loadPolygons(), loadPolylist(), loadTriangles(), loadVertexBulkData(), loadVertices(), and m_pStreamReader.
Referenced by loadGeometry().
| void GLC_ColladaToWorld::loadNewParam | ( | ) | [private] |
Load a new param.
Definition at line 471 of file glc_colladatoworld.cpp.
References checkForXmlError(), endElementNotReached(), loadSampler2D(), loadSurface(), m_CurrentId, m_pStreamReader, and readAttribute().
Referenced by loadProfileCommon().
| GLC_ColladaToWorld::ColladaNode * GLC_ColladaToWorld::loadNode | ( | ColladaNode * | pParent | ) | [private] |
Load a Collada Node element and return it.
Definition at line 1493 of file glc_colladatoworld.cpp.
References composeMatrixNode(), endElementNotReached(), loadInstanceController(), loadInstanceGeometry(), loadInstanceNode(), GLC_ColladaToWorld::ColladaNode::m_ChildNodes, m_ColladaNodeHash, m_CurrentId, m_pStreamReader, readAttribute(), rotateNode(), scaleNode(), and translateNode().
Referenced by loadLibraryNodes(), and loadVisualScenes().
| void GLC_ColladaToWorld::loadPolygons | ( | ) | [private] |
Load Polygons.
Definition at line 925 of file glc_colladatoworld.cpp.
References addPolylistToCurrentMesh(), endElementNotReached(), getContent(), GLC_ColladaToWorld::InputData::m_Offset, m_pStreamReader, GLC_ColladaToWorld::InputData::m_Semantic, GLC_ColladaToWorld::InputData::m_Source, m_VerticesSourceHash, NORMAL, readAttribute(), TEXCOORD, throwException(), updateProgressBar(), and VERTEX.
Referenced by loadMesh().
| void GLC_ColladaToWorld::loadPolylist | ( | ) | [private] |
Load polylist.
Definition at line 844 of file glc_colladatoworld.cpp.
References addPolylistToCurrentMesh(), endElementNotReached(), getContent(), GLC_ColladaToWorld::InputData::m_Offset, m_pStreamReader, GLC_ColladaToWorld::InputData::m_Semantic, GLC_ColladaToWorld::InputData::m_Source, m_VerticesSourceHash, NORMAL, readAttribute(), TEXCOORD, throwException(), updateProgressBar(), and VERTEX.
Referenced by loadMesh().
| void GLC_ColladaToWorld::loadProfileCommon | ( | ) | [private] |
Load profile_COMMON.
Definition at line 453 of file glc_colladatoworld.cpp.
References checkForXmlError(), endElementNotReached(), loadImage(), loadNewParam(), loadTechnique(), and m_pStreamReader.
Referenced by loadEffect().
| void GLC_ColladaToWorld::loadSampler2D | ( | const QString & | sid | ) | [private] |
Load Sampler 2D.
Definition at line 510 of file glc_colladatoworld.cpp.
References checkForXmlError(), endElementNotReached(), getContent(), m_CurrentId, m_pStreamReader, and m_Sampler2DSurfaceHash.
Referenced by loadNewParam().
| void GLC_ColladaToWorld::loadScene | ( | ) | [private] |
Load scene element.
Definition at line 1671 of file glc_colladatoworld.cpp.
References endElementNotReached(), and m_pStreamReader.
Referenced by CreateWorldFromCollada().
| void GLC_ColladaToWorld::loadShininess | ( | const QString & | name | ) | [private] |
Load shininess.
Definition at line 644 of file glc_colladatoworld.cpp.
References checkForXmlError(), endElementNotReached(), getContent(), m_pCurrentMaterial, m_pStreamReader, and GLC_Material::setShininess().
Referenced by loadMaterialTechnique().
| void GLC_ColladaToWorld::loadSurface | ( | const QString & | sid | ) | [private] |
Load a surface.
Definition at line 490 of file glc_colladatoworld.cpp.
References checkForXmlError(), endElementNotReached(), getContent(), m_pStreamReader, and m_SurfaceImageHash.
Referenced by loadNewParam().
| void GLC_ColladaToWorld::loadTechnique | ( | ) | [private] |
Load technique.
Definition at line 530 of file glc_colladatoworld.cpp.
References checkForXmlError(), endElementNotReached(), loadMaterialTechnique(), and m_pStreamReader.
Referenced by loadProfileCommon().
| void GLC_ColladaToWorld::loadTransparency | ( | const QString & | name | ) | [private] |
Load transparency.
Definition at line 609 of file glc_colladatoworld.cpp.
References checkForXmlError(), endElementNotReached(), getContent(), m_pCurrentMaterial, m_pStreamReader, m_TransparentIsRgbZero, GLC_Material::setOpacity(), and throwException().
Referenced by loadMaterialTechnique().
| void GLC_ColladaToWorld::loadTransparent | ( | ) | [private] |
Load transparent.
Definition at line 601 of file glc_colladatoworld.cpp.
References m_TransparentIsRgbZero, and readAttribute().
Referenced by loadMaterialTechnique().
| void GLC_ColladaToWorld::loadTriangles | ( | ) | [private] |
Load triangles.
Definition at line 1172 of file glc_colladatoworld.cpp.
References addTrianglesToCurrentMesh(), endElementNotReached(), getContent(), GLC_ColladaToWorld::InputData::m_Offset, m_pStreamReader, GLC_ColladaToWorld::InputData::m_Semantic, GLC_ColladaToWorld::InputData::m_Source, m_VerticesSourceHash, NORMAL, readAttribute(), TEXCOORD, throwException(), updateProgressBar(), and VERTEX.
Referenced by loadMesh().
| void GLC_ColladaToWorld::loadVertexBulkData | ( | ) | [private] |
Load Vertex bulk data.
Definition at line 790 of file glc_colladatoworld.cpp.
References checkForXmlError(), endElementNotReached(), getContent(), m_BulkDataHash, m_CurrentId, m_pStreamReader, readAttribute(), throwException(), and updateProgressBar().
Referenced by loadMesh().
| void GLC_ColladaToWorld::loadVertices | ( | ) | [private] |
Load attributes and identity of mesh vertices.
Definition at line 831 of file glc_colladatoworld.cpp.
References checkForXmlError(), goToElement(), m_CurrentId, m_VerticesSourceHash, and readAttribute().
Referenced by loadMesh().
| void GLC_ColladaToWorld::loadVisualScenes | ( | ) | [private] |
Load library_visual_scenes element.
Definition at line 1383 of file glc_colladatoworld.cpp.
References checkForXmlError(), endElementNotReached(), goToElement(), loadNode(), m_pStreamReader, m_TopLevelColladaNode, and updateProgressBar().
Referenced by CreateWorldFromCollada().
| QString GLC_ColladaToWorld::readAttribute | ( | const QString & | name, | |
| bool | required = false | |||
| ) | [private] |
Read the specified attribute.
Definition at line 190 of file glc_colladatoworld.cpp.
References clear(), m_FileName, m_pStreamReader, and GLC_FileFormatException::WrongFileFormat.
Referenced by CreateWorldFromCollada(), loadCommonColorOrTexture(), loadController(), loadEffect(), loadGeometry(), loadImage(), loadInstanceController(), loadInstanceGeometry(), loadInstanceNode(), loadMaterial(), loadNewParam(), loadNode(), loadPolygons(), loadPolylist(), loadTransparent(), loadTriangles(), loadVertexBulkData(), and loadVertices().
| QColor GLC_ColladaToWorld::readXmlColor | ( | ) | [private] |
Read a xml Color.
Definition at line 668 of file glc_colladatoworld.cpp.
References clear(), getContent(), m_FileName, and GLC_FileFormatException::WrongFileFormat.
Referenced by loadCommonColorOrTexture().
| void GLC_ColladaToWorld::rotateNode | ( | ColladaNode * | pNode | ) | [private] |
Rotate the node.
Definition at line 1611 of file glc_colladatoworld.cpp.
References getContent(), GLC_ColladaToWorld::ColladaNode::m_Matrix, and throwException().
Referenced by loadNode().
| void GLC_ColladaToWorld::scaleNode | ( | ColladaNode * | pNode | ) | [private] |
Scale the node.
Definition at line 1586 of file glc_colladatoworld.cpp.
References getContent(), GLC_ColladaToWorld::ColladaNode::m_Matrix, GLC_Matrix4x4::setMatScaling(), and throwException().
Referenced by loadNode().
| bool GLC_ColladaToWorld::startElementNotReached | ( | const QString & | element | ) | [inline, private] |
Return true if the start of specified element is not reached.
Definition at line 206 of file glc_colladatoworld.h.
Referenced by goToElement().
| void GLC_ColladaToWorld::throwException | ( | const QString & | message | ) | [private] |
Throw an exception with the specified text.
Definition at line 220 of file glc_colladatoworld.cpp.
References clear(), m_FileName, and GLC_FileFormatException::WrongFileFormat.
Referenced by addPolylistToCurrentMesh(), addTrianglesToCurrentMesh(), composeMatrixNode(), createOccurenceFromNode(), loadPolygons(), loadPolylist(), loadTransparency(), loadTriangles(), loadVertexBulkData(), rotateNode(), scaleNode(), and translateNode().
| void GLC_ColladaToWorld::translateNode | ( | ColladaNode * | pNode | ) | [private] |
Translate the node.
Definition at line 1562 of file glc_colladatoworld.cpp.
References getContent(), GLC_ColladaToWorld::ColladaNode::m_Matrix, and throwException().
Referenced by loadNode().
| void GLC_ColladaToWorld::updateProgressBar | ( | ) | [private] |
Update progress bar.
Definition at line 1979 of file glc_colladatoworld.cpp.
References currentQuantum(), m_CurrentOffset, m_FileSize, and m_pStreamReader.
Referenced by loadLibraryContollers(), loadLibraryEffects(), loadLibraryGeometries(), loadLibraryImage(), loadLibraryMaterials(), loadLibraryNodes(), loadPolygons(), loadPolylist(), loadTriangles(), loadVertexBulkData(), and loadVisualScenes().
QHash<const QString, GLC_3DRep*> GLC_ColladaToWorld::m_3DRepHash [private] |
3DRep hash table
Definition at line 415 of file glc_colladatoworld.h.
Referenced by clear(), createMesh(), and createOccurenceFromNode().
Bulk data hash table.
Definition at line 394 of file glc_colladatoworld.h.
Referenced by addPolylistToCurrentMesh(), addTrianglesToCurrentMesh(), clear(), and loadVertexBulkData().
QHash<const QString, ColladaNode*> GLC_ColladaToWorld::m_ColladaNodeHash [private] |
Hash table off collada node.
Definition at line 406 of file glc_colladatoworld.h.
Referenced by clear(), createOccurenceFromNode(), loadController(), and loadNode().
QString GLC_ColladaToWorld::m_CurrentId [private] |
The current Collada Element id.
Definition at line 421 of file glc_colladatoworld.h.
Referenced by clear(), loadCommonColorOrTexture(), loadController(), loadEffect(), loadGeometry(), loadImage(), loadMaterial(), loadNewParam(), loadNode(), loadSampler2D(), loadVertexBulkData(), and loadVertices().
int GLC_ColladaToWorld::m_CurrentOffset [private] |
The current offset in the collada file.
Definition at line 427 of file glc_colladatoworld.h.
Referenced by updateProgressBar().
QString GLC_ColladaToWorld::m_FileName [private] |
The collada fileName.
Definition at line 367 of file glc_colladatoworld.h.
Referenced by checkForXmlError(), CreateWorldFromCollada(), linkTexturesToMaterials(), readAttribute(), readXmlColor(), and throwException().
qint64 GLC_ColladaToWorld::m_FileSize [private] |
The Collada file size.
Definition at line 424 of file glc_colladatoworld.h.
Referenced by CreateWorldFromCollada(), and updateProgressBar().
QHash<const QString, MeshInfo*> GLC_ColladaToWorld::m_GeometryHash [private] |
Hash table off geometry (MeshInfo*).
Definition at line 403 of file glc_colladatoworld.h.
Referenced by clear(), createMesh(), and loadGeometry().
QHash<QString, QString> GLC_ColladaToWorld::m_ImageFileHash [private] |
Map image id to image file name.
Definition at line 373 of file glc_colladatoworld.h.
Referenced by clear(), linkTexturesToMaterials(), and loadImage().
QSet<QString> GLC_ColladaToWorld::m_ListOfAttachedFileName [private] |
The list of attached file name.
Definition at line 430 of file glc_colladatoworld.h.
Referenced by clear(), and linkTexturesToMaterials().
Material Effect hash table.
Definition at line 385 of file glc_colladatoworld.h.
Referenced by clear(), createMesh(), and loadEffect().
QHash<const QString, QString> GLC_ColladaToWorld::m_MaterialInstanceMap [private] |
Mapping between material instance and material.
Definition at line 412 of file glc_colladatoworld.h.
Referenced by clear(), createMesh(), loadInstanceController(), and loadInstanceGeometry().
QHash<QString, QString> GLC_ColladaToWorld::m_MaterialLibHash [private] |
Map materialInstance to material.
Definition at line 376 of file glc_colladatoworld.h.
Referenced by clear(), createMesh(), and loadMaterial().
The current material.
Definition at line 388 of file glc_colladatoworld.h.
Referenced by clear(), loadCommonColorOrTexture(), loadEffect(), loadShininess(), and loadTransparency().
QFile* GLC_ColladaToWorld::m_pFile [private] |
The collada file.
Definition at line 370 of file glc_colladatoworld.h.
Referenced by clear(), and CreateWorldFromCollada().
MeshInfo* GLC_ColladaToWorld::m_pMeshInfo [private] |
The current loadeed mesh.
Definition at line 400 of file glc_colladatoworld.h.
Referenced by addPolylistToCurrentMesh(), addTrianglesToCurrentMesh(), clear(), computeNormalOfCurrentPrimitiveOfCurrentMesh(), and loadGeometry().
const QGLContext* GLC_ColladaToWorld::m_pQGLContext [private] |
OpenGL Context.
Definition at line 361 of file glc_colladatoworld.h.
Referenced by linkTexturesToMaterials().
QXmlStreamReader* GLC_ColladaToWorld::m_pStreamReader [private] |
Xml Reader.
Definition at line 364 of file glc_colladatoworld.h.
Referenced by checkForXmlError(), clear(), CreateWorldFromCollada(), getContent(), goToElement(), goToEndElement(), loadCommonColorOrTexture(), loadController(), loadEffect(), loadGeometry(), loadImage(), loadInstanceController(), loadInstanceGeometry(), loadLibraryContollers(), loadLibraryEffects(), loadLibraryGeometries(), loadLibraryImage(), loadLibraryMaterials(), loadLibraryNodes(), loadMaterial(), loadMaterialTechnique(), loadMesh(), loadNewParam(), loadNode(), loadPolygons(), loadPolylist(), loadProfileCommon(), loadSampler2D(), loadScene(), loadShininess(), loadSurface(), loadTechnique(), loadTransparency(), loadTriangles(), loadVertexBulkData(), loadVisualScenes(), readAttribute(), and updateProgressBar().
GLC_World* GLC_ColladaToWorld::m_pWorld [private] |
The world to built.
Definition at line 358 of file glc_colladatoworld.h.
Referenced by clear(), createSceneGraph(), CreateWorldFromCollada(), and ~GLC_ColladaToWorld().
QHash<QString, QString> GLC_ColladaToWorld::m_Sampler2DSurfaceHash [private] |
Map sampler2D sid to surface sid.
Definition at line 382 of file glc_colladatoworld.h.
Referenced by linkTexturesToMaterials(), and loadSampler2D().
QHash<const QString, GLC_StructInstance*> GLC_ColladaToWorld::m_StructInstanceHash [private] |
GLC instance Hash table.
Definition at line 418 of file glc_colladatoworld.h.
Referenced by clear(), and createOccurenceFromNode().
QHash<QString, QString> GLC_ColladaToWorld::m_SurfaceImageHash [private] |
Map surface sid to image id.
Definition at line 379 of file glc_colladatoworld.h.
Referenced by clear(), linkTexturesToMaterials(), and loadSurface().
Texture to material link.
Definition at line 391 of file glc_colladatoworld.h.
Referenced by clear(), linkTexturesToMaterials(), and loadCommonColorOrTexture().
QList<ColladaNode*> GLC_ColladaToWorld::m_TopLevelColladaNode [private] |
The list of top level node.
Definition at line 409 of file glc_colladatoworld.h.
Referenced by clear(), createSceneGraph(), and loadVisualScenes().
bool GLC_ColladaToWorld::m_TransparentIsRgbZero [private] |
The transparent mode is RGB_ZERO.
Definition at line 433 of file glc_colladatoworld.h.
Referenced by loadTransparency(), and loadTransparent().
QHash<QString, QString> GLC_ColladaToWorld::m_VerticesSourceHash [private] |
Map vertices id to source data id.
Definition at line 397 of file glc_colladatoworld.h.
Referenced by clear(), loadPolygons(), loadPolylist(), loadTriangles(), and loadVertices().