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

GLC_WorldTo3ds : Export a GLC_World to a 3ds file. More...

#include <glc_worldto3ds.h>

+ Inheritance diagram for GLC_WorldTo3ds:

Signals

void currentQuantum (int)
 

Public Member Functions

Constructor / Destructor
 GLC_WorldTo3ds (const GLC_World &world)
 
virtual ~GLC_WorldTo3ds ()
 
Set Functions
bool exportToFile (const QString &fileName, bool useAbsolutePosition=false)
 Save the world to the specified file name.
 

Private Member Functions

Private services functions
void saveWorld ()
 Save the world into the lib3ds file structure.
 
void saveMeshes ()
 Save all meshes into the lib3ds file structure.
 
void saveBranch (GLC_StructOccurence *pOcc)
 Save the branch from the given GLC_StructOccurence.
 
void createNodeFromOccurrence (GLC_StructOccurence *pOcc)
 Create 3ds node from the given GLC_StructOccurence.
 
QList< Lib3dsMesh * > createMeshsFrom3DRep (GLC_3DRep *pRep, const QString &name, const GLC_Matrix4x4 &matrix=GLC_Matrix4x4())
 Return the list of 3ds mesh from the given GLC_3DRep.
 
Lib3dsMesh * create3dsMeshFromGLC_Mesh (GLC_Mesh *pMesh, const QString &meshName)
 Return the 3ds mesh from the given GLC_Mesh.
 
Lib3dsMaterial * get3dsMaterialFromGLC_Material (GLC_Material *pMat)
 Return the 3ds material from the given GLC_Material.
 
Lib3dsMaterial * create3dsMaterialFromGLC_Material (GLC_Material *pMat, const QString &materialName)
 Create and return the 3ds material from the given GLC_Material and name.
 
QString materialName (GLC_Material *pMat) const
 Return the material name of the given material.
 
void setNodePosition (Lib3dsNode *pNode, const GLC_Matrix4x4 &matrix)
 Set the object data position from the given matrix.
 

Private Attributes

GLC_World m_World
 The world to export.
 
Lib3dsFile * m_pLib3dsFile
 The Lib3dsFile Structure.
 
QString m_FileName
 The file absolute path.
 
QHash< GLC_StructReference
*, Lib3dsMesh * > 
m_ReferenceToMesh
 Reference to 3ds mesh hash table.
 
QHash< QString, Lib3dsMaterial * > m_NameToMaterial
 Name to 3ds material hash table.
 
Lib3dsNode * m_pRootLib3dsNode
 The root lib3ds node.
 
int m_CurrentNodeId
 The current node id.
 
QHash< GLC_uint, int > m_OccIdToNodeId
 Occurence id to node id hash.
 
int m_CurrentMeshIndex
 The current mesh inde.
 
bool m_UseAbsolutePosition
 Use absolute position (meshes are duplicated)
 
QHash< GLC_Texture *, QString > m_TextureToFileName
 GLC_Texture to fileName hash table.
 

Detailed Description

GLC_WorldTo3ds : Export a GLC_World to a 3ds file.

Definition at line 49 of file glc_worldto3ds.h.

Constructor & Destructor Documentation

GLC_WorldTo3ds::GLC_WorldTo3ds ( const GLC_World world)

Definition at line 42 of file glc_worldto3ds.cpp.

GLC_WorldTo3ds::~GLC_WorldTo3ds ( )
virtual

Definition at line 60 of file glc_worldto3ds.cpp.

Member Function Documentation

Lib3dsMaterial * GLC_WorldTo3ds::create3dsMaterialFromGLC_Material ( GLC_Material pMat,
const QString &  materialName 
)
private
Lib3dsMesh * GLC_WorldTo3ds::create3dsMeshFromGLC_Mesh ( GLC_Mesh pMesh,
const QString &  meshName 
)
private
QList< Lib3dsMesh * > GLC_WorldTo3ds::createMeshsFrom3DRep ( GLC_3DRep pRep,
const QString &  name,
const GLC_Matrix4x4 matrix = GLC_Matrix4x4() 
)
private
void GLC_WorldTo3ds::createNodeFromOccurrence ( GLC_StructOccurence pOcc)
private
void GLC_WorldTo3ds::currentQuantum ( int  )
signal
bool GLC_WorldTo3ds::exportToFile ( const QString &  fileName,
bool  useAbsolutePosition = false 
)
Lib3dsMaterial * GLC_WorldTo3ds::get3dsMaterialFromGLC_Material ( GLC_Material pMat)
private

Return the 3ds material from the given GLC_Material.

Definition at line 353 of file glc_worldto3ds.cpp.

References create3dsMaterialFromGLC_Material(), m_NameToMaterial, and materialName().

Referenced by create3dsMeshFromGLC_Mesh().

QString GLC_WorldTo3ds::materialName ( GLC_Material pMat) const
private

Return the material name of the given material.

Definition at line 449 of file glc_worldto3ds.cpp.

References GLC_Object::id(), and GLC_Object::name().

Referenced by get3dsMaterialFromGLC_Material().

void GLC_WorldTo3ds::saveBranch ( GLC_StructOccurence pOcc)
private

Save the branch from the given GLC_StructOccurence.

Definition at line 146 of file glc_worldto3ds.cpp.

References GLC_StructOccurence::child(), GLC_StructOccurence::childCount(), and createNodeFromOccurrence().

Referenced by saveWorld().

void GLC_WorldTo3ds::saveMeshes ( )
private
void GLC_WorldTo3ds::saveWorld ( )
private

Save the world into the lib3ds file structure.

Definition at line 101 of file glc_worldto3ds.cpp.

References GLC_StructOccurence::child(), GLC_StructOccurence::childCount(), m_UseAbsolutePosition, m_World, GLC_World::rootOccurence(), saveBranch(), and saveMeshes().

Referenced by exportToFile().

void GLC_WorldTo3ds::setNodePosition ( Lib3dsNode *  pNode,
const GLC_Matrix4x4 matrix 
)
private

Member Data Documentation

int GLC_WorldTo3ds::m_CurrentMeshIndex
private

The current mesh inde.

Definition at line 143 of file glc_worldto3ds.h.

Referenced by createNodeFromOccurrence(), exportToFile(), and saveMeshes().

int GLC_WorldTo3ds::m_CurrentNodeId
private

The current node id.

Definition at line 137 of file glc_worldto3ds.h.

Referenced by createNodeFromOccurrence(), and exportToFile().

QString GLC_WorldTo3ds::m_FileName
private

The file absolute path.

Definition at line 125 of file glc_worldto3ds.h.

Referenced by create3dsMaterialFromGLC_Material(), and exportToFile().

QHash<QString, Lib3dsMaterial*> GLC_WorldTo3ds::m_NameToMaterial
private

Name to 3ds material hash table.

Definition at line 131 of file glc_worldto3ds.h.

Referenced by create3dsMaterialFromGLC_Material(), exportToFile(), and get3dsMaterialFromGLC_Material().

QHash<GLC_uint, int> GLC_WorldTo3ds::m_OccIdToNodeId
private

Occurence id to node id hash.

Definition at line 140 of file glc_worldto3ds.h.

Referenced by createNodeFromOccurrence(), and exportToFile().

Lib3dsFile* GLC_WorldTo3ds::m_pLib3dsFile
private

The Lib3dsFile Structure.

Definition at line 122 of file glc_worldto3ds.h.

Referenced by create3dsMaterialFromGLC_Material(), createNodeFromOccurrence(), exportToFile(), and saveMeshes().

Lib3dsNode* GLC_WorldTo3ds::m_pRootLib3dsNode
private

The root lib3ds node.

Definition at line 134 of file glc_worldto3ds.h.

Referenced by exportToFile().

QHash<GLC_StructReference*, Lib3dsMesh*> GLC_WorldTo3ds::m_ReferenceToMesh
private

Reference to 3ds mesh hash table.

Definition at line 128 of file glc_worldto3ds.h.

Referenced by createNodeFromOccurrence(), exportToFile(), and saveMeshes().

QHash<GLC_Texture*, QString> GLC_WorldTo3ds::m_TextureToFileName
private

GLC_Texture to fileName hash table.

Definition at line 149 of file glc_worldto3ds.h.

Referenced by create3dsMaterialFromGLC_Material(), and exportToFile().

bool GLC_WorldTo3ds::m_UseAbsolutePosition
private

Use absolute position (meshes are duplicated)

Definition at line 146 of file glc_worldto3ds.h.

Referenced by createNodeFromOccurrence(), exportToFile(), and saveWorld().

GLC_World GLC_WorldTo3ds::m_World
private

The world to export.

Definition at line 119 of file glc_worldto3ds.h.

Referenced by createNodeFromOccurrence(), saveMeshes(), and saveWorld().


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

©2005-2013 Laurent Ribon