|
@@ -84,6 +84,9 @@ namespace Assimp {
|
|
|
|
|
|
struct aiScene;
|
|
struct aiScene;
|
|
|
|
|
|
|
|
+// importerdesc.h
|
|
|
|
+struct aiImporterDesc;
|
|
|
|
+
|
|
/** @namespace Assimp Assimp's CPP-API and all internal APIs */
|
|
/** @namespace Assimp Assimp's CPP-API and all internal APIs */
|
|
namespace Assimp {
|
|
namespace Assimp {
|
|
|
|
|
|
@@ -468,6 +471,35 @@ public:
|
|
* following methods is called: #ReadFile(), #FreeScene(). */
|
|
* following methods is called: #ReadFile(), #FreeScene(). */
|
|
const char* GetErrorString() const;
|
|
const char* GetErrorString() const;
|
|
|
|
|
|
|
|
+ // -------------------------------------------------------------------
|
|
|
|
+ /** Returns the scene loaded by the last successful call to ReadFile()
|
|
|
|
+ *
|
|
|
|
+ * @return Current scene or NULL if there is currently no scene loaded */
|
|
|
|
+ const aiScene* GetScene() const;
|
|
|
|
+
|
|
|
|
+ // -------------------------------------------------------------------
|
|
|
|
+ /** Returns the scene loaded by the last successful call to ReadFile()
|
|
|
|
+ * and releases the scene from the ownership of the Importer
|
|
|
|
+ * instance. The application is now responsible for deleting the
|
|
|
|
+ * scene. Any further calls to GetScene() or GetOrphanedScene()
|
|
|
|
+ * will return NULL - until a new scene has been loaded via ReadFile().
|
|
|
|
+ *
|
|
|
|
+ * @return Current scene or NULL if there is currently no scene loaded
|
|
|
|
+ * @note Use this method with maximal caution, and only if you have to.
|
|
|
|
+ * By design, aiScene's are exclusively maintained, allocated and
|
|
|
|
+ * deallocated by Assimp and no one else. The reasoning behind this
|
|
|
|
+ * is the golden rule that deallocations should always be done
|
|
|
|
+ * by the module that did the original allocation because heaps
|
|
|
|
+ * are not necessarily shared. GetOrphanedScene() enforces you
|
|
|
|
+ * to delete the returned scene by yourself, but this will only
|
|
|
|
+ * be fine if and only if you're using the same heap as assimp.
|
|
|
|
+ * On Windows, it's typically fine provided everything is linked
|
|
|
|
+ * against the multithreaded-dll version of the runtime library.
|
|
|
|
+ * It will work as well for static linkage with Assimp.*/
|
|
|
|
+ aiScene* GetOrphanedScene();
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
// -------------------------------------------------------------------
|
|
// -------------------------------------------------------------------
|
|
/** Returns whether a given file extension is supported by ASSIMP.
|
|
/** Returns whether a given file extension is supported by ASSIMP.
|
|
@@ -486,7 +518,6 @@ public:
|
|
* @see IsExtensionSupported(const char*) */
|
|
* @see IsExtensionSupported(const char*) */
|
|
inline bool IsExtensionSupported(const std::string& szExtension) const;
|
|
inline bool IsExtensionSupported(const std::string& szExtension) const;
|
|
|
|
|
|
-
|
|
|
|
// -------------------------------------------------------------------
|
|
// -------------------------------------------------------------------
|
|
/** Get a full list of all file extensions supported by ASSIMP.
|
|
/** Get a full list of all file extensions supported by ASSIMP.
|
|
*
|
|
*
|
|
@@ -507,46 +538,52 @@ public:
|
|
* @see GetExtensionList(aiString&)*/
|
|
* @see GetExtensionList(aiString&)*/
|
|
inline void GetExtensionList(std::string& szOut) const;
|
|
inline void GetExtensionList(std::string& szOut) const;
|
|
|
|
|
|
|
|
+ // -------------------------------------------------------------------
|
|
|
|
+ /** Get the number of importrs currently registered with Assimp. */
|
|
|
|
+ size_t GetImporterCount() const;
|
|
|
|
+
|
|
|
|
+ // -------------------------------------------------------------------
|
|
|
|
+ /** Get meta data for the importer corresponding to a specific index..
|
|
|
|
+ *
|
|
|
|
+ * For the declaration of #aiImporterDesc, include <assimp/importerdesc.h>.
|
|
|
|
+ * @param index Index to query, must be within [0,GetImporterCount())
|
|
|
|
+ * @return Importer meta data structure, NULL if the index does not
|
|
|
|
+ * exist or if the importer doesn't offer meta information (
|
|
|
|
+ * importers may do this at the cost of being hated by their peers).*/
|
|
|
|
+ const aiImporterDesc* GetImporterInfo(size_t index) const;
|
|
|
|
|
|
// -------------------------------------------------------------------
|
|
// -------------------------------------------------------------------
|
|
- /** Find the loader corresponding to a specific file extension.
|
|
|
|
|
|
+ /** Find the importer corresponding to a specific index.
|
|
*
|
|
*
|
|
- * This is quite similar to IsExtensionSupported() except a
|
|
|
|
|
|
+ * @param index Index to query, must be within [0,GetImporterCount())
|
|
|
|
+ * @return Importer instance. NULL if the index does not
|
|
|
|
+ * exist. */
|
|
|
|
+ BaseImporter* GetImporter(size_t index) const;
|
|
|
|
+
|
|
|
|
+ // -------------------------------------------------------------------
|
|
|
|
+ /** Find the importer corresponding to a specific file extension.
|
|
|
|
+ *
|
|
|
|
+ * This is quite similar to #IsExtensionSupported except a
|
|
* BaseImporter instance is returned.
|
|
* BaseImporter instance is returned.
|
|
* @param szExtension Extension to check for. The following formats
|
|
* @param szExtension Extension to check for. The following formats
|
|
- * are recgnized (BAH being the file extension): "BAH" (comparison
|
|
|
|
|
|
+ * are recognized (BAH being the file extension): "BAH" (comparison
|
|
* is case-insensitive), ".bah", "*.bah" (wild card and dot
|
|
* is case-insensitive), ".bah", "*.bah" (wild card and dot
|
|
* characters at the beginning of the extension are skipped).
|
|
* characters at the beginning of the extension are skipped).
|
|
- * @return NULL if there is no loader for the extension.*/
|
|
|
|
- BaseImporter* FindLoader (const char* szExtension) const;
|
|
|
|
-
|
|
|
|
|
|
+ * @return NULL if no importer is found*/
|
|
|
|
+ BaseImporter* GetImporter (const char* szExtension) const;
|
|
|
|
|
|
// -------------------------------------------------------------------
|
|
// -------------------------------------------------------------------
|
|
- /** Returns the scene loaded by the last successful call to ReadFile()
|
|
|
|
- *
|
|
|
|
- * @return Current scene or NULL if there is currently no scene loaded */
|
|
|
|
- const aiScene* GetScene() const;
|
|
|
|
|
|
+ /** Find the importer index corresponding to a specific file extension.
|
|
|
|
+ *
|
|
|
|
+ * @param szExtension Extension to check for. The following formats
|
|
|
|
+ * are recognized (BAH being the file extension): "BAH" (comparison
|
|
|
|
+ * is case-insensitive), ".bah", "*.bah" (wild card and dot
|
|
|
|
+ * characters at the beginning of the extension are skipped).
|
|
|
|
+ * @return (size_t)-1 if no importer is found */
|
|
|
|
+ size_t GetImporterIndex (const char* szExtension) const;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
- // -------------------------------------------------------------------
|
|
|
|
- /** Returns the scene loaded by the last successful call to ReadFile()
|
|
|
|
- * and releases the scene from the ownership of the Importer
|
|
|
|
- * instance. The application is now responsible for deleting the
|
|
|
|
- * scene. Any further calls to GetScene() or GetOrphanedScene()
|
|
|
|
- * will return NULL - until a new scene has been loaded via ReadFile().
|
|
|
|
- *
|
|
|
|
- * @return Current scene or NULL if there is currently no scene loaded
|
|
|
|
- * @note Use this method with maximal caution, and only if you have to.
|
|
|
|
- * By design, aiScene's are exclusively maintained, allocated and
|
|
|
|
- * deallocated by Assimp and no one else. The reasoning behind this
|
|
|
|
- * is the golden rule that deallocations should always be done
|
|
|
|
- * by the module that did the original allocation because heaps
|
|
|
|
- * are not necessarily shared. GetOrphanedScene() enforces you
|
|
|
|
- * to delete the returned scene by yourself, but this will only
|
|
|
|
- * be fine if and only if you're using the same heap as assimp.
|
|
|
|
- * On Windows, it's typically fine when everything is linked
|
|
|
|
- * against the multithreaded-dll version of the runtime library.
|
|
|
|
- * It will work as well for static linkage with Assimp.*/
|
|
|
|
- aiScene* GetOrphanedScene();
|
|
|
|
|
|
|
|
// -------------------------------------------------------------------
|
|
// -------------------------------------------------------------------
|
|
/** Returns the storage allocated by ASSIMP to hold the scene data
|
|
/** Returns the storage allocated by ASSIMP to hold the scene data
|