TDME2 1.9.121
Static Public Member Functions | Static Private Member Functions | List of all members
TMReader Class Reference

TDME model reader. More...

#include <tdme/engine/fileio/models/TMReader.h>

Collaboration diagram for TMReader:
Collaboration graph

Static Public Member Functions

static Modelread (const string &pathName, const string &fileName)
 TDME model format reader. More...
 
static Modelread (const vector< uint8_t > &data, const string &pathName=string(), const string &fileName=string())
 TDME model format reader. More...
 

Static Private Member Functions

static const string getTexturePath (const string &modelPathName, const string &texturePathName, const string &textureFileName)
 Get texture path. More...
 
static void readEmbeddedTextures (TMReaderInputStream *is, map< string, Texture * > &embeddedTextures)
 Read material. More...
 
static MaterialreadMaterial (const string &pathName, TMReaderInputStream *is, const map< string, Texture * > &embeddedTextures, const array< uint8_t, 3 > &version)
 Read material. More...
 
static void readAnimationSetup (TMReaderInputStream *is, Model *model, const array< uint8_t, 3 > &version)
 Read animation setup. More...
 
static const vector< Vector3readVertices (TMReaderInputStream *is)
 Read vertices from input stream. More...
 
static const vector< TextureCoordinatereadTextureCoordinates (TMReaderInputStream *is)
 Read texture coordinates from input stream. More...
 
static bool readIndices (TMReaderInputStream *is, array< int32_t, 3 > *indices)
 Read indices from input stream. More...
 
static AnimationreadAnimation (TMReaderInputStream *is, Node *g)
 Read animation from input stream into node. More...
 
static void readFacesEntities (TMReaderInputStream *is, Node *g)
 Read faces entities from input stream. More...
 
static Joint readSkinningJoint (TMReaderInputStream *is)
 Read skinning joint. More...
 
static JointWeight readSkinningJointWeight (TMReaderInputStream *is)
 Read skinning joint weight. More...
 
static void readSkinning (TMReaderInputStream *is, Node *g)
 Read skinning from input stream. More...
 
static void readSubNodes (TMReaderInputStream *is, Model *model, Node *parentNode, map< string, Node * > &subNodes)
 Read sub nodes. More...
 
static NodereadNode (TMReaderInputStream *is, Model *model, Node *parentNode)
 Write node to output stream. More...
 

Detailed Description

TDME model reader.

Author
Andreas Drewke
Version
$Id$

Definition at line 230 of file TMReader.h.

Member Function Documentation

◆ getTexturePath()

const string getTexturePath ( const string &  modelPathName,
const string &  texturePathName,
const string &  textureFileName 
)
staticprivate

Get texture path.

Parameters
modelPathNamemodel path name
texturePathNametexture path name
textureFileNametexture file name

Definition at line 160 of file TMReader.cpp.

◆ read() [1/2]

Model * read ( const string &  pathName,
const string &  fileName 
)
static

TDME model format reader.

Parameters
pathNamepath name
fileNamefile name
Exceptions
tdme::os::filesystem::FileSystemException
tdme::engine::fileio::models::ModelFileIOException
Returns
model

Definition at line 70 of file TMReader.cpp.

◆ read() [2/2]

Model * read ( const vector< uint8_t > &  data,
const string &  pathName = string(),
const string &  fileName = string() 
)
static

TDME model format reader.

Parameters
datadata vector to read TM from
pathNamepath name file was read from
fileNamefile name was read from
Exceptions
tdme::engine::fileio::models::ModelFileIOException
Returns
model

Definition at line 77 of file TMReader.cpp.

◆ readAnimation()

Animation * readAnimation ( TMReaderInputStream is,
Node g 
)
staticprivate

Read animation from input stream into node.

Parameters
isinput stream
gnode
Exceptions
tdme::engine::fileio::models::ModelFileIOException
Returns
Animation

Definition at line 430 of file TMReader.cpp.

◆ readAnimationSetup()

void readAnimationSetup ( TMReaderInputStream is,
Model model,
const array< uint8_t, 3 > &  version 
)
staticprivate

Read animation setup.

Parameters
isinput stream
modelmodel
versionversion
Exceptions
tdme::engine::fileio::models::ModelFileIOException

Definition at line 363 of file TMReader.cpp.

◆ readEmbeddedTextures()

void readEmbeddedTextures ( TMReaderInputStream is,
map< string, Texture * > &  embeddedTextures 
)
staticprivate

Read material.

Parameters
pathNamepath name
isinput stream
embeddedTexturesembedded textures
versionversion
Exceptions
tdme::engine::fileio::models::ModelFileIOException
Returns
material

Definition at line 174 of file TMReader.cpp.

◆ readFacesEntities()

void readFacesEntities ( TMReaderInputStream is,
Node g 
)
staticprivate

Read faces entities from input stream.

Parameters
isinput stream
gnode
Exceptions
tdme::engine::fileio::models::ModelFileIOException

Definition at line 450 of file TMReader.cpp.

◆ readIndices()

bool readIndices ( TMReaderInputStream is,
array< int32_t, 3 > *  indices 
)
staticprivate

Read indices from input stream.

Parameters
isinput stream
indicesindices
Exceptions
tdme::engine::fileio::models::ModelFileIOException
Returns
if having indices

Definition at line 414 of file TMReader.cpp.

◆ readMaterial()

Material * readMaterial ( const string &  pathName,
TMReaderInputStream is,
const map< string, Texture * > &  embeddedTextures,
const array< uint8_t, 3 > &  version 
)
staticprivate

Read material.

Parameters
pathNamepath name
isinput stream
embeddedTexturesembedded textures
versionversion
Exceptions
tdme::engine::fileio::models::ModelFileIOException
Returns
material

Definition at line 193 of file TMReader.cpp.

◆ readNode()

Node * readNode ( TMReaderInputStream is,
Model model,
Node parentNode 
)
staticprivate

Write node to output stream.

Parameters
isinput stream
modelmodel
parentNodeparent node
Exceptions
tdme::engine::fileio::models::ModelFileIOException
Returns
node

Definition at line 550 of file TMReader.cpp.

◆ readSkinning()

void readSkinning ( TMReaderInputStream is,
Node g 
)
staticprivate

Read skinning from input stream.

Parameters
isinput stream
gnode
Exceptions
tdme::engine::fileio::models::ModelFileIOException

Definition at line 516 of file TMReader.cpp.

◆ readSkinningJoint()

Joint readSkinningJoint ( TMReaderInputStream is)
staticprivate

Read skinning joint.

Parameters
isinput stream
Exceptions
tdme::engine::fileio::models::ModelFileIOException
Returns
joint

Definition at line 499 of file TMReader.cpp.

◆ readSkinningJointWeight()

JointWeight readSkinningJointWeight ( TMReaderInputStream is)
staticprivate

Read skinning joint weight.

Parameters
isinput stream
Exceptions
tdme::engine::fileio::models::ModelFileIOException
Returns
joint weight

Definition at line 508 of file TMReader.cpp.

◆ readSubNodes()

void readSubNodes ( TMReaderInputStream is,
Model model,
Node parentNode,
map< string, Node * > &  subNodes 
)
staticprivate

Read sub nodes.

Parameters
isinput stream
modelmodel
parentNodeparent node
subNodessub nodes
Exceptions
IOException
tdme::engine::fileio::models::ModelFileIOException
Returns
node

Definition at line 540 of file TMReader.cpp.

◆ readTextureCoordinates()

const vector< TextureCoordinate > readTextureCoordinates ( TMReaderInputStream is)
staticprivate

Read texture coordinates from input stream.

Parameters
isinput stream
Exceptions
tdme::engine::fileio::models::ModelFileIOException
Returns
texture coordinates array

Definition at line 400 of file TMReader.cpp.

◆ readVertices()

const vector< Vector3 > readVertices ( TMReaderInputStream is)
staticprivate

Read vertices from input stream.

Parameters
isinput stream
Exceptions
tdme::engine::fileio::models::ModelFileIOException
Returns
vector3 array

Definition at line 386 of file TMReader.cpp.


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