diff options
Diffstat (limited to 'src/3rdparty/assimp/code/BlenderDNA.h')
-rw-r--r-- | src/3rdparty/assimp/code/BlenderDNA.h | 89 |
1 files changed, 45 insertions, 44 deletions
diff --git a/src/3rdparty/assimp/code/BlenderDNA.h b/src/3rdparty/assimp/code/BlenderDNA.h index 801d68fce..bac8d78bc 100644 --- a/src/3rdparty/assimp/code/BlenderDNA.h +++ b/src/3rdparty/assimp/code/BlenderDNA.h @@ -2,7 +2,8 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2016, assimp team +Copyright (c) 2006-2017, assimp team + All rights reserved. Redistribution and use of this software in source and binary forms, @@ -46,12 +47,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define INCLUDED_AI_BLEND_DNA_H #include "BaseImporter.h" -#include "TinyFormatter.h" #include "StreamReader.h" #include <assimp/DefaultLogger.hpp> #include <stdint.h> #include <memory> - +#include <map> // enable verbose log output. really verbose, so be careful. #ifdef ASSIMP_BUILD_DEBUG @@ -61,15 +61,17 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // #define ASSIMP_BUILD_BLENDER_NO_STATS namespace Assimp { - template <bool,bool> class StreamReader; - typedef StreamReader<true,true> StreamReaderAny; - namespace Blender { - class FileDatabase; - struct FileBlockHead; +template <bool,bool> class StreamReader; +typedef StreamReader<true,true> StreamReaderAny; + +namespace Blender { + +class FileDatabase; +struct FileBlockHead; - template <template <typename> class TOUT> - class ObjectCache; +template <template <typename> class TOUT> +class ObjectCache; // ------------------------------------------------------------------------------- /** Exception class used by the blender loader to selectively catch exceptions @@ -78,20 +80,27 @@ namespace Assimp { * the loader itself, it will still be caught by Assimp due to its * ancestry. */ // ------------------------------------------------------------------------------- -struct Error : DeadlyImportError -{ +struct Error : DeadlyImportError { Error (const std::string& s) - : DeadlyImportError(s) - {} + : DeadlyImportError(s) { + // empty + } }; // ------------------------------------------------------------------------------- /** The only purpose of this structure is to feed a virtual dtor into its * descendents. It serves as base class for all data structure fields. */ // ------------------------------------------------------------------------------- -struct ElemBase -{ - virtual ~ElemBase() {} +struct ElemBase { + ElemBase() + : dna_type(nullptr) + { + // empty + } + + virtual ~ElemBase() { + // empty + } /** Type name of the element. The type * string points is the `c_str` of the `name` attribute of the @@ -103,25 +112,28 @@ struct ElemBase const char* dna_type; }; - // ------------------------------------------------------------------------------- /** Represents a generic pointer to a memory location, which can be either 32 * or 64 bits. These pointers are loaded from the BLEND file and finally * fixed to point to the real, converted representation of the objects * they used to point to.*/ // ------------------------------------------------------------------------------- -struct Pointer -{ - Pointer() : val() {} +struct Pointer { + Pointer() + : val() { + // empty + } uint64_t val; }; // ------------------------------------------------------------------------------- /** Represents a generic offset within a BLEND file */ // ------------------------------------------------------------------------------- -struct FileOffset -{ - FileOffset() : val() {} +struct FileOffset { + FileOffset() + : val() { + // empty + } uint64_t val; }; @@ -132,8 +144,7 @@ struct FileOffset * functions of shared_ptr */ // ------------------------------------------------------------------------------- template <typename T> -class vector : public std::vector<T> -{ +class vector : public std::vector<T> { public: using std::vector<T>::resize; using std::vector<T>::empty; @@ -150,8 +161,7 @@ public: // ------------------------------------------------------------------------------- /** Mixed flags for use in #Field */ // ------------------------------------------------------------------------------- -enum FieldFlags -{ +enum FieldFlags { FieldFlag_Pointer = 0x1, FieldFlag_Array = 0x2 }; @@ -159,8 +169,7 @@ enum FieldFlags // ------------------------------------------------------------------------------- /** Represents a single member of a data structure in a BLEND file */ // ------------------------------------------------------------------------------- -struct Field -{ +struct Field { std::string name; std::string type; @@ -180,8 +189,7 @@ struct Field * mission critical so we need them, while others can silently be default * initialized and no animations are harmed. */ // ------------------------------------------------------------------------------- -enum ErrorPolicy -{ +enum ErrorPolicy { /** Substitute default value and ignore */ ErrorPolicy_Igno, /** Substitute default value and write to log */ @@ -202,15 +210,14 @@ enum ErrorPolicy * binary `blob` read from the file to such a structure instance with * meaningful contents. */ // ------------------------------------------------------------------------------- -class Structure -{ +class Structure { template <template <typename> class> friend class ObjectCache; public: - Structure() - : cache_idx(static_cast<size_t>(-1) ) - {} + : cache_idx(static_cast<size_t>(-1) ){ + // empty + } public: @@ -252,10 +259,7 @@ public: * a compiler complain is the result. * @param dest Destination value to be written * @param db File database, including input stream. */ - template <typename T> inline void Convert (T& dest, - const FileDatabase& db) const; - - + template <typename T> void Convert (T& dest, const FileDatabase& db) const; // -------------------------------------------------------- // generic converter @@ -709,8 +713,6 @@ class FileDatabase template <template <typename> class TOUT> friend class ObjectCache; public: - - FileDatabase() : _cacheArrays(*this) , _cache(*this) @@ -718,7 +720,6 @@ public: {} public: - // publicly accessible fields bool i64bit; bool little; |