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

The XFileImporter is a worker class capable of importing a scene from a DirectX file .x. 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...
 
 XFileImporter ()
 
 ~XFileImporter ()
 
- 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 void SetupProperties (const Importer *pImp)
 Called prior to ReadFile(). More...
 
virtual ~BaseImporter ()
 Destructor, private as well. More...
 

Protected Member Functions

void ConvertMaterials (aiScene *pScene, std::vector< XFile::Material > &pMaterials)
 Converts all materials in the given array and stores them in the scene's material list. More...
 
void CreateAnimations (aiScene *pScene, const XFile::Scene *pData)
 Converts the animations from the given imported data and creates them in the scene. More...
 
void CreateDataRepresentationFromImport (aiScene *pScene, XFile::Scene *pData)
 Constructs the return data structure out of the imported data. More...
 
void CreateMeshes (aiScene *pScene, aiNode *pNode, const std::vector< XFile::Mesh * > &pMeshes)
 Converts all meshes in the given mesh array. More...
 
aiNodeCreateNodes (aiScene *pScene, aiNode *pParent, const XFile::Node *pNode)
 Recursively creates scene nodes from the imported hierarchy. 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...
 

Protected Attributes

std::vector< char > mBuffer
 Buffer to hold the loaded file. 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

The XFileImporter is a worker class capable of importing a scene from a DirectX file .x.

Constructor & Destructor Documentation

◆ XFileImporter()

XFileImporter::XFileImporter ( )

◆ ~XFileImporter()

XFileImporter::~XFileImporter ( )

Member Function Documentation

◆ CanRead()

bool XFileImporter::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.

◆ ConvertMaterials()

void XFileImporter::ConvertMaterials ( aiScene pScene,
std::vector< XFile::Material > &  pMaterials 
)
protected

Converts all materials in the given array and stores them in the scene's material list.

Parameters
pSceneThe scene to hold the converted materials.
pMaterialsThe material array to convert.

◆ CreateAnimations()

void XFileImporter::CreateAnimations ( aiScene pScene,
const XFile::Scene pData 
)
protected

Converts the animations from the given imported data and creates them in the scene.

Parameters
pSceneThe scene to hold to converted animations
pDataThe data to read the animations from

◆ CreateDataRepresentationFromImport()

void XFileImporter::CreateDataRepresentationFromImport ( aiScene pScene,
XFile::Scene pData 
)
protected

Constructs the return data structure out of the imported data.

Parameters
pSceneThe scene to construct the return data in.
pDataThe imported data in the internal temporary representation.

◆ CreateMeshes()

void XFileImporter::CreateMeshes ( aiScene pScene,
aiNode pNode,
const std::vector< XFile::Mesh * > &  pMeshes 
)
protected

Converts all meshes in the given mesh array.

Each mesh is split up per material, the indices of the generated meshes are stored in the node structure.

Parameters
pSceneThe scene to construct the return data in.
pNodeThe target node structure that references the constructed meshes.
pMeshesThe array of meshes to convert

◆ CreateNodes()

aiNode * XFileImporter::CreateNodes ( aiScene pScene,
aiNode pParent,
const XFile::Node pNode 
)
protected

Recursively creates scene nodes from the imported hierarchy.

The meshes and materials of the nodes will be extracted on the way.

Parameters
pSceneThe scene to construct the return data in.
pParentThe parent node where to create new child nodes
pNodeThe temporary node to copy.
Returns
The created node

◆ GetInfo()

const aiImporterDesc * XFileImporter::GetInfo ( ) const
protectedvirtual

Return importer meta information.

See #BaseImporter::GetInfo for the details

Implements Assimp::BaseImporter.

◆ InternReadFile()

void XFileImporter::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.

Member Data Documentation

◆ mBuffer

std::vector<char> Assimp::XFileImporter::mBuffer
protected

Buffer to hold the loaded file.


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