Assimp  v4.1. (December 2018)
Assimp::BVHLoader Class Reference

Loader class to read Motion Capturing data from a .bvh file. More...

Inherits Assimp::BaseImporter.

Public Member Functions

 BVHLoader ()
 
bool CanRead (const std::string &pFile, IOSystem *pIOHandler, bool cs) const
 Returns whether the class can handle the format of the given file. More...
 
const aiImporterDescGetInfo () const
 Called by #Importer::GetImporterInfo to get a description of some loader features. More...
 
void SetupProperties (const Importer *pImp)
 Called prior to ReadFile(). More...
 
 ~BVHLoader ()
 
- 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 CreateAnimation (aiScene *pScene)
 Constructs an animation for the motion data and stores it in the given scene. More...
 
std::string GetNextToken ()
 Retrieves the next token. More...
 
float GetNextTokenAsFloat ()
 Reads the next token as a float. More...
 
void InternReadFile (const std::string &pFile, aiScene *pScene, IOSystem *pIOHandler)
 Imports the given file into the given scene structure. More...
 
aiNodeReadEndSite (const std::string &pParentName)
 Reads an end node and returns the created node. More...
 
void ReadHierarchy (aiScene *pScene)
 Reads the hierarchy. More...
 
void ReadMotion (aiScene *pScene)
 Reads the motion data. More...
 
aiNodeReadNode ()
 Reads a node and recursively its childs and returns the created node. More...
 
void ReadNodeChannels (BVHLoader::Node &pNode)
 Reads the animation channels into the given node. More...
 
void ReadNodeOffset (aiNode *pNode)
 Reads a node offset for the given node. More...
 
void ReadStructure (aiScene *pScene)
 Reads the file. More...
 
AI_WONT_RETURN void ThrowException (const std::string &pError) AI_WONT_RETURN_SUFFIX
 Aborts the file reading with an exception. More...
 

Protected Attributes

unsigned int mAnimNumFrames
 
float mAnimTickDuration
 basic Animation parameters More...
 
std::vector< char > mBuffer
 Buffer to hold the loaded file. More...
 
std::string mFileName
 Filename, for a verbose error message. More...
 
unsigned int mLine
 Current line, for error messages. More...
 
std::vector< Node > mNodes
 Collected list of nodes. More...
 
std::vector< char >::const_iterator mReader
 Next char to read from the buffer. More...
 
bool noSkeletonMesh
 
- 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 }
 Enum to define, if empty files are ok or not. More...
 
- 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

Loader class to read Motion Capturing data from a .bvh file.

This format only contains a hierarchy of joints and a series of keyframes for the hierarchy. It contains no actual mesh data, but we generate a dummy mesh inside the loader just to be able to see something.

Constructor & Destructor Documentation

◆ BVHLoader()

BVHLoader::BVHLoader ( )

◆ ~BVHLoader()

BVHLoader::~BVHLoader ( )

Member Function Documentation

◆ CanRead()

bool BVHLoader::CanRead ( const std::string &  pFile,
IOSystem pIOHandler,
bool  cs 
) const
virtual

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

See BaseImporter::CanRead() for details.

Implements Assimp::BaseImporter.

◆ CreateAnimation()

void BVHLoader::CreateAnimation ( aiScene pScene)
protected

Constructs an animation for the motion data and stores it in the given scene.

◆ GetInfo()

const aiImporterDesc * BVHLoader::GetInfo ( ) const
virtual

Called by #Importer::GetImporterInfo to get a description of some loader features.

Importers must provide this information.

Implements Assimp::BaseImporter.

◆ GetNextToken()

std::string BVHLoader::GetNextToken ( )
protected

Retrieves the next token.

◆ GetNextTokenAsFloat()

float BVHLoader::GetNextTokenAsFloat ( )
protected

Reads the next token as a float.

◆ InternReadFile()

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

◆ ReadEndSite()

aiNode * BVHLoader::ReadEndSite ( const std::string &  pParentName)
protected

Reads an end node and returns the created node.

◆ ReadHierarchy()

void BVHLoader::ReadHierarchy ( aiScene pScene)
protected

Reads the hierarchy.

◆ ReadMotion()

void BVHLoader::ReadMotion ( aiScene pScene)
protected

Reads the motion data.

◆ ReadNode()

aiNode * BVHLoader::ReadNode ( )
protected

Reads a node and recursively its childs and returns the created node.

◆ ReadNodeChannels()

void BVHLoader::ReadNodeChannels ( BVHLoader::Node &  pNode)
protected

Reads the animation channels into the given node.

◆ ReadNodeOffset()

void BVHLoader::ReadNodeOffset ( aiNode pNode)
protected

Reads a node offset for the given node.

◆ ReadStructure()

void BVHLoader::ReadStructure ( aiScene pScene)
protected

Reads the file.

◆ SetupProperties()

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

Parameters
pImpImporter instance

Reimplemented from Assimp::BaseImporter.

◆ ThrowException()

AI_WONT_RETURN void BVHLoader::ThrowException ( const std::string &  pError)
protected

Aborts the file reading with an exception.

Member Data Documentation

◆ mAnimNumFrames

unsigned int Assimp::BVHLoader::mAnimNumFrames
protected

◆ mAnimTickDuration

float Assimp::BVHLoader::mAnimTickDuration
protected

basic Animation parameters

◆ mBuffer

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

Buffer to hold the loaded file.

◆ mFileName

std::string Assimp::BVHLoader::mFileName
protected

Filename, for a verbose error message.

◆ mLine

unsigned int Assimp::BVHLoader::mLine
protected

Current line, for error messages.

◆ mNodes

std::vector<Node> Assimp::BVHLoader::mNodes
protected

Collected list of nodes.

Will be bones of the dummy mesh some day, addressed by their array index. Also contain the motion data for the node's channels

◆ mReader

std::vector<char>::const_iterator Assimp::BVHLoader::mReader
protected

Next char to read from the buffer.

◆ noSkeletonMesh

bool Assimp::BVHLoader::noSkeletonMesh
protected

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