GLC_3dxmlToWorld Class Reference

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

#include <glc_3dxmltoworld.h>

List of all members.

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  OccurenceAttrib
 OccurenceAttrib : Specifique occurence attribute. More...
class  RepLink
 RepLink : Representation link between reference id and representation id. 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 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 loadLOD (GLC_Mesh *)
 Load Level of detail.
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 loadGraphicsProperties ()
 Load graphics properties.
void loadDefaultViewProperty ()
 Load default view property.
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 factorizeMaterial (GLC_3DRep *)
 Factorize material use.
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.

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,
OccurenceAttrib * > 
m_OccurenceAttrib
 Hash table of occurence specific attributes.
bool m_GetExternalRef3DName
 bool get external ref 3D name
QList< QByteArray > m_ByteArrayList

Static Private Attributes

static QMutex m_ZipMutex

Detailed Description

GLC_3dxmlToWorld : Create an GLC_World from 3dxml file.

Definition at line 51 of file glc_3dxmltoworld.h.


Member Typedef Documentation

typedef QList<AssyLink> GLC_3dxmlToWorld::AssyLinkList [private]

Definition at line 102 of file glc_3dxmltoworld.h.

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

Definition at line 104 of file glc_3dxmltoworld.h.

typedef QHash<GLC_StructInstance*, QString> GLC_3dxmlToWorld::InstanceOfExtRefHash [private]

Definition at line 100 of file glc_3dxmltoworld.h.

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

Definition at line 99 of file glc_3dxmltoworld.h.

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

Definition at line 105 of file glc_3dxmltoworld.h.

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

Definition at line 98 of file glc_3dxmltoworld.h.

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

Definition at line 106 of file glc_3dxmltoworld.h.

typedef QList<RepLink> GLC_3dxmlToWorld::RepLinkList [private]

Definition at line 103 of file glc_3dxmltoworld.h.

typedef QSet<const QString> GLC_3dxmlToWorld::SetOfExtRef [private]

Definition at line 101 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::checkFileValidity ( QIODevice *  pIODevice  )  [private]

Check if the given file is binary.

Definition at line 2254 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 1378 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 
) [inline, private]
void GLC_3dxmlToWorld::factorizeMaterial ( GLC_3DRep pRep  )  [private]

Factorize material use.

The hash table of rep material

Definition at line 2202 of file glc_3dxmltoworld.cpp.

References GLC_Material::hashCode(), GLC_Object::id(), m_MaterialHash, GLC_3DRep::materialSet(), and GLC_3DRep::replaceMaterial().

Referenced by loadExternalRef3D(), and loadExternRepresentations().

QString GLC_3dxmlToWorld::getContent ( QXmlStreamReader *  pReader,
const QString &  element 
) [inline, private]
GLC_Material * GLC_3dxmlToWorld::getMaterial (  )  [private]
bool GLC_3dxmlToWorld::goToElement ( QXmlStreamReader *  pReader,
const QString &  element 
) [inline, private]

Go to the given xml Element, return true on succes.

Definition at line 376 of file glc_3dxmltoworld.h.

References readNext().

Referenced by createReferenceRep(), loadCatMaterialRef(), loadCatRepImage(), loadDefaultViewProperty(), loadLocalRepresentations(), loadMaterialDef(), and loadProductStructure().

void GLC_3dxmlToWorld::goToEndElement ( QXmlStreamReader *  pReader,
const QString &  element 
) [inline, private]

Go to the end Element of a xml.

Definition at line 415 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 307 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 318 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 130 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::loadDefaultViewProperty (  )  [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::loadGraphicsProperties (  )  [private]
void GLC_3dxmlToWorld::loadInstance3D (  )  [private]
void GLC_3dxmlToWorld::loadInstanceRep (  )  [private]
void GLC_3dxmlToWorld::loadLocalRepresentations (  )  [private]
void GLC_3dxmlToWorld::loadLOD ( GLC_Mesh pMesh  )  [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 1075 of file glc_3dxmltoworld.cpp.

Referenced by loadInstance3D().

void GLC_3dxmlToWorld::loadPolyline ( GLC_Mesh pMesh  )  [private]

Load polyline.

Definition at line 1361 of file glc_3dxmltoworld.cpp.

References GLC_Geometry::addVerticeGroup(), and readAttribute().

Referenced by createReferenceRep(), and loadCurrentExtRep().

void GLC_3dxmlToWorld::loadProductStructure (  )  [private]
void GLC_3dxmlToWorld::loadReference3D (  )  [private]
void GLC_3dxmlToWorld::loadReferenceRep (  )  [private]

Load a Reference representation.

Definition at line 652 of file glc_3dxmltoworld.cpp.

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

Referenced by loadProductStructure().

GLC_Material * GLC_3dxmlToWorld::loadSurfaceAttributes (  )  [private]

Load surface attributes.

Definition at line 1393 of file glc_3dxmltoworld.cpp.

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

Referenced by loadFace(), and loadLOD().

GLC_Texture * GLC_3dxmlToWorld::loadTexture ( QString  fileName  )  [private]
QString GLC_3dxmlToWorld::readAttribute ( QXmlStreamReader *  pReader,
const QString &  attribute 
) [inline, private]

Read the specified attribute.

Definition at line 400 of file glc_3dxmltoworld.h.

QString GLC_3dxmlToWorld::readAttribute ( const QString &  name,
bool  required = false 
) [private]
QXmlStreamReader::TokenType GLC_3dxmlToWorld::readNext (  )  [inline, private]
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 
) [inline, private]

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

Definition at line 410 of file glc_3dxmltoworld.h.

Referenced by createReferenceRep(), and loadCurrentExtRep().


Member Data Documentation

The Structure Link Hash Table.

Definition at line 299 of file glc_3dxmltoworld.h.

Referenced by createUnfoldedTree(), and loadInstance3D().

QList<QByteArray> GLC_3dxmlToWorld::m_ByteArrayList [private]

Definition at line 357 of file glc_3dxmltoworld.h.

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

Externam reference hash table.

Definition at line 311 of file glc_3dxmltoworld.h.

Referenced by loadExternalRef3D(), and loadProductStructure().

The list of extern representation link.

Definition at line 326 of file glc_3dxmltoworld.h.

Referenced by loadExternRepresentations(), and loadInstanceRep().

QString GLC_3dxmlToWorld::m_FileName [private]

bool get external ref 3D name

Definition at line 353 of file glc_3dxmltoworld.h.

Referenced by createWorldFrom3dxml(), and loadExternalRef3D().

Instance of Hash table.

Definition at line 302 of file glc_3dxmltoworld.h.

Referenced by loadInstance3D(), and loadProductStructure().

Instance of ext ref hash table.

Definition at line 308 of file glc_3dxmltoworld.h.

Referenced by loadInstance3D(), and loadProductStructure().

Flag indicate the loading method.

Definition at line 338 of file glc_3dxmltoworld.h.

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

The list of local representation link.

Definition at line 323 of file glc_3dxmltoworld.h.

Referenced by loadInstanceRep(), and loadLocalRepresentations().

Hash table of material.

Definition at line 314 of file glc_3dxmltoworld.h.

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

QHash<unsigned int, OccurenceAttrib*> GLC_3dxmlToWorld::m_OccurenceAttrib [private]

Hash table of occurence specific attributes.

Definition at line 350 of file glc_3dxmltoworld.h.

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

The current file (if there is no archive).

Definition at line 287 of file glc_3dxmltoworld.h.

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

The 3DREP current material.

Definition at line 332 of file glc_3dxmltoworld.h.

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

QXmlStreamReader* GLC_3dxmlToWorld::m_pStreamReader [private]

The World to return.

Definition at line 293 of file glc_3dxmltoworld.h.

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

The Reference representation hash table.

Definition at line 320 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 290 of file glc_3dxmltoworld.h.

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

The Set of attached file name.

Definition at line 341 of file glc_3dxmltoworld.h.

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

The set of ext ref to load.

Definition at line 305 of file glc_3dxmltoworld.h.

Referenced by loadExternalRef3D(), and loadInstance3D().

The set of ext rep to load.

Definition at line 329 of file glc_3dxmltoworld.h.

QHash<QString, QString> GLC_3dxmlToWorld::m_TextureImagesHash [private]

The image file hash table.

Definition at line 335 of file glc_3dxmltoworld.h.

Referenced by loadCatRepImage(), and loadMaterialDef().

QMutex GLC_3dxmlToWorld::m_ZipMutex [static, private]

Definition at line 355 of file glc_3dxmltoworld.h.

Referenced by create3DrepFrom3dxmlRep(), and setStreamReaderToFile().


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

SourceForge.net Logo

©2005-2011 Laurent Ribon