Assimp
v3.1.1 (June 2014)
|
Implementation of the Plain-C API. More...
Classes | |
struct | Assimp::mpred |
Stores the LogStream objects for all active C log streams. More... | |
class | LogToCallbackRedirector |
Namespaces | |
Assimp | |
MACHINE-GENERATED by scripts/ICFImporter/CppGenerator.py. | |
Typedefs | |
typedef std::map< aiLogStream, Assimp::LogStream *, mpred > | Assimp::LogStreamMap |
typedef std::list < Assimp::LogStream * > | Assimp::PredefLogStreamMap |
Stores the LogStream objects allocated by aiGetPredefinedLogStream. More... | |
typedef BatchLoader::PropertyMap | Assimp::PropertyMap |
Functions | |
ASSIMP_API const aiScene * | aiApplyCustomizedPostProcessing (const aiScene *scene, BaseProcess *process, bool requestValidation) |
ASSIMP_API const aiScene * | aiApplyPostProcessing (const aiScene *pScene, unsigned int pFlags) |
Apply post-processing to an already-imported scene. More... | |
ASSIMP_API void | aiAttachLogStream (const aiLogStream *stream) |
Attach a custom log stream to the libraries' logging system. More... | |
ASSIMP_API aiPropertyStore * | aiCreatePropertyStore (void) |
Create an empty property store. More... | |
ASSIMP_API void | aiCreateQuaternionFromMatrix (aiQuaternion *quat, const aiMatrix3x3 *mat) |
Construct a quaternion from a 3x3 rotation matrix. More... | |
ASSIMP_API void | aiDecomposeMatrix (const aiMatrix4x4 *mat, aiVector3D *scaling, aiQuaternion *rotation, aiVector3D *position) |
Decompose a transformation matrix into its rotational, translational and scaling components. More... | |
ASSIMP_API void | aiDetachAllLogStreams (void) |
Detach all active log streams from the libraries' logging system. More... | |
ASSIMP_API aiReturn | aiDetachLogStream (const aiLogStream *stream) |
Detach a custom log stream from the libraries' logging system. More... | |
ASSIMP_API void | aiEnableVerboseLogging (aiBool d) |
Enable verbose logging. More... | |
const char * | aiGetErrorString () |
Returns the error text of the last failed import process. More... | |
void | aiGetExtensionList (aiString *szOut) |
Get a list of all file extensions supported by ASSIMP. More... | |
ASSIMP_API C_STRUCT const aiImporterDesc * | aiGetImporterDesc (const char *extension) |
Returns the Importer description for a given extension. More... | |
size_t | aiGetImportFormatCount (void) |
Returns the number of import file formats available in the current Assimp build. More... | |
const aiImporterDesc * | aiGetImportFormatDescription (size_t pIndex) |
Returns a description of the nth import file format. More... | |
void | aiGetMemoryRequirements (const C_STRUCT aiScene *pIn, C_STRUCT aiMemoryInfo *in) |
ASSIMP_API aiLogStream | aiGetPredefinedLogStream (aiDefaultLogStream pStream, const char *file) |
Get one of the predefine log streams. More... | |
ASSIMP_API void | aiIdentityMatrix3 (aiMatrix3x3 *mat) |
Get a 3x3 identity matrix. More... | |
ASSIMP_API void | aiIdentityMatrix4 (aiMatrix4x4 *mat) |
Get a 4x4 identity matrix. More... | |
const aiScene * | aiImportFile (const char *pFile, unsigned int pFlags) |
Reads the given file and returns its content. More... | |
const aiScene * | aiImportFileEx (const char *pFile, unsigned int pFlags, aiFileIO *pFS) |
Reads the given file using user-defined I/O functions and returns its content. More... | |
const aiScene * | aiImportFileExWithProperties (const char *pFile, unsigned int pFlags, aiFileIO *pFS, const aiPropertyStore *props) |
Same as aiImportFileEx, but adds an extra parameter containing importer settings. More... | |
const aiScene * | aiImportFileFromMemory (const char *pBuffer, unsigned int pLength, unsigned int pFlags, const char *pHint) |
Reads the given file from a given memory buffer,. More... | |
const aiScene * | aiImportFileFromMemoryWithProperties (const char *pBuffer, unsigned int pLength, unsigned int pFlags, const char *pHint, const aiPropertyStore *props) |
Same as aiImportFileFromMemory, but adds an extra parameter containing importer settings. More... | |
aiBool | aiIsExtensionSupported (const char *szExtension) |
Returns whether a given file extension is supported by ASSIMP. More... | |
ASSIMP_API void | aiMultiplyMatrix3 (aiMatrix3x3 *dst, const aiMatrix3x3 *src) |
Multiply two 3x3 matrices. More... | |
ASSIMP_API void | aiMultiplyMatrix4 (aiMatrix4x4 *dst, const aiMatrix4x4 *src) |
Multiply two 4x4 matrices. More... | |
void | aiReleaseImport (const aiScene *pScene) |
Releases all resources associated with the given import process. More... | |
ASSIMP_API void | aiReleasePropertyStore (aiPropertyStore *p) |
Delete a property store. More... | |
ASSIMP_API void | aiSetImportPropertyFloat (aiPropertyStore *p, const char *szName, float value) |
Set a floating-point property. More... | |
ASSIMP_API void | aiSetImportPropertyInteger (aiPropertyStore *p, const char *szName, int value) |
Set an integer property. More... | |
ASSIMP_API void | aiSetImportPropertyMatrix (aiPropertyStore *p, const char *szName, const C_STRUCT aiMatrix4x4 *mat) |
ASSIMP_API void | aiSetImportPropertyString (aiPropertyStore *p, const char *szName, const C_STRUCT aiString *st) |
ASSIMP_API void | aiTransformVecByMatrix3 (aiVector3D *vec, const aiMatrix3x3 *mat) |
Transform a vector by a 3x3 matrix. More... | |
ASSIMP_API void | aiTransformVecByMatrix4 (aiVector3D *vec, const aiMatrix4x4 *mat) |
Transform a vector by a 4x4 matrix. More... | |
ASSIMP_API void | aiTransposeMatrix3 (aiMatrix3x3 *mat) |
Transpose a 3x3 matrix. More... | |
ASSIMP_API void | aiTransposeMatrix4 (aiMatrix4x4 *mat) |
Transpose a 4x4 matrix. More... | |
void | CallbackToLogRedirector (const char *msg, char *dt) |
void | Assimp::DeleteImporterInstanceList (std::vector< BaseImporter * > &out) |
will delete all registered importers. More... | |
void | Assimp::GetImporterInstanceList (std::vector< BaseImporter * > &out) |
will return all registered importers. More... | |
void | ReportSceneNotFoundError () |
Variables | |
static LogStreamMap | Assimp::gActiveLogStreams |
Local storage of all active log streams. More... | |
static std::string | Assimp::gLastErrorString |
Error message of the last failed import process. More... | |
static std::mutex | gLogStreamMutex |
Global mutex to manage the access to the log-stream map. More... | |
static PredefLogStreamMap | Assimp::gPredefinedStreams |
Local storage of LogStreams allocated by aiGetPredefinedLogStream. More... | |
static aiBool | Assimp::gVerboseLogging = false |
Verbose logging active or not? More... | |
Implementation of the Plain-C API.
ASSIMP_API const aiScene* aiApplyCustomizedPostProcessing | ( | const aiScene * | scene, |
BaseProcess * | process, | ||
bool | requestValidation | ||
) |
ASSIMP_API const aiScene* aiApplyPostProcessing | ( | const aiScene * | pScene, |
unsigned int | pFlags | ||
) |
Apply post-processing to an already-imported scene.
This is strictly equivalent to calling aiImportFile()/aiImportFileEx with the same flags. However, you can use this separate function to inspect the imported scene first to fine-tune your post-processing setup.
pScene | Scene to work on. |
pFlags | Provide a bitwise combination of the aiPostProcessSteps flags. |
ASSIMP_API void aiAttachLogStream | ( | const aiLogStream * | stream | ) |
Attach a custom log stream to the libraries' logging system.
Attaching a log stream can slightly reduce Assimp's overall import performance. Multiple log-streams can be attached.
stream | Describes the new log stream. |
ASSIMP_API aiPropertyStore* aiCreatePropertyStore | ( | void | ) |
Create an empty property store.
Property stores are used to collect import settings.
ASSIMP_API void aiCreateQuaternionFromMatrix | ( | aiQuaternion * | quat, |
const aiMatrix3x3 * | mat | ||
) |
Construct a quaternion from a 3x3 rotation matrix.
quat | Receives the output quaternion. |
mat | Matrix to 'quaternionize'. |
ASSIMP_API void aiDecomposeMatrix | ( | const aiMatrix4x4 * | mat, |
aiVector3D * | scaling, | ||
aiQuaternion * | rotation, | ||
aiVector3D * | position | ||
) |
Decompose a transformation matrix into its rotational, translational and scaling components.
mat | Matrix to decompose |
scaling | Receives the scaling component |
rotation | Receives the rotational component |
position | Receives the translational component. |
ASSIMP_API void aiDetachAllLogStreams | ( | void | ) |
Detach all active log streams from the libraries' logging system.
This ensures that the logging system is terminated properly and all resources allocated by it are actually freed. If you attached a stream, don't forget to detach it again.
ASSIMP_API aiReturn aiDetachLogStream | ( | const aiLogStream * | stream | ) |
Detach a custom log stream from the libraries' logging system.
This is the counterpart of aiAttachLogStream. If you attached a stream, don't forget to detach it again.
stream | The log stream to be detached. |
ASSIMP_API void aiEnableVerboseLogging | ( | aiBool | d | ) |
Enable verbose logging.
Verbose logging includes debug-related stuff and detailed import statistics. This can have severe impact on import performance and memory consumption. However, it might be useful to find out why a file didn't read correctly.
d | AI_TRUE or AI_FALSE, your decision. |
const char* aiGetErrorString | ( | ) |
Returns the error text of the last failed import process.
Get a list of all file extensions supported by ASSIMP.
If a file extension is contained in the list this does, of course, not mean that ASSIMP is able to load all files with this extension.
szOut | String to receive the extension list. Format of the list: "*.3ds;*.obj;*.dae". NULL is not a valid parameter. |
ASSIMP_API C_STRUCT const aiImporterDesc* aiGetImporterDesc | ( | const char * | extension | ) |
Returns the Importer description for a given extension.
Will return a NULL-pointer if no assigned importer desc. was found for the given extension
extension | [in] The extension to look for |
size_t aiGetImportFormatCount | ( | void | ) |
Returns the number of import file formats available in the current Assimp build.
Use aiGetImportFormatDescription() to retrieve infos of a specific import format.
const aiImporterDesc* aiGetImportFormatDescription | ( | size_t | pIndex | ) |
Returns a description of the nth import file format.
Use aiGetImportFormatCount() to learn how many import formats are supported.
pIndex | Index of the import format to retrieve information for. Valid range is 0 to aiGetImportFormatCount() |
void aiGetMemoryRequirements | ( | const C_STRUCT aiScene * | pIn, |
C_STRUCT aiMemoryInfo * | in | ||
) |
ASSIMP_API aiLogStream aiGetPredefinedLogStream | ( | aiDefaultLogStream | pStreams, |
const char * | file | ||
) |
Get one of the predefine log streams.
This is the quick'n'easy solution to access Assimp's log system. Attaching a log stream can slightly reduce Assimp's overall import performance.
Usage is rather simple (this will stream the log to a file, named log.txt, and the stdout stream of the process:
pStreams | One of the aiDefaultLogStream enumerated values. |
file | Solely for the aiDefaultLogStream_FILE flag: specifies the file to write to. Pass NULL for all other flags. |
ASSIMP_API void aiIdentityMatrix3 | ( | aiMatrix3x3 * | mat | ) |
Get a 3x3 identity matrix.
mat | Matrix to receive its personal identity |
ASSIMP_API void aiIdentityMatrix4 | ( | aiMatrix4x4 * | mat | ) |
Get a 4x4 identity matrix.
mat | Matrix to receive its personal identity |
const aiScene* aiImportFile | ( | const char * | pFile, |
unsigned int | pFlags | ||
) |
Reads the given file and returns its content.
If the call succeeds, the imported data is returned in an aiScene structure. The data is intended to be read-only, it stays property of the ASSIMP library and will be stable until aiReleaseImport() is called. After you're done with it, call aiReleaseImport() to free the resources associated with this file. If the import fails, NULL is returned instead. Call aiGetErrorString() to retrieve a human-readable error text.
pFile | Path and filename of the file to be imported, expected to be a null-terminated c-string. NULL is not a valid value. |
pFlags | Optional post processing steps to be executed after a successful import. Provide a bitwise combination of the aiPostProcessSteps flags. |
Reads the given file using user-defined I/O functions and returns its content.
If the call succeeds, the imported data is returned in an aiScene structure. The data is intended to be read-only, it stays property of the ASSIMP library and will be stable until aiReleaseImport() is called. After you're done with it, call aiReleaseImport() to free the resources associated with this file. If the import fails, NULL is returned instead. Call aiGetErrorString() to retrieve a human-readable error text.
pFile | Path and filename of the file to be imported, expected to be a null-terminated c-string. NULL is not a valid value. |
pFlags | Optional post processing steps to be executed after a successful import. Provide a bitwise combination of the aiPostProcessSteps flags. |
pFS | aiFileIO structure. Will be used to open the model file itself and any other files the loader needs to open. Pass NULL to use the default implementation. |
const aiScene* aiImportFileExWithProperties | ( | const char * | pFile, |
unsigned int | pFlags, | ||
aiFileIO * | pFS, | ||
const aiPropertyStore * | pProps | ||
) |
Same as aiImportFileEx, but adds an extra parameter containing importer settings.
pFile | Path and filename of the file to be imported, expected to be a null-terminated c-string. NULL is not a valid value. |
pFlags | Optional post processing steps to be executed after a successful import. Provide a bitwise combination of the aiPostProcessSteps flags. |
pFS | aiFileIO structure. Will be used to open the model file itself and any other files the loader needs to open. Pass NULL to use the default implementation. |
pProps | aiPropertyStore instance containing import settings. |
const aiScene* aiImportFileFromMemory | ( | const char * | pBuffer, |
unsigned int | pLength, | ||
unsigned int | pFlags, | ||
const char * | pHint | ||
) |
Reads the given file from a given memory buffer,.
If the call succeeds, the contents of the file are returned as a pointer to an aiScene object. The returned data is intended to be read-only, the importer keeps ownership of the data and will destroy it upon destruction. If the import fails, NULL is returned. A human-readable error description can be retrieved by calling aiGetErrorString().
pBuffer | Pointer to the file data |
pLength | Length of pBuffer, in bytes |
pFlags | Optional post processing steps to be executed after a successful import. Provide a bitwise combination of the aiPostProcessSteps flags. If you wish to inspect the imported scene first in order to fine-tune your post-processing setup, consider to use aiApplyPostProcessing(). |
pHint | An additional hint to the library. If this is a non empty string, the library looks for a loader to support the file extension specified by pHint and passes the file to the first matching loader. If this loader is unable to completely the request, the library continues and tries to determine the file format on its own, a task that may or may not be successful. Check the return value, and you'll know ... |
const aiScene* aiImportFileFromMemoryWithProperties | ( | const char * | pBuffer, |
unsigned int | pLength, | ||
unsigned int | pFlags, | ||
const char * | pHint, | ||
const aiPropertyStore * | pProps | ||
) |
Same as aiImportFileFromMemory, but adds an extra parameter containing importer settings.
pBuffer | Pointer to the file data |
pLength | Length of pBuffer, in bytes |
pFlags | Optional post processing steps to be executed after a successful import. Provide a bitwise combination of the aiPostProcessSteps flags. If you wish to inspect the imported scene first in order to fine-tune your post-processing setup, consider to use aiApplyPostProcessing(). |
pHint | An additional hint to the library. If this is a non empty string, the library looks for a loader to support the file extension specified by pHint and passes the file to the first matching loader. If this loader is unable to completely the request, the library continues and tries to determine the file format on its own, a task that may or may not be successful. Check the return value, and you'll know ... |
pProps | aiPropertyStore instance containing import settings. |
aiBool aiIsExtensionSupported | ( | const char * | szExtension | ) |
Returns whether a given file extension is supported by ASSIMP.
szExtension | Extension for which the function queries support for. Must include a leading dot '.'. Example: ".3ds", ".md3" |
ASSIMP_API void aiMultiplyMatrix3 | ( | aiMatrix3x3 * | dst, |
const aiMatrix3x3 * | src | ||
) |
Multiply two 3x3 matrices.
dst | First factor, receives result. |
src | Matrix to be multiplied with 'dst'. |
ASSIMP_API void aiMultiplyMatrix4 | ( | aiMatrix4x4 * | dst, |
const aiMatrix4x4 * | src | ||
) |
Multiply two 4x4 matrices.
dst | First factor, receives result. |
src | Matrix to be multiplied with 'dst'. |
Releases all resources associated with the given import process.
Call this function after you're done with the imported data.
pScene | The imported data to release. NULL is a valid value. |
ASSIMP_API void aiReleasePropertyStore | ( | aiPropertyStore * | p | ) |
Delete a property store.
p | Property store to be deleted. |
ASSIMP_API void aiSetImportPropertyFloat | ( | aiPropertyStore * | store, |
const char * | szName, | ||
float | value | ||
) |
Set a floating-point property.
This is the C-version of Assimp::Importer::SetPropertyFloat(). In the C interface, properties are always shared by all imports. It is not possible to specify them per import.
store | Store to modify. Use aiCreatePropertyStore to obtain a store. |
szName | Name of the configuration property to be set. All supported public properties are defined in the config.h header file (AI_CONFIG_XXX). |
value | New value for the property |
ASSIMP_API void aiSetImportPropertyInteger | ( | aiPropertyStore * | store, |
const char * | szName, | ||
int | value | ||
) |
Set an integer property.
This is the C-version of Assimp::Importer::SetPropertyInteger(). In the C interface, properties are always shared by all imports. It is not possible to specify them per import.
store | Store to modify. Use aiCreatePropertyStore to obtain a store. |
szName | Name of the configuration property to be set. All supported public properties are defined in the config.h header file (AI_CONFIG_XXX). |
value | New value for the property |
ASSIMP_API void aiSetImportPropertyMatrix | ( | aiPropertyStore * | p, |
const char * | szName, | ||
const C_STRUCT aiMatrix4x4 * | mat | ||
) |
ASSIMP_API void aiSetImportPropertyString | ( | aiPropertyStore * | p, |
const char * | szName, | ||
const C_STRUCT aiString * | st | ||
) |
ASSIMP_API void aiTransformVecByMatrix3 | ( | aiVector3D * | vec, |
const aiMatrix3x3 * | mat | ||
) |
Transform a vector by a 3x3 matrix.
vec | Vector to be transformed. |
mat | Matrix to transform the vector with. |
ASSIMP_API void aiTransformVecByMatrix4 | ( | aiVector3D * | vec, |
const aiMatrix4x4 * | mat | ||
) |
Transform a vector by a 4x4 matrix.
vec | Vector to be transformed. |
mat | Matrix to transform the vector with. |
ASSIMP_API void aiTransposeMatrix3 | ( | aiMatrix3x3 * | mat | ) |
Transpose a 3x3 matrix.
mat | Pointer to the matrix to be transposed |
ASSIMP_API void aiTransposeMatrix4 | ( | aiMatrix4x4 * | mat | ) |
Transpose a 4x4 matrix.
mat | Pointer to the matrix to be transposed |
void CallbackToLogRedirector | ( | const char * | msg, |
char * | dt | ||
) |
void ReportSceneNotFoundError | ( | ) |
|
static |
Global mutex to manage the access to the log-stream map.