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

namespace SMD 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...
 
void SetupProperties (const Importer *pImp)
 Called prior to ReadFile(). More...
 
 SMDImporter ()
 
 ~SMDImporter ()
 
- 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 AddBoneChildren (aiNode *pcNode, uint32_t iParent)
 Add all children of a bone as subnodes to a node. More...
 
void ComputeAbsoluteBoneTransformations ()
 Computes absolute bone transformations All output transformations are in worldspace. More...
 
void CreateOutputAnimations ()
 
void CreateOutputMaterials ()
 
void CreateOutputMeshes ()
 Build output meshes/materials/nodes/animations. More...
 
void CreateOutputNodes ()
 
void FixTimeValues ()
 Fix invalid time values in the file. More...
 
const aiImporterDescGetInfo () const
 Return importer meta information. More...
 
unsigned int GetTextureIndex (const std::string &filename)
 Get the index of a texture. More...
 
void InternReadFile (const std::string &pFile, aiScene *pScene, IOSystem *pIOHandler)
 Imports the given file into the given scene structure. More...
 
void LogErrorNoThrow (const char *msg)
 Print a log message together with the current line number. More...
 
void LogWarning (const char *msg)
 
void ParseFile ()
 Parse the SMD file and create the output scene. More...
 
bool ParseFloat (const char *szCurrent, const char **szCurrentOut, float &out)
 Parse a floating-point value. More...
 
void ParseNodeInfo (const char *szCurrent, const char **szCurrentOut)
 Parse a line in the nodes section. More...
 
void ParseNodesSection (const char *szCurrent, const char **szCurrentOut)
 Parse the nodes section of the SMD file. More...
 
bool ParseSignedInt (const char *szCurrent, const char **szCurrentOut, int &out)
 Parse a signed integer. More...
 
void ParseSkeletonElement (const char *szCurrent, const char **szCurrentOut, int iTime)
 Parse a line in the skeleton section. More...
 
void ParseSkeletonSection (const char *szCurrent, const char **szCurrentOut)
 Parse the skeleton section of the SMD file. More...
 
void ParseTriangle (const char *szCurrent, const char **szCurrentOut)
 Parse a single triangle in the SMD file. More...
 
void ParseTrianglesSection (const char *szCurrent, const char **szCurrentOut)
 Parse the triangles section of the SMD file. More...
 
bool ParseUnsignedInt (const char *szCurrent, const char **szCurrentOut, unsigned int &out)
 Parse an unsigned integer. More...
 
void ParseVASection (const char *szCurrent, const char **szCurrentOut)
 Parse the vertex animation section in VTA files. More...
 
void ParseVertex (const char *szCurrent, const char **szCurrentOut, SMD::Vertex &vertex, bool bVASection=false)
 Parse a single vertex in the SMD file. More...
 
bool SkipLine (const char *in, const char **out)
 
bool SkipSpacesAndLineEnd (const char *in, const char **out)
 

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...
 
- 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...
 

Detailed Description

namespace SMD

Used to load Half-life 1 and 2 SMD models

Constructor & Destructor Documentation

◆ SMDImporter()

SMDImporter::SMDImporter ( )

◆ ~SMDImporter()

SMDImporter::~SMDImporter ( )

Member Function Documentation

◆ AddBoneChildren()

void SMDImporter::AddBoneChildren ( aiNode pcNode,
uint32_t  iParent 
)
protected

Add all children of a bone as subnodes to a node.

Parameters
pcNodeParent node
iParentParent bone index

◆ CanRead()

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

◆ ComputeAbsoluteBoneTransformations()

void SMDImporter::ComputeAbsoluteBoneTransformations ( )
protected

Computes absolute bone transformations All output transformations are in worldspace.

◆ CreateOutputAnimations()

void SMDImporter::CreateOutputAnimations ( )
protected

◆ CreateOutputMaterials()

void SMDImporter::CreateOutputMaterials ( )
protected

◆ CreateOutputMeshes()

void SMDImporter::CreateOutputMeshes ( )
protected

Build output meshes/materials/nodes/animations.

◆ CreateOutputNodes()

void SMDImporter::CreateOutputNodes ( )
protected

◆ FixTimeValues()

void SMDImporter::FixTimeValues ( )
protected

Fix invalid time values in the file.

◆ GetInfo()

const aiImporterDesc * SMDImporter::GetInfo ( ) const
protectedvirtual

Return importer meta information.

See #BaseImporter::GetInfo for the details

Implements Assimp::BaseImporter.

◆ GetTextureIndex()

unsigned int SMDImporter::GetTextureIndex ( const std::string &  filename)
protected

Get the index of a texture.

If the texture was not yet known it will be added to the internal texture list.

Parameters
filenameName of the texture
Returns
Value texture index

◆ InternReadFile()

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

◆ LogErrorNoThrow()

void SMDImporter::LogErrorNoThrow ( const char *  msg)
protected

Print a log message together with the current line number.

◆ LogWarning()

void SMDImporter::LogWarning ( const char *  msg)
protected

◆ ParseFile()

void SMDImporter::ParseFile ( )
protected

Parse the SMD file and create the output scene.

◆ ParseFloat()

bool SMDImporter::ParseFloat ( const char *  szCurrent,
const char **  szCurrentOut,
float &  out 
)
protected

Parse a floating-point value.

◆ ParseNodeInfo()

void SMDImporter::ParseNodeInfo ( const char *  szCurrent,
const char **  szCurrentOut 
)
protected

Parse a line in the nodes section.

◆ ParseNodesSection()

void SMDImporter::ParseNodesSection ( const char *  szCurrent,
const char **  szCurrentOut 
)
protected

Parse the nodes section of the SMD file.

Parameters
szCurrentCurrent position in the file. Points to the first data line of the section.
szCurrentOutReceives a pointer to the heading line of the next section (or to EOF)

◆ ParseSignedInt()

bool SMDImporter::ParseSignedInt ( const char *  szCurrent,
const char **  szCurrentOut,
int &  out 
)
protected

Parse a signed integer.

Signs (+,-) are handled.

◆ ParseSkeletonElement()

void SMDImporter::ParseSkeletonElement ( const char *  szCurrent,
const char **  szCurrentOut,
int  iTime 
)
protected

Parse a line in the skeleton section.

◆ ParseSkeletonSection()

void SMDImporter::ParseSkeletonSection ( const char *  szCurrent,
const char **  szCurrentOut 
)
protected

Parse the skeleton section of the SMD file.

Parameters
szCurrentCurrent position in the file. Points to the first data line of the section.
szCurrentOutReceives a pointer to the heading line of the next section (or to EOF)

◆ ParseTriangle()

void SMDImporter::ParseTriangle ( const char *  szCurrent,
const char **  szCurrentOut 
)
protected

Parse a single triangle in the SMD file.

Parameters
szCurrentCurrent position in the file. Points to the first data line of the section.
szCurrentOutReceives the output cursor position

◆ ParseTrianglesSection()

void SMDImporter::ParseTrianglesSection ( const char *  szCurrent,
const char **  szCurrentOut 
)
protected

Parse the triangles section of the SMD file.

Parameters
szCurrentCurrent position in the file. Points to the first data line of the section.
szCurrentOutReceives a pointer to the heading line of the next section (or to EOF)

◆ ParseUnsignedInt()

bool SMDImporter::ParseUnsignedInt ( const char *  szCurrent,
const char **  szCurrentOut,
unsigned int &  out 
)
protected

Parse an unsigned integer.

There may be no sign!

◆ ParseVASection()

void SMDImporter::ParseVASection ( const char *  szCurrent,
const char **  szCurrentOut 
)
protected

Parse the vertex animation section in VTA files.

Parameters
szCurrentCurrent position in the file. Points to the first data line of the section.
szCurrentOutReceives a pointer to the heading line of the next section (or to EOF)

◆ ParseVertex()

void SMDImporter::ParseVertex ( const char *  szCurrent,
const char **  szCurrentOut,
SMD::Vertex vertex,
bool  bVASection = false 
)
protected

Parse a single vertex in the SMD file.

Parameters
szCurrentCurrent position in the file. Points to the first data line of the section.
szCurrentOutReceives the output cursor position
vertexVertex to be filled

◆ SetupProperties()

void SMDImporter::SetupProperties ( const Importer pImp)
virtual

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.

◆ SkipLine()

bool Assimp::SMDImporter::SkipLine ( const char *  in,
const char **  out 
)
inlineprotected

◆ SkipSpacesAndLineEnd()

bool Assimp::SMDImporter::SkipSpacesAndLineEnd ( const char *  in,
const char **  out 
)
inlineprotected

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