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

GLC_ObjToWorld : Create an GLC_World from obj file. More...

#include <glc_objtoworld.h>

+ Inheritance diagram for GLC_ObjToWorld:

Classes

struct  CurrentObjMesh
 
struct  MatOffsetSize
 
struct  ObjVertice
 

Signals

void currentQuantum (int)
 

Public Member Functions

Constructor / Destructor
 GLC_ObjToWorld ()
 
virtual ~GLC_ObjToWorld ()
 
Set Functions
GLC_WorldCreateWorldFromObj (QFile &file)
 Create an GLC_World from an input OBJ File.
 
QStringList listOfAttachedFileName () const
 Get the list of attached files.
 

Private Member Functions

QString getMtlLibFileName (QString)
 Return the name of the mtl file.
 
void scanLigne (QString &)
 Scan a line previously extracted from OBJ file.
 
void changeGroup (QString)
 Change current group.
 
QList< float > extract3dVect (QString &)
 Extract a 3D Vector from a string.
 
QList< float > extract2dVect (QString &)
 Extract a 2D Vector from a string.
 
void extractFaceIndex (QString &)
 Extract a face from a string.
 
void setCurrentMaterial (QString &line)
 Set Current material index.
 
void extractVertexIndex (QString ligne, int &Coordinate, int &Normal, int &TextureCoordinate)
 Extract a vertex from a string.
 
void setObjType (QString &)
 set the OBJ File type
 
GLC_Vector3df computeNormal (GLuint, GLuint, GLuint)
 compute face normal
 
void clear ()
 clear objToWorld allocate memmory
 
void mergeLines (QString *, QTextStream *)
 Merge Mutli line in one.
 
void addCurrentObjMeshToWorld ()
 Add the current Obj mesh to the world.
 

Private Attributes

GLC_Worldm_pWorld
 pointer to a GLC_World
 
QString m_FileName
 The Obj File name.
 
GLC_ObjMtlLoaderm_pMtlLoader
 the Obj Mtl loader
 
int m_CurrentLineNumber
 The current line number.
 
CurrentObjMeshm_pCurrentObjMesh
 The current mesh.
 
FaceType m_FaceType
 Face type.
 
QHash< QString, int > m_CurrentMeshMaterials
 List of material already used by the current mesh.
 
QString m_CurrentMaterialName
 Current material name.
 
QStringList m_ListOfAttachedFileName
 The list of attached file name.
 
QList< float > m_Positions
 The position bulk data.
 
QList< float > m_Normals
 The normal bulk data.
 
QList< float > m_Texels
 The texture coordinate bulk data.
 
int m_VerticeIndex
 
int m_NormalIndex
 
int m_TextureIndex
 
int m_VerticeOffset
 
int m_NormalOffset
 
int m_TextureOffset
 
bool m_ResetIndex
 

Detailed Description

GLC_ObjToWorld : Create an GLC_World from obj file.

An GLC_ObjToWorld extract the meshs from an .obj file
List of elements extracted from the OBJ

Definition at line 69 of file glc_objtoworld.h.

Constructor & Destructor Documentation

GLC_ObjToWorld::GLC_ObjToWorld ( )

Definition at line 43 of file glc_objtoworld.cpp.

GLC_ObjToWorld::~GLC_ObjToWorld ( )
virtual

Definition at line 66 of file glc_objtoworld.cpp.

References clear().

Member Function Documentation

void GLC_ObjToWorld::addCurrentObjMeshToWorld ( )
private
void GLC_ObjToWorld::changeGroup ( QString  line)
private
void GLC_ObjToWorld::clear ( )
private
GLC_Vector3df GLC_ObjToWorld::computeNormal ( GLuint  index1,
GLuint  index2,
GLuint  index3 
)
private
GLC_World * GLC_ObjToWorld::CreateWorldFromObj ( QFile &  file)
void GLC_ObjToWorld::currentQuantum ( int  )
signal

Referenced by CreateWorldFromObj().

QList< float > GLC_ObjToWorld::extract2dVect ( QString &  line)
private

Extract a 2D Vector from a string.

Definition at line 402 of file glc_objtoworld.cpp.

References clear(), m_CurrentLineNumber, m_FileName, and GLC_FileFormatException::WrongFileFormat.

Referenced by scanLigne().

QList< float > GLC_ObjToWorld::extract3dVect ( QString &  line)
private

Extract a 3D Vector from a string.

Definition at line 361 of file glc_objtoworld.cpp.

References GLC_ErrorLog::addError(), m_CurrentLineNumber, and m_FileName.

Referenced by scanLigne().

void GLC_ObjToWorld::extractFaceIndex ( QString &  line)
private
void GLC_ObjToWorld::extractVertexIndex ( QString  ligne,
int &  Coordinate,
int &  Normal,
int &  TextureCoordinate 
)
private
QString GLC_ObjToWorld::getMtlLibFileName ( QString  line)
private

Return the name of the mtl file.

Definition at line 214 of file glc_objtoworld.cpp.

References m_FileName.

Referenced by CreateWorldFromObj().

QStringList GLC_ObjToWorld::listOfAttachedFileName ( ) const
inline

Get the list of attached files.

Definition at line 166 of file glc_objtoworld.h.

Referenced by GLC_FileLoader::createWorldFromFile().

void GLC_ObjToWorld::mergeLines ( QString *  pLineBuff,
QTextStream *  p0bjStream 
)
private

Merge Mutli line in one.

Definition at line 872 of file glc_objtoworld.cpp.

References m_CurrentLineNumber.

Referenced by CreateWorldFromObj().

void GLC_ObjToWorld::scanLigne ( QString &  line)
private
void GLC_ObjToWorld::setCurrentMaterial ( QString &  line)
private
void GLC_ObjToWorld::setObjType ( QString &  ligne)
private

Member Data Documentation

int GLC_ObjToWorld::m_CurrentLineNumber
private
QString GLC_ObjToWorld::m_CurrentMaterialName
private

Current material name.

Definition at line 246 of file glc_objtoworld.h.

Referenced by changeGroup(), and setCurrentMaterial().

QHash<QString, int> GLC_ObjToWorld::m_CurrentMeshMaterials
private

List of material already used by the current mesh.

Definition at line 243 of file glc_objtoworld.h.

Referenced by clear().

FaceType GLC_ObjToWorld::m_FaceType
private

Face type.

Definition at line 240 of file glc_objtoworld.h.

Referenced by extractFaceIndex(), extractVertexIndex(), scanLigne(), and setObjType().

QString GLC_ObjToWorld::m_FileName
private
QStringList GLC_ObjToWorld::m_ListOfAttachedFileName
private

The list of attached file name.

Definition at line 249 of file glc_objtoworld.h.

Referenced by clear(), and CreateWorldFromObj().

int GLC_ObjToWorld::m_NormalIndex
private

Definition at line 261 of file glc_objtoworld.h.

Referenced by CreateWorldFromObj(), extractVertexIndex(), and scanLigne().

int GLC_ObjToWorld::m_NormalOffset
private

Definition at line 265 of file glc_objtoworld.h.

Referenced by CreateWorldFromObj(), extractVertexIndex(), and scanLigne().

QList<float> GLC_ObjToWorld::m_Normals
private

The normal bulk data.

Definition at line 255 of file glc_objtoworld.h.

Referenced by extractFaceIndex(), and scanLigne().

CurrentObjMesh* GLC_ObjToWorld::m_pCurrentObjMesh
private
GLC_ObjMtlLoader* GLC_ObjToWorld::m_pMtlLoader
private

the Obj Mtl loader

Definition at line 231 of file glc_objtoworld.h.

Referenced by addCurrentObjMeshToWorld(), clear(), CreateWorldFromObj(), and setCurrentMaterial().

QList<float> GLC_ObjToWorld::m_Positions
private

The position bulk data.

Definition at line 252 of file glc_objtoworld.h.

Referenced by extractFaceIndex(), and scanLigne().

GLC_World* GLC_ObjToWorld::m_pWorld
private

pointer to a GLC_World

Definition at line 225 of file glc_objtoworld.h.

Referenced by addCurrentObjMeshToWorld(), and CreateWorldFromObj().

bool GLC_ObjToWorld::m_ResetIndex
private

Definition at line 269 of file glc_objtoworld.h.

Referenced by scanLigne().

QList<float> GLC_ObjToWorld::m_Texels
private

The texture coordinate bulk data.

Definition at line 258 of file glc_objtoworld.h.

Referenced by extractFaceIndex(), and scanLigne().

int GLC_ObjToWorld::m_TextureIndex
private

Definition at line 262 of file glc_objtoworld.h.

Referenced by CreateWorldFromObj(), extractVertexIndex(), and scanLigne().

int GLC_ObjToWorld::m_TextureOffset
private

Definition at line 266 of file glc_objtoworld.h.

Referenced by CreateWorldFromObj(), extractVertexIndex(), and scanLigne().

int GLC_ObjToWorld::m_VerticeIndex
private

Definition at line 260 of file glc_objtoworld.h.

Referenced by CreateWorldFromObj(), extractVertexIndex(), and scanLigne().

int GLC_ObjToWorld::m_VerticeOffset
private

Definition at line 264 of file glc_objtoworld.h.

Referenced by CreateWorldFromObj(), extractVertexIndex(), and scanLigne().


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

©2005-2013 Laurent Ribon