Assimp v5.2.2 (January 2022)
The Asset-Importer-Lib API documentation.
Assimp Namespace Reference

Some C++ utilities for inter- and extrapolation. More...

Namespaces

namespace  Base64
 
namespace  Formatter
 
namespace  Intern
 
namespace  Math
 
namespace  Profiling
 

Classes

struct  AttachmentInfo
 Helper data structure for SceneCombiner. More...
 
class  BaseImporter
 FOR IMPORTER PLUGINS ONLY: The BaseImporter defines a common interface for all importer worker classes. More...
 
class  Bitmap
 This class is used to store and write bitmap information. More...
 
class  BlobIOStream
 Redirect IOStream to a blob. More...
 
class  BlobIOSystem
 Redirect IOSystem to a blob. More...
 
struct  BoneWithHash
 Helper data structure for SceneCombiner::MergeBones. More...
 
class  ByteSwap
 Defines some useful byte order swap routines. More...
 
class  CommentRemover
 Helper class to remove single and multi line comments from a file. More...
 
class  DefaultIOStream
 Default IO implementation, use standard IO operations. More...
 
class  DefaultIOSystem
 Default implementation of IOSystem using the standard C file functions. More...
 
class  DefaultLogger
 CPP-API: Primary logging facility of Assimp. More...
 
class  Exporter
 
class  ExportProperties
 
struct  find_node_by_name_predicate
 Will find a node by its name. More...
 
class  Importer
 CPP-API: The Importer class forms an C++ interface to the functionality of the Open Asset Import Library. More...
 
struct  Interpolator
 CPP-API: Utility class to simplify interpolations of various data types. More...
 
class  IOStream
 CPP-API: Class to handle file I/O for C++. More...
 
class  IOStreamBuffer
 Implementation of a cached stream buffer. More...
 
class  IOSystem
 CPP-API: Interface to the file system. More...
 
class  LineSplitter
 Usage: More...
 
class  LogFunctions
 Logger class, which will extend the class by log-functions. More...
 
class  Logger
 CPP-API: Abstract interface for logger implementations. More...
 
class  LogStream
 CPP-API: Abstract interface for log stream implementations. More...
 
class  MemoryIOStream
 Implementation of IOStream to read directly from a memory buffer. More...
 
class  MemoryIOSystem
 Dummy IO system to read from a memory buffer. More...
 
struct  NodeAttachmentInfo
 
struct  NodeConverter
 Will convert an attribute to its int value. More...
 
class  NullLogger
 CPP-API: Empty logging implementation. More...
 
class  ProgressHandler
 CPP-API: Abstract interface for custom progress report receivers. More...
 
class  SceneCombiner
 Static helper class providing various utilities to merge two scenes. More...
 
struct  SceneHelper
 Utility for SceneCombiner. More...
 
class  SGSpatialSort
 Specialized version of SpatialSort to support smoothing groups This is used in by the 3DS, ASE and LWO loaders. More...
 
class  SkeletonMeshBuilder
 This little helper class constructs a dummy mesh for a given scene the resembles the node hierarchy. More...
 
class  SmallVector
 Small vector with inplace storage. More...
 
class  SpatialSort
 A little helper class to quickly find all vertices in the epsilon environment of a given position. More...
 
class  StandardShapes
 Helper class to generate vertex buffers for standard geometric shapes, such as cylinders, cones, boxes, spheres, elipsoids ... . More...
 
class  StreamReader
 Wrapper class around IOStream to allow for consistent reading of binary data in both little and big endian format. More...
 
class  StreamWriter
 Wrapper class around IOStream to allow for consistent writing of binary data in both little and big endian format. More...
 
class  Subdivider
 Helper class to evaluate subdivision surfaces. More...
 
class  TXmlParser
 The Xml-Parser class. More...
 
class  Vertex
 Intermediate description a vertex with all possible components. More...
 
class  XmlNodeIterator
 This class declares an iterator to loop through all children of the root node. More...
 
class  ZipArchiveIOSystem
 

Typedefs

typedef std::pair< aiBone *, unsigned int > BoneSrcIndex
 
typedef StreamReader< true, true > StreamReaderAny
 
typedef StreamReader< true > StreamReaderBE
 
typedef StreamReader< false > StreamReaderLE
 
typedef StreamWriter< true, true > StreamWriterAny
 
typedef StreamWriter< true > StreamWriterBE
 
typedef StreamWriter< false > StreamWriterLE
 
using XmlAttribute = pugi::xml_attribute
 
using XmlNode = pugi::xml_node
 
using XmlParser = TXmlParser< pugi::xml_node >
 

Functions

std::string ai_stdStrToLower (const std::string &str)
 
ASSIMP_API aiAnimMeshaiCreateAnimMesh (const aiMesh *mesh, bool needPositions=true, bool needNormals=true, bool needTangents=true, bool needColors=true, bool needTexCoords=true)
 Create aiAnimMesh from aiMesh. More...
 
unsigned int ASSIMP_itoa10 (char *out, unsigned int max, int32_t number)
 itoa with a fixed base 10 'itoa' is not consistently available on all platforms so it is quite useful to have a small replacement function here. More...
 
template<size_t length>
unsigned int ASSIMP_itoa10 (char(&out)[length], int32_t number)
 itoa with a fixed base 10 (Secure template overload) The compiler should choose this function if he or she is able to determine the size of the array automatically. More...
 
int ASSIMP_stricmp (const char *s1, const char *s2)
 Helper function to do platform independent string comparison. More...
 
int ASSIMP_stricmp (const std::string &a, const std::string &b)
 Case independent comparison of two std::strings. More...
 
int ASSIMP_strincmp (const char *s1, const char *s2, unsigned int n)
 Helper function to do platform independent string comparison. More...
 
template<typename ExceptionType = DeadlyImportError>
ai_real fast_atof (const char **inout)
 
template<typename ExceptionType = DeadlyImportError>
ai_real fast_atof (const char *c)
 
template<typename ExceptionType = DeadlyImportError>
ai_real fast_atof (const char *c, const char **cout)
 
template<typename Real , typename ExceptionType = DeadlyImportError>
const char * fast_atoreal_move (const char *c, Real &out, bool check_comma=true)
 Provides a fast function for converting a string into a float, about 6 times faster than atof in win32. More...
 
template<class char_t >
AI_FORCE_INLINE bool GetNextLine (const char_t *&buffer, char_t out[BufferSize])
 
AI_FORCE_INLINE std::string GetNextToken (const char *&in)
 
unsigned int HexDigitToDecimal (char in)
 
uint8_t HexOctetToDecimal (const char *in)
 
unsigned int integer_pow (unsigned int base, unsigned int power)
 Evaluates an integer power. More...
 
static AI_FORCE_INLINE bool isEndOfCache (size_t pos, size_t cacheSize)
 
template<class char_t >
AI_FORCE_INLINE bool IsLineEnd (char_t in)
 
template<class char_t >
AI_FORCE_INLINE bool IsLower (char_t in)
 
template<class char_t >
AI_FORCE_INLINE bool IsNumeric (char_t in)
 
template<class char_t >
AI_FORCE_INLINE bool IsSpace (char_t in)
 
template<class char_t >
AI_FORCE_INLINE bool IsSpaceOrNewLine (char_t in)
 
template<class char_t >
AI_FORCE_INLINE bool IsUpper (char_t in)
 
AI_FORCE_INLINE Vertex operator* (ai_real f, const Vertex &v0)
 
AI_FORCE_INLINE Vertex operator* (const Vertex &v0, ai_real f)
 
AI_FORCE_INLINE Vertex operator+ (const Vertex &v0, const Vertex &v1)
 
AI_FORCE_INLINE Vertex operator- (const Vertex &v0, const Vertex &v1)
 
AI_FORCE_INLINE Vertex operator/ (const Vertex &v0, ai_real f)
 
template<class char_t >
AI_FORCE_INLINE bool SkipLine (const char_t **inout)
 
template<class char_t >
AI_FORCE_INLINE bool SkipLine (const char_t *in, const char_t **out)
 
template<class char_t >
AI_FORCE_INLINE bool SkipSpaces (const char_t **inout)
 
template<class char_t >
AI_FORCE_INLINE bool SkipSpaces (const char_t *in, const char_t **out)
 
template<class char_t >
AI_FORCE_INLINE bool SkipSpacesAndLineEnd (const char_t **inout)
 
template<class char_t >
AI_FORCE_INLINE bool SkipSpacesAndLineEnd (const char_t *in, const char_t **out)
 
AI_FORCE_INLINE void SkipToken (const char *&in)
 
int strtol10 (const char *in, const char **out=0)
 
template<typename ExceptionType = DeadlyImportError>
int64_t strtol10_64 (const char *in, const char **out=0, unsigned int *max_inout=0)
 
unsigned int strtoul10 (const char *in, const char **out=0)
 
template<typename ExceptionType = DeadlyImportError>
uint64_t strtoul10_64 (const char *in, const char **out=0, unsigned int *max_inout=0)
 
unsigned int strtoul16 (const char *in, const char **out=0)
 
unsigned int strtoul8 (const char *in, const char **out=0)
 
unsigned int strtoul_cppstyle (const char *in, const char **out=0)
 
template<class string_type >
AI_FORCE_INLINE unsigned int tokenize (const string_type &str, std::vector< string_type > &tokens, const string_type &delimiters)
 Will perform a simple tokenize. More...
 
template<class char_t >
AI_FORCE_INLINE bool TokenMatch (char_t *&in, const char *token, unsigned int len)
 
AI_FORCE_INLINE bool TokenMatchI (const char *&in, const char *token, unsigned int len)
 Case-ignoring version of TokenMatch. More...
 
std::string XMLEscape (const std::string &data)
 

Variables

static const unsigned int BufferSize = 4096
 
class ASSIMP_API ExportProperties
 CPP-API: The Exporter class forms an C++ interface to the export functionality of the Open Asset Import Library. More...
 
const double fast_atof_table [16]
 

Detailed Description

Some C++ utilities for inter- and extrapolation.

Assimp's CPP-API and all internal APIs.

Typedef Documentation

◆ BoneSrcIndex

typedef std::pair<aiBone *, unsigned int> Assimp::BoneSrcIndex

◆ StreamReaderAny

◆ StreamReaderBE

◆ StreamReaderLE

◆ StreamWriterAny

◆ StreamWriterBE

◆ StreamWriterLE

◆ XmlAttribute

using Assimp::XmlAttribute = typedef pugi::xml_attribute

◆ XmlNode

using Assimp::XmlNode = typedef pugi::xml_node

◆ XmlParser

using Assimp::XmlParser = typedef TXmlParser<pugi::xml_node>

Function Documentation

◆ ai_stdStrToLower()

std::string Assimp::ai_stdStrToLower ( const std::string &  str)
inline

◆ aiCreateAnimMesh()

ASSIMP_API aiAnimMesh * Assimp::aiCreateAnimMesh ( const aiMesh mesh,
bool  needPositions = true,
bool  needNormals = true,
bool  needTangents = true,
bool  needColors = true,
bool  needTexCoords = true 
)

Create aiAnimMesh from aiMesh.

Parameters
meshThe input mesh to create an animated mesh from.
needPositionsIf true, positions will be copied from.
needNormalsIf true, normals will be copied from.
needTangentsIf true, tangents and bitangents will be copied from.
needColorsIf true, colors will be copied from.
needTexCoordsIf true, texCoords will be copied from.
Returns
The new created animated mesh.

◆ ASSIMP_itoa10() [1/2]

unsigned int Assimp::ASSIMP_itoa10 ( char *  out,
unsigned int  max,
int32_t  number 
)
inline

itoa with a fixed base 10 'itoa' is not consistently available on all platforms so it is quite useful to have a small replacement function here.

No need to use a full sprintf() if we just want to print a number ...

Parameters
outOutput buffer
maxMaximum number of characters to be written, including '\0'. This parameter may not be 0.
numberNumber to be written
Returns
Length of the output string, excluding the '\0'

◆ ASSIMP_itoa10() [2/2]

template<size_t length>
unsigned int Assimp::ASSIMP_itoa10 ( char(&)  out[length],
int32_t  number 
)
inline

itoa with a fixed base 10 (Secure template overload) The compiler should choose this function if he or she is able to determine the size of the array automatically.

◆ ASSIMP_stricmp() [1/2]

int Assimp::ASSIMP_stricmp ( const char *  s1,
const char *  s2 
)
inline

Helper function to do platform independent string comparison.

This is required since stricmp() is not consistently available on all platforms. Some platforms use the '_' prefix, others don't even have such a function.

Parameters
s1First input string
s2Second input string
Returns
0 if the given strings are identical

◆ ASSIMP_stricmp() [2/2]

int Assimp::ASSIMP_stricmp ( const std::string &  a,
const std::string &  b 
)
inline

Case independent comparison of two std::strings.

Parameters
aFirst string
bSecond string
Returns
0 if a == b

◆ ASSIMP_strincmp()

int Assimp::ASSIMP_strincmp ( const char *  s1,
const char *  s2,
unsigned int  n 
)
inline

Helper function to do platform independent string comparison.

This is required since strincmp() is not consistently available on all platforms. Some platforms use the '_' prefix, others don't even have such a function.

Parameters
s1First input string
s2Second input string
nMaximum number of characters to compare
Returns
0 if the given strings are identical

◆ fast_atof() [1/3]

template<typename ExceptionType = DeadlyImportError>
ai_real Assimp::fast_atof ( const char **  inout)
inline

◆ fast_atof() [2/3]

template<typename ExceptionType = DeadlyImportError>
ai_real Assimp::fast_atof ( const char *  c)
inline

◆ fast_atof() [3/3]

template<typename ExceptionType = DeadlyImportError>
ai_real Assimp::fast_atof ( const char *  c,
const char **  cout 
)
inline

◆ fast_atoreal_move()

template<typename Real , typename ExceptionType = DeadlyImportError>
const char * Assimp::fast_atoreal_move ( const char *  c,
Real &  out,
bool  check_comma = true 
)
inline

Provides a fast function for converting a string into a float, about 6 times faster than atof in win32.

◆ GetNextLine()

template<class char_t >
AI_FORCE_INLINE bool Assimp::GetNextLine ( const char_t *&  buffer,
char_t  out[BufferSize] 
)

◆ GetNextToken()

AI_FORCE_INLINE std::string Assimp::GetNextToken ( const char *&  in)

◆ HexDigitToDecimal()

unsigned int Assimp::HexDigitToDecimal ( char  in)
inline

◆ HexOctetToDecimal()

uint8_t Assimp::HexOctetToDecimal ( const char *  in)
inline

◆ integer_pow()

unsigned int Assimp::integer_pow ( unsigned int  base,
unsigned int  power 
)
inline

Evaluates an integer power.

todo: move somewhere where it fits better in than here

◆ isEndOfCache()

static AI_FORCE_INLINE bool Assimp::isEndOfCache ( size_t  pos,
size_t  cacheSize 
)
static

◆ IsLineEnd()

template<class char_t >
AI_FORCE_INLINE bool Assimp::IsLineEnd ( char_t  in)

◆ IsLower()

template<class char_t >
AI_FORCE_INLINE bool Assimp::IsLower ( char_t  in)

◆ IsNumeric()

template<class char_t >
AI_FORCE_INLINE bool Assimp::IsNumeric ( char_t  in)

◆ IsSpace()

template<class char_t >
AI_FORCE_INLINE bool Assimp::IsSpace ( char_t  in)

◆ IsSpaceOrNewLine()

template<class char_t >
AI_FORCE_INLINE bool Assimp::IsSpaceOrNewLine ( char_t  in)

◆ IsUpper()

template<class char_t >
AI_FORCE_INLINE bool Assimp::IsUpper ( char_t  in)

◆ operator*() [1/2]

AI_FORCE_INLINE Vertex Assimp::operator* ( ai_real  f,
const Vertex v0 
)

◆ operator*() [2/2]

AI_FORCE_INLINE Vertex Assimp::operator* ( const Vertex v0,
ai_real  f 
)

◆ operator+()

AI_FORCE_INLINE Vertex Assimp::operator+ ( const Vertex v0,
const Vertex v1 
)

◆ operator-()

AI_FORCE_INLINE Vertex Assimp::operator- ( const Vertex v0,
const Vertex v1 
)

◆ operator/()

AI_FORCE_INLINE Vertex Assimp::operator/ ( const Vertex v0,
ai_real  f 
)

◆ SkipLine() [1/2]

template<class char_t >
AI_FORCE_INLINE bool Assimp::SkipLine ( const char_t **  inout)

◆ SkipLine() [2/2]

template<class char_t >
AI_FORCE_INLINE bool Assimp::SkipLine ( const char_t *  in,
const char_t **  out 
)

◆ SkipSpaces() [1/2]

template<class char_t >
AI_FORCE_INLINE bool Assimp::SkipSpaces ( const char_t **  inout)

◆ SkipSpaces() [2/2]

template<class char_t >
AI_FORCE_INLINE bool Assimp::SkipSpaces ( const char_t *  in,
const char_t **  out 
)

◆ SkipSpacesAndLineEnd() [1/2]

template<class char_t >
AI_FORCE_INLINE bool Assimp::SkipSpacesAndLineEnd ( const char_t **  inout)

◆ SkipSpacesAndLineEnd() [2/2]

template<class char_t >
AI_FORCE_INLINE bool Assimp::SkipSpacesAndLineEnd ( const char_t *  in,
const char_t **  out 
)

◆ SkipToken()

AI_FORCE_INLINE void Assimp::SkipToken ( const char *&  in)

◆ strtol10()

int Assimp::strtol10 ( const char *  in,
const char **  out = 0 
)
inline

◆ strtol10_64()

template<typename ExceptionType = DeadlyImportError>
int64_t Assimp::strtol10_64 ( const char *  in,
const char **  out = 0,
unsigned int *  max_inout = 0 
)
inline

◆ strtoul10()

unsigned int Assimp::strtoul10 ( const char *  in,
const char **  out = 0 
)
inline

◆ strtoul10_64()

template<typename ExceptionType = DeadlyImportError>
uint64_t Assimp::strtoul10_64 ( const char *  in,
const char **  out = 0,
unsigned int *  max_inout = 0 
)
inline

◆ strtoul16()

unsigned int Assimp::strtoul16 ( const char *  in,
const char **  out = 0 
)
inline

◆ strtoul8()

unsigned int Assimp::strtoul8 ( const char *  in,
const char **  out = 0 
)
inline

◆ strtoul_cppstyle()

unsigned int Assimp::strtoul_cppstyle ( const char *  in,
const char **  out = 0 
)
inline

◆ tokenize()

template<class string_type >
AI_FORCE_INLINE unsigned int Assimp::tokenize ( const string_type &  str,
std::vector< string_type > &  tokens,
const string_type &  delimiters 
)

Will perform a simple tokenize.

Parameters
strString to tokenize.
tokensArray with tokens, will be empty if no token was found.
delimitersDelimiter for tokenize.
Returns
Number of found token.

◆ TokenMatch()

template<class char_t >
AI_FORCE_INLINE bool Assimp::TokenMatch ( char_t *&  in,
const char *  token,
unsigned int  len 
)

◆ TokenMatchI()

AI_FORCE_INLINE bool Assimp::TokenMatchI ( const char *&  in,
const char *  token,
unsigned int  len 
)

Case-ignoring version of TokenMatch.

Parameters
inInput
tokenToken to check for
lenNumber of characters to check

◆ XMLEscape()

std::string Assimp::XMLEscape ( const std::string &  data)

Variable Documentation

◆ BufferSize

const unsigned int Assimp::BufferSize = 4096
static

◆ ExportProperties

CPP-API: The Exporter class forms an C++ interface to the export functionality of the Open Asset Import Library.

Note that the export interface is available only if Assimp has been built with ASSIMP_BUILD_NO_EXPORT not defined.

The interface is modeled after the importer interface and mostly symmetric. The same rules for threading etc. apply.

In a nutshell, there are two export interfaces: #Export, which writes the output file(s) either to the regular file system or to a user-supplied #IOSystem, and #ExportToBlob which returns a linked list of memory buffers (blob), each referring to one output file (in most cases there will be only one output file of course, but this extra complexity is needed since Assimp aims at supporting a wide range of file formats).

#ExportToBlob is especially useful if you intend to work with the data in-memory.

◆ fast_atof_table

const double Assimp::fast_atof_table[16]
Initial value:
= {
0.0,
0.1,
0.01,
0.001,
0.0001,
0.00001,
0.000001,
0.0000001,
0.00000001,
0.000000001,
0.0000000001,
0.00000000001,
0.000000000001,
0.0000000000001,
0.00000000000001,
0.000000000000001
}