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

GLC_3dxmlToWorld : Create an GLC_World from 3dxml file. More...

#include <glc_3dxmltoworld.h>

+ Inheritance diagram for GLC_3dxmlToWorld:

Classes

struct  AssyLink
 AssyLink : Assemblage link between parent id and GLC_StructInstance*. More...
 
class  MaterialRef
 MaterialRef : Material reference containing id, name and associated file. More...
 
class  RepLink
 RepLink : Representation link between reference id and representation id. More...
 
class  V3OccurenceAttrib
 V3OccurenceAttrib : Specifique occurence attribute. More...
 
struct  V4OccurenceAttrib
 V3OccurenceAttrib : Specifique occurence attribute. More...
 

Signals

void currentQuantum (int)
 

Public Member Functions

Constructor / Destructor
 GLC_3dxmlToWorld ()
 Default constructor.
 
virtual ~GLC_3dxmlToWorld ()
 
Set Functions
GLC_WorldcreateWorldFrom3dxml (QFile &, bool StructureOnly, bool getExternalRef=false)
 Create an GLC_World from an input 3DXML File.
 
GLC_3DRep create3DrepFrom3dxmlRep (const QString &)
 Create 3DRep from an 3DXML rep.
 
QStringList listOfAttachedFileName () const
 Get the list of attached files.
 

Private Types

typedef QHash< unsigned int,
GLC_StructReference * > 
ReferenceHash
 
typedef QHash
< GLC_StructInstance
*, unsigned int > 
InstanceOfHash
 
typedef QHash
< GLC_StructInstance
*, QString > 
InstanceOfExtRefHash
 
typedef QSet< const QString > SetOfExtRef
 
typedef QList< AssyLinkAssyLinkList
 
typedef QList< RepLinkRepLinkList
 
typedef QHash< const QString,
GLC_StructReference * > 
ExternalReferenceHash
 
typedef QHash< const QString,
GLC_Material * > 
MaterialHash
 
typedef QHash< const unsigned
int, QString > 
ReferenceRepHash
 

Private Member Functions

Private services functions
void loadManifest ()
 Load the 3dxml's manifest.
 
void clear ()
 Close all files and clear memmory.
 
void goToRepId (const QString &)
 Go to a Rep of a xml.
 
void gotToPolygonalRepType ()
 Go to Polygonal Rep Type.
 
QString readAttribute (const QString &, bool required=false)
 Read the specified attribute.
 
void readHeader ()
 Read the Header.
 
void loadProductStructure ()
 Load the product structure.
 
void loadReference3D ()
 Load a Reference3D.
 
void loadInstance3D ()
 Load a Instance3D.
 
void loadReferenceRep ()
 Load a Reference representation.
 
void loadInstanceRep ()
 Load a Instance representation.
 
void loadExternalRef3D ()
 Load External Ref.
 
GLC_StructReferencecreateReferenceRep (QString id, GLC_3DRep *pRep)
 Add a reference from 3dxml to m_ExternalReferenceHash.
 
GLC_Matrix4x4 loadMatrix (const QString &)
 Load Matrix.
 
void createUnfoldedTree ()
 Create the unfolded tree.
 
void checkForXmlError (const QString &)
 
void loadFace (GLC_Mesh *, const int lod, double accuracy)
 Load a face.
 
void loadPolyline (GLC_Mesh *)
 Load polyline.
 
void clearMaterialHash ()
 Clear material hash.
 
GLC_MaterialloadSurfaceAttributes ()
 Load surface attributes.
 
GLC_MaterialgetMaterial ()
 get material
 
bool setStreamReaderToFile (QString, bool test=false)
 Set the stream reader to the specified file.
 
void loadDefaultView ()
 Load default view element.
 
void loadV3DefaultViewProperty ()
 Load 3DXML V3 default view property.
 
void loadV4DefaultViewProperty ()
 Load 3DXML V4 default view property.
 
QList< unsigned int > loadOccurencePath ()
 Return the occurence path of the current DefaultViewProperty.
 
void loadGraphicProperties (V4OccurenceAttrib *pAttrib)
 Load Graphics properties element.
 
void loadLocalRepresentations ()
 Load the local representation.
 
void loadExternRepresentations ()
 Load the extern representation.
 
GLC_3DRep loadCurrentExtRep ()
 Return the instance of the current extern representation.
 
void loadCatMaterialRef ()
 Load CatMaterial Ref if present.
 
void loadMaterialDef (const MaterialRef &)
 Create material from material def file.
 
void loadCatRepImage ()
 Load CATRepIage if present.
 
GLC_TextureloadTexture (QString)
 Try to construct a texture with the specified fileName.
 
void setRepresentationFileName (GLC_3DRep *pRep)
 Set fileName of the given 3DRep.
 
QXmlStreamReader::TokenType readNext ()
 Read next element from the stream.
 
bool goToElement (QXmlStreamReader *pReader, const QString &element)
 Go to the given xml Element, return true on succes.
 
QString getContent (QXmlStreamReader *pReader, const QString &element)
 
QString readAttribute (QXmlStreamReader *pReader, const QString &attribute)
 Read the specified attribute.
 
bool endElementNotReached (QXmlStreamReader *pReader, const QString &element)
 Return true if the end of specified element is not reached.
 
bool startElementNotReached (QXmlStreamReader *pReader, const QString &element)
 Return true if the start of specified element is not reached.
 
void goToEndElement (QXmlStreamReader *pReader, const QString &element)
 Go to the end Element of a xml.
 
void checkFileValidity (QIODevice *pIODevice)
 Check if the given file is binary.
 
void applyV4Attribute (GLC_StructOccurence *pOccurence, V4OccurenceAttrib *pV4OccurenceAttrib, QHash< GLC_StructInstance *, unsigned int > &InstanceToIdHash)
 Apply the given attribute to the right occurence from the given occurence.
 
void loadRep (GLC_Mesh *pMesh)
 Load representation from 3DRep file.
 
void loadVertexBuffer (GLC_Mesh *pMesh)
 Load The 3DXML vertex buffer.
 

Private Attributes

QXmlStreamReader * m_pStreamReader
 Xml Reader.
 
QString m_FileName
 The 3dxml fileName.
 
QuaZip * m_p3dxmlArchive
 The Quazip archive.
 
QFile * m_pCurrentFile
 The current file (if there is no archive)
 
QString m_RootName
 The root Name of the 3dxml file.
 
GLC_Worldm_pWorld
 The World to return.
 
ReferenceHash m_ReferenceHash
 Reference Hash Table.
 
AssyLinkList m_AssyLinkList
 The Structure Link Hash Table.
 
InstanceOfHash m_InstanceOf
 Instance of Hash table.
 
SetOfExtRef m_SetOfExtRef
 The set of ext ref to load.
 
InstanceOfExtRefHash m_InstanceOfExtRefHash
 Instance of ext ref hash table.
 
ExternalReferenceHash m_ExternalReferenceHash
 Externam reference hash table.
 
MaterialHash m_MaterialHash
 Hash table of material.
 
bool m_IsInArchive
 Flag to know if the 3dxml is in an archive.
 
ReferenceRepHash m_ReferenceRepHash
 The Reference representation hash table.
 
RepLinkList m_LocalRepLinkList
 The list of local representation link.
 
RepLinkList m_ExternRepLinkList
 The list of extern representation link.
 
SetOfExtRef m_SetOfExtRep
 The set of ext rep to load.
 
GLC_Materialm_pCurrentMaterial
 The 3DREP current material.
 
QHash< QString, QString > m_TextureImagesHash
 The image file hash table.
 
bool m_LoadStructureOnly
 Flag indicate the loading method.
 
QSet< QString > m_SetOfAttachedFileName
 The Set of attached file name.
 
QString m_CurrentFileName
 The current file name.
 
QDateTime m_CurrentDateTime
 The current file time and date.
 
QHash< unsigned int,
V3OccurenceAttrib * > 
m_V3OccurenceAttribHash
 Hash table of occurence specific attributes for 3DXML V3.
 
QList< V4OccurenceAttrib * > m_V4OccurenceAttribList
 List of occurence specific attributes for 3DXML V4.
 
bool m_GetExternalRef3DName
 bool get external ref 3D name
 
QList< QByteArray > m_ByteArrayList
 
bool m_IsVersion3
 Flag to know if the 3DXML is in version 3.x.
 

Static Private Attributes

static QMutex m_ZipMutex
 

Detailed Description

GLC_3dxmlToWorld : Create an GLC_World from 3dxml file.

Definition at line 52 of file glc_3dxmltoworld.h.

Member Typedef Documentation

typedef QList<AssyLink> GLC_3dxmlToWorld::AssyLinkList
private

Definition at line 129 of file glc_3dxmltoworld.h.

typedef QHash<const QString, GLC_StructReference*> GLC_3dxmlToWorld::ExternalReferenceHash
private

Definition at line 131 of file glc_3dxmltoworld.h.

Definition at line 127 of file glc_3dxmltoworld.h.

typedef QHash<GLC_StructInstance*, unsigned int> GLC_3dxmlToWorld::InstanceOfHash
private

Definition at line 126 of file glc_3dxmltoworld.h.

typedef QHash<const QString, GLC_Material*> GLC_3dxmlToWorld::MaterialHash
private

Definition at line 132 of file glc_3dxmltoworld.h.

typedef QHash<unsigned int, GLC_StructReference*> GLC_3dxmlToWorld::ReferenceHash
private

Definition at line 125 of file glc_3dxmltoworld.h.

typedef QHash<const unsigned int, QString> GLC_3dxmlToWorld::ReferenceRepHash
private

Definition at line 133 of file glc_3dxmltoworld.h.

typedef QList<RepLink> GLC_3dxmlToWorld::RepLinkList
private

Definition at line 130 of file glc_3dxmltoworld.h.

typedef QSet<const QString> GLC_3dxmlToWorld::SetOfExtRef
private

Definition at line 128 of file glc_3dxmltoworld.h.

Constructor & Destructor Documentation

GLC_3dxmlToWorld::GLC_3dxmlToWorld ( )

Default constructor.

Definition at line 48 of file glc_3dxmltoworld.cpp.

GLC_3dxmlToWorld::~GLC_3dxmlToWorld ( )
virtual

Member Function Documentation

void GLC_3dxmlToWorld::applyV4Attribute ( GLC_StructOccurence pOccurence,
V4OccurenceAttrib pV4OccurenceAttrib,
QHash< GLC_StructInstance *, unsigned int > &  InstanceToIdHash 
)
private
void GLC_3dxmlToWorld::checkFileValidity ( QIODevice *  pIODevice)
private

Check if the given file is binary.

Definition at line 2175 of file glc_3dxmltoworld.cpp.

References clear(), GLC_FileFormatException::FileNotSupported, and m_CurrentFileName.

Referenced by setStreamReaderToFile().

void GLC_3dxmlToWorld::checkForXmlError ( const QString &  info)
private
void GLC_3dxmlToWorld::clear ( )
private
void GLC_3dxmlToWorld::clearMaterialHash ( )
private

Clear material hash.

Definition at line 1324 of file glc_3dxmltoworld.cpp.

References m_MaterialHash.

Referenced by clear(), and ~GLC_3dxmlToWorld().

GLC_3DRep GLC_3dxmlToWorld::create3DrepFrom3dxmlRep ( const QString &  fileName)
GLC_StructReference * GLC_3dxmlToWorld::createReferenceRep ( QString  id,
GLC_3DRep pRep 
)
private
void GLC_3dxmlToWorld::createUnfoldedTree ( )
private
GLC_World * GLC_3dxmlToWorld::createWorldFrom3dxml ( QFile &  file,
bool  StructureOnly,
bool  getExternalRef = false 
)
void GLC_3dxmlToWorld::currentQuantum ( int  )
signal
bool GLC_3dxmlToWorld::endElementNotReached ( QXmlStreamReader *  pReader,
const QString &  element 
)
inlineprivate
QString GLC_3dxmlToWorld::getContent ( QXmlStreamReader *  pReader,
const QString &  element 
)
inlineprivate
GLC_Material * GLC_3dxmlToWorld::getMaterial ( )
private
bool GLC_3dxmlToWorld::goToElement ( QXmlStreamReader *  pReader,
const QString &  element 
)
inlineprivate
void GLC_3dxmlToWorld::goToEndElement ( QXmlStreamReader *  pReader,
const QString &  element 
)
inlineprivate

Go to the end Element of a xml.

Definition at line 463 of file glc_3dxmltoworld.h.

References endElementNotReached(), and readNext().

void GLC_3dxmlToWorld::goToRepId ( const QString &  id)
private

Go to a Rep of a xml.

Definition at line 317 of file glc_3dxmltoworld.cpp.

References m_pStreamReader, and readNext().

Referenced by createReferenceRep().

void GLC_3dxmlToWorld::gotToPolygonalRepType ( )
private

Go to Polygonal Rep Type.

Definition at line 328 of file glc_3dxmltoworld.cpp.

References endElementNotReached(), m_pStreamReader, and readNext().

Referenced by createReferenceRep(), and loadCurrentExtRep().

QStringList GLC_3dxmlToWorld::listOfAttachedFileName ( ) const
inline

Get the list of attached files.

Definition at line 157 of file glc_3dxmltoworld.h.

Referenced by GLC_FileLoader::createWorldFromFile().

void GLC_3dxmlToWorld::loadCatMaterialRef ( )
private
void GLC_3dxmlToWorld::loadCatRepImage ( )
private
GLC_3DRep GLC_3dxmlToWorld::loadCurrentExtRep ( )
private
void GLC_3dxmlToWorld::loadDefaultView ( )
private
void GLC_3dxmlToWorld::loadExternalRef3D ( )
private
void GLC_3dxmlToWorld::loadExternRepresentations ( )
private
void GLC_3dxmlToWorld::loadFace ( GLC_Mesh pMesh,
const int  lod,
double  accuracy 
)
private
void GLC_3dxmlToWorld::loadGraphicProperties ( V4OccurenceAttrib pAttrib)
private
void GLC_3dxmlToWorld::loadInstance3D ( )
private
void GLC_3dxmlToWorld::loadInstanceRep ( )
private
void GLC_3dxmlToWorld::loadLocalRepresentations ( )
private
void GLC_3dxmlToWorld::loadManifest ( )
private
void GLC_3dxmlToWorld::loadMaterialDef ( const MaterialRef materialRef)
private
GLC_Matrix4x4 GLC_3dxmlToWorld::loadMatrix ( const QString &  stringMatrix)
private

Load Matrix.

Definition at line 1034 of file glc_3dxmltoworld.cpp.

References GLC_Matrix4x4::optimise().

Referenced by loadInstance3D(), and loadV4DefaultViewProperty().

QList< unsigned int > GLC_3dxmlToWorld::loadOccurencePath ( )
private

Return the occurence path of the current DefaultViewProperty.

Definition at line 1688 of file glc_3dxmltoworld.cpp.

References clear(), endElementNotReached(), getContent(), m_FileName, m_pStreamReader, readNext(), and GLC_FileFormatException::WrongFileFormat.

Referenced by loadV4DefaultViewProperty().

void GLC_3dxmlToWorld::loadPolyline ( GLC_Mesh pMesh)
private
void GLC_3dxmlToWorld::loadProductStructure ( )
private
void GLC_3dxmlToWorld::loadReference3D ( )
private
void GLC_3dxmlToWorld::loadReferenceRep ( )
private

Load a Reference representation.

Definition at line 708 of file glc_3dxmltoworld.cpp.

References clear(), GLC_FileFormatException::FileNotSupported, m_CurrentFileName, m_FileName, m_ReferenceRepHash, and readAttribute().

Referenced by loadProductStructure().

void GLC_3dxmlToWorld::loadRep ( GLC_Mesh pMesh)
private
GLC_Material * GLC_3dxmlToWorld::loadSurfaceAttributes ( )
private

Load surface attributes.

Definition at line 1339 of file glc_3dxmltoworld.cpp.

References checkForXmlError(), endElementNotReached(), getMaterial(), m_MaterialHash, m_pStreamReader, readAttribute(), and readNext().

Referenced by loadFace(), and loadRep().

GLC_Texture * GLC_3dxmlToWorld::loadTexture ( QString  fileName)
private
void GLC_3dxmlToWorld::loadV3DefaultViewProperty ( )
private
void GLC_3dxmlToWorld::loadV4DefaultViewProperty ( )
private
void GLC_3dxmlToWorld::loadVertexBuffer ( GLC_Mesh pMesh)
private
QString GLC_3dxmlToWorld::readAttribute ( const QString &  name,
bool  required = false 
)
private
QString GLC_3dxmlToWorld::readAttribute ( QXmlStreamReader *  pReader,
const QString &  attribute 
)
inlineprivate

Read the specified attribute.

Definition at line 448 of file glc_3dxmltoworld.h.

void GLC_3dxmlToWorld::readHeader ( )
private
QXmlStreamReader::TokenType GLC_3dxmlToWorld::readNext ( )
inlineprivate
void GLC_3dxmlToWorld::setRepresentationFileName ( GLC_3DRep pRep)
private
bool GLC_3dxmlToWorld::setStreamReaderToFile ( QString  fileName,
bool  test = false 
)
private
bool GLC_3dxmlToWorld::startElementNotReached ( QXmlStreamReader *  pReader,
const QString &  element 
)
inlineprivate

Return true if the start of specified element is not reached.

Definition at line 458 of file glc_3dxmltoworld.h.

Member Data Documentation

AssyLinkList GLC_3dxmlToWorld::m_AssyLinkList
private

The Structure Link Hash Table.

Definition at line 341 of file glc_3dxmltoworld.h.

Referenced by createUnfoldedTree(), loadInstance3D(), and loadProductStructure().

QList<QByteArray> GLC_3dxmlToWorld::m_ByteArrayList
private

Definition at line 402 of file glc_3dxmltoworld.h.

Referenced by clear(), readNext(), and setStreamReaderToFile().

QDateTime GLC_3dxmlToWorld::m_CurrentDateTime
private
QString GLC_3dxmlToWorld::m_CurrentFileName
private
ExternalReferenceHash GLC_3dxmlToWorld::m_ExternalReferenceHash
private

Externam reference hash table.

Definition at line 353 of file glc_3dxmltoworld.h.

Referenced by loadExternalRef3D(), and loadProductStructure().

RepLinkList GLC_3dxmlToWorld::m_ExternRepLinkList
private

The list of extern representation link.

Definition at line 368 of file glc_3dxmltoworld.h.

Referenced by loadExternRepresentations(), and loadInstanceRep().

QString GLC_3dxmlToWorld::m_FileName
private
bool GLC_3dxmlToWorld::m_GetExternalRef3DName
private

bool get external ref 3D name

Definition at line 398 of file glc_3dxmltoworld.h.

Referenced by createWorldFrom3dxml(), and loadExternalRef3D().

InstanceOfHash GLC_3dxmlToWorld::m_InstanceOf
private

Instance of Hash table.

Definition at line 344 of file glc_3dxmltoworld.h.

Referenced by loadInstance3D(), and loadProductStructure().

InstanceOfExtRefHash GLC_3dxmlToWorld::m_InstanceOfExtRefHash
private

Instance of ext ref hash table.

Definition at line 350 of file glc_3dxmltoworld.h.

Referenced by loadInstance3D(), and loadProductStructure().

bool GLC_3dxmlToWorld::m_IsInArchive
private
bool GLC_3dxmlToWorld::m_IsVersion3
private

Flag to know if the 3DXML is in version 3.x.

Definition at line 405 of file glc_3dxmltoworld.h.

Referenced by loadDefaultView(), and readHeader().

bool GLC_3dxmlToWorld::m_LoadStructureOnly
private

Flag indicate the loading method.

Definition at line 380 of file glc_3dxmltoworld.h.

Referenced by createWorldFrom3dxml(), loadExternalRef3D(), and loadExternRepresentations().

RepLinkList GLC_3dxmlToWorld::m_LocalRepLinkList
private

The list of local representation link.

Definition at line 365 of file glc_3dxmltoworld.h.

Referenced by loadInstanceRep(), and loadLocalRepresentations().

MaterialHash GLC_3dxmlToWorld::m_MaterialHash
private

Hash table of material.

Definition at line 356 of file glc_3dxmltoworld.h.

Referenced by clearMaterialHash(), getMaterial(), loadMaterialDef(), and loadSurfaceAttributes().

QuaZip* GLC_3dxmlToWorld::m_p3dxmlArchive
private
QFile* GLC_3dxmlToWorld::m_pCurrentFile
private

The current file (if there is no archive)

Definition at line 329 of file glc_3dxmltoworld.h.

Referenced by clear(), setStreamReaderToFile(), and ~GLC_3dxmlToWorld().

GLC_Material* GLC_3dxmlToWorld::m_pCurrentMaterial
private

The 3DREP current material.

Definition at line 374 of file glc_3dxmltoworld.h.

Referenced by loadCurrentExtRep(), loadFace(), and loadRep().

QXmlStreamReader* GLC_3dxmlToWorld::m_pStreamReader
private
GLC_World* GLC_3dxmlToWorld::m_pWorld
private

The World to return.

Definition at line 335 of file glc_3dxmltoworld.h.

Referenced by clear(), createUnfoldedTree(), createWorldFrom3dxml(), loadProductStructure(), and loadReference3D().

ReferenceHash GLC_3dxmlToWorld::m_ReferenceHash
private
ReferenceRepHash GLC_3dxmlToWorld::m_ReferenceRepHash
private

The Reference representation hash table.

Definition at line 362 of file glc_3dxmltoworld.h.

Referenced by loadExternRepresentations(), loadLocalRepresentations(), and loadReferenceRep().

QString GLC_3dxmlToWorld::m_RootName
private

The root Name of the 3dxml file.

Definition at line 332 of file glc_3dxmltoworld.h.

Referenced by createWorldFrom3dxml(), loadManifest(), and readHeader().

QSet<QString> GLC_3dxmlToWorld::m_SetOfAttachedFileName
private

The Set of attached file name.

Definition at line 383 of file glc_3dxmltoworld.h.

Referenced by clear(), loadExternalRef3D(), loadExternRepresentations(), loadTexture(), and setStreamReaderToFile().

SetOfExtRef GLC_3dxmlToWorld::m_SetOfExtRef
private

The set of ext ref to load.

Definition at line 347 of file glc_3dxmltoworld.h.

Referenced by loadExternalRef3D(), and loadInstance3D().

SetOfExtRef GLC_3dxmlToWorld::m_SetOfExtRep
private

The set of ext rep to load.

Definition at line 371 of file glc_3dxmltoworld.h.

QHash<QString, QString> GLC_3dxmlToWorld::m_TextureImagesHash
private

The image file hash table.

Definition at line 377 of file glc_3dxmltoworld.h.

Referenced by loadCatRepImage(), and loadMaterialDef().

QHash<unsigned int, V3OccurenceAttrib*> GLC_3dxmlToWorld::m_V3OccurenceAttribHash
private

Hash table of occurence specific attributes for 3DXML V3.

Definition at line 392 of file glc_3dxmltoworld.h.

Referenced by loadProductStructure(), loadV3DefaultViewProperty(), and ~GLC_3dxmlToWorld().

QList<V4OccurenceAttrib*> GLC_3dxmlToWorld::m_V4OccurenceAttribList
private

List of occurence specific attributes for 3DXML V4.

Definition at line 395 of file glc_3dxmltoworld.h.

Referenced by loadProductStructure(), loadV4DefaultViewProperty(), and ~GLC_3dxmlToWorld().

QMutex GLC_3dxmlToWorld::m_ZipMutex
staticprivate

Definition at line 400 of file glc_3dxmltoworld.h.

Referenced by create3DrepFrom3dxmlRep(), and setStreamReaderToFile().


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

©2005-2013 Laurent Ribon