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 ()
 
ai_real 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::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::~XFileParser ( )

Destructor.

Destroys all imported data along with it

Member Function Documentation

◆ CheckForClosingBrace()

void XFileParser::CheckForClosingBrace ( )
protected

checks for closing curly brace, throws exception if not there

checks for closing curly brace

◆ CheckForSemicolon()

void XFileParser::CheckForSemicolon ( )
protected

checks for one following semicolon, throws exception if not there

checks for one following semicolon

◆ CheckForSeparator()

void XFileParser::CheckForSeparator ( )
protected

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

◆ FilterHierarchy()

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

◆ FindNextNoneWhiteSpace()

void XFileParser::FindNextNoneWhiteSpace ( )
protected

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

◆ GetImportedData()

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

Returns the temporary representation of the imported data.

◆ GetNextToken()

std::string XFileParser::GetNextToken ( )
protected

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

◆ GetNextTokenAsString()

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

reads a x file style string

◆ ParseDataObjectAnimation()

void XFileParser::ParseDataObjectAnimation ( XFile::Animation pAnim)
protected

◆ ParseDataObjectAnimationKey()

void XFileParser::ParseDataObjectAnimationKey ( XFile::AnimBone pAnimBone)
protected

◆ ParseDataObjectAnimationSet()

void XFileParser::ParseDataObjectAnimationSet ( )
protected

◆ ParseDataObjectAnimTicksPerSecond()

void XFileParser::ParseDataObjectAnimTicksPerSecond ( )
protected

◆ ParseDataObjectFrame()

void XFileParser::ParseDataObjectFrame ( XFile::Node pParent)
protected

◆ ParseDataObjectMaterial()

void XFileParser::ParseDataObjectMaterial ( XFile::Material pMaterial)
protected

◆ ParseDataObjectMesh()

void XFileParser::ParseDataObjectMesh ( XFile::Mesh pMesh)
protected

◆ ParseDataObjectMeshMaterialList()

void XFileParser::ParseDataObjectMeshMaterialList ( XFile::Mesh pMesh)
protected

◆ ParseDataObjectMeshNormals()

void XFileParser::ParseDataObjectMeshNormals ( XFile::Mesh pMesh)
protected

◆ ParseDataObjectMeshTextureCoords()

void XFileParser::ParseDataObjectMeshTextureCoords ( XFile::Mesh pMesh)
protected

◆ ParseDataObjectMeshVertexColors()

void XFileParser::ParseDataObjectMeshVertexColors ( XFile::Mesh pMesh)
protected

◆ ParseDataObjectSkinMeshHeader()

void XFileParser::ParseDataObjectSkinMeshHeader ( XFile::Mesh pMesh)
protected

◆ ParseDataObjectSkinWeights()

void XFileParser::ParseDataObjectSkinWeights ( XFile::Mesh pMesh)
protected

◆ ParseDataObjectTemplate()

void XFileParser::ParseDataObjectTemplate ( )
protected

◆ ParseDataObjectTextureFilename()

void XFileParser::ParseDataObjectTextureFilename ( std::string &  pName)
protected

◆ ParseDataObjectTransformationMatrix()

void XFileParser::ParseDataObjectTransformationMatrix ( aiMatrix4x4 pMatrix)
protected

◆ ParseFile()

void XFileParser::ParseFile ( )
protected

◆ ParseUnknownDataObject()

void XFileParser::ParseUnknownDataObject ( )
protected

◆ ReadBinDWord()

unsigned int XFileParser::ReadBinDWord ( )
protected

◆ ReadBinWord()

unsigned short XFileParser::ReadBinWord ( )
protected

◆ ReadFloat()

ai_real XFileParser::ReadFloat ( )
protected

◆ readHeadOfDataObject()

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

◆ ReadInt()

unsigned int XFileParser::ReadInt ( )
protected

◆ ReadRGB()

aiColor3D XFileParser::ReadRGB ( )
protected

◆ ReadRGBA()

aiColor4D XFileParser::ReadRGBA ( )
protected

◆ ReadUntilEndOfLine()

void XFileParser::ReadUntilEndOfLine ( )
protected

◆ ReadVector2()

aiVector2D XFileParser::ReadVector2 ( )
protected

◆ ReadVector3()

aiVector3D XFileParser::ReadVector3 ( )
protected

◆ TestForSeparator()

void XFileParser::TestForSeparator ( )
protected

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

◆ ThrowException()

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

◆ End

const char* Assimp::XFileParser::End
protected

◆ mBinaryFloatSize

unsigned int Assimp::XFileParser::mBinaryFloatSize
protected

float size in bytes, either 4 or 8

◆ mBinaryNumCount

unsigned int Assimp::XFileParser::mBinaryNumCount
protected

◆ mIsBinaryFormat

bool Assimp::XFileParser::mIsBinaryFormat
protected

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

◆ mLineNumber

unsigned int Assimp::XFileParser::mLineNumber
protected

Line number when reading in text format.

◆ mMajorVersion

unsigned int Assimp::XFileParser::mMajorVersion
protected

◆ mMinorVersion

unsigned int Assimp::XFileParser::mMinorVersion
protected

version numbers

◆ mScene

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

Imported data.

◆ P

const char* Assimp::XFileParser::P
protected

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