summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/assimp/include/assimp/Exporter.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/assimp/include/assimp/Exporter.hpp')
-rw-r--r--src/3rdparty/assimp/include/assimp/Exporter.hpp85
1 files changed, 32 insertions, 53 deletions
diff --git a/src/3rdparty/assimp/include/assimp/Exporter.hpp b/src/3rdparty/assimp/include/assimp/Exporter.hpp
index 079060f4b..c6a6f684a 100644
--- a/src/3rdparty/assimp/include/assimp/Exporter.hpp
+++ b/src/3rdparty/assimp/include/assimp/Exporter.hpp
@@ -3,7 +3,8 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
-Copyright (c) 2006-2011, assimp team
+Copyright (c) 2006-2017, assimp team
+
All rights reserved.
@@ -42,6 +43,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/** @file Exporter.hpp
* @brief Defines the CPP-API for the Assimp export interface
*/
+#pragma once
#ifndef AI_EXPORT_HPP_INC
#define AI_EXPORT_HPP_INC
@@ -50,17 +52,17 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "cexport.h"
#include <map>
-namespace Assimp {
- class ExporterPimpl;
- class IOSystem;
-
+namespace Assimp {
+
+class ExporterPimpl;
+class IOSystem;
// ----------------------------------------------------------------------------------
/** 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 modelled after the importer interface and mostly
+ * 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
@@ -73,17 +75,10 @@ namespace Assimp {
* #ExportToBlob is especially useful if you intend to work
* with the data in-memory.
*/
-
class ASSIMP_API ExportProperties;
-class ASSIMP_API Exporter
- // TODO: causes good ol' base class has no dll interface warning
-//#ifdef __cplusplus
-// : public boost::noncopyable
-//#endif // __cplusplus
-{
+class ASSIMP_API Exporter {
public:
-
/** Function pointer type of a Export worker function */
typedef void (*fpExportFunc)(const char*, IOSystem*, const aiScene*, const ExportProperties*);
@@ -96,7 +91,7 @@ public:
// Worker function to do the actual exporting
fpExportFunc mExportFunction;
- // Postprocessing steps to be executed PRIOR to invoking mExportFunction
+ // Post-processing steps to be executed PRIOR to invoking mExportFunction
unsigned int mEnforcePP;
// Constructor to fill all entries
@@ -121,14 +116,10 @@ public:
public:
-
-
Exporter();
~Exporter();
public:
-
-
// -------------------------------------------------------------------
/** Supplies a custom IO handler to the exporter to use to open and
* access files.
@@ -162,8 +153,6 @@ public:
* @return true by default */
bool IsDefaultIOHandler() const;
-
-
// -------------------------------------------------------------------
/** Exports the given scene to a chosen file format. Returns the exported
* data as a binary blob which you can write into a file or something.
@@ -182,9 +171,8 @@ public:
* Any IO handlers set via #SetIOHandler are ignored here.
* @note Use aiCopyScene() to get a modifiable copy of a previously
* imported scene. */
- const aiExportDataBlob* ExportToBlob( const aiScene* pScene, const char* pFormatId, unsigned int pPreprocessing = 0u, const ExportProperties* pProperties = NULL);
- inline const aiExportDataBlob* ExportToBlob( const aiScene* pScene, const std::string& pFormatId, unsigned int pPreprocessing = 0u, const ExportProperties* pProperties = NULL);
-
+ const aiExportDataBlob* ExportToBlob(const aiScene* pScene, const char* pFormatId, unsigned int pPreprocessing = 0u, const ExportProperties* = NULL);
+ const aiExportDataBlob* ExportToBlob( const aiScene* pScene, const std::string& pFormatId, unsigned int pPreprocessing = 0u, const ExportProperties* pProperties = NULL);
// -------------------------------------------------------------------
/** Convenience function to export directly to a file. Use
@@ -212,16 +200,15 @@ public:
* triangulate data so they would run the step even if it wasn't requested.
*
* If assimp detects that the input scene was directly taken from the importer side of
- * the library (i.e. not copied using aiCopyScene and potetially modified afterwards),
- * any postprocessing steps already applied to the scene will not be applied again, unless
- * they show non-idempotent behaviour (#aiProcess_MakeLeftHanded, #aiProcess_FlipUVs and
+ * the library (i.e. not copied using aiCopyScene and potentially modified afterwards),
+ * any post-processing steps already applied to the scene will not be applied again, unless
+ * they show non-idempotent behavior (#aiProcess_MakeLeftHanded, #aiProcess_FlipUVs and
* #aiProcess_FlipWindingOrder).
* @return AI_SUCCESS if everything was fine.
* @note Use aiCopyScene() to get a modifiable copy of a previously
* imported scene.*/
aiReturn Export( const aiScene* pScene, const char* pFormatId, const char* pPath, unsigned int pPreprocessing = 0u, const ExportProperties* pProperties = NULL);
- inline aiReturn Export( const aiScene* pScene, const std::string& pFormatId, const std::string& pPath, unsigned int pPreprocessing = 0u, const ExportProperties* pProperties = NULL);
-
+ aiReturn Export( const aiScene* pScene, const std::string& pFormatId, const std::string& pPath, unsigned int pPreprocessing = 0u, const ExportProperties* pProperties = NULL);
// -------------------------------------------------------------------
/** Returns an error description of an error that occurred in #Export
@@ -235,30 +222,26 @@ public:
* following methods is called: #Export, #ExportToBlob, #FreeBlob */
const char* GetErrorString() const;
-
// -------------------------------------------------------------------
/** Return the blob obtained from the last call to #ExportToBlob */
const aiExportDataBlob* GetBlob() const;
-
// -------------------------------------------------------------------
/** Orphan the blob from the last call to #ExportToBlob. This means
* the caller takes ownership and is thus responsible for calling
* the C API function #aiReleaseExportBlob to release it. */
const aiExportDataBlob* GetOrphanedBlob() const;
-
// -------------------------------------------------------------------
/** Frees the current blob.
*
* The function does nothing if no blob has previously been
* previously produced via #ExportToBlob. #FreeBlob is called
* automatically by the destructor. The only reason to call
- * it manually would be to reclain as much storage as possible
+ * it manually would be to reclaim as much storage as possible
* without giving up the #Exporter instance yet. */
void FreeBlob( );
-
// -------------------------------------------------------------------
/** Returns the number of export file formats available in the current
* Assimp build. Use #Exporter::GetExportFormatDescription to
@@ -269,13 +252,12 @@ public:
**/
size_t GetExportFormatCount() const;
-
// -------------------------------------------------------------------
/** Returns a description of the nth export file format. Use #
* #Exporter::GetExportFormatCount to learn how many export
* formats are supported.
*
- * The returned pointer is of static storage duration iff the
+ * The returned pointer is of static storage duration if the
* pIndex pertains to a built-in exporter (i.e. one not registered
* via #RegistrerExporter). It is restricted to the life-time of the
* #Exporter instance otherwise.
@@ -286,7 +268,6 @@ public:
* NULL if pIndex is out of range. */
const aiExportFormatDesc* GetExportFormatDescription( size_t pIndex ) const;
-
// -------------------------------------------------------------------
/** Register a custom exporter. Custom export formats are limited to
* to the current #Exporter instance and do not affect the
@@ -300,11 +281,10 @@ public:
* occupied by another format. */
aiReturn RegisterExporter(const ExportFormatEntry& desc);
-
// -------------------------------------------------------------------
/** Remove an export format previously registered with #RegisterExporter
* from the #Exporter instance (this can also be used to drop
- * builtin exporters because those are implicitly registered
+ * built-in exporters because those are implicitly registered
* using #RegisterExporter).
* @param id Format id to be unregistered, this refers to the
* 'id' field of #aiExportFormatDesc.
@@ -312,16 +292,12 @@ public:
* has no effect.*/
void UnregisterExporter(const char* id);
-
protected:
-
// Just because we don't want you to know how we're hacking around.
ExporterPimpl* pimpl;
};
-
-class ASSIMP_API ExportProperties
-{
+class ASSIMP_API ExportProperties {
public:
// Data type to store the key hash
typedef unsigned int KeyType;
@@ -329,16 +305,14 @@ public:
// typedefs for our four configuration maps.
// We don't need more, so there is no need for a generic solution
typedef std::map<KeyType, int> IntPropertyMap;
- typedef std::map<KeyType, float> FloatPropertyMap;
+ typedef std::map<KeyType, ai_real> FloatPropertyMap;
typedef std::map<KeyType, std::string> StringPropertyMap;
typedef std::map<KeyType, aiMatrix4x4> MatrixPropertyMap;
public:
-
/** Standard constructor
* @see ExportProperties()
*/
-
ExportProperties();
// -------------------------------------------------------------------
@@ -379,7 +353,7 @@ public:
/** Set a floating-point configuration property.
* @see SetPropertyInteger()
*/
- bool SetPropertyFloat(const char* szName, float fValue);
+ bool SetPropertyFloat(const char* szName, ai_real fValue);
// -------------------------------------------------------------------
/** Set a string configuration property.
@@ -424,8 +398,8 @@ public:
/** Get a floating-point configuration property
* @see GetPropertyInteger()
*/
- float GetPropertyFloat(const char* szName,
- float fErrorReturn = 10e10f) const;
+ ai_real GetPropertyFloat(const char* szName,
+ ai_real fErrorReturn = 10e10f) const;
// -------------------------------------------------------------------
/** Get a string configuration property
@@ -486,19 +460,24 @@ protected:
MatrixPropertyMap mMatrixProperties;
};
-
// ----------------------------------------------------------------------------------
-inline const aiExportDataBlob* Exporter :: ExportToBlob( const aiScene* pScene, const std::string& pFormatId,unsigned int pPreprocessing, const ExportProperties* pProperties)
+inline
+const aiExportDataBlob* Exporter::ExportToBlob( const aiScene* pScene, const std::string& pFormatId,
+ unsigned int pPreprocessing, const ExportProperties* pProperties)
{
return ExportToBlob(pScene,pFormatId.c_str(),pPreprocessing, pProperties);
}
// ----------------------------------------------------------------------------------
-inline aiReturn Exporter :: Export( const aiScene* pScene, const std::string& pFormatId, const std::string& pPath, unsigned int pPreprocessing, const ExportProperties* pProperties)
+inline
+aiReturn Exporter :: Export( const aiScene* pScene, const std::string& pFormatId,
+ const std::string& pPath, unsigned int pPreprocessing,
+ const ExportProperties* pProperties)
{
return Export(pScene,pFormatId.c_str(),pPath.c_str(),pPreprocessing, pProperties);
}
} // namespace Assimp
+
#endif // ASSIMP_BUILD_NO_EXPORT
#endif // AI_EXPORT_HPP_INC