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

The XFileParser reads a XFile either in text or binary form and builds a temporary data structure out of it. More...

Public Member Functions

XFile::SceneGetImportedData () const
 Returns the temporary representation of the imported data. More...
 
 XFileParser (const std::vector< char > &pBuffer)
 Constructor. More...
 
 ~XFileParser ()
 Destructor. More...
 

Protected Member Functions

void CheckForClosingBrace ()
 checks for closing curly brace, throws exception if not there More...
 
void CheckForSemicolon ()
 checks for one following semicolon, throws exception if not there More...
 
void CheckForSeparator ()
 checks for a separator char, either a ',' or a ';' More...
 
void FilterHierarchy (XFile::Node *pNode)
 Filters the imported hierarchy for some degenerated cases that some exporters produce. More...
 
void FindNextNoneWhiteSpace ()
 places pointer to next begin of a token, and ignores comments More...
 
std::string GetNextToken ()
 returns next parseable token. Returns empty string if no token there More...
 
void GetNextTokenAsString (std::string &poString)
 reads a x file style string More...
 
void ParseDataObjectAnimation (XFile::Animation *pAnim)
 
void ParseDataObjectAnimationKey (XFile::AnimBone *pAnimBone)
 
void ParseDataObjectAnimationSet ()
 
void ParseDataObjectAnimTicksPerSecond ()
 
void ParseDataObjectFrame (XFile::Node *pParent)
 
void ParseDataObjectMaterial (XFile::Material *pMaterial)
 
void ParseDataObjectMesh (XFile::Mesh *pMesh)
 
void ParseDataObjectMeshMaterialList (XFile::Mesh *pMesh)
 
void ParseDataObjectMeshNormals (XFile::Mesh *pMesh)
 
void ParseDataObjectMeshTextureCoords (XFile::Mesh *pMesh)
 
void ParseDataObjectMeshVertexColors (XFile::Mesh *pMesh)
 
void ParseDataObjectSkinMeshHeader (XFile::Mesh *pMesh)
 
void ParseDataObjectSkinWeights (XFile::Mesh *pMesh)
 
void ParseDataObjectTemplate ()
 
void ParseDataObjectTextureFilename (std::string &pName)
 
void ParseDataObjectTransformationMatrix (aiMatrix4x4 &pMatrix)
 
void ParseFile ()
 
void ParseUnknownDataObject ()
 
unsigned int ReadBinDWord ()
 
unsigned short ReadBinWord ()
 
float ReadFloat ()
 
void readHeadOfDataObject (std::string *poName=NULL)
 reads header of dataobject including the opening brace. More...
 
unsigned int ReadInt ()
 
aiColor3D ReadRGB ()
 
aiColor4D ReadRGBA ()
 
void ReadUntilEndOfLine ()
 
aiVector2D ReadVector2 ()
 
aiVector3D ReadVector3 ()
 
void TestForSeparator ()
 tests and possibly consumes a separator char, but does nothing if there was no separator More...
 
AI_WONT_RETURN void ThrowException (const std::string &pText) AI_WONT_RETURN_SUFFIX
 Throws an exception with a line number and the given text. More...
 

Protected Attributes

const char * End
 
unsigned int mBinaryFloatSize
 float size in bytes, either 4 or 8 More...
 
unsigned int mBinaryNumCount
 
bool mIsBinaryFormat
 true if the file is in binary, false if it's in text form More...
 
unsigned int mLineNumber
 Line number when reading in text format. More...
 
unsigned int mMajorVersion
 
unsigned int mMinorVersion
 version numbers More...
 
XFile::ScenemScene
 Imported data. More...
 
const char * P
 

Detailed Description

The XFileParser reads a XFile either in text or binary form and builds a temporary data structure out of it.

Constructor & Destructor Documentation

XFileParser::XFileParser ( const std::vector< char > &  pBuffer)
explicit

Constructor.

Creates a data structure out of the XFile given in the memory block.

Parameters
pBufferNull-terminated memory buffer containing the XFile
XFileParser::~XFileParser ( )

Destructor.

Destroys all imported data along with it

Member Function Documentation

void XFileParser::CheckForClosingBrace ( )
protected

checks for closing curly brace, throws exception if not there

checks for closing curly brace

void XFileParser::CheckForSemicolon ( )
protected

checks for one following semicolon, throws exception if not there

checks for one following semicolon

void XFileParser::CheckForSeparator ( )
protected

checks for a separator char, either a ',' or a ';'

void XFileParser::FilterHierarchy ( XFile::Node pNode)
protected

Filters the imported hierarchy for some degenerated cases that some exporters produce.

Parameters
pDataThe sub-hierarchy to filter
void XFileParser::FindNextNoneWhiteSpace ( )
protected

places pointer to next begin of a token, and ignores comments

XFile::Scene* Assimp::XFileParser::GetImportedData ( ) const
inline

Returns the temporary representation of the imported data.

std::string XFileParser::GetNextToken ( )
protected

returns next parseable token. Returns empty string if no token there

void XFileParser::GetNextTokenAsString ( std::string &  poString)
protected

reads a x file style string

void XFileParser::ParseDataObjectAnimation ( XFile::Animation pAnim)
protected
void XFileParser::ParseDataObjectAnimationKey ( XFile::AnimBone pAnimBone)
protected
void XFileParser::ParseDataObjectAnimationSet ( )
protected
void XFileParser::ParseDataObjectAnimTicksPerSecond ( )
protected
void XFileParser::ParseDataObjectFrame ( XFile::Node pParent)
protected
void XFileParser::ParseDataObjectMaterial ( XFile::Material pMaterial)
protected
void XFileParser::ParseDataObjectMesh ( XFile::Mesh pMesh)
protected
void XFileParser::ParseDataObjectMeshMaterialList ( XFile::Mesh pMesh)
protected
void XFileParser::ParseDataObjectMeshNormals ( XFile::Mesh pMesh)
protected
void XFileParser::ParseDataObjectMeshTextureCoords ( XFile::Mesh pMesh)
protected
void XFileParser::ParseDataObjectMeshVertexColors ( XFile::Mesh pMesh)
protected
void XFileParser::ParseDataObjectSkinMeshHeader ( XFile::Mesh pMesh)
protected
void XFileParser::ParseDataObjectSkinWeights ( XFile::Mesh pMesh)
protected
void XFileParser::ParseDataObjectTemplate ( )
protected
void XFileParser::ParseDataObjectTextureFilename ( std::string &  pName)
protected
void XFileParser::ParseDataObjectTransformationMatrix ( aiMatrix4x4 pMatrix)
protected
void XFileParser::ParseFile ( )
protected
void XFileParser::ParseUnknownDataObject ( )
protected
unsigned int XFileParser::ReadBinDWord ( )
protected
unsigned short XFileParser::ReadBinWord ( )
protected
float XFileParser::ReadFloat ( )
protected
void XFileParser::readHeadOfDataObject ( std::string *  poName = NULL)
protected

reads header of dataobject including the opening brace.

returns false if error happened, and writes name of object if there is one

unsigned int XFileParser::ReadInt ( )
protected
aiColor3D XFileParser::ReadRGB ( )
protected
aiColor4D XFileParser::ReadRGBA ( )
protected
void XFileParser::ReadUntilEndOfLine ( )
protected
aiVector2D XFileParser::ReadVector2 ( )
protected
aiVector3D XFileParser::ReadVector3 ( )
protected
void XFileParser::TestForSeparator ( )
protected

tests and possibly consumes a separator char, but does nothing if there was no separator

AI_WONT_RETURN void XFileParser::ThrowException ( const std::string &  pText)
protected

Throws an exception with a line number and the given text.

Member Data Documentation

const char* Assimp::XFileParser::End
protected
unsigned int Assimp::XFileParser::mBinaryFloatSize
protected

float size in bytes, either 4 or 8

unsigned int Assimp::XFileParser::mBinaryNumCount
protected
bool Assimp::XFileParser::mIsBinaryFormat
protected

true if the file is in binary, false if it's in text form

unsigned int Assimp::XFileParser::mLineNumber
protected

Line number when reading in text format.

unsigned int Assimp::XFileParser::mMajorVersion
protected
unsigned int Assimp::XFileParser::mMinorVersion
protected

version numbers

XFile::Scene* Assimp::XFileParser::mScene
protected

Imported data.

const char* Assimp::XFileParser::P
protected

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