Assimp  v3.1.1 (June 2014)
Assimp::MD5Importer Class Reference

Importer class for the MD5 file format. More...

Inherits Assimp::BaseImporter.

Public Member Functions

bool CanRead (const std::string &pFile, IOSystem *pIOHandler, bool checkSig) const
 Returns whether the class can handle the format of the given file. More...
 
 MD5Importer ()
 
 ~MD5Importer ()
 
- Public Member Functions inherited from Assimp::BaseImporter
 BaseImporter ()
 Constructor to be privately used by Importer. More...
 
const std::string & GetErrorText () const
 Returns the error description of the last error that occurred. More...
 
void GetExtensionList (std::set< std::string > &extensions)
 Called by #Importer::GetExtensionList for each loaded importer. More...
 
aiSceneReadFile (const Importer *pImp, const std::string &pFile, IOSystem *pIOHandler)
 Imports the given file and returns the imported data. More...
 
virtual ~BaseImporter ()
 Destructor, private as well. More...
 

Protected Member Functions

void AttachChilds_Anim (int iParentID, aiNode *piParent, AnimBoneList &bones, const aiNodeAnim **node_anims)
 Construct node hierarchy from a given MD5ANIM. More...
 
void AttachChilds_Mesh (int iParentID, aiNode *piParent, BoneList &bones)
 Construct node hierarchy from a given MD5MESH. More...
 
const aiImporterDescGetInfo () const
 Return importer meta information. More...
 
void InternReadFile (const std::string &pFile, aiScene *pScene, IOSystem *pIOHandler)
 Imports the given file into the given scene structure. More...
 
void LoadFileIntoMemory (IOStream *pFile)
 Load the contents of a specific file into memory and alocates a buffer to keep it. More...
 
void LoadMD5AnimFile ()
 Load a *.MD5ANIM file. More...
 
void LoadMD5CameraFile ()
 Load a *.MD5CAMERA file. More...
 
void LoadMD5MeshFile ()
 Load a *.MD5MESH file. More...
 
void MakeDataUnique (MD5::MeshDesc &meshSrc)
 Build unique vertex buffers from a given MD5ANIM. More...
 
void SetupProperties (const Importer *pImp)
 Called prior to ReadFile(). More...
 
void UnloadFileFromMemory ()
 

Protected Attributes

bool bHadMD5Anim
 true if a MD5ANIM file has already been parsed More...
 
bool bHadMD5Camera
 true if a MD5CAMERA file has already been parsed More...
 
bool bHadMD5Mesh
 true if a MD5MESH file has already been parsed More...
 
bool configNoAutoLoad
 configuration option: prevent anim autoload More...
 
unsigned int fileSize
 Size of the file. More...
 
unsigned int iLineNumber
 Current line number. More...
 
char * mBuffer
 Buffer to hold the loaded file. More...
 
std::string mFile
 Path to the file, excluding the file extension but with the dot. More...
 
IOSystemmIOHandler
 IOSystem to be used to access files. More...
 
IOSystempIOHandler
 (Custom) I/O handler implementation More...
 
aiScenepScene
 Scene to be filled. More...
 
- Protected Attributes inherited from Assimp::BaseImporter
std::string m_ErrorText
 Error description in case there was one. More...
 
ProgressHandlerm_progress
 Currently set progress handler. More...
 

Additional Inherited Members

- Public Types inherited from Assimp::BaseImporter
enum  TextFileMode { ALLOW_EMPTY, FORBID_EMPTY }
 
- Static Public Member Functions inherited from Assimp::BaseImporter
static bool CheckMagicToken (IOSystem *pIOHandler, const std::string &pFile, const void *magic, unsigned int num, unsigned int offset=0, unsigned int size=4)
 Check whether a file starts with one or more magic tokens. More...
 
static void ConvertToUTF8 (std::vector< char > &data)
 An utility for all text file loaders. More...
 
static void ConvertUTF8toISO8859_1 (std::string &data)
 An utility for all text file loaders. More...
 
template<typename T >
static AI_FORCE_INLINE void CopyVector (std::vector< T > &vec, T *&out, unsigned int &outLength)
 Utility function to move a std::vector into a aiScene array. More...
 
static std::string GetExtension (const std::string &pFile)
 Extract file extension from a string. More...
 
static bool SearchFileHeaderForToken (IOSystem *pIOSystem, const std::string &file, const char **tokens, unsigned int numTokens, unsigned int searchBytes=200, bool tokensSol=false)
 A utility for CanRead(). More...
 
static bool SimpleExtensionCheck (const std::string &pFile, const char *ext0, const char *ext1=NULL, const char *ext2=NULL)
 Check whether a file has a specific file extension. More...
 
static void TextFileToBuffer (IOStream *stream, std::vector< char > &data, TextFileMode mode=FORBID_EMPTY)
 Utility for text file loaders which copies the contents of the file into a memory buffer and converts it to our UTF8 representation. More...
 

Detailed Description

Importer class for the MD5 file format.

Constructor & Destructor Documentation

§ MD5Importer()

MD5Importer::MD5Importer ( )

§ ~MD5Importer()

MD5Importer::~MD5Importer ( )

Member Function Documentation

§ AttachChilds_Anim()

void MD5Importer::AttachChilds_Anim ( int  iParentID,
aiNode piParent,
AnimBoneList bones,
const aiNodeAnim **  node_anims 
)
protected

Construct node hierarchy from a given MD5ANIM.

Parameters
iParentIDCurrent parent ID
piParentParent node to attach to
bonesInput bones
node_animsGenerated node animations

§ AttachChilds_Mesh()

void MD5Importer::AttachChilds_Mesh ( int  iParentID,
aiNode piParent,
BoneList bones 
)
protected

Construct node hierarchy from a given MD5MESH.

Parameters
iParentIDCurrent parent ID
piParentParent node to attach to
bonesInput bones

§ CanRead()

bool MD5Importer::CanRead ( const std::string &  pFile,
IOSystem pIOHandler,
bool  checkSig 
) const
virtual

Returns whether the class can handle the format of the given file.

See BaseImporter::CanRead() for details.

Implements Assimp::BaseImporter.

§ GetInfo()

const aiImporterDesc * MD5Importer::GetInfo ( ) const
protectedvirtual

Return importer meta information.

See #BaseImporter::GetInfo for the details

Implements Assimp::BaseImporter.

§ InternReadFile()

void MD5Importer::InternReadFile ( const std::string &  pFile,
aiScene pScene,
IOSystem pIOHandler 
)
protectedvirtual

Imports the given file into the given scene structure.

See BaseImporter::InternReadFile() for details

Implements Assimp::BaseImporter.

§ LoadFileIntoMemory()

void MD5Importer::LoadFileIntoMemory ( IOStream pFile)
protected

Load the contents of a specific file into memory and alocates a buffer to keep it.

mBuffer is modified to point to this buffer.

Parameters
pFileFile stream to be read

§ LoadMD5AnimFile()

void MD5Importer::LoadMD5AnimFile ( )
protected

Load a *.MD5ANIM file.

§ LoadMD5CameraFile()

void MD5Importer::LoadMD5CameraFile ( )
protected

Load a *.MD5CAMERA file.

§ LoadMD5MeshFile()

void MD5Importer::LoadMD5MeshFile ( )
protected

Load a *.MD5MESH file.

§ MakeDataUnique()

void MD5Importer::MakeDataUnique ( MD5::MeshDesc meshSrc)
protected

Build unique vertex buffers from a given MD5ANIM.

Parameters
meshSrcInput data

§ SetupProperties()

void MD5Importer::SetupProperties ( const Importer pImp)
protectedvirtual

Called prior to ReadFile().

The function is a request to the importer to update its configuration basing on the Importer's configuration property list.

Reimplemented from Assimp::BaseImporter.

§ UnloadFileFromMemory()

void MD5Importer::UnloadFileFromMemory ( )
protected

Member Data Documentation

§ bHadMD5Anim

bool Assimp::MD5Importer::bHadMD5Anim
protected

true if a MD5ANIM file has already been parsed

§ bHadMD5Camera

bool Assimp::MD5Importer::bHadMD5Camera
protected

true if a MD5CAMERA file has already been parsed

§ bHadMD5Mesh

bool Assimp::MD5Importer::bHadMD5Mesh
protected

true if a MD5MESH file has already been parsed

§ configNoAutoLoad

bool Assimp::MD5Importer::configNoAutoLoad
protected

configuration option: prevent anim autoload

§ fileSize

unsigned int Assimp::MD5Importer::fileSize
protected

Size of the file.

§ iLineNumber

unsigned int Assimp::MD5Importer::iLineNumber
protected

Current line number.

For debugging purposes

§ mBuffer

char* Assimp::MD5Importer::mBuffer
protected

Buffer to hold the loaded file.

§ mFile

std::string Assimp::MD5Importer::mFile
protected

Path to the file, excluding the file extension but with the dot.

§ mIOHandler

IOSystem* Assimp::MD5Importer::mIOHandler
protected

IOSystem to be used to access files.

§ pIOHandler

IOSystem* Assimp::MD5Importer::pIOHandler
protected

(Custom) I/O handler implementation

§ pScene

aiScene* Assimp::MD5Importer::pScene
protected

Scene to be filled.


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