miniassimp

changeset 0:879c81d94345 tip

initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 28 Jan 2019 18:19:26 +0200
parents
children
files .hgignore Makefile include/miniassimp/BaseImporter.h include/miniassimp/Compiler/poppack1.h include/miniassimp/Compiler/pstdint.h include/miniassimp/Compiler/pushpack1.h include/miniassimp/DefaultIOStream.h include/miniassimp/DefaultLogger.hpp include/miniassimp/Defines.h include/miniassimp/Exceptional.h include/miniassimp/GenericProperty.h include/miniassimp/Hash.h include/miniassimp/IOStream.hpp include/miniassimp/IOSystem.hpp include/miniassimp/Importer.hpp include/miniassimp/LogStream.hpp include/miniassimp/Logger.hpp include/miniassimp/NullLogger.hpp include/miniassimp/ProgressHandler.hpp include/miniassimp/TinyFormatter.h include/miniassimp/ai_assert.h include/miniassimp/anim.h include/miniassimp/camera.h include/miniassimp/cfileio.h include/miniassimp/cimport.h include/miniassimp/color4.h include/miniassimp/color4.inl include/miniassimp/config.h include/miniassimp/defs.h include/miniassimp/importerdesc.h include/miniassimp/light.h include/miniassimp/material.h include/miniassimp/material.inl include/miniassimp/matrix3x3.h include/miniassimp/matrix3x3.inl include/miniassimp/matrix4x4.h include/miniassimp/matrix4x4.inl include/miniassimp/mesh.h include/miniassimp/metadata.h include/miniassimp/postprocess.h include/miniassimp/quaternion.h include/miniassimp/quaternion.inl include/miniassimp/scene.h include/miniassimp/texture.h include/miniassimp/types.h include/miniassimp/vector2.h include/miniassimp/vector2.inl include/miniassimp/vector3.h include/miniassimp/vector3.inl src/Assimp.cpp src/CInterfaceIOWrapper.cpp src/CInterfaceIOWrapper.h src/Importer.h src/ScenePrivate.h
diffstat 54 files changed, 16721 insertions(+), 0 deletions(-) [+]
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/.hgignore	Mon Jan 28 18:19:26 2019 +0200
     1.3 @@ -0,0 +1,5 @@
     1.4 +\.o$
     1.5 +\.d$
     1.6 +\.swp$
     1.7 +\.a$
     1.8 +\.so\.
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/Makefile	Mon Jan 28 18:19:26 2019 +0200
     2.3 @@ -0,0 +1,43 @@
     2.4 +src = $(wildcard src/*.cpp)
     2.5 +obj = $(src:.cpp=.o)
     2.6 +dep = $(obj:.o=.d)
     2.7 +
     2.8 +name = miniassimp
     2.9 +so_major = 0
    2.10 +so_minor = 1
    2.11 +
    2.12 +liba = lib$(name).a
    2.13 +libso = lib$(name).so
    2.14 +ldname = lib$(name).so.$(so_major)
    2.15 +soname = lib$(name).so.$(so_major).$(so_minor)
    2.16 +
    2.17 +warn = -pedantic -Wall
    2.18 +dbg = -g
    2.19 +opt = -O0
    2.20 +inc = -Iinclude
    2.21 +
    2.22 +CC=gcc
    2.23 +CXX=g++
    2.24 +CFLAGS = $(warn) $(dbg) $(opt) $(def) $(inc)
    2.25 +CXXFLAGS = $(warn) $(dbg) $(opt) $(def) $(inc)
    2.26 +
    2.27 +shared = -shared -Wl,-soname,$(soname)
    2.28 +
    2.29 +.PHONY: all
    2.30 +all: $(libso) $(liba)
    2.31 +
    2.32 +$(liba): $(obj)
    2.33 +	$(AR) rcs $@ $(obj)
    2.34 +
    2.35 +$(libso): $(obj)
    2.36 +	$(CC) -o $@ $(shared) $(obj) $(LDFLAGS)
    2.37 +
    2.38 +-include $(dep)
    2.39 +
    2.40 +%.d: %.cpp
    2.41 +	@echo depfile $@
    2.42 +	@$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@
    2.43 +
    2.44 +.PHONY: clean
    2.45 +clean:
    2.46 +	rm -f $(obj) $(liba) $(libso)
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/include/miniassimp/BaseImporter.h	Mon Jan 28 18:19:26 2019 +0200
     3.3 @@ -0,0 +1,361 @@
     3.4 +/*
     3.5 +Open Asset Import Library (assimp)
     3.6 +----------------------------------------------------------------------
     3.7 +
     3.8 +Copyright (c) 2006-2018, assimp team
     3.9 +
    3.10 +
    3.11 +All rights reserved.
    3.12 +
    3.13 +Redistribution and use of this software in source and binary forms,
    3.14 +with or without modification, are permitted provided that the
    3.15 +following conditions are met:
    3.16 +
    3.17 +* Redistributions of source code must retain the above
    3.18 +  copyright notice, this list of conditions and the
    3.19 +  following disclaimer.
    3.20 +
    3.21 +* Redistributions in binary form must reproduce the above
    3.22 +  copyright notice, this list of conditions and the
    3.23 +  following disclaimer in the documentation and/or other
    3.24 +  materials provided with the distribution.
    3.25 +
    3.26 +* Neither the name of the assimp team, nor the names of its
    3.27 +  contributors may be used to endorse or promote products
    3.28 +  derived from this software without specific prior
    3.29 +  written permission of the assimp team.
    3.30 +
    3.31 +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    3.32 +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    3.33 +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    3.34 +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
    3.35 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    3.36 +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    3.37 +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    3.38 +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    3.39 +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    3.40 +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    3.41 +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    3.42 +
    3.43 +----------------------------------------------------------------------
    3.44 +*/
    3.45 +
    3.46 +/** @file Definition of the base class for all importer worker classes. */
    3.47 +#ifndef INCLUDED_AI_BASEIMPORTER_H
    3.48 +#define INCLUDED_AI_BASEIMPORTER_H
    3.49 +
    3.50 +#include "Exceptional.h"
    3.51 +
    3.52 +#include <vector>
    3.53 +#include <set>
    3.54 +#include <miniassimp/types.h>
    3.55 +#include <miniassimp/ProgressHandler.hpp>
    3.56 +
    3.57 +struct aiScene;
    3.58 +struct aiImporterDesc;
    3.59 +
    3.60 +namespace Assimp    {
    3.61 +
    3.62 +class Importer;
    3.63 +class IOSystem;
    3.64 +class BaseProcess;
    3.65 +class SharedPostProcessInfo;
    3.66 +class IOStream;
    3.67 +
    3.68 +// utility to do char4 to uint32 in a portable manner
    3.69 +#define AI_MAKE_MAGIC(string) ((uint32_t)((string[0] << 24) + \
    3.70 +    (string[1] << 16) + (string[2] << 8) + string[3]))
    3.71 +
    3.72 +
    3.73 +// ---------------------------------------------------------------------------
    3.74 +/** FOR IMPORTER PLUGINS ONLY: The BaseImporter defines a common interface
    3.75 + *  for all importer worker classes.
    3.76 + *
    3.77 + * The interface defines two functions: CanRead() is used to check if the
    3.78 + * importer can handle the format of the given file. If an implementation of
    3.79 + * this function returns true, the importer then calls ReadFile() which
    3.80 + * imports the given file. ReadFile is not overridable, it just calls
    3.81 + * InternReadFile() and catches any ImportErrorException that might occur.
    3.82 + */
    3.83 +class ASSIMP_API BaseImporter {
    3.84 +    friend class Importer;
    3.85 +
    3.86 +public:
    3.87 +
    3.88 +    /** Constructor to be privately used by #Importer */
    3.89 +    BaseImporter() AI_NO_EXCEPT;
    3.90 +
    3.91 +    /** Destructor, private as well */
    3.92 +    virtual ~BaseImporter();
    3.93 +
    3.94 +    // -------------------------------------------------------------------
    3.95 +    /** Returns whether the class can handle the format of the given file.
    3.96 +     *
    3.97 +     * The implementation should be as quick as possible. A check for
    3.98 +     * the file extension is enough. If no suitable loader is found with
    3.99 +     * this strategy, CanRead() is called again, the 'checkSig' parameter
   3.100 +     * set to true this time. Now the implementation is expected to
   3.101 +     * perform a full check of the file structure, possibly searching the
   3.102 +     * first bytes of the file for magic identifiers or keywords.
   3.103 +     *
   3.104 +     * @param pFile Path and file name of the file to be examined.
   3.105 +     * @param pIOHandler The IO handler to use for accessing any file.
   3.106 +     * @param checkSig Set to true if this method is called a second time.
   3.107 +     *   This time, the implementation may take more time to examine the
   3.108 +     *   contents of the file to be loaded for magic bytes, keywords, etc
   3.109 +     *   to be able to load files with unknown/not existent file extensions.
   3.110 +     * @return true if the class can read this file, false if not.
   3.111 +     */
   3.112 +    virtual bool CanRead(
   3.113 +        const std::string& pFile,
   3.114 +        IOSystem* pIOHandler,
   3.115 +        bool checkSig
   3.116 +        ) const = 0;
   3.117 +
   3.118 +    // -------------------------------------------------------------------
   3.119 +    /** Imports the given file and returns the imported data.
   3.120 +     * If the import succeeds, ownership of the data is transferred to
   3.121 +     * the caller. If the import fails, NULL is returned. The function
   3.122 +     * takes care that any partially constructed data is destroyed
   3.123 +     * beforehand.
   3.124 +     *
   3.125 +     * @param pImp #Importer object hosting this loader.
   3.126 +     * @param pFile Path of the file to be imported.
   3.127 +     * @param pIOHandler IO-Handler used to open this and possible other files.
   3.128 +     * @return The imported data or NULL if failed. If it failed a
   3.129 +     * human-readable error description can be retrieved by calling
   3.130 +     * GetErrorText()
   3.131 +     *
   3.132 +     * @note This function is not intended to be overridden. Implement
   3.133 +     * InternReadFile() to do the import. If an exception is thrown somewhere
   3.134 +     * in InternReadFile(), this function will catch it and transform it into
   3.135 +     *  a suitable response to the caller.
   3.136 +     */
   3.137 +    aiScene* ReadFile(
   3.138 +        const Importer* pImp,
   3.139 +        const std::string& pFile,
   3.140 +        IOSystem* pIOHandler
   3.141 +        );
   3.142 +
   3.143 +    // -------------------------------------------------------------------
   3.144 +    /** Returns the error description of the last error that occurred.
   3.145 +     * @return A description of the last error that occurred. An empty
   3.146 +     * string if there was no error.
   3.147 +     */
   3.148 +    const std::string& GetErrorText() const {
   3.149 +        return m_ErrorText;
   3.150 +    }
   3.151 +
   3.152 +    // -------------------------------------------------------------------
   3.153 +    /** Called prior to ReadFile().
   3.154 +     * The function is a request to the importer to update its configuration
   3.155 +     * basing on the Importer's configuration property list.
   3.156 +     * @param pImp Importer instance
   3.157 +     */
   3.158 +    virtual void SetupProperties(
   3.159 +        const Importer* pImp
   3.160 +        );
   3.161 +
   3.162 +    // -------------------------------------------------------------------
   3.163 +    /** Called by #Importer::GetImporterInfo to get a description of
   3.164 +     *  some loader features. Importers must provide this information. */
   3.165 +    virtual const aiImporterDesc* GetInfo() const = 0;
   3.166 +
   3.167 +    // -------------------------------------------------------------------
   3.168 +    /** Called by #Importer::GetExtensionList for each loaded importer.
   3.169 +     *  Take the extension list contained in the structure returned by
   3.170 +     *  #GetInfo and insert all file extensions into the given set.
   3.171 +     *  @param extension set to collect file extensions in*/
   3.172 +    void GetExtensionList(std::set<std::string>& extensions);
   3.173 +
   3.174 +protected:
   3.175 +
   3.176 +    // -------------------------------------------------------------------
   3.177 +    /** Imports the given file into the given scene structure. The
   3.178 +     * function is expected to throw an ImportErrorException if there is
   3.179 +     * an error. If it terminates normally, the data in aiScene is
   3.180 +     * expected to be correct. Override this function to implement the
   3.181 +     * actual importing.
   3.182 +     * <br>
   3.183 +     *  The output scene must meet the following requirements:<br>
   3.184 +     * <ul>
   3.185 +     * <li>At least a root node must be there, even if its only purpose
   3.186 +     *     is to reference one mesh.</li>
   3.187 +     * <li>aiMesh::mPrimitiveTypes may be 0. The types of primitives
   3.188 +     *   in the mesh are determined automatically in this case.</li>
   3.189 +     * <li>the vertex data is stored in a pseudo-indexed "verbose" format.
   3.190 +     *   In fact this means that every vertex that is referenced by
   3.191 +     *   a face is unique. Or the other way round: a vertex index may
   3.192 +     *   not occur twice in a single aiMesh.</li>
   3.193 +     * <li>aiAnimation::mDuration may be -1. Assimp determines the length
   3.194 +     *   of the animation automatically in this case as the length of
   3.195 +     *   the longest animation channel.</li>
   3.196 +     * <li>aiMesh::mBitangents may be NULL if tangents and normals are
   3.197 +     *   given. In this case bitangents are computed as the cross product
   3.198 +     *   between normal and tangent.</li>
   3.199 +     * <li>There needn't be a material. If none is there a default material
   3.200 +     *   is generated. However, it is recommended practice for loaders
   3.201 +     *   to generate a default material for yourself that matches the
   3.202 +     *   default material setting for the file format better than Assimp's
   3.203 +     *   generic default material. Note that default materials *should*
   3.204 +     *   be named AI_DEFAULT_MATERIAL_NAME if they're just color-shaded
   3.205 +     *   or AI_DEFAULT_TEXTURED_MATERIAL_NAME if they define a (dummy)
   3.206 +     *   texture. </li>
   3.207 +     * </ul>
   3.208 +     * If the AI_SCENE_FLAGS_INCOMPLETE-Flag is <b>not</b> set:<ul>
   3.209 +     * <li> at least one mesh must be there</li>
   3.210 +     * <li> there may be no meshes with 0 vertices or faces</li>
   3.211 +     * </ul>
   3.212 +     * This won't be checked (except by the validation step): Assimp will
   3.213 +     * crash if one of the conditions is not met!
   3.214 +     *
   3.215 +     * @param pFile Path of the file to be imported.
   3.216 +     * @param pScene The scene object to hold the imported data.
   3.217 +     * NULL is not a valid parameter.
   3.218 +     * @param pIOHandler The IO handler to use for any file access.
   3.219 +     * NULL is not a valid parameter. */
   3.220 +    virtual void InternReadFile(
   3.221 +        const std::string& pFile,
   3.222 +        aiScene* pScene,
   3.223 +        IOSystem* pIOHandler
   3.224 +        ) = 0;
   3.225 +
   3.226 +public: // static utilities
   3.227 +
   3.228 +    // -------------------------------------------------------------------
   3.229 +    /** A utility for CanRead().
   3.230 +     *
   3.231 +     *  The function searches the header of a file for a specific token
   3.232 +     *  and returns true if this token is found. This works for text
   3.233 +     *  files only. There is a rudimentary handling of UNICODE files.
   3.234 +     *  The comparison is case independent.
   3.235 +     *
   3.236 +     *  @param pIOSystem IO System to work with
   3.237 +     *  @param file File name of the file
   3.238 +     *  @param tokens List of tokens to search for
   3.239 +     *  @param numTokens Size of the token array
   3.240 +     *  @param searchBytes Number of bytes to be searched for the tokens.
   3.241 +     */
   3.242 +    static bool SearchFileHeaderForToken(
   3.243 +        IOSystem* pIOSystem,
   3.244 +        const std::string&  file,
   3.245 +        const char** tokens,
   3.246 +        unsigned int numTokens,
   3.247 +        unsigned int searchBytes = 200,
   3.248 +        bool tokensSol = false,
   3.249 +        bool noAlphaBeforeTokens = false);
   3.250 +
   3.251 +    // -------------------------------------------------------------------
   3.252 +    /** @brief Check whether a file has a specific file extension
   3.253 +     *  @param pFile Input file
   3.254 +     *  @param ext0 Extension to check for. Lowercase characters only, no dot!
   3.255 +     *  @param ext1 Optional second extension
   3.256 +     *  @param ext2 Optional third extension
   3.257 +     *  @note Case-insensitive
   3.258 +     */
   3.259 +    static bool SimpleExtensionCheck (
   3.260 +        const std::string& pFile,
   3.261 +        const char* ext0,
   3.262 +        const char* ext1 = NULL,
   3.263 +        const char* ext2 = NULL);
   3.264 +
   3.265 +    // -------------------------------------------------------------------
   3.266 +    /** @brief Extract file extension from a string
   3.267 +     *  @param pFile Input file
   3.268 +     *  @return Extension without trailing dot, all lowercase
   3.269 +     */
   3.270 +    static std::string GetExtension (
   3.271 +        const std::string& pFile);
   3.272 +
   3.273 +    // -------------------------------------------------------------------
   3.274 +    /** @brief Check whether a file starts with one or more magic tokens
   3.275 +     *  @param pFile Input file
   3.276 +     *  @param pIOHandler IO system to be used
   3.277 +     *  @param magic n magic tokens
   3.278 +     *  @params num Size of magic
   3.279 +     *  @param offset Offset from file start where tokens are located
   3.280 +     *  @param Size of one token, in bytes. Maximally 16 bytes.
   3.281 +     *  @return true if one of the given tokens was found
   3.282 +     *
   3.283 +     *  @note For convenience, the check is also performed for the
   3.284 +     *  byte-swapped variant of all tokens (big endian). Only for
   3.285 +     *  tokens of size 2,4.
   3.286 +     */
   3.287 +    static bool CheckMagicToken(
   3.288 +        IOSystem* pIOHandler,
   3.289 +        const std::string& pFile,
   3.290 +        const void* magic,
   3.291 +        unsigned int num,
   3.292 +        unsigned int offset = 0,
   3.293 +        unsigned int size   = 4);
   3.294 +
   3.295 +    // -------------------------------------------------------------------
   3.296 +    /** An utility for all text file loaders. It converts a file to our
   3.297 +     *   UTF8 character set. Errors are reported, but ignored.
   3.298 +     *
   3.299 +     *  @param data File buffer to be converted to UTF8 data. The buffer
   3.300 +     *  is resized as appropriate. */
   3.301 +    static void ConvertToUTF8(
   3.302 +        std::vector<char>& data);
   3.303 +
   3.304 +    // -------------------------------------------------------------------
   3.305 +    /** An utility for all text file loaders. It converts a file from our
   3.306 +     *   UTF8 character set back to ISO-8859-1. Errors are reported, but ignored.
   3.307 +     *
   3.308 +     *  @param data File buffer to be converted from UTF8 to ISO-8859-1. The buffer
   3.309 +     *  is resized as appropriate. */
   3.310 +    static void ConvertUTF8toISO8859_1(
   3.311 +        std::string& data);
   3.312 +
   3.313 +    // -------------------------------------------------------------------
   3.314 +    /// @brief  Enum to define, if empty files are ok or not.
   3.315 +    enum TextFileMode { 
   3.316 +        ALLOW_EMPTY,
   3.317 +        FORBID_EMPTY 
   3.318 +    };
   3.319 +
   3.320 +    // -------------------------------------------------------------------
   3.321 +    /** Utility for text file loaders which copies the contents of the
   3.322 +     *  file into a memory buffer and converts it to our UTF8
   3.323 +     *  representation.
   3.324 +     *  @param stream Stream to read from.
   3.325 +     *  @param data Output buffer to be resized and filled with the
   3.326 +     *   converted text file data. The buffer is terminated with
   3.327 +     *   a binary 0.
   3.328 +     *  @param mode Whether it is OK to load empty text files. */
   3.329 +    static void TextFileToBuffer(
   3.330 +        IOStream* stream,
   3.331 +        std::vector<char>& data,
   3.332 +        TextFileMode mode = FORBID_EMPTY);
   3.333 +
   3.334 +    // -------------------------------------------------------------------
   3.335 +    /** Utility function to move a std::vector into a aiScene array
   3.336 +    *  @param vec The vector to be moved
   3.337 +    *  @param out The output pointer to the allocated array.
   3.338 +    *  @param numOut The output count of elements copied. */
   3.339 +    template<typename T>
   3.340 +    AI_FORCE_INLINE
   3.341 +    static void CopyVector(
   3.342 +        std::vector<T>& vec,
   3.343 +        T*& out,
   3.344 +        unsigned int& outLength)
   3.345 +    {
   3.346 +        outLength = unsigned(vec.size());
   3.347 +        if (outLength) {
   3.348 +            out = new T[outLength];
   3.349 +            std::swap_ranges(vec.begin(), vec.end(), out);
   3.350 +        }
   3.351 +    }
   3.352 +
   3.353 +protected:
   3.354 +    /// Error description in case there was one.
   3.355 +    std::string m_ErrorText;
   3.356 +    /// Currently set progress handler.
   3.357 +    ProgressHandler* m_progress;
   3.358 +};
   3.359 +
   3.360 +
   3.361 +
   3.362 +} // end of namespace Assimp
   3.363 +
   3.364 +#endif // AI_BASEIMPORTER_H_INC
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/include/miniassimp/Compiler/poppack1.h	Mon Jan 28 18:19:26 2019 +0200
     4.3 @@ -0,0 +1,22 @@
     4.4 +
     4.5 +// ===============================================================================
     4.6 +// May be included multiple times - resets structure packing to the defaults 
     4.7 +// for all supported compilers. Reverts the changes made by #include <pushpack1.h> 
     4.8 +//
     4.9 +// Currently this works on the following compilers:
    4.10 +// MSVC 7,8,9
    4.11 +// GCC
    4.12 +// BORLAND (complains about 'pack state changed but not reverted', but works)
    4.13 +// ===============================================================================
    4.14 +
    4.15 +#ifndef AI_PUSHPACK_IS_DEFINED
    4.16 +#	error pushpack1.h must be included after poppack1.h
    4.17 +#endif
    4.18 +
    4.19 +// reset packing to the original value
    4.20 +#if defined(_MSC_VER) ||  defined(__BORLANDC__) || defined (__BCPLUSPLUS__)
    4.21 +#	pragma pack( pop )
    4.22 +#endif
    4.23 +#undef PACK_STRUCT
    4.24 +
    4.25 +#undef AI_PUSHPACK_IS_DEFINED
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/include/miniassimp/Compiler/pstdint.h	Mon Jan 28 18:19:26 2019 +0200
     5.3 @@ -0,0 +1,912 @@
     5.4 +/*  A portable stdint.h
     5.5 + ****************************************************************************
     5.6 + *  BSD License:
     5.7 + ****************************************************************************
     5.8 + *
     5.9 + *  Copyright (c) 2005-2016 Paul Hsieh
    5.10 + *  All rights reserved.
    5.11 + *
    5.12 + *  Redistribution and use in source and binary forms, with or without
    5.13 + *  modification, are permitted provided that the following conditions
    5.14 + *  are met:
    5.15 + *
    5.16 + *  1. Redistributions of source code must retain the above copyright
    5.17 + *     notice, this list of conditions and the following disclaimer.
    5.18 + *  2. Redistributions in binary form must reproduce the above copyright
    5.19 + *     notice, this list of conditions and the following disclaimer in the
    5.20 + *     documentation and/or other materials provided with the distribution.
    5.21 + *  3. The name of the author may not be used to endorse or promote products
    5.22 + *     derived from this software without specific prior written permission.
    5.23 + *
    5.24 + *  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
    5.25 + *  IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    5.26 + *  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    5.27 + *  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
    5.28 + *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
    5.29 + *  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    5.30 + *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    5.31 + *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    5.32 + *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
    5.33 + *  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    5.34 + *
    5.35 + ****************************************************************************
    5.36 + *
    5.37 + *  Version 0.1.15.4
    5.38 + *
    5.39 + *  The ANSI C standard committee, for the C99 standard, specified the
    5.40 + *  inclusion of a new standard include file called stdint.h.  This is
    5.41 + *  a very useful and long desired include file which contains several
    5.42 + *  very precise definitions for integer scalar types that is
    5.43 + *  critically important for making portable several classes of
    5.44 + *  applications including cryptography, hashing, variable length
    5.45 + *  integer libraries and so on.  But for most developers its likely
    5.46 + *  useful just for programming sanity.
    5.47 + *
    5.48 + *  The problem is that some compiler vendors chose to ignore the C99
    5.49 + *  standard and some older compilers have no opportunity to be updated.
    5.50 + *  Because of this situation, simply including stdint.h in your code
    5.51 + *  makes it unportable.
    5.52 + *
    5.53 + *  So that's what this file is all about.  Its an attempt to build a
    5.54 + *  single universal include file that works on as many platforms as
    5.55 + *  possible to deliver what stdint.h is supposed to.  Even compilers
    5.56 + *  that already come with stdint.h can use this file instead without
    5.57 + *  any loss of functionality.  A few things that should be noted about
    5.58 + *  this file:
    5.59 + *
    5.60 + *    1) It is not guaranteed to be portable and/or present an identical
    5.61 + *       interface on all platforms.  The extreme variability of the
    5.62 + *       ANSI C standard makes this an impossibility right from the
    5.63 + *       very get go. Its really only meant to be useful for the vast
    5.64 + *       majority of platforms that possess the capability of
    5.65 + *       implementing usefully and precisely defined, standard sized
    5.66 + *       integer scalars.  Systems which are not intrinsically 2s
    5.67 + *       complement may produce invalid constants.
    5.68 + *
    5.69 + *    2) There is an unavoidable use of non-reserved symbols.
    5.70 + *
    5.71 + *    3) Other standard include files are invoked.
    5.72 + *
    5.73 + *    4) This file may come in conflict with future platforms that do
    5.74 + *       include stdint.h.  The hope is that one or the other can be
    5.75 + *       used with no real difference.
    5.76 + *
    5.77 + *    5) In the current version, if your platform can't represent
    5.78 + *       int32_t, int16_t and int8_t, it just dumps out with a compiler
    5.79 + *       error.
    5.80 + *
    5.81 + *    6) 64 bit integers may or may not be defined.  Test for their
    5.82 + *       presence with the test: #ifdef INT64_MAX or #ifdef UINT64_MAX.
    5.83 + *       Note that this is different from the C99 specification which
    5.84 + *       requires the existence of 64 bit support in the compiler.  If
    5.85 + *       this is not defined for your platform, yet it is capable of
    5.86 + *       dealing with 64 bits then it is because this file has not yet
    5.87 + *       been extended to cover all of your system's capabilities.
    5.88 + *
    5.89 + *    7) (u)intptr_t may or may not be defined.  Test for its presence
    5.90 + *       with the test: #ifdef PTRDIFF_MAX.  If this is not defined
    5.91 + *       for your platform, then it is because this file has not yet
    5.92 + *       been extended to cover all of your system's capabilities, not
    5.93 + *       because its optional.
    5.94 + *
    5.95 + *    8) The following might not been defined even if your platform is
    5.96 + *       capable of defining it:
    5.97 + *
    5.98 + *       WCHAR_MIN
    5.99 + *       WCHAR_MAX
   5.100 + *       (u)int64_t
   5.101 + *       PTRDIFF_MIN
   5.102 + *       PTRDIFF_MAX
   5.103 + *       (u)intptr_t
   5.104 + *
   5.105 + *    9) The following have not been defined:
   5.106 + *
   5.107 + *       WINT_MIN
   5.108 + *       WINT_MAX
   5.109 + *
   5.110 + *   10) The criteria for defining (u)int_least(*)_t isn't clear,
   5.111 + *       except for systems which don't have a type that precisely
   5.112 + *       defined 8, 16, or 32 bit types (which this include file does
   5.113 + *       not support anyways). Default definitions have been given.
   5.114 + *
   5.115 + *   11) The criteria for defining (u)int_fast(*)_t isn't something I
   5.116 + *       would trust to any particular compiler vendor or the ANSI C
   5.117 + *       committee.  It is well known that "compatible systems" are
   5.118 + *       commonly created that have very different performance
   5.119 + *       characteristics from the systems they are compatible with,
   5.120 + *       especially those whose vendors make both the compiler and the
   5.121 + *       system.  Default definitions have been given, but its strongly
   5.122 + *       recommended that users never use these definitions for any
   5.123 + *       reason (they do *NOT* deliver any serious guarantee of
   5.124 + *       improved performance -- not in this file, nor any vendor's
   5.125 + *       stdint.h).
   5.126 + *
   5.127 + *   12) The following macros:
   5.128 + *
   5.129 + *       PRINTF_INTMAX_MODIFIER
   5.130 + *       PRINTF_INT64_MODIFIER
   5.131 + *       PRINTF_INT32_MODIFIER
   5.132 + *       PRINTF_INT16_MODIFIER
   5.133 + *       PRINTF_LEAST64_MODIFIER
   5.134 + *       PRINTF_LEAST32_MODIFIER
   5.135 + *       PRINTF_LEAST16_MODIFIER
   5.136 + *       PRINTF_INTPTR_MODIFIER
   5.137 + *
   5.138 + *       are strings which have been defined as the modifiers required
   5.139 + *       for the "d", "u" and "x" printf formats to correctly output
   5.140 + *       (u)intmax_t, (u)int64_t, (u)int32_t, (u)int16_t, (u)least64_t,
   5.141 + *       (u)least32_t, (u)least16_t and (u)intptr_t types respectively.
   5.142 + *       PRINTF_INTPTR_MODIFIER is not defined for some systems which
   5.143 + *       provide their own stdint.h.  PRINTF_INT64_MODIFIER is not
   5.144 + *       defined if INT64_MAX is not defined.  These are an extension
   5.145 + *       beyond what C99 specifies must be in stdint.h.
   5.146 + *
   5.147 + *       In addition, the following macros are defined:
   5.148 + *
   5.149 + *       PRINTF_INTMAX_HEX_WIDTH
   5.150 + *       PRINTF_INT64_HEX_WIDTH
   5.151 + *       PRINTF_INT32_HEX_WIDTH
   5.152 + *       PRINTF_INT16_HEX_WIDTH
   5.153 + *       PRINTF_INT8_HEX_WIDTH
   5.154 + *       PRINTF_INTMAX_DEC_WIDTH
   5.155 + *       PRINTF_INT64_DEC_WIDTH
   5.156 + *       PRINTF_INT32_DEC_WIDTH
   5.157 + *       PRINTF_INT16_DEC_WIDTH
   5.158 + *       PRINTF_UINT8_DEC_WIDTH
   5.159 + *       PRINTF_UINTMAX_DEC_WIDTH
   5.160 + *       PRINTF_UINT64_DEC_WIDTH
   5.161 + *       PRINTF_UINT32_DEC_WIDTH
   5.162 + *       PRINTF_UINT16_DEC_WIDTH
   5.163 + *       PRINTF_UINT8_DEC_WIDTH
   5.164 + *
   5.165 + *       Which specifies the maximum number of characters required to
   5.166 + *       print the number of that type in either hexadecimal or decimal.
   5.167 + *       These are an extension beyond what C99 specifies must be in
   5.168 + *       stdint.h.
   5.169 + *
   5.170 + *  Compilers tested (all with 0 warnings at their highest respective
   5.171 + *  settings): Borland Turbo C 2.0, WATCOM C/C++ 11.0 (16 bits and 32
   5.172 + *  bits), Microsoft Visual C++ 6.0 (32 bit), Microsoft Visual Studio
   5.173 + *  .net (VC7), Intel C++ 4.0, GNU gcc v3.3.3
   5.174 + *
   5.175 + *  This file should be considered a work in progress.  Suggestions for
   5.176 + *  improvements, especially those which increase coverage are strongly
   5.177 + *  encouraged.
   5.178 + *
   5.179 + *  Acknowledgements
   5.180 + *
   5.181 + *  The following people have made significant contributions to the
   5.182 + *  development and testing of this file:
   5.183 + *
   5.184 + *  Chris Howie
   5.185 + *  John Steele Scott
   5.186 + *  Dave Thorup
   5.187 + *  John Dill
   5.188 + *  Florian Wobbe
   5.189 + *  Christopher Sean Morrison
   5.190 + *  Mikkel Fahnoe Jorgensen
   5.191 + *
   5.192 + */
   5.193 +
   5.194 +#include <stddef.h>
   5.195 +#include <limits.h>
   5.196 +#include <signal.h>
   5.197 +
   5.198 +/*
   5.199 + *  For gcc with _STDINT_H, fill in the PRINTF_INT*_MODIFIER macros, and
   5.200 + *  do nothing else.  On the Mac OS X version of gcc this is _STDINT_H_.
   5.201 + */
   5.202 +
   5.203 +#if ((defined(__SUNPRO_C) && __SUNPRO_C >= 0x570) || (defined(_MSC_VER) && _MSC_VER >= 1600) || (defined(__STDC__) && __STDC__ && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || (defined (__WATCOMC__) && (defined (_STDINT_H_INCLUDED) || __WATCOMC__ >= 1250)) || (defined(__GNUC__) && (__GNUC__ > 3 || defined(_STDINT_H) || defined(_STDINT_H_) || defined (__UINT_FAST64_TYPE__)) )) && !defined (_PSTDINT_H_INCLUDED)
   5.204 +#include <stdint.h>
   5.205 +#define _PSTDINT_H_INCLUDED
   5.206 +# if defined(__GNUC__) && (defined(__x86_64__) || defined(__ppc64__)) && !(defined(__APPLE__) && defined(__MACH__))
   5.207 +#  ifndef PRINTF_INT64_MODIFIER
   5.208 +#   define PRINTF_INT64_MODIFIER "l"
   5.209 +#  endif
   5.210 +#  ifndef PRINTF_INT32_MODIFIER
   5.211 +#   define PRINTF_INT32_MODIFIER ""
   5.212 +#  endif
   5.213 +# else
   5.214 +#  ifndef PRINTF_INT64_MODIFIER
   5.215 +#   define PRINTF_INT64_MODIFIER "ll"
   5.216 +#  endif
   5.217 +#  ifndef PRINTF_INT32_MODIFIER
   5.218 +#   if (UINT_MAX == UINT32_MAX)
   5.219 +#    define PRINTF_INT32_MODIFIER ""
   5.220 +#   else
   5.221 +#    define PRINTF_INT32_MODIFIER "l"
   5.222 +#   endif
   5.223 +#  endif
   5.224 +# endif
   5.225 +# ifndef PRINTF_INT16_MODIFIER
   5.226 +#  define PRINTF_INT16_MODIFIER "h"
   5.227 +# endif
   5.228 +# ifndef PRINTF_INTMAX_MODIFIER
   5.229 +#  define PRINTF_INTMAX_MODIFIER PRINTF_INT64_MODIFIER
   5.230 +# endif
   5.231 +# ifndef PRINTF_INT64_HEX_WIDTH
   5.232 +#  define PRINTF_INT64_HEX_WIDTH "16"
   5.233 +# endif
   5.234 +# ifndef PRINTF_UINT64_HEX_WIDTH
   5.235 +#  define PRINTF_UINT64_HEX_WIDTH "16"
   5.236 +# endif
   5.237 +# ifndef PRINTF_INT32_HEX_WIDTH
   5.238 +#  define PRINTF_INT32_HEX_WIDTH "8"
   5.239 +# endif
   5.240 +# ifndef PRINTF_UINT32_HEX_WIDTH
   5.241 +#  define PRINTF_UINT32_HEX_WIDTH "8"
   5.242 +# endif
   5.243 +# ifndef PRINTF_INT16_HEX_WIDTH
   5.244 +#  define PRINTF_INT16_HEX_WIDTH "4"
   5.245 +# endif
   5.246 +# ifndef PRINTF_UINT16_HEX_WIDTH
   5.247 +#  define PRINTF_UINT16_HEX_WIDTH "4"
   5.248 +# endif
   5.249 +# ifndef PRINTF_INT8_HEX_WIDTH
   5.250 +#  define PRINTF_INT8_HEX_WIDTH "2"
   5.251 +# endif
   5.252 +# ifndef PRINTF_UINT8_HEX_WIDTH
   5.253 +#  define PRINTF_UINT8_HEX_WIDTH "2"
   5.254 +# endif
   5.255 +# ifndef PRINTF_INT64_DEC_WIDTH
   5.256 +#  define PRINTF_INT64_DEC_WIDTH "19"
   5.257 +# endif
   5.258 +# ifndef PRINTF_UINT64_DEC_WIDTH
   5.259 +#  define PRINTF_UINT64_DEC_WIDTH "20"
   5.260 +# endif
   5.261 +# ifndef PRINTF_INT32_DEC_WIDTH
   5.262 +#  define PRINTF_INT32_DEC_WIDTH "10"
   5.263 +# endif
   5.264 +# ifndef PRINTF_UINT32_DEC_WIDTH
   5.265 +#  define PRINTF_UINT32_DEC_WIDTH "10"
   5.266 +# endif
   5.267 +# ifndef PRINTF_INT16_DEC_WIDTH
   5.268 +#  define PRINTF_INT16_DEC_WIDTH "5"
   5.269 +# endif
   5.270 +# ifndef PRINTF_UINT16_DEC_WIDTH
   5.271 +#  define PRINTF_UINT16_DEC_WIDTH "5"
   5.272 +# endif
   5.273 +# ifndef PRINTF_INT8_DEC_WIDTH
   5.274 +#  define PRINTF_INT8_DEC_WIDTH "3"
   5.275 +# endif
   5.276 +# ifndef PRINTF_UINT8_DEC_WIDTH
   5.277 +#  define PRINTF_UINT8_DEC_WIDTH "3"
   5.278 +# endif
   5.279 +# ifndef PRINTF_INTMAX_HEX_WIDTH
   5.280 +#  define PRINTF_INTMAX_HEX_WIDTH PRINTF_UINT64_HEX_WIDTH
   5.281 +# endif
   5.282 +# ifndef PRINTF_UINTMAX_HEX_WIDTH
   5.283 +#  define PRINTF_UINTMAX_HEX_WIDTH PRINTF_UINT64_HEX_WIDTH
   5.284 +# endif
   5.285 +# ifndef PRINTF_INTMAX_DEC_WIDTH
   5.286 +#  define PRINTF_INTMAX_DEC_WIDTH PRINTF_UINT64_DEC_WIDTH
   5.287 +# endif
   5.288 +# ifndef PRINTF_UINTMAX_DEC_WIDTH
   5.289 +#  define PRINTF_UINTMAX_DEC_WIDTH PRINTF_UINT64_DEC_WIDTH
   5.290 +# endif
   5.291 +
   5.292 +/*
   5.293 + *  Something really weird is going on with Open Watcom.  Just pull some of
   5.294 + *  these duplicated definitions from Open Watcom's stdint.h file for now.
   5.295 + */
   5.296 +
   5.297 +# if defined (__WATCOMC__) && __WATCOMC__ >= 1250
   5.298 +#  if !defined (INT64_C)
   5.299 +#   define INT64_C(x)   (x + (INT64_MAX - INT64_MAX))
   5.300 +#  endif
   5.301 +#  if !defined (UINT64_C)
   5.302 +#   define UINT64_C(x)  (x + (UINT64_MAX - UINT64_MAX))
   5.303 +#  endif
   5.304 +#  if !defined (INT32_C)
   5.305 +#   define INT32_C(x)   (x + (INT32_MAX - INT32_MAX))
   5.306 +#  endif
   5.307 +#  if !defined (UINT32_C)
   5.308 +#   define UINT32_C(x)  (x + (UINT32_MAX - UINT32_MAX))
   5.309 +#  endif
   5.310 +#  if !defined (INT16_C)
   5.311 +#   define INT16_C(x)   (x)
   5.312 +#  endif
   5.313 +#  if !defined (UINT16_C)
   5.314 +#   define UINT16_C(x)  (x)
   5.315 +#  endif
   5.316 +#  if !defined (INT8_C)
   5.317 +#   define INT8_C(x)   (x)
   5.318 +#  endif
   5.319 +#  if !defined (UINT8_C)
   5.320 +#   define UINT8_C(x)  (x)
   5.321 +#  endif
   5.322 +#  if !defined (UINT64_MAX)
   5.323 +#   define UINT64_MAX  18446744073709551615ULL
   5.324 +#  endif
   5.325 +#  if !defined (INT64_MAX)
   5.326 +#   define INT64_MAX  9223372036854775807LL
   5.327 +#  endif
   5.328 +#  if !defined (UINT32_MAX)
   5.329 +#   define UINT32_MAX  4294967295UL
   5.330 +#  endif
   5.331 +#  if !defined (INT32_MAX)
   5.332 +#   define INT32_MAX  2147483647L
   5.333 +#  endif
   5.334 +#  if !defined (INTMAX_MAX)
   5.335 +#   define INTMAX_MAX INT64_MAX
   5.336 +#  endif
   5.337 +#  if !defined (INTMAX_MIN)
   5.338 +#   define INTMAX_MIN INT64_MIN
   5.339 +#  endif
   5.340 +# endif
   5.341 +#endif
   5.342 +
   5.343 +/*
   5.344 + *  I have no idea what is the truly correct thing to do on older Solaris.
   5.345 + *  From some online discussions, this seems to be what is being
   5.346 + *  recommended.  For people who actually are developing on older Solaris,
   5.347 + *  what I would like to know is, does this define all of the relevant
   5.348 + *  macros of a complete stdint.h?  Remember, in pstdint.h 64 bit is
   5.349 + *  considered optional.
   5.350 + */
   5.351 +
   5.352 +#if (defined(__SUNPRO_C) && __SUNPRO_C >= 0x420) && !defined(_PSTDINT_H_INCLUDED)
   5.353 +#include <sys/inttypes.h>
   5.354 +#define _PSTDINT_H_INCLUDED
   5.355 +#endif
   5.356 +
   5.357 +#ifndef _PSTDINT_H_INCLUDED
   5.358 +#define _PSTDINT_H_INCLUDED
   5.359 +
   5.360 +#ifndef SIZE_MAX
   5.361 +# define SIZE_MAX (~(size_t)0)
   5.362 +#endif
   5.363 +
   5.364 +/*
   5.365 + *  Deduce the type assignments from limits.h under the assumption that
   5.366 + *  integer sizes in bits are powers of 2, and follow the ANSI
   5.367 + *  definitions.
   5.368 + */
   5.369 +
   5.370 +#ifndef UINT8_MAX
   5.371 +# define UINT8_MAX 0xff
   5.372 +#endif
   5.373 +#if !defined(uint8_t) && !defined(_UINT8_T) && !defined(vxWorks)
   5.374 +# if (UCHAR_MAX == UINT8_MAX) || defined (S_SPLINT_S)
   5.375 +    typedef unsigned char uint8_t;
   5.376 +#   define UINT8_C(v) ((uint8_t) v)
   5.377 +# else
   5.378 +#   error "Platform not supported"
   5.379 +# endif
   5.380 +#endif
   5.381 +
   5.382 +#ifndef INT8_MAX
   5.383 +# define INT8_MAX 0x7f
   5.384 +#endif
   5.385 +#ifndef INT8_MIN
   5.386 +# define INT8_MIN INT8_C(0x80)
   5.387 +#endif
   5.388 +#if !defined(int8_t) && !defined(_INT8_T) && !defined(vxWorks)
   5.389 +# if (SCHAR_MAX == INT8_MAX) || defined (S_SPLINT_S)
   5.390 +    typedef signed char int8_t;
   5.391 +#   define INT8_C(v) ((int8_t) v)
   5.392 +# else
   5.393 +#   error "Platform not supported"
   5.394 +# endif
   5.395 +#endif
   5.396 +
   5.397 +#ifndef UINT16_MAX
   5.398 +# define UINT16_MAX 0xffff
   5.399 +#endif
   5.400 +#if !defined(uint16_t) && !defined(_UINT16_T) && !defined(vxWorks)
   5.401 +#if (UINT_MAX == UINT16_MAX) || defined (S_SPLINT_S)
   5.402 +  typedef unsigned int uint16_t;
   5.403 +# ifndef PRINTF_INT16_MODIFIER
   5.404 +#  define PRINTF_INT16_MODIFIER ""
   5.405 +# endif
   5.406 +# define UINT16_C(v) ((uint16_t) (v))
   5.407 +#elif (USHRT_MAX == UINT16_MAX)
   5.408 +  typedef unsigned short uint16_t;
   5.409 +# define UINT16_C(v) ((uint16_t) (v))
   5.410 +# ifndef PRINTF_INT16_MODIFIER
   5.411 +#  define PRINTF_INT16_MODIFIER "h"
   5.412 +# endif
   5.413 +#else
   5.414 +#error "Platform not supported"
   5.415 +#endif
   5.416 +#endif
   5.417 +
   5.418 +#ifndef INT16_MAX
   5.419 +# define INT16_MAX 0x7fff
   5.420 +#endif
   5.421 +#ifndef INT16_MIN
   5.422 +# define INT16_MIN INT16_C(0x8000)
   5.423 +#endif
   5.424 +#if !defined(int16_t) && !defined(_INT16_T) && !defined(vxWorks)
   5.425 +#if (INT_MAX == INT16_MAX) || defined (S_SPLINT_S)
   5.426 +  typedef signed int int16_t;
   5.427 +# define INT16_C(v) ((int16_t) (v))
   5.428 +# ifndef PRINTF_INT16_MODIFIER
   5.429 +#  define PRINTF_INT16_MODIFIER ""
   5.430 +# endif
   5.431 +#elif (SHRT_MAX == INT16_MAX)
   5.432 +  typedef signed short int16_t;
   5.433 +# define INT16_C(v) ((int16_t) (v))
   5.434 +# ifndef PRINTF_INT16_MODIFIER
   5.435 +#  define PRINTF_INT16_MODIFIER "h"
   5.436 +# endif
   5.437 +#else
   5.438 +#error "Platform not supported"
   5.439 +#endif
   5.440 +#endif
   5.441 +
   5.442 +#ifndef UINT32_MAX
   5.443 +# define UINT32_MAX (0xffffffffUL)
   5.444 +#endif
   5.445 +#if !defined(uint32_t) && !defined(_UINT32_T) && !defined(vxWorks)
   5.446 +#if (ULONG_MAX == UINT32_MAX) || defined (S_SPLINT_S)
   5.447 +  typedef unsigned long uint32_t;
   5.448 +# define UINT32_C(v) v ## UL
   5.449 +# ifndef PRINTF_INT32_MODIFIER
   5.450 +#  define PRINTF_INT32_MODIFIER "l"
   5.451 +# endif
   5.452 +#elif (UINT_MAX == UINT32_MAX)
   5.453 +  typedef unsigned int uint32_t;
   5.454 +# ifndef PRINTF_INT32_MODIFIER
   5.455 +#  define PRINTF_INT32_MODIFIER ""
   5.456 +# endif
   5.457 +# define UINT32_C(v) v ## U
   5.458 +#elif (USHRT_MAX == UINT32_MAX)
   5.459 +  typedef unsigned short uint32_t;
   5.460 +# define UINT32_C(v) ((unsigned short) (v))
   5.461 +# ifndef PRINTF_INT32_MODIFIER
   5.462 +#  define PRINTF_INT32_MODIFIER ""
   5.463 +# endif
   5.464 +#else
   5.465 +#error "Platform not supported"
   5.466 +#endif
   5.467 +#endif
   5.468 +
   5.469 +#ifndef INT32_MAX
   5.470 +# define INT32_MAX (0x7fffffffL)
   5.471 +#endif
   5.472 +#ifndef INT32_MIN
   5.473 +# define INT32_MIN INT32_C(0x80000000)
   5.474 +#endif
   5.475 +#if !defined(int32_t) && !defined(_INT32_T) && !defined(vxWorks)
   5.476 +#if (LONG_MAX == INT32_MAX) || defined (S_SPLINT_S)
   5.477 +  typedef signed long int32_t;
   5.478 +# define INT32_C(v) v ## L
   5.479 +# ifndef PRINTF_INT32_MODIFIER
   5.480 +#  define PRINTF_INT32_MODIFIER "l"
   5.481 +# endif
   5.482 +#elif (INT_MAX == INT32_MAX)
   5.483 +  typedef signed int int32_t;
   5.484 +# define INT32_C(v) v
   5.485 +# ifndef PRINTF_INT32_MODIFIER
   5.486 +#  define PRINTF_INT32_MODIFIER ""
   5.487 +# endif
   5.488 +#elif (SHRT_MAX == INT32_MAX)
   5.489 +  typedef signed short int32_t;
   5.490 +# define INT32_C(v) ((short) (v))
   5.491 +# ifndef PRINTF_INT32_MODIFIER
   5.492 +#  define PRINTF_INT32_MODIFIER ""
   5.493 +# endif
   5.494 +#else
   5.495 +#error "Platform not supported"
   5.496 +#endif
   5.497 +#endif
   5.498 +
   5.499 +/*
   5.500 + *  The macro stdint_int64_defined is temporarily used to record
   5.501 + *  whether or not 64 integer support is available.  It must be
   5.502 + *  defined for any 64 integer extensions for new platforms that are
   5.503 + *  added.
   5.504 + */
   5.505 +
   5.506 +#undef stdint_int64_defined
   5.507 +#if (defined(__STDC__) && defined(__STDC_VERSION__)) || defined (S_SPLINT_S)
   5.508 +# if (__STDC__ && __STDC_VERSION__ >= 199901L) || defined (S_SPLINT_S)
   5.509 +#  define stdint_int64_defined
   5.510 +   typedef long long int64_t;
   5.511 +   typedef unsigned long long uint64_t;
   5.512 +#  define UINT64_C(v) v ## ULL
   5.513 +#  define  INT64_C(v) v ## LL
   5.514 +#  ifndef PRINTF_INT64_MODIFIER
   5.515 +#   define PRINTF_INT64_MODIFIER "ll"
   5.516 +#  endif
   5.517 +# endif
   5.518 +#endif
   5.519 +
   5.520 +#if !defined (stdint_int64_defined)
   5.521 +# if defined(__GNUC__) && !defined(vxWorks)
   5.522 +#  define stdint_int64_defined
   5.523 +   __extension__ typedef long long int64_t;
   5.524 +   __extension__ typedef unsigned long long uint64_t;
   5.525 +#  define UINT64_C(v) v ## ULL
   5.526 +#  define  INT64_C(v) v ## LL
   5.527 +#  ifndef PRINTF_INT64_MODIFIER
   5.528 +#   define PRINTF_INT64_MODIFIER "ll"
   5.529 +#  endif
   5.530 +# elif defined(__MWERKS__) || defined (__SUNPRO_C) || defined (__SUNPRO_CC) || defined (__APPLE_CC__) || defined (_LONG_LONG) || defined (_CRAYC) || defined (S_SPLINT_S)
   5.531 +#  define stdint_int64_defined
   5.532 +   typedef long long int64_t;
   5.533 +   typedef unsigned long long uint64_t;
   5.534 +#  define UINT64_C(v) v ## ULL
   5.535 +#  define  INT64_C(v) v ## LL
   5.536 +#  ifndef PRINTF_INT64_MODIFIER
   5.537 +#   define PRINTF_INT64_MODIFIER "ll"
   5.538 +#  endif
   5.539 +# elif (defined(__WATCOMC__) && defined(__WATCOM_INT64__)) || (defined(_MSC_VER) && _INTEGRAL_MAX_BITS >= 64) || (defined (__BORLANDC__) && __BORLANDC__ > 0x460) || defined (__alpha) || defined (__DECC)
   5.540 +#  define stdint_int64_defined
   5.541 +   typedef __int64 int64_t;
   5.542 +   typedef unsigned __int64 uint64_t;
   5.543 +#  define UINT64_C(v) v ## UI64
   5.544 +#  define  INT64_C(v) v ## I64
   5.545 +#  ifndef PRINTF_INT64_MODIFIER
   5.546 +#   define PRINTF_INT64_MODIFIER "I64"
   5.547 +#  endif
   5.548 +# endif
   5.549 +#endif
   5.550 +
   5.551 +#if !defined (LONG_LONG_MAX) && defined (INT64_C)
   5.552 +# define LONG_LONG_MAX INT64_C (9223372036854775807)
   5.553 +#endif
   5.554 +#ifndef ULONG_LONG_MAX
   5.555 +# define ULONG_LONG_MAX UINT64_C (18446744073709551615)
   5.556 +#endif
   5.557 +
   5.558 +#if !defined (INT64_MAX) && defined (INT64_C)
   5.559 +# define INT64_MAX INT64_C (9223372036854775807)
   5.560 +#endif
   5.561 +#if !defined (INT64_MIN) && defined (INT64_C)
   5.562 +# define INT64_MIN INT64_C (-9223372036854775808)
   5.563 +#endif
   5.564 +#if !defined (UINT64_MAX) && defined (INT64_C)
   5.565 +# define UINT64_MAX UINT64_C (18446744073709551615)
   5.566 +#endif
   5.567 +
   5.568 +/*
   5.569 + *  Width of hexadecimal for number field.
   5.570 + */
   5.571 +
   5.572 +#ifndef PRINTF_INT64_HEX_WIDTH
   5.573 +# define PRINTF_INT64_HEX_WIDTH "16"
   5.574 +#endif
   5.575 +#ifndef PRINTF_INT32_HEX_WIDTH
   5.576 +# define PRINTF_INT32_HEX_WIDTH "8"
   5.577 +#endif
   5.578 +#ifndef PRINTF_INT16_HEX_WIDTH
   5.579 +# define PRINTF_INT16_HEX_WIDTH "4"
   5.580 +#endif
   5.581 +#ifndef PRINTF_INT8_HEX_WIDTH
   5.582 +# define PRINTF_INT8_HEX_WIDTH "2"
   5.583 +#endif
   5.584 +#ifndef PRINTF_INT64_DEC_WIDTH
   5.585 +# define PRINTF_INT64_DEC_WIDTH "19"
   5.586 +#endif
   5.587 +#ifndef PRINTF_INT32_DEC_WIDTH
   5.588 +# define PRINTF_INT32_DEC_WIDTH "10"
   5.589 +#endif
   5.590 +#ifndef PRINTF_INT16_DEC_WIDTH
   5.591 +# define PRINTF_INT16_DEC_WIDTH "5"
   5.592 +#endif
   5.593 +#ifndef PRINTF_INT8_DEC_WIDTH
   5.594 +# define PRINTF_INT8_DEC_WIDTH "3"
   5.595 +#endif
   5.596 +#ifndef PRINTF_UINT64_DEC_WIDTH
   5.597 +# define PRINTF_UINT64_DEC_WIDTH "20"
   5.598 +#endif
   5.599 +#ifndef PRINTF_UINT32_DEC_WIDTH
   5.600 +# define PRINTF_UINT32_DEC_WIDTH "10"
   5.601 +#endif
   5.602 +#ifndef PRINTF_UINT16_DEC_WIDTH
   5.603 +# define PRINTF_UINT16_DEC_WIDTH "5"
   5.604 +#endif
   5.605 +#ifndef PRINTF_UINT8_DEC_WIDTH
   5.606 +# define PRINTF_UINT8_DEC_WIDTH "3"
   5.607 +#endif
   5.608 +
   5.609 +/*
   5.610 + *  Ok, lets not worry about 128 bit integers for now.  Moore's law says
   5.611 + *  we don't need to worry about that until about 2040 at which point
   5.612 + *  we'll have bigger things to worry about.
   5.613 + */
   5.614 +
   5.615 +#ifdef stdint_int64_defined
   5.616 +  typedef int64_t intmax_t;
   5.617 +  typedef uint64_t uintmax_t;
   5.618 +# define  INTMAX_MAX   INT64_MAX
   5.619 +# define  INTMAX_MIN   INT64_MIN
   5.620 +# define UINTMAX_MAX  UINT64_MAX
   5.621 +# define UINTMAX_C(v) UINT64_C(v)
   5.622 +# define  INTMAX_C(v)  INT64_C(v)
   5.623 +# ifndef PRINTF_INTMAX_MODIFIER
   5.624 +#   define PRINTF_INTMAX_MODIFIER PRINTF_INT64_MODIFIER
   5.625 +# endif
   5.626 +# ifndef PRINTF_INTMAX_HEX_WIDTH
   5.627 +#  define PRINTF_INTMAX_HEX_WIDTH PRINTF_INT64_HEX_WIDTH
   5.628 +# endif
   5.629 +# ifndef PRINTF_INTMAX_DEC_WIDTH
   5.630 +#  define PRINTF_INTMAX_DEC_WIDTH PRINTF_INT64_DEC_WIDTH
   5.631 +# endif
   5.632 +#else
   5.633 +  typedef int32_t intmax_t;
   5.634 +  typedef uint32_t uintmax_t;
   5.635 +# define  INTMAX_MAX   INT32_MAX
   5.636 +# define UINTMAX_MAX  UINT32_MAX
   5.637 +# define UINTMAX_C(v) UINT32_C(v)
   5.638 +# define  INTMAX_C(v)  INT32_C(v)
   5.639 +# ifndef PRINTF_INTMAX_MODIFIER
   5.640 +#   define PRINTF_INTMAX_MODIFIER PRINTF_INT32_MODIFIER
   5.641 +# endif
   5.642 +# ifndef PRINTF_INTMAX_HEX_WIDTH
   5.643 +#  define PRINTF_INTMAX_HEX_WIDTH PRINTF_INT32_HEX_WIDTH
   5.644 +# endif
   5.645 +# ifndef PRINTF_INTMAX_DEC_WIDTH
   5.646 +#  define PRINTF_INTMAX_DEC_WIDTH PRINTF_INT32_DEC_WIDTH
   5.647 +# endif
   5.648 +#endif
   5.649 +
   5.650 +/*
   5.651 + *  Because this file currently only supports platforms which have
   5.652 + *  precise powers of 2 as bit sizes for the default integers, the
   5.653 + *  least definitions are all trivial.  Its possible that a future
   5.654 + *  version of this file could have different definitions.
   5.655 + */
   5.656 +
   5.657 +#ifndef stdint_least_defined
   5.658 +  typedef   int8_t   int_least8_t;
   5.659 +  typedef  uint8_t  uint_least8_t;
   5.660 +  typedef  int16_t  int_least16_t;
   5.661 +  typedef uint16_t uint_least16_t;
   5.662 +  typedef  int32_t  int_least32_t;
   5.663 +  typedef uint32_t uint_least32_t;
   5.664 +# define PRINTF_LEAST32_MODIFIER PRINTF_INT32_MODIFIER
   5.665 +# define PRINTF_LEAST16_MODIFIER PRINTF_INT16_MODIFIER
   5.666 +# define  UINT_LEAST8_MAX  UINT8_MAX
   5.667 +# define   INT_LEAST8_MAX   INT8_MAX
   5.668 +# define UINT_LEAST16_MAX UINT16_MAX
   5.669 +# define  INT_LEAST16_MAX  INT16_MAX
   5.670 +# define UINT_LEAST32_MAX UINT32_MAX
   5.671 +# define  INT_LEAST32_MAX  INT32_MAX
   5.672 +# define   INT_LEAST8_MIN   INT8_MIN
   5.673 +# define  INT_LEAST16_MIN  INT16_MIN
   5.674 +# define  INT_LEAST32_MIN  INT32_MIN
   5.675 +# ifdef stdint_int64_defined
   5.676 +    typedef  int64_t  int_least64_t;
   5.677 +    typedef uint64_t uint_least64_t;
   5.678 +#   define PRINTF_LEAST64_MODIFIER PRINTF_INT64_MODIFIER
   5.679 +#   define UINT_LEAST64_MAX UINT64_MAX
   5.680 +#   define  INT_LEAST64_MAX  INT64_MAX
   5.681 +#   define  INT_LEAST64_MIN  INT64_MIN
   5.682 +# endif
   5.683 +#endif
   5.684 +#undef stdint_least_defined
   5.685 +
   5.686 +/*
   5.687 + *  The ANSI C committee pretending to know or specify anything about
   5.688 + *  performance is the epitome of misguided arrogance.  The mandate of
   5.689 + *  this file is to *ONLY* ever support that absolute minimum
   5.690 + *  definition of the fast integer types, for compatibility purposes.
   5.691 + *  No extensions, and no attempt to suggest what may or may not be a
   5.692 + *  faster integer type will ever be made in this file.  Developers are
   5.693 + *  warned to stay away from these types when using this or any other
   5.694 + *  stdint.h.
   5.695 + */
   5.696 +
   5.697 +typedef   int_least8_t   int_fast8_t;
   5.698 +typedef  uint_least8_t  uint_fast8_t;
   5.699 +typedef  int_least16_t  int_fast16_t;
   5.700 +typedef uint_least16_t uint_fast16_t;
   5.701 +typedef  int_least32_t  int_fast32_t;
   5.702 +typedef uint_least32_t uint_fast32_t;
   5.703 +#define  UINT_FAST8_MAX  UINT_LEAST8_MAX
   5.704 +#define   INT_FAST8_MAX   INT_LEAST8_MAX
   5.705 +#define UINT_FAST16_MAX UINT_LEAST16_MAX
   5.706 +#define  INT_FAST16_MAX  INT_LEAST16_MAX
   5.707 +#define UINT_FAST32_MAX UINT_LEAST32_MAX
   5.708 +#define  INT_FAST32_MAX  INT_LEAST32_MAX
   5.709 +#define   INT_FAST8_MIN   INT_LEAST8_MIN
   5.710 +#define  INT_FAST16_MIN  INT_LEAST16_MIN
   5.711 +#define  INT_FAST32_MIN  INT_LEAST32_MIN
   5.712 +#ifdef stdint_int64_defined
   5.713 +  typedef  int_least64_t  int_fast64_t;
   5.714 +  typedef uint_least64_t uint_fast64_t;
   5.715 +# define UINT_FAST64_MAX UINT_LEAST64_MAX
   5.716 +# define  INT_FAST64_MAX  INT_LEAST64_MAX
   5.717 +# define  INT_FAST64_MIN  INT_LEAST64_MIN
   5.718 +#endif
   5.719 +
   5.720 +#undef stdint_int64_defined
   5.721 +
   5.722 +/*
   5.723 + *  Whatever piecemeal, per compiler thing we can do about the wchar_t
   5.724 + *  type limits.
   5.725 + */
   5.726 +
   5.727 +#if defined(__WATCOMC__) || defined(_MSC_VER) || defined (__GNUC__) && !defined(vxWorks)
   5.728 +# include <wchar.h>
   5.729 +# ifndef WCHAR_MIN
   5.730 +#  define WCHAR_MIN 0
   5.731 +# endif
   5.732 +# ifndef WCHAR_MAX
   5.733 +#  define WCHAR_MAX ((wchar_t)-1)
   5.734 +# endif
   5.735 +#endif
   5.736 +
   5.737 +/*
   5.738 + *  Whatever piecemeal, per compiler/platform thing we can do about the
   5.739 + *  (u)intptr_t types and limits.
   5.740 + */
   5.741 +
   5.742 +#if (defined (_MSC_VER) && defined (_UINTPTR_T_DEFINED)) || defined (_UINTPTR_T)
   5.743 +# define STDINT_H_UINTPTR_T_DEFINED
   5.744 +#endif
   5.745 +
   5.746 +#ifndef STDINT_H_UINTPTR_T_DEFINED
   5.747 +# if defined (__alpha__) || defined (__ia64__) || defined (__x86_64__) || defined (_WIN64) || defined (__ppc64__)
   5.748 +#  define stdint_intptr_bits 64
   5.749 +# elif defined (__WATCOMC__) || defined (__TURBOC__)
   5.750 +#  if defined(__TINY__) || defined(__SMALL__) || defined(__MEDIUM__)
   5.751 +#    define stdint_intptr_bits 16
   5.752 +#  else
   5.753 +#    define stdint_intptr_bits 32
   5.754 +#  endif
   5.755 +# elif defined (__i386__) || defined (_WIN32) || defined (WIN32) || defined (__ppc64__)
   5.756 +#  define stdint_intptr_bits 32
   5.757 +# elif defined (__INTEL_COMPILER)
   5.758 +/* TODO -- what did Intel do about x86-64? */
   5.759 +# else
   5.760 +/* #error "This platform might not be supported yet" */
   5.761 +# endif
   5.762 +
   5.763 +# ifdef stdint_intptr_bits
   5.764 +#  define stdint_intptr_glue3_i(a,b,c)  a##b##c
   5.765 +#  define stdint_intptr_glue3(a,b,c)    stdint_intptr_glue3_i(a,b,c)
   5.766 +#  ifndef PRINTF_INTPTR_MODIFIER
   5.767 +#    define PRINTF_INTPTR_MODIFIER      stdint_intptr_glue3(PRINTF_INT,stdint_intptr_bits,_MODIFIER)
   5.768 +#  endif
   5.769 +#  ifndef PTRDIFF_MAX
   5.770 +#    define PTRDIFF_MAX                 stdint_intptr_glue3(INT,stdint_intptr_bits,_MAX)
   5.771 +#  endif
   5.772 +#  ifndef PTRDIFF_MIN
   5.773 +#    define PTRDIFF_MIN                 stdint_intptr_glue3(INT,stdint_intptr_bits,_MIN)
   5.774 +#  endif
   5.775 +#  ifndef UINTPTR_MAX
   5.776 +#    define UINTPTR_MAX                 stdint_intptr_glue3(UINT,stdint_intptr_bits,_MAX)
   5.777 +#  endif
   5.778 +#  ifndef INTPTR_MAX
   5.779 +#    define INTPTR_MAX                  stdint_intptr_glue3(INT,stdint_intptr_bits,_MAX)
   5.780 +#  endif
   5.781 +#  ifndef INTPTR_MIN
   5.782 +#    define INTPTR_MIN                  stdint_intptr_glue3(INT,stdint_intptr_bits,_MIN)
   5.783 +#  endif
   5.784 +#  ifndef INTPTR_C
   5.785 +#    define INTPTR_C(x)                 stdint_intptr_glue3(INT,stdint_intptr_bits,_C)(x)
   5.786 +#  endif
   5.787 +#  ifndef UINTPTR_C
   5.788 +#    define UINTPTR_C(x)                stdint_intptr_glue3(UINT,stdint_intptr_bits,_C)(x)
   5.789 +#  endif
   5.790 +  typedef stdint_intptr_glue3(uint,stdint_intptr_bits,_t) uintptr_t;
   5.791 +  typedef stdint_intptr_glue3( int,stdint_intptr_bits,_t)  intptr_t;
   5.792 +# else
   5.793 +/* TODO -- This following is likely wrong for some platforms, and does
   5.794 +   nothing for the definition of uintptr_t. */
   5.795 +  typedef ptrdiff_t intptr_t;
   5.796 +# endif
   5.797 +# define STDINT_H_UINTPTR_T_DEFINED
   5.798 +#endif
   5.799 +
   5.800 +/*
   5.801 + *  Assumes sig_atomic_t is signed and we have a 2s complement machine.
   5.802 + */
   5.803 +
   5.804 +#ifndef SIG_ATOMIC_MAX
   5.805 +# define SIG_ATOMIC_MAX ((((sig_atomic_t) 1) << (sizeof (sig_atomic_t)*CHAR_BIT-1)) - 1)
   5.806 +#endif
   5.807 +
   5.808 +#endif
   5.809 +
   5.810 +#if defined (__TEST_PSTDINT_FOR_CORRECTNESS)
   5.811 +
   5.812 +/*
   5.813 + *  Please compile with the maximum warning settings to make sure macros are
   5.814 + *  not defined more than once.
   5.815 + */
   5.816 +
   5.817 +#include <stdlib.h>
   5.818 +#include <stdio.h>
   5.819 +#include <string.h>
   5.820 +
   5.821 +#define glue3_aux(x,y,z) x ## y ## z
   5.822 +#define glue3(x,y,z) glue3_aux(x,y,z)
   5.823 +
   5.824 +#define DECLU(bits) glue3(uint,bits,_t) glue3(u,bits,) = glue3(UINT,bits,_C) (0);
   5.825 +#define DECLI(bits) glue3(int,bits,_t) glue3(i,bits,) = glue3(INT,bits,_C) (0);
   5.826 +
   5.827 +#define DECL(us,bits) glue3(DECL,us,) (bits)
   5.828 +
   5.829 +#define TESTUMAX(bits) glue3(u,bits,) = ~glue3(u,bits,); if (glue3(UINT,bits,_MAX) != glue3(u,bits,)) printf ("Something wrong with UINT%d_MAX\n", bits)
   5.830 +
   5.831 +#define REPORTERROR(msg) { err_n++; if (err_first <= 0) err_first = __LINE__; printf msg; }
   5.832 +
   5.833 +int main () {
   5.834 +	int err_n = 0;
   5.835 +	int err_first = 0;
   5.836 +	DECL(I,8)
   5.837 +	DECL(U,8)
   5.838 +	DECL(I,16)
   5.839 +	DECL(U,16)
   5.840 +	DECL(I,32)
   5.841 +	DECL(U,32)
   5.842 +#ifdef INT64_MAX
   5.843 +	DECL(I,64)
   5.844 +	DECL(U,64)
   5.845 +#endif
   5.846 +	intmax_t imax = INTMAX_C(0);
   5.847 +	uintmax_t umax = UINTMAX_C(0);
   5.848 +	char str0[256], str1[256];
   5.849 +
   5.850 +	sprintf (str0, "%" PRINTF_INT32_MODIFIER "d", INT32_C(2147483647));
   5.851 +	if (0 != strcmp (str0, "2147483647")) REPORTERROR (("Something wrong with PRINTF_INT32_MODIFIER : %s\n", str0));
   5.852 +	if (atoi(PRINTF_INT32_DEC_WIDTH) != (int) strlen(str0)) REPORTERROR (("Something wrong with PRINTF_INT32_DEC_WIDTH : %s\n", PRINTF_INT32_DEC_WIDTH));
   5.853 +	sprintf (str0, "%" PRINTF_INT32_MODIFIER "u", UINT32_C(4294967295));
   5.854 +	if (0 != strcmp (str0, "4294967295")) REPORTERROR (("Something wrong with PRINTF_INT32_MODIFIER : %s\n", str0));
   5.855 +	if (atoi(PRINTF_UINT32_DEC_WIDTH) != (int) strlen(str0)) REPORTERROR (("Something wrong with PRINTF_UINT32_DEC_WIDTH : %s\n", PRINTF_UINT32_DEC_WIDTH));
   5.856 +#ifdef INT64_MAX
   5.857 +	sprintf (str1, "%" PRINTF_INT64_MODIFIER "d", INT64_C(9223372036854775807));
   5.858 +	if (0 != strcmp (str1, "9223372036854775807")) REPORTERROR (("Something wrong with PRINTF_INT32_MODIFIER : %s\n", str1));
   5.859 +	if (atoi(PRINTF_INT64_DEC_WIDTH) != (int) strlen(str1)) REPORTERROR (("Something wrong with PRINTF_INT64_DEC_WIDTH : %s, %d\n", PRINTF_INT64_DEC_WIDTH, (int) strlen(str1)));
   5.860 +	sprintf (str1, "%" PRINTF_INT64_MODIFIER "u", UINT64_C(18446744073709550591));
   5.861 +	if (0 != strcmp (str1, "18446744073709550591")) REPORTERROR (("Something wrong with PRINTF_INT32_MODIFIER : %s\n", str1));
   5.862 +	if (atoi(PRINTF_UINT64_DEC_WIDTH) != (int) strlen(str1)) REPORTERROR (("Something wrong with PRINTF_UINT64_DEC_WIDTH : %s, %d\n", PRINTF_UINT64_DEC_WIDTH, (int) strlen(str1)));
   5.863 +#endif
   5.864 +
   5.865 +	sprintf (str0, "%d %x\n", 0, ~0);
   5.866 +
   5.867 +	sprintf (str1, "%d %x\n",  i8, ~0);
   5.868 +	if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with i8 : %s\n", str1));
   5.869 +	sprintf (str1, "%u %x\n",  u8, ~0);
   5.870 +	if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with u8 : %s\n", str1));
   5.871 +	sprintf (str1, "%d %x\n",  i16, ~0);
   5.872 +	if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with i16 : %s\n", str1));
   5.873 +	sprintf (str1, "%u %x\n",  u16, ~0);
   5.874 +	if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with u16 : %s\n", str1));
   5.875 +	sprintf (str1, "%" PRINTF_INT32_MODIFIER "d %x\n",  i32, ~0);
   5.876 +	if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with i32 : %s\n", str1));
   5.877 +	sprintf (str1, "%" PRINTF_INT32_MODIFIER "u %x\n",  u32, ~0);
   5.878 +	if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with u32 : %s\n", str1));
   5.879 +#ifdef INT64_MAX
   5.880 +	sprintf (str1, "%" PRINTF_INT64_MODIFIER "d %x\n",  i64, ~0);
   5.881 +	if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with i64 : %s\n", str1));
   5.882 +#endif
   5.883 +	sprintf (str1, "%" PRINTF_INTMAX_MODIFIER "d %x\n",  imax, ~0);
   5.884 +	if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with imax : %s\n", str1));
   5.885 +	sprintf (str1, "%" PRINTF_INTMAX_MODIFIER "u %x\n",  umax, ~0);
   5.886 +	if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with umax : %s\n", str1));
   5.887 +
   5.888 +	TESTUMAX(8);
   5.889 +	TESTUMAX(16);
   5.890 +	TESTUMAX(32);
   5.891 +#ifdef INT64_MAX
   5.892 +	TESTUMAX(64);
   5.893 +#endif
   5.894 +
   5.895 +#define STR(v) #v
   5.896 +#define Q(v) printf ("sizeof " STR(v) " = %u\n", (unsigned) sizeof (v));
   5.897 +	if (err_n) {
   5.898 +		printf ("pstdint.h is not correct.  Please use sizes below to correct it:\n");
   5.899 +	}
   5.900 +
   5.901 +	Q(int)
   5.902 +	Q(unsigned)
   5.903 +	Q(long int)
   5.904 +	Q(short int)
   5.905 +	Q(int8_t)
   5.906 +	Q(int16_t)
   5.907 +	Q(int32_t)
   5.908 +#ifdef INT64_MAX
   5.909 +	Q(int64_t)
   5.910 +#endif
   5.911 +
   5.912 +	return EXIT_SUCCESS;
   5.913 +}
   5.914 +
   5.915 +#endif
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/include/miniassimp/Compiler/pushpack1.h	Mon Jan 28 18:19:26 2019 +0200
     6.3 @@ -0,0 +1,43 @@
     6.4 +
     6.5 +
     6.6 +// ===============================================================================
     6.7 +// May be included multiple times - sets structure packing to 1 
     6.8 +// for all supported compilers. #include <poppack1.h> reverts the changes.
     6.9 +//
    6.10 +// Currently this works on the following compilers:
    6.11 +// MSVC 7,8,9
    6.12 +// GCC
    6.13 +// BORLAND (complains about 'pack state changed but not reverted', but works)
    6.14 +// Clang
    6.15 +//
    6.16 +//
    6.17 +// USAGE:
    6.18 +//
    6.19 +// struct StructToBePacked {
    6.20 +// } PACK_STRUCT;
    6.21 +//
    6.22 +// ===============================================================================
    6.23 +
    6.24 +#ifdef AI_PUSHPACK_IS_DEFINED
    6.25 +#	error poppack1.h must be included after pushpack1.h
    6.26 +#endif
    6.27 +
    6.28 +#if defined(_MSC_VER) ||  defined(__BORLANDC__) ||	defined (__BCPLUSPLUS__)
    6.29 +#	pragma pack(push,1)
    6.30 +#	define PACK_STRUCT
    6.31 +#elif defined( __GNUC__ ) || defined(__clang__)
    6.32 +#	if !defined(HOST_MINGW)
    6.33 +#		define PACK_STRUCT	__attribute__((__packed__))
    6.34 +#	else
    6.35 +#		define PACK_STRUCT	__attribute__((gcc_struct, __packed__))
    6.36 +#	endif
    6.37 +#else
    6.38 +#	error Compiler not supported
    6.39 +#endif
    6.40 +
    6.41 +#if defined(_MSC_VER)
    6.42 +// C4103: Packing was changed after the inclusion of the header, probably missing #pragma pop
    6.43 +#	pragma warning (disable : 4103) 
    6.44 +#endif
    6.45 +
    6.46 +#define AI_PUSHPACK_IS_DEFINED
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/include/miniassimp/DefaultIOStream.h	Mon Jan 28 18:19:26 2019 +0200
     7.3 @@ -0,0 +1,140 @@
     7.4 +/*
     7.5 +Open Asset Import Library (assimp)
     7.6 +----------------------------------------------------------------------
     7.7 +
     7.8 +Copyright (c) 2006-2018, assimp team
     7.9 +
    7.10 +
    7.11 +All rights reserved.
    7.12 +
    7.13 +Redistribution and use of this software in source and binary forms,
    7.14 +with or without modification, are permitted provided that the
    7.15 +following conditions are met:
    7.16 +
    7.17 +* Redistributions of source code must retain the above
    7.18 +  copyright notice, this list of conditions and the
    7.19 +  following disclaimer.
    7.20 +
    7.21 +* Redistributions in binary form must reproduce the above
    7.22 +  copyright notice, this list of conditions and the
    7.23 +  following disclaimer in the documentation and/or other
    7.24 +  materials provided with the distribution.
    7.25 +
    7.26 +* Neither the name of the assimp team, nor the names of its
    7.27 +  contributors may be used to endorse or promote products
    7.28 +  derived from this software without specific prior
    7.29 +  written permission of the assimp team.
    7.30 +
    7.31 +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    7.32 +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    7.33 +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    7.34 +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
    7.35 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    7.36 +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    7.37 +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    7.38 +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    7.39 +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    7.40 +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    7.41 +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    7.42 +
    7.43 +----------------------------------------------------------------------
    7.44 +*/
    7.45 +
    7.46 +/** @file Default file I/O using fXXX()-family of functions */
    7.47 +#ifndef AI_DEFAULTIOSTREAM_H_INC
    7.48 +#define AI_DEFAULTIOSTREAM_H_INC
    7.49 +
    7.50 +#include <stdio.h>
    7.51 +#include <miniassimp/IOStream.hpp>
    7.52 +#include <miniassimp/importerdesc.h>
    7.53 +#include <miniassimp/Defines.h>
    7.54 +
    7.55 +namespace Assimp    {
    7.56 +
    7.57 +// ----------------------------------------------------------------------------------
    7.58 +//! @class  DefaultIOStream
    7.59 +//! @brief  Default IO implementation, use standard IO operations
    7.60 +//! @note   An instance of this class can exist without a valid file handle
    7.61 +//!         attached to it. All calls fail, but the instance can nevertheless be
    7.62 +//!         used with no restrictions.
    7.63 +class ASSIMP_API DefaultIOStream : public IOStream
    7.64 +{
    7.65 +    friend class DefaultIOSystem;
    7.66 +#if __ANDROID__
    7.67 +# if __ANDROID_API__ > 9
    7.68 +#  if defined(AI_CONFIG_ANDROID_JNI_ASSIMP_MANAGER_SUPPORT)
    7.69 +    friend class AndroidJNIIOSystem;
    7.70 +#  endif // defined(AI_CONFIG_ANDROID_JNI_ASSIMP_MANAGER_SUPPORT)
    7.71 +# endif // __ANDROID_API__ > 9
    7.72 +#endif // __ANDROID__
    7.73 +
    7.74 +protected:
    7.75 +    DefaultIOStream() AI_NO_EXCEPT;
    7.76 +    DefaultIOStream(FILE* pFile, const std::string &strFilename);
    7.77 +
    7.78 +public:
    7.79 +    /** Destructor public to allow simple deletion to close the file. */
    7.80 +    ~DefaultIOStream ();
    7.81 +
    7.82 +    // -------------------------------------------------------------------
    7.83 +    /// Read from stream
    7.84 +    size_t Read(void* pvBuffer,
    7.85 +        size_t pSize,
    7.86 +        size_t pCount);
    7.87 +
    7.88 +
    7.89 +    // -------------------------------------------------------------------
    7.90 +    /// Write to stream
    7.91 +    size_t Write(const void* pvBuffer,
    7.92 +        size_t pSize,
    7.93 +        size_t pCount);
    7.94 +
    7.95 +    // -------------------------------------------------------------------
    7.96 +    /// Seek specific position
    7.97 +    aiReturn Seek(size_t pOffset,
    7.98 +        aiOrigin pOrigin);
    7.99 +
   7.100 +    // -------------------------------------------------------------------
   7.101 +    /// Get current seek position
   7.102 +    size_t Tell() const;
   7.103 +
   7.104 +    // -------------------------------------------------------------------
   7.105 +    /// Get size of file
   7.106 +    size_t FileSize() const;
   7.107 +
   7.108 +    // -------------------------------------------------------------------
   7.109 +    /// Flush file contents
   7.110 +    void Flush();
   7.111 +
   7.112 +private:
   7.113 +    //  File data-structure, using clib
   7.114 +    FILE* mFile;
   7.115 +    //  Filename
   7.116 +    std::string mFilename;
   7.117 +    // Cached file size
   7.118 +    mutable size_t mCachedSize;
   7.119 +};
   7.120 +
   7.121 +// ----------------------------------------------------------------------------------
   7.122 +inline
   7.123 +DefaultIOStream::DefaultIOStream() AI_NO_EXCEPT
   7.124 +: mFile(0)
   7.125 +, mFilename("")
   7.126 +, mCachedSize(SIZE_MAX) {
   7.127 +    // empty
   7.128 +}
   7.129 +
   7.130 +// ----------------------------------------------------------------------------------
   7.131 +inline
   7.132 +DefaultIOStream::DefaultIOStream (FILE* pFile, const std::string &strFilename)
   7.133 +: mFile(pFile)
   7.134 +, mFilename(strFilename)
   7.135 +, mCachedSize(SIZE_MAX) {
   7.136 +    // empty
   7.137 +}
   7.138 +// ----------------------------------------------------------------------------------
   7.139 +
   7.140 +} // ns assimp
   7.141 +
   7.142 +#endif //!!AI_DEFAULTIOSTREAM_H_INC
   7.143 +
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/include/miniassimp/DefaultLogger.hpp	Mon Jan 28 18:19:26 2019 +0200
     8.3 @@ -0,0 +1,188 @@
     8.4 +/*
     8.5 +Open Asset Import Library (assimp)
     8.6 +----------------------------------------------------------------------
     8.7 +
     8.8 +Copyright (c) 2006-2018, assimp team
     8.9 +
    8.10 +
    8.11 +All rights reserved.
    8.12 +
    8.13 +Redistribution and use of this software in source and binary forms,
    8.14 +with or without modification, are permitted provided that the
    8.15 +following conditions are met:
    8.16 +
    8.17 +* Redistributions of source code must retain the above
    8.18 +  copyright notice, this list of conditions and the
    8.19 +  following disclaimer.
    8.20 +
    8.21 +* Redistributions in binary form must reproduce the above
    8.22 +  copyright notice, this list of conditions and the
    8.23 +  following disclaimer in the documentation and/or other
    8.24 +  materials provided with the distribution.
    8.25 +
    8.26 +* Neither the name of the assimp team, nor the names of its
    8.27 +  contributors may be used to endorse or promote products
    8.28 +  derived from this software without specific prior
    8.29 +  written permission of the assimp team.
    8.30 +
    8.31 +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    8.32 +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    8.33 +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    8.34 +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
    8.35 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    8.36 +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    8.37 +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    8.38 +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    8.39 +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    8.40 +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    8.41 +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    8.42 +
    8.43 +----------------------------------------------------------------------
    8.44 +*/
    8.45 +/** @file DefaultLogger.hpp
    8.46 +*/
    8.47 +
    8.48 +#ifndef INCLUDED_AI_DEFAULTLOGGER
    8.49 +#define INCLUDED_AI_DEFAULTLOGGER
    8.50 +
    8.51 +#include "Logger.hpp"
    8.52 +#include "LogStream.hpp"
    8.53 +#include "NullLogger.hpp"
    8.54 +#include <vector>
    8.55 +
    8.56 +namespace Assimp    {
    8.57 +// ------------------------------------------------------------------------------------
    8.58 +class IOStream;
    8.59 +struct LogStreamInfo;
    8.60 +
    8.61 +/** default name of logfile */
    8.62 +#define ASSIMP_DEFAULT_LOG_NAME "AssimpLog.txt"
    8.63 +
    8.64 +// ------------------------------------------------------------------------------------
    8.65 +/** @brief CPP-API: Primary logging facility of Assimp.
    8.66 + *
    8.67 + *  The library stores its primary #Logger as a static member of this class.
    8.68 + *  #get() returns this primary logger. By default the underlying implementation is
    8.69 + *  just a #NullLogger which rejects all log messages. By calling #create(), logging
    8.70 + *  is turned on. To capture the log output multiple log streams (#LogStream) can be
    8.71 + *  attach to the logger. Some default streams for common streaming locations (such as
    8.72 + *  a file, std::cout, OutputDebugString()) are also provided.
    8.73 + *
    8.74 + *  If you wish to customize the logging at an even deeper level supply your own
    8.75 + *  implementation of #Logger to #set().
    8.76 + *  @note The whole logging stuff causes a small extra overhead for all imports. */
    8.77 +class ASSIMP_API DefaultLogger :
    8.78 +    public Logger   {
    8.79 +
    8.80 +public:
    8.81 +
    8.82 +    // ----------------------------------------------------------------------
    8.83 +    /** @brief Creates a logging instance.
    8.84 +     *  @param name Name for log file. Only valid in combination
    8.85 +     *    with the aiDefaultLogStream_FILE flag.
    8.86 +     *  @param severity Log severity, VERBOSE turns on debug messages
    8.87 +     *  @param defStreams  Default log streams to be attached. Any bitwise
    8.88 +     *    combination of the aiDefaultLogStream enumerated values.
    8.89 +     *    If #aiDefaultLogStream_FILE is specified but an empty string is
    8.90 +     *    passed for 'name', no log file is created at all.
    8.91 +     *  @param  io IOSystem to be used to open external files (such as the
    8.92 +     *   log file). Pass NULL to rely on the default implementation.
    8.93 +     *  This replaces the default #NullLogger with a #DefaultLogger instance. */
    8.94 +    static Logger *create(const char* name = ASSIMP_DEFAULT_LOG_NAME,
    8.95 +        LogSeverity severity    = NORMAL,
    8.96 +        unsigned int defStreams = aiDefaultLogStream_DEBUGGER | aiDefaultLogStream_FILE,
    8.97 +        IOSystem* io            = NULL);
    8.98 +
    8.99 +    // ----------------------------------------------------------------------
   8.100 +    /** @brief Setup a custom #Logger implementation.
   8.101 +     *
   8.102 +     *  Use this if the provided #DefaultLogger class doesn't fit into
   8.103 +     *  your needs. If the provided message formatting is OK for you,
   8.104 +     *  it's much easier to use #create() and to attach your own custom
   8.105 +     *  output streams to it.
   8.106 +     *  @param logger Pass NULL to setup a default NullLogger*/
   8.107 +    static void set (Logger *logger);
   8.108 +
   8.109 +    // ----------------------------------------------------------------------
   8.110 +    /** @brief  Getter for singleton instance
   8.111 +     *   @return Only instance. This is never null, but it could be a
   8.112 +     *  NullLogger. Use isNullLogger to check this.*/
   8.113 +    static Logger *get();
   8.114 +
   8.115 +    // ----------------------------------------------------------------------
   8.116 +    /** @brief  Return whether a #NullLogger is currently active
   8.117 +     *  @return true if the current logger is a #NullLogger.
   8.118 +     *  Use create() or set() to setup a logger that does actually do
   8.119 +     *  something else than just rejecting all log messages. */
   8.120 +    static bool isNullLogger();
   8.121 +
   8.122 +    // ----------------------------------------------------------------------
   8.123 +    /** @brief  Kills the current singleton logger and replaces it with a
   8.124 +     *  #NullLogger instance. */
   8.125 +    static void kill();
   8.126 +
   8.127 +    // ----------------------------------------------------------------------
   8.128 +    /** @copydoc Logger::attachStream   */
   8.129 +    bool attachStream(LogStream *pStream,
   8.130 +        unsigned int severity);
   8.131 +
   8.132 +    // ----------------------------------------------------------------------
   8.133 +    /** @copydoc Logger::detatchStream */
   8.134 +    bool detatchStream(LogStream *pStream,
   8.135 +        unsigned int severity);
   8.136 +
   8.137 +private:
   8.138 +    // ----------------------------------------------------------------------
   8.139 +    /** @briefPrivate construction for internal use by create().
   8.140 +     *  @param severity Logging granularity  */
   8.141 +    explicit DefaultLogger(LogSeverity severity);
   8.142 +
   8.143 +    // ----------------------------------------------------------------------
   8.144 +    /** @briefDestructor    */
   8.145 +    ~DefaultLogger();
   8.146 +
   8.147 +    /** @brief  Logs debug infos, only been written when severity level VERBOSE is set */
   8.148 +    void OnDebug(const char* message);
   8.149 +
   8.150 +    /** @brief  Logs an info message */
   8.151 +    void OnInfo(const char*  message);
   8.152 +
   8.153 +    /** @brief  Logs a warning message */
   8.154 +    void OnWarn(const char*  message);
   8.155 +
   8.156 +    /** @brief  Logs an error message */
   8.157 +    void OnError(const char* message);
   8.158 +
   8.159 +    // ----------------------------------------------------------------------
   8.160 +    /** @brief Writes a message to all streams */
   8.161 +    void WriteToStreams(const char* message, ErrorSeverity ErrorSev );
   8.162 +
   8.163 +    // ----------------------------------------------------------------------
   8.164 +    /** @brief Returns the thread id.
   8.165 +     *  @note This is an OS specific feature, if not supported, a
   8.166 +     *    zero will be returned.
   8.167 +     */
   8.168 +    unsigned int GetThreadID();
   8.169 +
   8.170 +private:
   8.171 +    //  Aliases for stream container
   8.172 +    typedef std::vector<LogStreamInfo*> StreamArray;
   8.173 +    typedef std::vector<LogStreamInfo*>::iterator StreamIt;
   8.174 +    typedef std::vector<LogStreamInfo*>::const_iterator ConstStreamIt;
   8.175 +
   8.176 +    //! only logging instance
   8.177 +    static Logger *m_pLogger;
   8.178 +    static NullLogger s_pNullLogger;
   8.179 +
   8.180 +    //! Attached streams
   8.181 +    StreamArray m_StreamArray;
   8.182 +
   8.183 +    bool noRepeatMsg;
   8.184 +    char lastMsg[MAX_LOG_MESSAGE_LENGTH*2];
   8.185 +    size_t lastLen;
   8.186 +};
   8.187 +// ------------------------------------------------------------------------------------
   8.188 +
   8.189 +} // Namespace Assimp
   8.190 +
   8.191 +#endif // !! INCLUDED_AI_DEFAULTLOGGER
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/include/miniassimp/Defines.h	Mon Jan 28 18:19:26 2019 +0200
     9.3 @@ -0,0 +1,49 @@
     9.4 +/*
     9.5 +Open Asset Import Library (assimp)
     9.6 +----------------------------------------------------------------------
     9.7 +
     9.8 +Copyright (c) 2006-2012, assimp team
     9.9 +All rights reserved.
    9.10 +
    9.11 +Redistribution and use of this software in source and binary forms,
    9.12 +with or without modification, are permitted provided that the
    9.13 +following conditions are met:
    9.14 +
    9.15 +* Redistributions of source code must retain the above
    9.16 +  copyright notice, this list of conditions and the
    9.17 +  following disclaimer.
    9.18 +
    9.19 +* Redistributions in binary form must reproduce the above
    9.20 +  copyright notice, this list of conditions and the
    9.21 +  following disclaimer in the documentation and/or other
    9.22 +  materials provided with the distribution.
    9.23 +
    9.24 +* Neither the name of the assimp team, nor the names of its
    9.25 +  contributors may be used to endorse or promote products
    9.26 +  derived from this software without specific prior
    9.27 +  written permission of the assimp team.
    9.28 +
    9.29 +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    9.30 +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    9.31 +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    9.32 +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
    9.33 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    9.34 +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    9.35 +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    9.36 +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    9.37 +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    9.38 +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    9.39 +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    9.40 +
    9.41 +----------------------------------------------------------------------
    9.42 +*/
    9.43 +
    9.44 +// We need those constants, workaround for any platforms where nobody defined them yet
    9.45 +#if (!defined SIZE_MAX)
    9.46 +#   define SIZE_MAX (~((size_t)0))
    9.47 +#endif
    9.48 +
    9.49 +#if (!defined UINT_MAX)
    9.50 +#   define UINT_MAX (~((unsigned int)0))
    9.51 +#endif
    9.52 +
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/include/miniassimp/Exceptional.h	Mon Jan 28 18:19:26 2019 +0200
    10.3 @@ -0,0 +1,125 @@
    10.4 +/*
    10.5 +Open Asset Import Library (assimp)
    10.6 +----------------------------------------------------------------------
    10.7 +
    10.8 +Copyright (c) 2006-2008, assimp team
    10.9 +All rights reserved.
   10.10 +
   10.11 +Redistribution and use of this software in source and binary forms,
   10.12 +with or without modification, are permitted provided that the
   10.13 +following conditions are met:
   10.14 +
   10.15 +* Redistributions of source code must retain the above
   10.16 +  copyright notice, this list of conditions and the
   10.17 +  following disclaimer.
   10.18 +
   10.19 +* Redistributions in binary form must reproduce the above
   10.20 +  copyright notice, this list of conditions and the
   10.21 +  following disclaimer in the documentation and/or other
   10.22 +  materials provided with the distribution.
   10.23 +
   10.24 +* Neither the name of the assimp team, nor the names of its
   10.25 +  contributors may be used to endorse or promote products
   10.26 +  derived from this software without specific prior
   10.27 +  written permission of the assimp team.
   10.28 +
   10.29 +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   10.30 +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   10.31 +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
   10.32 +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
   10.33 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   10.34 +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   10.35 +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
   10.36 +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
   10.37 +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   10.38 +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   10.39 +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   10.40 +
   10.41 +----------------------------------------------------------------------
   10.42 +*/
   10.43 +
   10.44 +#ifndef INCLUDED_EXCEPTIONAL_H
   10.45 +#define INCLUDED_EXCEPTIONAL_H
   10.46 +
   10.47 +#include <stdexcept>
   10.48 +#include <miniassimp/DefaultIOStream.h>
   10.49 +using std::runtime_error;
   10.50 +
   10.51 +#ifdef _MSC_VER
   10.52 +#   pragma warning(disable : 4275)
   10.53 +#endif
   10.54 +
   10.55 +// ---------------------------------------------------------------------------
   10.56 +/** FOR IMPORTER PLUGINS ONLY: Simple exception class to be thrown if an
   10.57 + *  unrecoverable error occurs while importing. Loading APIs return
   10.58 + *  NULL instead of a valid aiScene then.  */
   10.59 +class DeadlyImportError
   10.60 +    : public runtime_error
   10.61 +{
   10.62 +public:
   10.63 +    /** Constructor with arguments */
   10.64 +    explicit DeadlyImportError( const std::string& errorText)
   10.65 +        : runtime_error(errorText)
   10.66 +    {
   10.67 +    }
   10.68 +
   10.69 +private:
   10.70 +};
   10.71 +
   10.72 +typedef DeadlyImportError DeadlyExportError;
   10.73 +
   10.74 +#ifdef _MSC_VER
   10.75 +#   pragma warning(default : 4275)
   10.76 +#endif
   10.77 +
   10.78 +// ---------------------------------------------------------------------------
   10.79 +template <typename T>
   10.80 +struct ExceptionSwallower   {
   10.81 +    T operator ()() const {
   10.82 +        return T();
   10.83 +    }
   10.84 +};
   10.85 +
   10.86 +// ---------------------------------------------------------------------------
   10.87 +template <typename T>
   10.88 +struct ExceptionSwallower<T*>   {
   10.89 +    T* operator ()() const {
   10.90 +        return NULL;
   10.91 +    }
   10.92 +};
   10.93 +
   10.94 +// ---------------------------------------------------------------------------
   10.95 +template <>
   10.96 +struct ExceptionSwallower<aiReturn> {
   10.97 +    aiReturn operator ()() const {
   10.98 +        try {
   10.99 +            throw;
  10.100 +        }
  10.101 +        catch (std::bad_alloc&) {
  10.102 +            return aiReturn_OUTOFMEMORY;
  10.103 +        }
  10.104 +        catch (...) {
  10.105 +            return aiReturn_FAILURE;
  10.106 +        }
  10.107 +    }
  10.108 +};
  10.109 +
  10.110 +// ---------------------------------------------------------------------------
  10.111 +template <>
  10.112 +struct ExceptionSwallower<void> {
  10.113 +    void operator ()() const {
  10.114 +        return;
  10.115 +    }
  10.116 +};
  10.117 +
  10.118 +#define ASSIMP_BEGIN_EXCEPTION_REGION()\
  10.119 +{\
  10.120 +    try {
  10.121 +
  10.122 +#define ASSIMP_END_EXCEPTION_REGION(type)\
  10.123 +    } catch(...) {\
  10.124 +        return ExceptionSwallower<type>()();\
  10.125 +    }\
  10.126 +}
  10.127 +
  10.128 +#endif // INCLUDED_EXCEPTIONAL_H
    11.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.2 +++ b/include/miniassimp/GenericProperty.h	Mon Jan 28 18:19:26 2019 +0200
    11.3 @@ -0,0 +1,133 @@
    11.4 +/*
    11.5 +Open Asset Import Library (assimp)
    11.6 +----------------------------------------------------------------------
    11.7 +
    11.8 +Copyright (c) 2006-2018, assimp team
    11.9 +
   11.10 +
   11.11 +All rights reserved.
   11.12 +
   11.13 +Redistribution and use of this software in source and binary forms,
   11.14 +with or without modification, are permitted provided that the
   11.15 +following conditions are met:
   11.16 +
   11.17 +* Redistributions of source code must retain the above
   11.18 +  copyright notice, this list of conditions and the
   11.19 +  following disclaimer.
   11.20 +
   11.21 +* Redistributions in binary form must reproduce the above
   11.22 +  copyright notice, this list of conditions and the
   11.23 +  following disclaimer in the documentation and/or other
   11.24 +  materials provided with the distribution.
   11.25 +
   11.26 +* Neither the name of the assimp team, nor the names of its
   11.27 +  contributors may be used to endorse or promote products
   11.28 +  derived from this software without specific prior
   11.29 +  written permission of the assimp team.
   11.30 +
   11.31 +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   11.32 +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   11.33 +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
   11.34 +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
   11.35 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   11.36 +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   11.37 +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
   11.38 +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
   11.39 +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   11.40 +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   11.41 +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   11.42 +
   11.43 +----------------------------------------------------------------------
   11.44 +*/
   11.45 +
   11.46 +#ifndef AI_GENERIC_PROPERTY_H_INCLUDED
   11.47 +#define AI_GENERIC_PROPERTY_H_INCLUDED
   11.48 +
   11.49 +#include <miniassimp/Importer.hpp>
   11.50 +#include <miniassimp/ai_assert.h>
   11.51 +#include "Hash.h"
   11.52 +
   11.53 +#include <map>
   11.54 +
   11.55 +// ------------------------------------------------------------------------------------------------
   11.56 +template <class T>
   11.57 +inline
   11.58 +bool SetGenericProperty(std::map< unsigned int, T >& list,
   11.59 +        const char* szName, const T& value) {
   11.60 +    ai_assert(0 != szName);
   11.61 +    const uint32_t hash = SuperFastHash(szName);
   11.62 +
   11.63 +    typename std::map<unsigned int, T>::iterator it = list.find(hash);
   11.64 +    if (it == list.end())   {
   11.65 +        list.insert(std::pair<unsigned int, T>( hash, value ));
   11.66 +        return false;
   11.67 +    }
   11.68 +    (*it).second = value;
   11.69 +
   11.70 +    return true;
   11.71 +}
   11.72 +
   11.73 +// ------------------------------------------------------------------------------------------------
   11.74 +template <class T>
   11.75 +inline
   11.76 +const T& GetGenericProperty(const std::map< unsigned int, T >& list,
   11.77 +        const char* szName, const T& errorReturn) {
   11.78 +    ai_assert(0 != szName);
   11.79 +    const uint32_t hash = SuperFastHash(szName);
   11.80 +
   11.81 +    typename std::map<unsigned int, T>::const_iterator it = list.find(hash);
   11.82 +    if (it == list.end()) {
   11.83 +        return errorReturn;
   11.84 +    }
   11.85 +
   11.86 +    return (*it).second;
   11.87 +}
   11.88 +
   11.89 +// ------------------------------------------------------------------------------------------------
   11.90 +// Special version for pointer types - they will be deleted when replaced with another value
   11.91 +// passing NULL removes the whole property
   11.92 +template <class T>
   11.93 +inline
   11.94 +void SetGenericPropertyPtr(std::map< unsigned int, T* >& list,
   11.95 +        const char* szName, T* value, bool* bWasExisting = 0 ) {
   11.96 +    ai_assert(0 != szName);
   11.97 +    const uint32_t hash = SuperFastHash(szName);
   11.98 +
   11.99 +    typename std::map<unsigned int, T*>::iterator it = list.find(hash);
  11.100 +    if (it == list.end())   {
  11.101 +        if (bWasExisting) {
  11.102 +            *bWasExisting = false;
  11.103 +        }
  11.104 +
  11.105 +        list.insert(std::pair<unsigned int,T*>( hash, value ));
  11.106 +        return;
  11.107 +    }
  11.108 +    if ((*it).second != value)  {
  11.109 +        delete (*it).second;
  11.110 +        (*it).second = value;
  11.111 +    }
  11.112 +    if (!value) {
  11.113 +        list.erase(it);
  11.114 +    }
  11.115 +    if (bWasExisting) {
  11.116 +        *bWasExisting = true;
  11.117 +    }
  11.118 +}
  11.119 +
  11.120 +// ------------------------------------------------------------------------------------------------
  11.121 +template <class T>
  11.122 +inline
  11.123 +bool HasGenericProperty(const std::map< unsigned int, T >& list,
  11.124 +        const char* szName) {
  11.125 +    ai_assert(0 != szName);
  11.126 +    const uint32_t hash = SuperFastHash(szName);
  11.127 +
  11.128 +    typename std::map<unsigned int, T>::const_iterator it = list.find(hash);
  11.129 +    if (it == list.end()) {
  11.130 +        return false;
  11.131 +    }
  11.132 +
  11.133 +    return true;
  11.134 +}
  11.135 +
  11.136 +#endif // !! AI_GENERIC_PROPERTY_H_INCLUDED
    12.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.2 +++ b/include/miniassimp/Hash.h	Mon Jan 28 18:19:26 2019 +0200
    12.3 @@ -0,0 +1,118 @@
    12.4 +/*
    12.5 +Open Asset Import Library (assimp)
    12.6 +----------------------------------------------------------------------
    12.7 +
    12.8 +Copyright (c) 2006-2018, assimp team
    12.9 +
   12.10 +
   12.11 +All rights reserved.
   12.12 +
   12.13 +Redistribution and use of this software in source and binary forms,
   12.14 +with or without modification, are permitted provided that the
   12.15 +following conditions are met:
   12.16 +
   12.17 +* Redistributions of source code must retain the above
   12.18 +  copyright notice, this list of conditions and the
   12.19 +  following disclaimer.
   12.20 +
   12.21 +* Redistributions in binary form must reproduce the above
   12.22 +  copyright notice, this list of conditions and the
   12.23 +  following disclaimer in the documentation and/or other
   12.24 +  materials provided with the distribution.
   12.25 +
   12.26 +* Neither the name of the assimp team, nor the names of its
   12.27 +  contributors may be used to endorse or promote products
   12.28 +  derived from this software without specific prior
   12.29 +  written permission of the assimp team.
   12.30 +
   12.31 +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   12.32 +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   12.33 +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
   12.34 +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
   12.35 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   12.36 +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   12.37 +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
   12.38 +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
   12.39 +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   12.40 +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   12.41 +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   12.42 +
   12.43 +----------------------------------------------------------------------
   12.44 +*/
   12.45 +
   12.46 +#ifndef AI_HASH_H_INCLUDED
   12.47 +#define AI_HASH_H_INCLUDED
   12.48 +
   12.49 +#include <inttypes.h>
   12.50 +#include <string.h>
   12.51 +
   12.52 +// ------------------------------------------------------------------------------------------------
   12.53 +// Hashing function taken from
   12.54 +// http://www.azillionmonkeys.com/qed/hash.html
   12.55 +// (incremental version)
   12.56 +//
   12.57 +// This code is Copyright 2004-2008 by Paul Hsieh. It is used here in the belief that
   12.58 +// Assimp's license is considered compatible with Pauls's derivative license as specified
   12.59 +// on his web page.
   12.60 +//
   12.61 +// (stdint.h should have been been included here)
   12.62 +// ------------------------------------------------------------------------------------------------
   12.63 +#undef get16bits
   12.64 +#if (defined(__GNUC__) && defined(__i386__)) || defined(__WATCOMC__) \
   12.65 +  || defined(_MSC_VER) || defined (__BORLANDC__) || defined (__TURBOC__)
   12.66 +#define get16bits(d) (*((const uint16_t *) (d)))
   12.67 +#endif
   12.68 +
   12.69 +#if !defined (get16bits)
   12.70 +#define get16bits(d) ((((uint32_t)(((const uint8_t *)(d))[1])) << 8)\
   12.71 +                       +(uint32_t)(((const uint8_t *)(d))[0]) )
   12.72 +#endif
   12.73 +
   12.74 +// ------------------------------------------------------------------------------------------------
   12.75 +inline uint32_t SuperFastHash (const char * data, uint32_t len = 0, uint32_t hash = 0) {
   12.76 +uint32_t tmp;
   12.77 +int rem;
   12.78 +
   12.79 +    if (!data) return 0;
   12.80 +    if (!len)len = (uint32_t)::strlen(data);
   12.81 +
   12.82 +    rem = len & 3;
   12.83 +    len >>= 2;
   12.84 +
   12.85 +    /* Main loop */
   12.86 +    for (;len > 0; len--) {
   12.87 +        hash  += get16bits (data);
   12.88 +        tmp    = (get16bits (data+2) << 11) ^ hash;
   12.89 +        hash   = (hash << 16) ^ tmp;
   12.90 +        data  += 2*sizeof (uint16_t);
   12.91 +        hash  += hash >> 11;
   12.92 +    }
   12.93 +
   12.94 +    /* Handle end cases */
   12.95 +    switch (rem) {
   12.96 +        case 3: hash += get16bits (data);
   12.97 +                hash ^= hash << 16;
   12.98 +                hash ^= data[sizeof (uint16_t)] << 18;
   12.99 +                hash += hash >> 11;
  12.100 +                break;
  12.101 +        case 2: hash += get16bits (data);
  12.102 +                hash ^= hash << 11;
  12.103 +                hash += hash >> 17;
  12.104 +                break;
  12.105 +        case 1: hash += *data;
  12.106 +                hash ^= hash << 10;
  12.107 +                hash += hash >> 1;
  12.108 +    }
  12.109 +
  12.110 +    /* Force "avalanching" of final 127 bits */
  12.111 +    hash ^= hash << 3;
  12.112 +    hash += hash >> 5;
  12.113 +    hash ^= hash << 4;
  12.114 +    hash += hash >> 17;
  12.115 +    hash ^= hash << 25;
  12.116 +    hash += hash >> 6;
  12.117 +
  12.118 +    return hash;
  12.119 +}
  12.120 +
  12.121 +#endif // !! AI_HASH_H_INCLUDED
    13.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.2 +++ b/include/miniassimp/IOStream.hpp	Mon Jan 28 18:19:26 2019 +0200
    13.3 @@ -0,0 +1,142 @@
    13.4 +/*
    13.5 +---------------------------------------------------------------------------
    13.6 +Open Asset Import Library (assimp)
    13.7 +---------------------------------------------------------------------------
    13.8 +
    13.9 +Copyright (c) 2006-2018, assimp team
   13.10 +
   13.11 +
   13.12 +
   13.13 +All rights reserved.
   13.14 +
   13.15 +Redistribution and use of this software in source and binary forms,
   13.16 +with or without modification, are permitted provided that the following
   13.17 +conditions are met:
   13.18 +
   13.19 +* Redistributions of source code must retain the above
   13.20 +  copyright notice, this list of conditions and the
   13.21 +  following disclaimer.
   13.22 +
   13.23 +* Redistributions in binary form must reproduce the above
   13.24 +  copyright notice, this list of conditions and the
   13.25 +  following disclaimer in the documentation and/or other
   13.26 +  materials provided with the distribution.
   13.27 +
   13.28 +* Neither the name of the assimp team, nor the names of its
   13.29 +  contributors may be used to endorse or promote products
   13.30 +  derived from this software without specific prior
   13.31 +  written permission of the assimp team.
   13.32 +
   13.33 +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   13.34 +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   13.35 +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
   13.36 +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
   13.37 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   13.38 +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   13.39 +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
   13.40 +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
   13.41 +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   13.42 +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   13.43 +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   13.44 +---------------------------------------------------------------------------
   13.45 +*/
   13.46 +/** @file IOStream.hpp
   13.47 + *  @brief File I/O wrappers for C++.
   13.48 + */
   13.49 +
   13.50 +#pragma once
   13.51 +#ifndef AI_IOSTREAM_H_INC
   13.52 +#define AI_IOSTREAM_H_INC
   13.53 +
   13.54 +#include "types.h"
   13.55 +
   13.56 +#ifndef __cplusplus
   13.57 +#   error This header requires C++ to be used. aiFileIO.h is the \
   13.58 +    corresponding C interface.
   13.59 +#endif
   13.60 +
   13.61 +namespace Assimp    {
   13.62 +
   13.63 +// ----------------------------------------------------------------------------------
   13.64 +/** @brief CPP-API: Class to handle file I/O for C++
   13.65 + *
   13.66 + *  Derive an own implementation from this interface to provide custom IO handling
   13.67 + *  to the Importer. If you implement this interface, be sure to also provide an
   13.68 + *  implementation for IOSystem that creates instances of your custom IO class.
   13.69 +*/
   13.70 +class ASSIMP_API IOStream
   13.71 +#ifndef SWIG
   13.72 +    : public Intern::AllocateFromAssimpHeap
   13.73 +#endif
   13.74 +{
   13.75 +protected:
   13.76 +    /** Constructor protected, use IOSystem::Open() to create an instance. */
   13.77 +    IOStream() AI_NO_EXCEPT;
   13.78 +
   13.79 +public:
   13.80 +    // -------------------------------------------------------------------
   13.81 +    /** @brief Destructor. Deleting the object closes the underlying file,
   13.82 +     * alternatively you may use IOSystem::Close() to release the file.
   13.83 +     */
   13.84 +    virtual ~IOStream();
   13.85 +
   13.86 +    // -------------------------------------------------------------------
   13.87 +    /** @brief Read from the file
   13.88 +     *
   13.89 +     * See fread() for more details
   13.90 +     * This fails for write-only files */
   13.91 +    virtual size_t Read(void* pvBuffer,
   13.92 +        size_t pSize,
   13.93 +        size_t pCount) = 0;
   13.94 +
   13.95 +    // -------------------------------------------------------------------
   13.96 +    /** @brief Write to the file
   13.97 +    *
   13.98 +    * See fwrite() for more details
   13.99 +    * This fails for read-only files */
  13.100 +    virtual size_t Write(const void* pvBuffer,
  13.101 +        size_t pSize,
  13.102 +        size_t pCount) = 0;
  13.103 +
  13.104 +    // -------------------------------------------------------------------
  13.105 +    /** @brief Set the read/write cursor of the file
  13.106 +     *
  13.107 +     * Note that the offset is _negative_ for aiOrigin_END.
  13.108 +     * See fseek() for more details */
  13.109 +    virtual aiReturn Seek(size_t pOffset,
  13.110 +        aiOrigin pOrigin) = 0;
  13.111 +
  13.112 +    // -------------------------------------------------------------------
  13.113 +    /** @brief Get the current position of the read/write cursor
  13.114 +     *
  13.115 +     * See ftell() for more details */
  13.116 +    virtual size_t Tell() const = 0;
  13.117 +
  13.118 +    // -------------------------------------------------------------------
  13.119 +    /** @brief Returns filesize
  13.120 +     *  Returns the filesize. */
  13.121 +    virtual size_t FileSize() const = 0;
  13.122 +
  13.123 +    // -------------------------------------------------------------------
  13.124 +    /** @brief Flush the contents of the file buffer (for writers)
  13.125 +     *  See fflush() for more details.
  13.126 +     */
  13.127 +    virtual void Flush() = 0;
  13.128 +}; //! class IOStream
  13.129 +
  13.130 +// ----------------------------------------------------------------------------------
  13.131 +inline
  13.132 +IOStream::IOStream() AI_NO_EXCEPT {
  13.133 +    // empty
  13.134 +}
  13.135 +
  13.136 +// ----------------------------------------------------------------------------------
  13.137 +inline
  13.138 +IOStream::~IOStream() {
  13.139 +    // empty
  13.140 +}
  13.141 +// ----------------------------------------------------------------------------------
  13.142 +
  13.143 +} //!namespace Assimp
  13.144 +
  13.145 +#endif //!!AI_IOSTREAM_H_INC
    14.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.2 +++ b/include/miniassimp/IOSystem.hpp	Mon Jan 28 18:19:26 2019 +0200
    14.3 @@ -0,0 +1,357 @@
    14.4 +/*
    14.5 +---------------------------------------------------------------------------
    14.6 +Open Asset Import Library (assimp)
    14.7 +---------------------------------------------------------------------------
    14.8 +
    14.9 +Copyright (c) 2006-2018, assimp team
   14.10 +
   14.11 +
   14.12 +
   14.13 +All rights reserved.
   14.14 +
   14.15 +Redistribution and use of this software in source and binary forms,
   14.16 +with or without modification, are permitted provided that the following
   14.17 +conditions are met:
   14.18 +
   14.19 +* Redistributions of source code must retain the above
   14.20 +  copyright notice, this list of conditions and the
   14.21 +  following disclaimer.
   14.22 +
   14.23 +* Redistributions in binary form must reproduce the above
   14.24 +  copyright notice, this list of conditions and the
   14.25 +  following disclaimer in the documentation and/or other
   14.26 +  materials provided with the distribution.
   14.27 +
   14.28 +* Neither the name of the assimp team, nor the names of its
   14.29 +  contributors may be used to endorse or promote products
   14.30 +  derived from this software without specific prior
   14.31 +  written permission of the assimp team.
   14.32 +
   14.33 +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   14.34 +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   14.35 +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
   14.36 +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
   14.37 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   14.38 +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   14.39 +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
   14.40 +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
   14.41 +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   14.42 +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   14.43 +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   14.44 +---------------------------------------------------------------------------
   14.45 +*/
   14.46 +
   14.47 +/** @file IOSystem.hpp
   14.48 + *  @brief File system wrapper for C++. Inherit this class to supply
   14.49 + *  custom file handling logic to the Import library.
   14.50 +*/
   14.51 +
   14.52 +#pragma once
   14.53 +#ifndef AI_IOSYSTEM_H_INC
   14.54 +#define AI_IOSYSTEM_H_INC
   14.55 +
   14.56 +#ifndef __cplusplus
   14.57 +#   error This header requires C++ to be used. aiFileIO.h is the \
   14.58 +    corresponding C interface.
   14.59 +#endif
   14.60 +
   14.61 +#include "types.h"
   14.62 +
   14.63 +#ifdef _WIN32
   14.64 +#   include <direct.h>  
   14.65 +#   include <stdlib.h>  
   14.66 +#   include <stdio.h>  
   14.67 +#else
   14.68 +#   include <sys/stat.h>
   14.69 +#   include <sys/types.h>
   14.70 +#   include <unistd.h>
   14.71 +#endif // _WIN32
   14.72 +
   14.73 +#include <vector>
   14.74 +
   14.75 +namespace Assimp    {
   14.76 +
   14.77 +    class IOStream;
   14.78 +
   14.79 +// ---------------------------------------------------------------------------
   14.80 +/** @brief CPP-API: Interface to the file system.
   14.81 + *
   14.82 + *  Derive an own implementation from this interface to supply custom file handling
   14.83 + *  to the importer library. If you implement this interface, you also want to
   14.84 + *  supply a custom implementation for IOStream.
   14.85 + *
   14.86 + *  @see Importer::SetIOHandler() 
   14.87 + */
   14.88 +class ASSIMP_API IOSystem
   14.89 +#ifndef SWIG
   14.90 +    : public Intern::AllocateFromAssimpHeap
   14.91 +#endif
   14.92 +{
   14.93 +public:
   14.94 +
   14.95 +    // -------------------------------------------------------------------
   14.96 +    /** @brief Default constructor.
   14.97 +     *
   14.98 +     *  Create an instance of your derived class and assign it to an
   14.99 +     *  #Assimp::Importer instance by calling Importer::SetIOHandler().
  14.100 +     */
  14.101 +    IOSystem() AI_NO_EXCEPT;
  14.102 +
  14.103 +    // -------------------------------------------------------------------
  14.104 +    /** @brief Virtual destructor.
  14.105 +     *
  14.106 +     *  It is safe to be called from within DLL Assimp, we're constructed
  14.107 +     *  on Assimp's heap.
  14.108 +     */
  14.109 +    virtual ~IOSystem();
  14.110 +
  14.111 +    // -------------------------------------------------------------------
  14.112 +    /** @brief For backward compatibility
  14.113 +     *  @see Exists(const char*)
  14.114 +     */
  14.115 +    AI_FORCE_INLINE bool Exists( const std::string& pFile) const;
  14.116 +
  14.117 +    // -------------------------------------------------------------------
  14.118 +    /** @brief Tests for the existence of a file at the given path.
  14.119 +     *
  14.120 +     * @param pFile Path to the file
  14.121 +     * @return true if there is a file with this path, else false.
  14.122 +     */
  14.123 +    virtual bool Exists( const char* pFile) const = 0;
  14.124 +
  14.125 +    // -------------------------------------------------------------------
  14.126 +    /** @brief Returns the system specific directory separator
  14.127 +     *  @return System specific directory separator
  14.128 +     */
  14.129 +    virtual char getOsSeparator() const = 0;
  14.130 +
  14.131 +    // -------------------------------------------------------------------
  14.132 +    /** @brief Open a new file with a given path.
  14.133 +     *
  14.134 +     *  When the access to the file is finished, call Close() to release
  14.135 +     *  all associated resources (or the virtual dtor of the IOStream).
  14.136 +     *
  14.137 +     *  @param pFile Path to the file
  14.138 +     *  @param pMode Desired file I/O mode. Required are: "wb", "w", "wt",
  14.139 +     *         "rb", "r", "rt".
  14.140 +     *
  14.141 +     *  @return New IOStream interface allowing the lib to access
  14.142 +     *         the underlying file.
  14.143 +     *  @note When implementing this class to provide custom IO handling,
  14.144 +     *  you probably have to supply an own implementation of IOStream as well.
  14.145 +     */
  14.146 +    virtual IOStream* Open(const char* pFile,
  14.147 +        const char* pMode = "rb") = 0;
  14.148 +
  14.149 +    // -------------------------------------------------------------------
  14.150 +    /** @brief For backward compatibility
  14.151 +     *  @see Open(const char*, const char*)
  14.152 +     */
  14.153 +    inline IOStream* Open(const std::string& pFile,
  14.154 +        const std::string& pMode = std::string("rb"));
  14.155 +
  14.156 +    // -------------------------------------------------------------------
  14.157 +    /** @brief Closes the given file and releases all resources
  14.158 +     *    associated with it.
  14.159 +     *  @param pFile The file instance previously created by Open().
  14.160 +     */
  14.161 +    virtual void Close( IOStream* pFile) = 0;
  14.162 +
  14.163 +    // -------------------------------------------------------------------
  14.164 +    /** @brief Compares two paths and check whether the point to
  14.165 +     *         identical files.
  14.166 +     *
  14.167 +     * The dummy implementation of this virtual member performs a
  14.168 +     * case-insensitive comparison of the given strings. The default IO
  14.169 +     * system implementation uses OS mechanisms to convert relative into
  14.170 +     * absolute paths, so the result can be trusted.
  14.171 +     * @param one First file
  14.172 +     * @param second Second file
  14.173 +     * @return true if the paths point to the same file. The file needn't
  14.174 +     *   be existing, however.
  14.175 +     */
  14.176 +    virtual bool ComparePaths (const char* one,
  14.177 +        const char* second) const;
  14.178 +
  14.179 +    // -------------------------------------------------------------------
  14.180 +    /** @brief For backward compatibility
  14.181 +     *  @see ComparePaths(const char*, const char*)
  14.182 +     */
  14.183 +    inline bool ComparePaths (const std::string& one,
  14.184 +        const std::string& second) const;
  14.185 +
  14.186 +    // -------------------------------------------------------------------
  14.187 +    /** @brief Pushes a new directory onto the directory stack.
  14.188 +     *  @param path Path to push onto the stack.
  14.189 +     *  @return True, when push was successful, false if path is empty.
  14.190 +     */
  14.191 +    virtual bool PushDirectory( const std::string &path );
  14.192 +
  14.193 +    // -------------------------------------------------------------------
  14.194 +    /** @brief Returns the top directory from the stack.
  14.195 +     *  @return The directory on the top of the stack.
  14.196 +     *          Returns empty when no directory was pushed to the stack.
  14.197 +     */
  14.198 +    virtual const std::string &CurrentDirectory() const;
  14.199 +
  14.200 +    // -------------------------------------------------------------------
  14.201 +    /** @brief Returns the number of directories stored on the stack.
  14.202 +     *  @return The number of directories of the stack.
  14.203 +     */
  14.204 +    virtual size_t StackSize() const;
  14.205 +
  14.206 +    // -------------------------------------------------------------------
  14.207 +    /** @brief Pops the top directory from the stack.
  14.208 +     *  @return True, when a directory was on the stack. False if no
  14.209 +     *          directory was on the stack.
  14.210 +     */
  14.211 +    virtual bool PopDirectory();
  14.212 +
  14.213 +    // -------------------------------------------------------------------
  14.214 +    /** @brief CReates an new directory at the given path.
  14.215 +     *  @param  path    [in] The path to create.
  14.216 +     *  @return True, when a directory was created. False if the directory
  14.217 +     *           cannot be created.
  14.218 +     */
  14.219 +    virtual bool CreateDirectory( const std::string &path );
  14.220 +
  14.221 +    // -------------------------------------------------------------------
  14.222 +    /** @brief Will change the current directory to the given path.
  14.223 +     *  @param path     [in] The path to change to.
  14.224 +     *  @return True, when the directory has changed successfully.
  14.225 +     */
  14.226 +    virtual bool ChangeDirectory( const std::string &path );
  14.227 +
  14.228 +    virtual bool DeleteFile( const std::string &file );
  14.229 +
  14.230 +private:
  14.231 +    std::vector<std::string> m_pathStack;
  14.232 +};
  14.233 +
  14.234 +// ----------------------------------------------------------------------------
  14.235 +AI_FORCE_INLINE
  14.236 +IOSystem::IOSystem() AI_NO_EXCEPT
  14.237 +: m_pathStack() {
  14.238 +    // empty
  14.239 +}
  14.240 +
  14.241 +// ----------------------------------------------------------------------------
  14.242 +AI_FORCE_INLINE
  14.243 +IOSystem::~IOSystem() {
  14.244 +    // empty
  14.245 +}
  14.246 +
  14.247 +// ----------------------------------------------------------------------------
  14.248 +// For compatibility, the interface of some functions taking a std::string was
  14.249 +// changed to const char* to avoid crashes between binary incompatible STL
  14.250 +// versions. This code her is inlined,  so it shouldn't cause any problems.
  14.251 +// ----------------------------------------------------------------------------
  14.252 +
  14.253 +// ----------------------------------------------------------------------------
  14.254 +AI_FORCE_INLINE
  14.255 +IOStream* IOSystem::Open(const std::string& pFile, const std::string& pMode) {
  14.256 +    // NOTE:
  14.257 +    // For compatibility, interface was changed to const char* to
  14.258 +    // avoid crashes between binary incompatible STL versions
  14.259 +    return Open(pFile.c_str(),pMode.c_str());
  14.260 +}
  14.261 +
  14.262 +// ----------------------------------------------------------------------------
  14.263 +AI_FORCE_INLINE
  14.264 +bool IOSystem::Exists( const std::string& pFile) const {
  14.265 +    // NOTE:
  14.266 +    // For compatibility, interface was changed to const char* to
  14.267 +    // avoid crashes between binary incompatible STL versions
  14.268 +    return Exists(pFile.c_str());
  14.269 +}
  14.270 +
  14.271 +// ----------------------------------------------------------------------------
  14.272 +AI_FORCE_INLINE
  14.273 +bool IOSystem::ComparePaths (const std::string& one, const std::string& second) const {
  14.274 +    // NOTE:
  14.275 +    // For compatibility, interface was changed to const char* to
  14.276 +    // avoid crashes between binary incompatible STL versions
  14.277 +    return ComparePaths(one.c_str(),second.c_str());
  14.278 +}
  14.279 +
  14.280 +// ----------------------------------------------------------------------------
  14.281 +AI_FORCE_INLINE
  14.282 +bool IOSystem::PushDirectory( const std::string &path ) {
  14.283 +    if ( path.empty() ) {
  14.284 +        return false;
  14.285 +    }
  14.286 +
  14.287 +    m_pathStack.push_back( path );
  14.288 +
  14.289 +    return true;
  14.290 +}
  14.291 +
  14.292 +// ----------------------------------------------------------------------------
  14.293 +AI_FORCE_INLINE
  14.294 +const std::string &IOSystem::CurrentDirectory() const {
  14.295 +    if ( m_pathStack.empty() ) {
  14.296 +        static const std::string Dummy("");
  14.297 +        return Dummy;
  14.298 +    }
  14.299 +    return m_pathStack[ m_pathStack.size()-1 ];
  14.300 +}
  14.301 +
  14.302 +// ----------------------------------------------------------------------------
  14.303 +AI_FORCE_INLINE
  14.304 +size_t IOSystem::StackSize() const {
  14.305 +    return m_pathStack.size();
  14.306 +}
  14.307 +
  14.308 +// ----------------------------------------------------------------------------
  14.309 +AI_FORCE_INLINE
  14.310 +bool IOSystem::PopDirectory() {
  14.311 +    if ( m_pathStack.empty() ) {
  14.312 +        return false;
  14.313 +    }
  14.314 +
  14.315 +    m_pathStack.pop_back();
  14.316 +
  14.317 +    return true;
  14.318 +}
  14.319 +
  14.320 +// ----------------------------------------------------------------------------
  14.321 +AI_FORCE_INLINE
  14.322 +bool IOSystem::CreateDirectory( const std::string &path ) {
  14.323 +    if ( path.empty() ) {
  14.324 +        return false;
  14.325 +    }
  14.326 +
  14.327 +#ifdef _WIN32
  14.328 +    return 0 != ::_mkdir( path.c_str() );
  14.329 +#else
  14.330 +    return 0 != ::mkdir( path.c_str(), 0777 );
  14.331 +#endif // _WIN32
  14.332 +}
  14.333 +
  14.334 +// ----------------------------------------------------------------------------
  14.335 +AI_FORCE_INLINE
  14.336 +bool IOSystem::ChangeDirectory( const std::string &path ) {
  14.337 +    if ( path.empty() ) {
  14.338 +        return false;
  14.339 +    }
  14.340 +
  14.341 +#ifdef _WIN32
  14.342 +    return 0 != ::_chdir( path.c_str() );
  14.343 +#else
  14.344 +    return 0 != ::chdir( path.c_str() );
  14.345 +#endif // _WIN32
  14.346 +}
  14.347 +
  14.348 +
  14.349 +// ----------------------------------------------------------------------------
  14.350 +AI_FORCE_INLINE
  14.351 +bool IOSystem::DeleteFile( const std::string &file ) {
  14.352 +    if ( file.empty() ) {
  14.353 +        return false;
  14.354 +    }
  14.355 +    const int retCode( ::remove( file.c_str() ) );
  14.356 +    return ( 0 == retCode );
  14.357 +}
  14.358 +} //!ns Assimp
  14.359 +
  14.360 +#endif //AI_IOSYSTEM_H_INC
    15.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.2 +++ b/include/miniassimp/Importer.hpp	Mon Jan 28 18:19:26 2019 +0200
    15.3 @@ -0,0 +1,649 @@
    15.4 +/*
    15.5 +---------------------------------------------------------------------------
    15.6 +Open Asset Import Library (assimp)
    15.7 +---------------------------------------------------------------------------
    15.8 +
    15.9 +Copyright (c) 2006-2018, assimp team
   15.10 +
   15.11 +
   15.12 +
   15.13 +All rights reserved.
   15.14 +
   15.15 +Redistribution and use of this software in source and binary forms,
   15.16 +with or without modification, are permitted provided that the following
   15.17 +conditions are met:
   15.18 +
   15.19 +* Redistributions of source code must retain the above
   15.20 +  copyright notice, this list of conditions and the
   15.21 +  following disclaimer.
   15.22 +
   15.23 +* Redistributions in binary form must reproduce the above
   15.24 +  copyright notice, this list of conditions and the
   15.25 +  following disclaimer in the documentation and/or other
   15.26 +  materials provided with the distribution.
   15.27 +
   15.28 +* Neither the name of the assimp team, nor the names of its
   15.29 +  contributors may be used to endorse or promote products
   15.30 +  derived from this software without specific prior
   15.31 +  written permission of the assimp team.
   15.32 +
   15.33 +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   15.34 +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   15.35 +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
   15.36 +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
   15.37 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   15.38 +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   15.39 +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
   15.40 +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
   15.41 +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   15.42 +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   15.43 +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   15.44 +---------------------------------------------------------------------------
   15.45 +*/
   15.46 +
   15.47 +/** @file  Importer.hpp
   15.48 + *  @brief Defines the C++-API to the Open Asset Import Library.
   15.49 + */
   15.50 +#pragma once
   15.51 +#ifndef AI_ASSIMP_HPP_INC
   15.52 +#define AI_ASSIMP_HPP_INC
   15.53 +
   15.54 +#ifndef __cplusplus
   15.55 +#   error This header requires C++ to be used. Use assimp.h for plain C.
   15.56 +#endif // __cplusplus
   15.57 +
   15.58 +// Public ASSIMP data structures
   15.59 +#include <miniassimp/types.h>
   15.60 +
   15.61 +namespace Assimp    {
   15.62 +    // =======================================================================
   15.63 +    // Public interface to Assimp
   15.64 +    class Importer;
   15.65 +    class IOStream;
   15.66 +    class IOSystem;
   15.67 +    class ProgressHandler;
   15.68 +
   15.69 +    // =======================================================================
   15.70 +    // Plugin development
   15.71 +    //
   15.72 +    // Include the following headers for the declarations:
   15.73 +    // BaseImporter.h
   15.74 +    // BaseProcess.h
   15.75 +    class BaseImporter;
   15.76 +    class BaseProcess;
   15.77 +    class SharedPostProcessInfo;
   15.78 +    class BatchLoader;
   15.79 +
   15.80 +    // =======================================================================
   15.81 +    // Holy stuff, only for members of the high council of the Jedi.
   15.82 +    class ImporterPimpl;
   15.83 +} //! namespace Assimp
   15.84 +
   15.85 +#define AI_PROPERTY_WAS_NOT_EXISTING 0xffffffff
   15.86 +
   15.87 +struct aiScene;
   15.88 +
   15.89 +// importerdesc.h
   15.90 +struct aiImporterDesc;
   15.91 +
   15.92 +/** @namespace Assimp Assimp's CPP-API and all internal APIs */
   15.93 +namespace Assimp    {
   15.94 +
   15.95 +// ----------------------------------------------------------------------------------
   15.96 +/** CPP-API: The Importer class forms an C++ interface to the functionality of the
   15.97 +*   Open Asset Import Library.
   15.98 +*
   15.99 +* Create an object of this class and call ReadFile() to import a file.
  15.100 +* If the import succeeds, the function returns a pointer to the imported data.
  15.101 +* The data remains property of the object, it is intended to be accessed
  15.102 +* read-only. The imported data will be destroyed along with the Importer
  15.103 +* object. If the import fails, ReadFile() returns a NULL pointer. In this
  15.104 +* case you can retrieve a human-readable error description be calling
  15.105 +* GetErrorString(). You can call ReadFile() multiple times with a single Importer
  15.106 +* instance. Actually, constructing Importer objects involves quite many
  15.107 +* allocations and may take some time, so it's better to reuse them as often as
  15.108 +* possible.
  15.109 +*
  15.110 +* If you need the Importer to do custom file handling to access the files,
  15.111 +* implement IOSystem and IOStream and supply an instance of your custom
  15.112 +* IOSystem implementation by calling SetIOHandler() before calling ReadFile().
  15.113 +* If you do not assign a custion IO handler, a default handler using the
  15.114 +* standard C++ IO logic will be used.
  15.115 +*
  15.116 +* @note One Importer instance is not thread-safe. If you use multiple
  15.117 +* threads for loading, each thread should maintain its own Importer instance.
  15.118 +*/
  15.119 +class ASSIMP_API Importer   {
  15.120 +private:
  15.121 +    Importer(const Importer& other);
  15.122 +    Importer &operator=(const Importer &);
  15.123 +
  15.124 +public:
  15.125 +    /**
  15.126 +     *  @brief The upper limit for hints.
  15.127 +     */
  15.128 +    static const unsigned int MaxLenHint = 200;
  15.129 +
  15.130 +public:
  15.131 +
  15.132 +    // -------------------------------------------------------------------
  15.133 +    /** Constructor. Creates an empty importer object.
  15.134 +     *
  15.135 +     * Call ReadFile() to start the import process. The configuration
  15.136 +     * property table is initially empty.
  15.137 +     */
  15.138 +    Importer();
  15.139 +
  15.140 +    // -------------------------------------------------------------------
  15.141 +    /** Destructor. The object kept ownership of the imported data,
  15.142 +     * which now will be destroyed along with the object.
  15.143 +     */
  15.144 +    ~Importer();
  15.145 +
  15.146 +
  15.147 +    // -------------------------------------------------------------------
  15.148 +    /** Registers a new loader.
  15.149 +     *
  15.150 +     * @param pImp Importer to be added. The Importer instance takes
  15.151 +     *   ownership of the pointer, so it will be automatically deleted
  15.152 +     *   with the Importer instance.
  15.153 +     * @return AI_SUCCESS if the loader has been added. The registration
  15.154 +     *   fails if there is already a loader for a specific file extension.
  15.155 +     */
  15.156 +    aiReturn RegisterLoader(BaseImporter* pImp);
  15.157 +
  15.158 +    // -------------------------------------------------------------------
  15.159 +    /** Unregisters a loader.
  15.160 +     *
  15.161 +     * @param pImp Importer to be unregistered.
  15.162 +     * @return AI_SUCCESS if the loader has been removed. The function
  15.163 +     *   fails if the loader is currently in use (this could happen
  15.164 +     *   if the #Importer instance is used by more than one thread) or
  15.165 +     *   if it has not yet been registered.
  15.166 +     */
  15.167 +    aiReturn UnregisterLoader(BaseImporter* pImp);
  15.168 +
  15.169 +    // -------------------------------------------------------------------
  15.170 +    /** Registers a new post-process step.
  15.171 +     *
  15.172 +     * At the moment, there's a small limitation: new post processing
  15.173 +     * steps are added to end of the list, or in other words, executed
  15.174 +     * last, after all built-in steps.
  15.175 +     * @param pImp Post-process step to be added. The Importer instance
  15.176 +     *   takes ownership of the pointer, so it will be automatically
  15.177 +     *   deleted with the Importer instance.
  15.178 +     * @return AI_SUCCESS if the step has been added correctly.
  15.179 +     */
  15.180 +    aiReturn RegisterPPStep(BaseProcess* pImp);
  15.181 +
  15.182 +    // -------------------------------------------------------------------
  15.183 +    /** Unregisters a post-process step.
  15.184 +     *
  15.185 +     * @param pImp Step to be unregistered.
  15.186 +     * @return AI_SUCCESS if the step has been removed. The function
  15.187 +     *   fails if the step is currently in use (this could happen
  15.188 +     *   if the #Importer instance is used by more than one thread) or
  15.189 +     *   if it has not yet been registered.
  15.190 +     */
  15.191 +    aiReturn UnregisterPPStep(BaseProcess* pImp);
  15.192 +
  15.193 +    // -------------------------------------------------------------------
  15.194 +    /** Set an integer configuration property.
  15.195 +     * @param szName Name of the property. All supported properties
  15.196 +     *   are defined in the aiConfig.g header (all constants share the
  15.197 +     *   prefix AI_CONFIG_XXX and are simple strings).
  15.198 +     * @param iValue New value of the property
  15.199 +     * @return true if the property was set before. The new value replaces
  15.200 +     *   the previous value in this case.
  15.201 +     * @note Property of different types (float, int, string ..) are kept
  15.202 +     *   on different stacks, so calling SetPropertyInteger() for a
  15.203 +     *   floating-point property has no effect - the loader will call
  15.204 +     *   GetPropertyFloat() to read the property, but it won't be there.
  15.205 +     */
  15.206 +    bool SetPropertyInteger(const char* szName, int iValue);
  15.207 +
  15.208 +    // -------------------------------------------------------------------
  15.209 +    /** Set a boolean configuration property. Boolean properties
  15.210 +     *  are stored on the integer stack internally so it's possible
  15.211 +     *  to set them via #SetPropertyBool and query them with
  15.212 +     *  #GetPropertyBool and vice versa.
  15.213 +     * @see SetPropertyInteger()
  15.214 +     */
  15.215 +    bool SetPropertyBool(const char* szName, bool value)    {
  15.216 +        return SetPropertyInteger(szName,value);
  15.217 +    }
  15.218 +
  15.219 +    // -------------------------------------------------------------------
  15.220 +    /** Set a floating-point configuration property.
  15.221 +     * @see SetPropertyInteger()
  15.222 +     */
  15.223 +    bool SetPropertyFloat(const char* szName, ai_real fValue);
  15.224 +
  15.225 +    // -------------------------------------------------------------------
  15.226 +    /** Set a string configuration property.
  15.227 +     * @see SetPropertyInteger()
  15.228 +     */
  15.229 +    bool SetPropertyString(const char* szName, const std::string& sValue);
  15.230 +
  15.231 +    // -------------------------------------------------------------------
  15.232 +    /** Set a matrix configuration property.
  15.233 +     * @see SetPropertyInteger()
  15.234 +     */
  15.235 +    bool SetPropertyMatrix(const char* szName, const aiMatrix4x4& sValue);
  15.236 +
  15.237 +    // -------------------------------------------------------------------
  15.238 +    /** Get a configuration property.
  15.239 +     * @param szName Name of the property. All supported properties
  15.240 +     *   are defined in the aiConfig.g header (all constants share the
  15.241 +     *   prefix AI_CONFIG_XXX).
  15.242 +     * @param iErrorReturn Value that is returned if the property
  15.243 +     *   is not found.
  15.244 +     * @return Current value of the property
  15.245 +     * @note Property of different types (float, int, string ..) are kept
  15.246 +     *   on different lists, so calling SetPropertyInteger() for a
  15.247 +     *   floating-point property has no effect - the loader will call
  15.248 +     *   GetPropertyFloat() to read the property, but it won't be there.
  15.249 +     */
  15.250 +    int GetPropertyInteger(const char* szName,
  15.251 +        int iErrorReturn = 0xffffffff) const;
  15.252 +
  15.253 +    // -------------------------------------------------------------------
  15.254 +    /** Get a boolean configuration property. Boolean properties
  15.255 +     *  are stored on the integer stack internally so it's possible
  15.256 +     *  to set them via #SetPropertyBool and query them with
  15.257 +     *  #GetPropertyBool and vice versa.
  15.258 +     * @see GetPropertyInteger()
  15.259 +     */
  15.260 +    bool GetPropertyBool(const char* szName, bool bErrorReturn = false) const {
  15.261 +        return GetPropertyInteger(szName,bErrorReturn)!=0;
  15.262 +    }
  15.263 +
  15.264 +    // -------------------------------------------------------------------
  15.265 +    /** Get a floating-point configuration property
  15.266 +     * @see GetPropertyInteger()
  15.267 +     */
  15.268 +    ai_real GetPropertyFloat(const char* szName,
  15.269 +        ai_real fErrorReturn = 10e10) const;
  15.270 +
  15.271 +    // -------------------------------------------------------------------
  15.272 +    /** Get a string configuration property
  15.273 +     *
  15.274 +     *  The return value remains valid until the property is modified.
  15.275 +     * @see GetPropertyInteger()
  15.276 +     */
  15.277 +    const std::string GetPropertyString(const char* szName,
  15.278 +        const std::string& sErrorReturn = "") const;
  15.279 +
  15.280 +    // -------------------------------------------------------------------
  15.281 +    /** Get a matrix configuration property
  15.282 +     *
  15.283 +     *  The return value remains valid until the property is modified.
  15.284 +     * @see GetPropertyInteger()
  15.285 +     */
  15.286 +    const aiMatrix4x4 GetPropertyMatrix(const char* szName,
  15.287 +        const aiMatrix4x4& sErrorReturn = aiMatrix4x4()) const;
  15.288 +
  15.289 +    // -------------------------------------------------------------------
  15.290 +    /** Supplies a custom IO handler to the importer to use to open and
  15.291 +     * access files. If you need the importer to use custom IO logic to
  15.292 +     * access the files, you need to provide a custom implementation of
  15.293 +     * IOSystem and IOFile to the importer. Then create an instance of
  15.294 +     * your custom IOSystem implementation and supply it by this function.
  15.295 +     *
  15.296 +     * The Importer takes ownership of the object and will destroy it
  15.297 +     * afterwards. The previously assigned handler will be deleted.
  15.298 +     * Pass NULL to take again ownership of your IOSystem and reset Assimp
  15.299 +     * to use its default implementation.
  15.300 +     *
  15.301 +     * @param pIOHandler The IO handler to be used in all file accesses
  15.302 +     *   of the Importer.
  15.303 +     */
  15.304 +    void SetIOHandler( IOSystem* pIOHandler);
  15.305 +
  15.306 +    // -------------------------------------------------------------------
  15.307 +    /** Retrieves the IO handler that is currently set.
  15.308 +     * You can use #IsDefaultIOHandler() to check whether the returned
  15.309 +     * interface is the default IO handler provided by ASSIMP. The default
  15.310 +     * handler is active as long the application doesn't supply its own
  15.311 +     * custom IO handler via #SetIOHandler().
  15.312 +     * @return A valid IOSystem interface, never NULL.
  15.313 +     */
  15.314 +    IOSystem* GetIOHandler() const;
  15.315 +
  15.316 +    // -------------------------------------------------------------------
  15.317 +    /** Checks whether a default IO handler is active
  15.318 +     * A default handler is active as long the application doesn't
  15.319 +     * supply its own custom IO handler via #SetIOHandler().
  15.320 +     * @return true by default
  15.321 +     */
  15.322 +    bool IsDefaultIOHandler() const;
  15.323 +
  15.324 +    // -------------------------------------------------------------------
  15.325 +    /** Supplies a custom progress handler to the importer. This
  15.326 +     *  interface exposes an #Update() callback, which is called
  15.327 +     *  more or less periodically (please don't sue us if it
  15.328 +     *  isn't as periodically as you'd like it to have ...).
  15.329 +     *  This can be used to implement progress bars and loading
  15.330 +     *  timeouts.
  15.331 +     *  @param pHandler Progress callback interface. Pass NULL to
  15.332 +     *    disable progress reporting.
  15.333 +     *  @note Progress handlers can be used to abort the loading
  15.334 +     *    at almost any time.*/
  15.335 +    void SetProgressHandler ( ProgressHandler* pHandler );
  15.336 +
  15.337 +    // -------------------------------------------------------------------
  15.338 +    /** Retrieves the progress handler that is currently set.
  15.339 +     * You can use #IsDefaultProgressHandler() to check whether the returned
  15.340 +     * interface is the default handler provided by ASSIMP. The default
  15.341 +     * handler is active as long the application doesn't supply its own
  15.342 +     * custom handler via #SetProgressHandler().
  15.343 +     * @return A valid ProgressHandler interface, never NULL.
  15.344 +     */
  15.345 +    ProgressHandler* GetProgressHandler() const;
  15.346 +
  15.347 +    // -------------------------------------------------------------------
  15.348 +    /** Checks whether a default progress handler is active
  15.349 +     * A default handler is active as long the application doesn't
  15.350 +     * supply its own custom progress handler via #SetProgressHandler().
  15.351 +     * @return true by default
  15.352 +     */
  15.353 +    bool IsDefaultProgressHandler() const;
  15.354 +
  15.355 +    // -------------------------------------------------------------------
  15.356 +    /** @brief Check whether a given set of post-processing flags
  15.357 +     *  is supported.
  15.358 +     *
  15.359 +     *  Some flags are mutually exclusive, others are probably
  15.360 +     *  not available because your excluded them from your
  15.361 +     *  Assimp builds. Calling this function is recommended if
  15.362 +     *  you're unsure.
  15.363 +     *
  15.364 +     *  @param pFlags Bitwise combination of the aiPostProcess flags.
  15.365 +     *  @return true if this flag combination is fine.
  15.366 +     */
  15.367 +    bool ValidateFlags(unsigned int pFlags) const;
  15.368 +
  15.369 +    // -------------------------------------------------------------------
  15.370 +    /** Reads the given file and returns its contents if successful.
  15.371 +     *
  15.372 +     * If the call succeeds, the contents of the file are returned as a
  15.373 +     * pointer to an aiScene object. The returned data is intended to be
  15.374 +     * read-only, the importer object keeps ownership of the data and will
  15.375 +     * destroy it upon destruction. If the import fails, NULL is returned.
  15.376 +     * A human-readable error description can be retrieved by calling
  15.377 +     * GetErrorString(). The previous scene will be deleted during this call.
  15.378 +     * @param pFile Path and filename to the file to be imported.
  15.379 +     * @param pFlags Optional post processing steps to be executed after
  15.380 +     *   a successful import. Provide a bitwise combination of the
  15.381 +     *   #aiPostProcessSteps flags. If you wish to inspect the imported
  15.382 +     *   scene first in order to fine-tune your post-processing setup,
  15.383 +     *   consider to use #ApplyPostProcessing().
  15.384 +     * @return A pointer to the imported data, NULL if the import failed.
  15.385 +     *   The pointer to the scene remains in possession of the Importer
  15.386 +     *   instance. Use GetOrphanedScene() to take ownership of it.
  15.387 +     *
  15.388 +     * @note Assimp is able to determine the file format of a file
  15.389 +     * automatically.
  15.390 +     */
  15.391 +    const aiScene* ReadFile(
  15.392 +        const char* pFile,
  15.393 +        unsigned int pFlags);
  15.394 +
  15.395 +    // -------------------------------------------------------------------
  15.396 +    /** Reads the given file from a memory buffer and returns its
  15.397 +     *  contents if successful.
  15.398 +     *
  15.399 +     * If the call succeeds, the contents of the file are returned as a
  15.400 +     * pointer to an aiScene object. The returned data is intended to be
  15.401 +     * read-only, the importer object keeps ownership of the data and will
  15.402 +     * destroy it upon destruction. If the import fails, NULL is returned.
  15.403 +     * A human-readable error description can be retrieved by calling
  15.404 +     * GetErrorString(). The previous scene will be deleted during this call.
  15.405 +     * Calling this method doesn't affect the active IOSystem.
  15.406 +     * @param pBuffer Pointer to the file data
  15.407 +     * @param pLength Length of pBuffer, in bytes
  15.408 +     * @param pFlags Optional post processing steps to be executed after
  15.409 +     *   a successful import. Provide a bitwise combination of the
  15.410 +     *   #aiPostProcessSteps flags. If you wish to inspect the imported
  15.411 +     *   scene first in order to fine-tune your post-processing setup,
  15.412 +     *   consider to use #ApplyPostProcessing().
  15.413 +     * @param pHint An additional hint to the library. If this is a non
  15.414 +     *   empty string, the library looks for a loader to support
  15.415 +     *   the file extension specified by pHint and passes the file to
  15.416 +     *   the first matching loader. If this loader is unable to completely
  15.417 +     *   the request, the library continues and tries to determine the
  15.418 +     *   file format on its own, a task that may or may not be successful.
  15.419 +     *   Check the return value, and you'll know ...
  15.420 +     * @return A pointer to the imported data, NULL if the import failed.
  15.421 +     *   The pointer to the scene remains in possession of the Importer
  15.422 +     *   instance. Use GetOrphanedScene() to take ownership of it.
  15.423 +     *
  15.424 +     * @note This is a straightforward way to decode models from memory
  15.425 +     * buffers, but it doesn't handle model formats that spread their
  15.426 +     * data across multiple files or even directories. Examples include
  15.427 +     * OBJ or MD3, which outsource parts of their material info into
  15.428 +     * external scripts. If you need full functionality, provide
  15.429 +     * a custom IOSystem to make Assimp find these files and use
  15.430 +     * the regular ReadFile() API.
  15.431 +     */
  15.432 +    const aiScene* ReadFileFromMemory(
  15.433 +        const void* pBuffer,
  15.434 +        size_t pLength,
  15.435 +        unsigned int pFlags,
  15.436 +        const char* pHint = "");
  15.437 +
  15.438 +    // -------------------------------------------------------------------
  15.439 +    /** Apply post-processing to an already-imported scene.
  15.440 +     *
  15.441 +     *  This is strictly equivalent to calling #ReadFile() with the same
  15.442 +     *  flags. However, you can use this separate function to inspect
  15.443 +     *  the imported scene first to fine-tune your post-processing setup.
  15.444 +     *  @param pFlags Provide a bitwise combination of the
  15.445 +     *   #aiPostProcessSteps flags.
  15.446 +     *  @return A pointer to the post-processed data. This is still the
  15.447 +     *   same as the pointer returned by #ReadFile(). However, if
  15.448 +     *   post-processing fails, the scene could now be NULL.
  15.449 +     *   That's quite a rare case, post processing steps are not really
  15.450 +     *   designed to 'fail'. To be exact, the #aiProcess_ValidateDS
  15.451 +     *   flag is currently the only post processing step which can actually
  15.452 +     *   cause the scene to be reset to NULL.
  15.453 +     *
  15.454 +     *  @note The method does nothing if no scene is currently bound
  15.455 +     *    to the #Importer instance.  */
  15.456 +    const aiScene* ApplyPostProcessing(unsigned int pFlags);
  15.457 +
  15.458 +    const aiScene* ApplyCustomizedPostProcessing( BaseProcess *rootProcess, bool requestValidation );
  15.459 +
  15.460 +    // -------------------------------------------------------------------
  15.461 +    /** @brief Reads the given file and returns its contents if successful.
  15.462 +     *
  15.463 +     * This function is provided for backward compatibility.
  15.464 +     * See the const char* version for detailed docs.
  15.465 +     * @see ReadFile(const char*, pFlags)  */
  15.466 +    const aiScene* ReadFile(
  15.467 +        const std::string& pFile,
  15.468 +        unsigned int pFlags);
  15.469 +
  15.470 +    // -------------------------------------------------------------------
  15.471 +    /** Frees the current scene.
  15.472 +     *
  15.473 +     *  The function does nothing if no scene has previously been
  15.474 +     *  read via ReadFile(). FreeScene() is called automatically by the
  15.475 +     *  destructor and ReadFile() itself.  */
  15.476 +    void FreeScene( );
  15.477 +
  15.478 +    // -------------------------------------------------------------------
  15.479 +    /** Returns an error description of an error that occurred in ReadFile().
  15.480 +     *
  15.481 +     * Returns an empty string if no error occurred.
  15.482 +     * @return A description of the last error, an empty string if no
  15.483 +     *   error occurred. The string is never NULL.
  15.484 +     *
  15.485 +     * @note The returned function remains valid until one of the
  15.486 +     * following methods is called: #ReadFile(), #FreeScene(). */
  15.487 +    const char* GetErrorString() const;
  15.488 +
  15.489 +    // -------------------------------------------------------------------
  15.490 +    /** Returns the scene loaded by the last successful call to ReadFile()
  15.491 +     *
  15.492 +     * @return Current scene or NULL if there is currently no scene loaded */
  15.493 +    const aiScene* GetScene() const;
  15.494 +
  15.495 +    // -------------------------------------------------------------------
  15.496 +    /** Returns the scene loaded by the last successful call to ReadFile()
  15.497 +     *  and releases the scene from the ownership of the Importer
  15.498 +     *  instance. The application is now responsible for deleting the
  15.499 +     *  scene. Any further calls to GetScene() or GetOrphanedScene()
  15.500 +     *  will return NULL - until a new scene has been loaded via ReadFile().
  15.501 +     *
  15.502 +     * @return Current scene or NULL if there is currently no scene loaded
  15.503 +     * @note Use this method with maximal caution, and only if you have to.
  15.504 +     *   By design, aiScene's are exclusively maintained, allocated and
  15.505 +     *   deallocated by Assimp and no one else. The reasoning behind this
  15.506 +     *   is the golden rule that deallocations should always be done
  15.507 +     *   by the module that did the original allocation because heaps
  15.508 +     *   are not necessarily shared. GetOrphanedScene() enforces you
  15.509 +     *   to delete the returned scene by yourself, but this will only
  15.510 +     *   be fine if and only if you're using the same heap as assimp.
  15.511 +     *   On Windows, it's typically fine provided everything is linked
  15.512 +     *   against the multithreaded-dll version of the runtime library.
  15.513 +     *   It will work as well for static linkage with Assimp.*/
  15.514 +    aiScene* GetOrphanedScene();
  15.515 +
  15.516 +    // -------------------------------------------------------------------
  15.517 +    /** Returns whether a given file extension is supported by ASSIMP.
  15.518 +     *
  15.519 +     * @param szExtension Extension to be checked.
  15.520 +     *   Must include a trailing dot '.'. Example: ".3ds", ".md3".
  15.521 +     *   Cases-insensitive.
  15.522 +     * @return true if the extension is supported, false otherwise */
  15.523 +    bool IsExtensionSupported(const char* szExtension) const;
  15.524 +
  15.525 +    // -------------------------------------------------------------------
  15.526 +    /** @brief Returns whether a given file extension is supported by ASSIMP.
  15.527 +     *
  15.528 +     * This function is provided for backward compatibility.
  15.529 +     * See the const char* version for detailed and up-to-date docs.
  15.530 +     * @see IsExtensionSupported(const char*) */
  15.531 +    inline bool IsExtensionSupported(const std::string& szExtension) const;
  15.532 +
  15.533 +    // -------------------------------------------------------------------
  15.534 +    /** Get a full list of all file extensions supported by ASSIMP.
  15.535 +     *
  15.536 +     * If a file extension is contained in the list this does of course not
  15.537 +     * mean that ASSIMP is able to load all files with this extension ---
  15.538 +     * it simply means there is an importer loaded which claims to handle
  15.539 +     * files with this file extension.
  15.540 +     * @param szOut String to receive the extension list.
  15.541 +     *   Format of the list: "*.3ds;*.obj;*.dae". This is useful for
  15.542 +     *   use with the WinAPI call GetOpenFileName(Ex). */
  15.543 +    void GetExtensionList(aiString& szOut) const;
  15.544 +
  15.545 +    // -------------------------------------------------------------------
  15.546 +    /** @brief Get a full list of all file extensions supported by ASSIMP.
  15.547 +     *
  15.548 +     * This function is provided for backward compatibility.
  15.549 +     * See the aiString version for detailed and up-to-date docs.
  15.550 +     * @see GetExtensionList(aiString&)*/
  15.551 +    inline void GetExtensionList(std::string& szOut) const;
  15.552 +
  15.553 +    // -------------------------------------------------------------------
  15.554 +    /** Get the number of importers currently registered with Assimp. */
  15.555 +    size_t GetImporterCount() const;
  15.556 +
  15.557 +    // -------------------------------------------------------------------
  15.558 +    /** Get meta data for the importer corresponding to a specific index..
  15.559 +    *
  15.560 +    *  For the declaration of #aiImporterDesc, include <assimp/importerdesc.h>.
  15.561 +    *  @param index Index to query, must be within [0,GetImporterCount())
  15.562 +    *  @return Importer meta data structure, NULL if the index does not
  15.563 +    *     exist or if the importer doesn't offer meta information (
  15.564 +    *     importers may do this at the cost of being hated by their peers).*/
  15.565 +    const aiImporterDesc* GetImporterInfo(size_t index) const;
  15.566 +
  15.567 +    // -------------------------------------------------------------------
  15.568 +    /** Find the importer corresponding to a specific index.
  15.569 +    *
  15.570 +    *  @param index Index to query, must be within [0,GetImporterCount())
  15.571 +    *  @return Importer instance. NULL if the index does not
  15.572 +    *     exist. */
  15.573 +    BaseImporter* GetImporter(size_t index) const;
  15.574 +
  15.575 +    // -------------------------------------------------------------------
  15.576 +    /** Find the importer corresponding to a specific file extension.
  15.577 +    *
  15.578 +    *  This is quite similar to #IsExtensionSupported except a
  15.579 +    *  BaseImporter instance is returned.
  15.580 +    *  @param szExtension Extension to check for. The following formats
  15.581 +    *    are recognized (BAH being the file extension): "BAH" (comparison
  15.582 +    *    is case-insensitive), ".bah", "*.bah" (wild card and dot
  15.583 +    *    characters at the beginning of the extension are skipped).
  15.584 +    *  @return NULL if no importer is found*/
  15.585 +    BaseImporter* GetImporter (const char* szExtension) const;
  15.586 +
  15.587 +    // -------------------------------------------------------------------
  15.588 +    /** Find the importer index corresponding to a specific file extension.
  15.589 +    *
  15.590 +    *  @param szExtension Extension to check for. The following formats
  15.591 +    *    are recognized (BAH being the file extension): "BAH" (comparison
  15.592 +    *    is case-insensitive), ".bah", "*.bah" (wild card and dot
  15.593 +    *    characters at the beginning of the extension are skipped).
  15.594 +    *  @return (size_t)-1 if no importer is found */
  15.595 +    size_t GetImporterIndex (const char* szExtension) const;
  15.596 +
  15.597 +    // -------------------------------------------------------------------
  15.598 +    /** Returns the storage allocated by ASSIMP to hold the scene data
  15.599 +     * in memory.
  15.600 +     *
  15.601 +     * This refers to the currently loaded file, see #ReadFile().
  15.602 +     * @param in Data structure to be filled.
  15.603 +     * @note The returned memory statistics refer to the actual
  15.604 +     *   size of the use data of the aiScene. Heap-related overhead
  15.605 +     *   is (naturally) not included.*/
  15.606 +    void GetMemoryRequirements(aiMemoryInfo& in) const;
  15.607 +
  15.608 +    // -------------------------------------------------------------------
  15.609 +    /** Enables "extra verbose" mode.
  15.610 +     *
  15.611 +     * 'Extra verbose' means the data structure is validated after *every*
  15.612 +     * single post processing step to make sure everyone modifies the data
  15.613 +     * structure in a well-defined manner. This is a debug feature and not
  15.614 +     * intended for use in production environments. */
  15.615 +    void SetExtraVerbose(bool bDo);
  15.616 +
  15.617 +    // -------------------------------------------------------------------
  15.618 +    /** Private, do not use. */
  15.619 +    ImporterPimpl* Pimpl() { return pimpl; }
  15.620 +    const ImporterPimpl* Pimpl() const { return pimpl; }
  15.621 +
  15.622 +protected:
  15.623 +
  15.624 +    // Just because we don't want you to know how we're hacking around.
  15.625 +    ImporterPimpl* pimpl;
  15.626 +}; //! class Importer
  15.627 +
  15.628 +
  15.629 +// ----------------------------------------------------------------------------
  15.630 +// For compatibility, the interface of some functions taking a std::string was
  15.631 +// changed to const char* to avoid crashes between binary incompatible STL
  15.632 +// versions. This code her is inlined,  so it shouldn't cause any problems.
  15.633 +// ----------------------------------------------------------------------------
  15.634 +
  15.635 +// ----------------------------------------------------------------------------
  15.636 +AI_FORCE_INLINE const aiScene* Importer::ReadFile( const std::string& pFile,unsigned int pFlags){
  15.637 +    return ReadFile(pFile.c_str(),pFlags);
  15.638 +}
  15.639 +// ----------------------------------------------------------------------------
  15.640 +AI_FORCE_INLINE void Importer::GetExtensionList(std::string& szOut) const   {
  15.641 +    aiString s;
  15.642 +    GetExtensionList(s);
  15.643 +    szOut = s.data;
  15.644 +}
  15.645 +// ----------------------------------------------------------------------------
  15.646 +AI_FORCE_INLINE bool Importer::IsExtensionSupported(const std::string& szExtension) const   {
  15.647 +    return IsExtensionSupported(szExtension.c_str());
  15.648 +}
  15.649 +
  15.650 +} // !namespace Assimp
  15.651 +
  15.652 +#endif // AI_ASSIMP_HPP_INC
    16.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.2 +++ b/include/miniassimp/LogStream.hpp	Mon Jan 28 18:19:26 2019 +0200
    16.3 @@ -0,0 +1,111 @@
    16.4 +/*
    16.5 +Open Asset Import Library (assimp)
    16.6 +----------------------------------------------------------------------
    16.7 +
    16.8 +Copyright (c) 2006-2018, assimp team
    16.9 +
   16.10 +
   16.11 +All rights reserved.
   16.12 +
   16.13 +Redistribution and use of this software in source and binary forms,
   16.14 +with or without modification, are permitted provided that the
   16.15 +following conditions are met:
   16.16 +
   16.17 +* Redistributions of source code must retain the above
   16.18 +  copyright notice, this list of conditions and the
   16.19 +  following disclaimer.
   16.20 +
   16.21 +* Redistributions in binary form must reproduce the above
   16.22 +  copyright notice, this list of conditions and the
   16.23 +  following disclaimer in the documentation and/or other
   16.24 +  materials provided with the distribution.
   16.25 +
   16.26 +* Neither the name of the assimp team, nor the names of its
   16.27 +  contributors may be used to endorse or promote products
   16.28 +  derived from this software without specific prior
   16.29 +  written permission of the assimp team.
   16.30 +
   16.31 +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   16.32 +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   16.33 +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
   16.34 +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
   16.35 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   16.36 +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   16.37 +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
   16.38 +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
   16.39 +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   16.40 +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   16.41 +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   16.42 +
   16.43 +----------------------------------------------------------------------
   16.44 +*/
   16.45 +
   16.46 +/** @file LogStream.hpp
   16.47 + *  @brief Abstract base class 'LogStream', representing an output log stream.
   16.48 + */
   16.49 +#ifndef INCLUDED_AI_LOGSTREAM_H
   16.50 +#define INCLUDED_AI_LOGSTREAM_H
   16.51 +
   16.52 +#include "types.h"
   16.53 +
   16.54 +namespace Assimp    {
   16.55 +
   16.56 +class IOSystem;
   16.57 +
   16.58 +// ------------------------------------------------------------------------------------
   16.59 +/** @brief CPP-API: Abstract interface for log stream implementations.
   16.60 + *
   16.61 + *  Several default implementations are provided, see #aiDefaultLogStream for more
   16.62 + *  details. Writing your own implementation of LogStream is just necessary if these
   16.63 + *  are not enough for your purpose. */
   16.64 +class ASSIMP_API LogStream
   16.65 +#ifndef SWIG
   16.66 +    : public Intern::AllocateFromAssimpHeap
   16.67 +#endif
   16.68 +{
   16.69 +protected:
   16.70 +    /** @brief  Default constructor */
   16.71 +    LogStream() AI_NO_EXCEPT;
   16.72 +
   16.73 +public:
   16.74 +    /** @brief  Virtual destructor  */
   16.75 +    virtual ~LogStream();
   16.76 +
   16.77 +    // -------------------------------------------------------------------
   16.78 +    /** @brief  Overwrite this for your own output methods
   16.79 +     *
   16.80 +     *  Log messages *may* consist of multiple lines and you shouldn't
   16.81 +     *  expect a consistent formatting. If you want custom formatting
   16.82 +     *  (e.g. generate HTML), supply a custom instance of Logger to
   16.83 +     *  #DefaultLogger:set(). Usually you can *expect* that a log message
   16.84 +     *  is exactly one line and terminated with a single \n character.
   16.85 +     *  @param message Message to be written */
   16.86 +    virtual void write(const char* message) = 0;
   16.87 +
   16.88 +    // -------------------------------------------------------------------
   16.89 +    /** @brief Creates a default log stream
   16.90 +     *  @param streams Type of the default stream
   16.91 +     *  @param name For aiDefaultLogStream_FILE: name of the output file
   16.92 +     *  @param io For aiDefaultLogStream_FILE: IOSystem to be used to open the output
   16.93 +     *   file. Pass NULL for the default implementation.
   16.94 +     *  @return New LogStream instance.  */
   16.95 +    static LogStream* createDefaultStream(aiDefaultLogStream stream,
   16.96 +        const char* name = "AssimpLog.txt",
   16.97 +        IOSystem* io = 0 );
   16.98 +
   16.99 +}; // !class LogStream
  16.100 +
  16.101 +inline
  16.102 +LogStream::LogStream() AI_NO_EXCEPT {
  16.103 +    // empty
  16.104 +}
  16.105 +
  16.106 +inline
  16.107 +LogStream::~LogStream() {
  16.108 +    // empty
  16.109 +}
  16.110 +
  16.111 +// ------------------------------------------------------------------------------------
  16.112 +} // Namespace Assimp
  16.113 +
  16.114 +#endif
    17.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.2 +++ b/include/miniassimp/Logger.hpp	Mon Jan 28 18:19:26 2019 +0200
    17.3 @@ -0,0 +1,305 @@
    17.4 +/*
    17.5 +Open Asset Import Library (assimp)
    17.6 +----------------------------------------------------------------------
    17.7 +
    17.8 +Copyright (c) 2006-2018, assimp team
    17.9 +
   17.10 +
   17.11 +All rights reserved.
   17.12 +
   17.13 +Redistribution and use of this software in source and binary forms,
   17.14 +with or without modification, are permitted provided that the
   17.15 +following conditions are met:
   17.16 +
   17.17 +* Redistributions of source code must retain the above
   17.18 +  copyright notice, this list of conditions and the
   17.19 +  following disclaimer.
   17.20 +
   17.21 +* Redistributions in binary form must reproduce the above
   17.22 +  copyright notice, this list of conditions and the
   17.23 +  following disclaimer in the documentation and/or other
   17.24 +  materials provided with the distribution.
   17.25 +
   17.26 +* Neither the name of the assimp team, nor the names of its
   17.27 +  contributors may be used to endorse or promote products
   17.28 +  derived from this software without specific prior
   17.29 +  written permission of the assimp team.
   17.30 +
   17.31 +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   17.32 +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   17.33 +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
   17.34 +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
   17.35 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   17.36 +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   17.37 +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
   17.38 +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
   17.39 +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   17.40 +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   17.41 +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   17.42 +
   17.43 +----------------------------------------------------------------------
   17.44 +*/
   17.45 +
   17.46 +/** @file Logger.hpp
   17.47 + *  @brief Abstract base class 'Logger', base of the logging system.
   17.48 + */
   17.49 +#ifndef INCLUDED_AI_LOGGER_H
   17.50 +#define INCLUDED_AI_LOGGER_H
   17.51 +
   17.52 +#include <miniassimp/types.h>
   17.53 +#include <miniassimp/TinyFormatter.h>
   17.54 +
   17.55 +namespace Assimp {
   17.56 +
   17.57 +class LogStream;
   17.58 +
   17.59 +// Maximum length of a log message. Longer messages are rejected.
   17.60 +#define MAX_LOG_MESSAGE_LENGTH 1024u
   17.61 +
   17.62 +// ----------------------------------------------------------------------------------
   17.63 +/** @brief CPP-API: Abstract interface for logger implementations.
   17.64 + *  Assimp provides a default implementation and uses it for almost all
   17.65 + *  logging stuff ('DefaultLogger'). This class defines just basic logging
   17.66 + *  behavior and is not of interest for you. Instead, take a look at #DefaultLogger. */
   17.67 +class ASSIMP_API Logger
   17.68 +#ifndef SWIG
   17.69 +    : public Intern::AllocateFromAssimpHeap
   17.70 +#endif
   17.71 +{
   17.72 +public:
   17.73 +
   17.74 +    // ----------------------------------------------------------------------
   17.75 +    /** @enum   LogSeverity
   17.76 +     *  @brief  Log severity to describe the granularity of logging.
   17.77 +     */
   17.78 +    enum LogSeverity {
   17.79 +        NORMAL,     //!< Normal granularity of logging
   17.80 +        VERBOSE     //!< Debug infos will be logged, too
   17.81 +    };
   17.82 +
   17.83 +    // ----------------------------------------------------------------------
   17.84 +    /** @enum   ErrorSeverity
   17.85 +     *  @brief  Description for severity of a log message.
   17.86 +     *
   17.87 +     *  Every LogStream has a bitwise combination of these flags.
   17.88 +     *  A LogStream doesn't receive any messages of a specific type
   17.89 +     *  if it doesn't specify the corresponding ErrorSeverity flag.
   17.90 +     */
   17.91 +    enum ErrorSeverity {
   17.92 +        Debugging   = 1,    //!< Debug log message
   17.93 +        Info        = 2,    //!< Info log message
   17.94 +        Warn        = 4,    //!< Warn log message
   17.95 +        Err         = 8     //!< Error log message
   17.96 +    };
   17.97 +
   17.98 +public:
   17.99 +
  17.100 +    /** @brief  Virtual destructor */
  17.101 +    virtual ~Logger();
  17.102 +
  17.103 +    // ----------------------------------------------------------------------
  17.104 +    /** @brief  Writes a debug message
  17.105 +     *   @param message Debug message*/
  17.106 +    void debug(const char* message);
  17.107 +    void debug(const std::string &message);
  17.108 +
  17.109 +    // ----------------------------------------------------------------------
  17.110 +    /** @brief  Writes a info message
  17.111 +     *  @param  message Info message*/
  17.112 +    void info(const char* message);
  17.113 +    void info(const std::string &message);
  17.114 +
  17.115 +    // ----------------------------------------------------------------------
  17.116 +    /** @brief  Writes a warning message
  17.117 +     *  @param  message Warn message*/
  17.118 +    void warn(const char* message);
  17.119 +    void warn(const std::string &message);
  17.120 +
  17.121 +    // ----------------------------------------------------------------------
  17.122 +    /** @brief  Writes an error message
  17.123 +     *  @param  message Error message*/
  17.124 +    void error(const char* message);
  17.125 +    void error(const std::string &message);
  17.126 +
  17.127 +    // ----------------------------------------------------------------------
  17.128 +    /** @brief  Set a new log severity.
  17.129 +     *  @param  log_severity New severity for logging*/
  17.130 +    void setLogSeverity(LogSeverity log_severity);
  17.131 +
  17.132 +    // ----------------------------------------------------------------------
  17.133 +    /** @brief Get the current log severity*/
  17.134 +    LogSeverity getLogSeverity() const;
  17.135 +
  17.136 +    // ----------------------------------------------------------------------
  17.137 +    /** @brief  Attach a new log-stream
  17.138 +     *
  17.139 +     *  The logger takes ownership of the stream and is responsible
  17.140 +     *  for its destruction (which is done using ::delete when the logger
  17.141 +     *  itself is destroyed). Call detachStream to detach a stream and to
  17.142 +     *  gain ownership of it again.
  17.143 +     *   @param pStream  Log-stream to attach
  17.144 +     *  @param severity  Message filter, specified which types of log
  17.145 +     *    messages are dispatched to the stream. Provide a bitwise
  17.146 +     *    combination of the ErrorSeverity flags.
  17.147 +     *  @return true if the stream has been attached, false otherwise.*/
  17.148 +    virtual bool attachStream(LogStream *pStream,
  17.149 +        unsigned int severity = Debugging | Err | Warn | Info) = 0;
  17.150 +
  17.151 +    // ----------------------------------------------------------------------
  17.152 +    /** @brief  Detach a still attached stream from the logger (or
  17.153 +     *          modify the filter flags bits)
  17.154 +     *   @param pStream Log-stream instance for detaching
  17.155 +     *  @param severity Provide a bitwise combination of the ErrorSeverity
  17.156 +     *    flags. This value is &~ed with the current flags of the stream,
  17.157 +     *    if the result is 0 the stream is detached from the Logger and
  17.158 +     *    the caller retakes the possession of the stream.
  17.159 +     *  @return true if the stream has been detached, false otherwise.*/
  17.160 +    virtual bool detatchStream(LogStream *pStream,
  17.161 +        unsigned int severity = Debugging | Err | Warn | Info) = 0;
  17.162 +
  17.163 +protected:
  17.164 +    /**
  17.165 +     *  Default constructor
  17.166 +     */
  17.167 +    Logger() AI_NO_EXCEPT;
  17.168 +
  17.169 +    /**
  17.170 +     *  Construction with a given log severity
  17.171 +     */
  17.172 +    explicit Logger(LogSeverity severity);
  17.173 +
  17.174 +    // ----------------------------------------------------------------------
  17.175 +    /**
  17.176 +     *  @brief Called as a request to write a specific debug message
  17.177 +     *  @param  message Debug message. Never longer than
  17.178 +     *    MAX_LOG_MESSAGE_LENGTH characters (excluding the '0').
  17.179 +     *  @note  The message string is only valid until the scope of
  17.180 +     *    the function is left.
  17.181 +     */
  17.182 +    virtual void OnDebug(const char* message)= 0;
  17.183 +
  17.184 +    // ----------------------------------------------------------------------
  17.185 +    /**
  17.186 +     *  @brief Called as a request to write a specific info message
  17.187 +     *  @param  message Info message. Never longer than
  17.188 +     *    MAX_LOG_MESSAGE_LENGTH characters (ecxluding the '0').
  17.189 +     *  @note  The message string is only valid until the scope of
  17.190 +     *    the function is left.
  17.191 +     */
  17.192 +    virtual void OnInfo(const char* message) = 0;
  17.193 +
  17.194 +    // ----------------------------------------------------------------------
  17.195 +    /**
  17.196 +     *  @brief Called as a request to write a specific warn message
  17.197 +     *  @param  message Warn message. Never longer than
  17.198 +     *    MAX_LOG_MESSAGE_LENGTH characters (exluding the '0').
  17.199 +     *  @note  The message string is only valid until the scope of
  17.200 +     *    the function is left.
  17.201 +     */
  17.202 +    virtual void OnWarn(const char* essage) = 0;
  17.203 +
  17.204 +    // ----------------------------------------------------------------------
  17.205 +    /**
  17.206 +     *  @brief Called as a request to write a specific error message
  17.207 +     *  @param  message Error message. Never longer than
  17.208 +     *    MAX_LOG_MESSAGE_LENGTH characters (exluding the '0').
  17.209 +     *  @note  The message string is only valid until the scope of
  17.210 +     *    the function is left.
  17.211 +     */
  17.212 +    virtual void OnError(const char* message) = 0;
  17.213 +
  17.214 +protected:
  17.215 +    LogSeverity m_Severity;
  17.216 +};
  17.217 +
  17.218 +// ----------------------------------------------------------------------------------
  17.219 +//  Default constructor
  17.220 +inline
  17.221 +Logger::Logger() AI_NO_EXCEPT
  17.222 +: m_Severity(NORMAL) {
  17.223 +    // empty
  17.224 +}
  17.225 +
  17.226 +// ----------------------------------------------------------------------------------
  17.227 +//  Virtual destructor
  17.228 +inline
  17.229 +Logger::~Logger() {
  17.230 +    // empty
  17.231 +}
  17.232 +
  17.233 +// ----------------------------------------------------------------------------------
  17.234 +// Construction with given logging severity
  17.235 +inline
  17.236 +Logger::Logger(LogSeverity severity)
  17.237 +: m_Severity(severity) {
  17.238 +    // empty
  17.239 +}
  17.240 +
  17.241 +// ----------------------------------------------------------------------------------
  17.242 +// Log severity setter
  17.243 +inline
  17.244 +void Logger::setLogSeverity(LogSeverity log_severity){
  17.245 +    m_Severity = log_severity;
  17.246 +}
  17.247 +
  17.248 +// ----------------------------------------------------------------------------------
  17.249 +// Log severity getter
  17.250 +inline
  17.251 +Logger::LogSeverity Logger::getLogSeverity() const {
  17.252 +    return m_Severity;
  17.253 +}
  17.254 +
  17.255 +// ----------------------------------------------------------------------------------
  17.256 +inline
  17.257 +void Logger::debug(const std::string &message) {
  17.258 +    return debug(message.c_str());
  17.259 +}
  17.260 +
  17.261 +// ----------------------------------------------------------------------------------
  17.262 +inline
  17.263 +void Logger::error(const std::string &message) {
  17.264 +    return error(message.c_str());
  17.265 +}
  17.266 +
  17.267 +// ----------------------------------------------------------------------------------
  17.268 +inline
  17.269 +void Logger::warn(const std::string &message) {
  17.270 +    return warn(message.c_str());
  17.271 +}
  17.272 +
  17.273 +// ----------------------------------------------------------------------------------
  17.274 +inline
  17.275 +void Logger::info(const std::string &message) {
  17.276 +    return info(message.c_str());
  17.277 +}
  17.278 +
  17.279 +// ------------------------------------------------------------------------------------------------
  17.280 +#define ASSIMP_LOG_WARN_F(string,...)\
  17.281 +    DefaultLogger::get()->warn((Formatter::format(string),__VA_ARGS__))
  17.282 +
  17.283 +#define ASSIMP_LOG_ERROR_F(string,...)\
  17.284 +    DefaultLogger::get()->error((Formatter::format(string),__VA_ARGS__))
  17.285 +
  17.286 +#define ASSIMP_LOG_DEBUG_F(string,...)\
  17.287 +    DefaultLogger::get()->debug((Formatter::format(string),__VA_ARGS__))
  17.288 +
  17.289 +#define ASSIMP_LOG_INFO_F(string,...)\
  17.290 +    DefaultLogger::get()->info((Formatter::format(string),__VA_ARGS__))
  17.291 +
  17.292 +
  17.293 +#define ASSIMP_LOG_WARN(string)\
  17.294 +    DefaultLogger::get()->warn(string)
  17.295 +
  17.296 +#define ASSIMP_LOG_ERROR(string)\
  17.297 +    DefaultLogger::get()->error(string)
  17.298 +
  17.299 +#define ASSIMP_LOG_DEBUG(string)\
  17.300 +    DefaultLogger::get()->debug(string)
  17.301 +
  17.302 +#define ASSIMP_LOG_INFO(string)\
  17.303 +    DefaultLogger::get()->info(string)
  17.304 +
  17.305 +
  17.306 +} // Namespace Assimp
  17.307 +
  17.308 +#endif // !! INCLUDED_AI_LOGGER_H
    18.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.2 +++ b/include/miniassimp/NullLogger.hpp	Mon Jan 28 18:19:26 2019 +0200
    18.3 @@ -0,0 +1,99 @@
    18.4 +/*
    18.5 +Open Asset Import Library (assimp)
    18.6 +----------------------------------------------------------------------
    18.7 +
    18.8 +Copyright (c) 2006-2018, assimp team
    18.9 +
   18.10 +
   18.11 +All rights reserved.
   18.12 +
   18.13 +Redistribution and use of this software in source and binary forms,
   18.14 +with or without modification, are permitted provided that the
   18.15 +following conditions are met:
   18.16 +
   18.17 +* Redistributions of source code must retain the above
   18.18 +  copyright notice, this list of conditions and the
   18.19 +  following disclaimer.
   18.20 +
   18.21 +* Redistributions in binary form must reproduce the above
   18.22 +  copyright notice, this list of conditions and the
   18.23 +  following disclaimer in the documentation and/or other
   18.24 +  materials provided with the distribution.
   18.25 +
   18.26 +* Neither the name of the assimp team, nor the names of its
   18.27 +  contributors may be used to endorse or promote products
   18.28 +  derived from this software without specific prior
   18.29 +  written permission of the assimp team.
   18.30 +
   18.31 +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   18.32 +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   18.33 +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
   18.34 +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
   18.35 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   18.36 +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   18.37 +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
   18.38 +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
   18.39 +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   18.40 +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   18.41 +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   18.42 +
   18.43 +----------------------------------------------------------------------
   18.44 +*/
   18.45 +
   18.46 +/** @file  NullLogger.hpp
   18.47 + *  @brief Dummy logger
   18.48 +*/
   18.49 +
   18.50 +#ifndef INCLUDED_AI_NULLLOGGER_H
   18.51 +#define INCLUDED_AI_NULLLOGGER_H
   18.52 +
   18.53 +#include "Logger.hpp"
   18.54 +
   18.55 +namespace Assimp {
   18.56 +
   18.57 +// ---------------------------------------------------------------------------
   18.58 +/** @brief CPP-API: Empty logging implementation.
   18.59 + *
   18.60 + * Does nothing! Used by default if the application hasn't requested a
   18.61 + * custom logger via #DefaultLogger::set() or #DefaultLogger::create(); */
   18.62 +class ASSIMP_API NullLogger
   18.63 +    : public Logger {
   18.64 +
   18.65 +public:
   18.66 +
   18.67 +    /** @brief  Logs a debug message */
   18.68 +    void OnDebug(const char* message) {
   18.69 +        (void)message; //this avoids compiler warnings
   18.70 +    }
   18.71 +
   18.72 +    /** @brief  Logs an info message */
   18.73 +    void OnInfo(const char* message) {
   18.74 +        (void)message; //this avoids compiler warnings
   18.75 +    }
   18.76 +
   18.77 +    /** @brief  Logs a warning message */
   18.78 +    void OnWarn(const char* message) {
   18.79 +        (void)message; //this avoids compiler warnings
   18.80 +    }
   18.81 +
   18.82 +    /** @brief  Logs an error message */
   18.83 +    void OnError(const char* message) {
   18.84 +        (void)message; //this avoids compiler warnings
   18.85 +    }
   18.86 +
   18.87 +    /** @brief  Detach a still attached stream from logger */
   18.88 +    bool attachStream(LogStream *pStream, unsigned int severity) {
   18.89 +        (void)pStream; (void)severity; //this avoids compiler warnings
   18.90 +        return false;
   18.91 +    }
   18.92 +
   18.93 +    /** @brief  Detach a still attached stream from logger */
   18.94 +    bool detatchStream(LogStream *pStream, unsigned int severity) {
   18.95 +        (void)pStream; (void)severity; //this avoids compiler warnings
   18.96 +        return false;
   18.97 +    }
   18.98 +
   18.99 +private:
  18.100 +};
  18.101 +}
  18.102 +#endif // !! AI_NULLLOGGER_H_INCLUDED
    19.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.2 +++ b/include/miniassimp/ProgressHandler.hpp	Mon Jan 28 18:19:26 2019 +0200
    19.3 @@ -0,0 +1,145 @@
    19.4 +/*
    19.5 +Open Asset Import Library (assimp)
    19.6 +----------------------------------------------------------------------
    19.7 +
    19.8 +Copyright (c) 2006-2018, assimp team
    19.9 +
   19.10 +
   19.11 +All rights reserved.
   19.12 +
   19.13 +Redistribution and use of this software in source and binary forms,
   19.14 +with or without modification, are permitted provided that the
   19.15 +following conditions are met:
   19.16 +
   19.17 +* Redistributions of source code must retain the above
   19.18 +  copyright notice, this list of conditions and the
   19.19 +  following disclaimer.
   19.20 +
   19.21 +* Redistributions in binary form must reproduce the above
   19.22 +  copyright notice, this list of conditions and the
   19.23 +  following disclaimer in the documentation and/or other
   19.24 +  materials provided with the distribution.
   19.25 +
   19.26 +* Neither the name of the assimp team, nor the names of its
   19.27 +  contributors may be used to endorse or promote products
   19.28 +  derived from this software without specific prior
   19.29 +  written permission of the assimp team.
   19.30 +
   19.31 +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   19.32 +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   19.33 +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
   19.34 +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
   19.35 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   19.36 +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   19.37 +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
   19.38 +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
   19.39 +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   19.40 +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   19.41 +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   19.42 +
   19.43 +----------------------------------------------------------------------
   19.44 +*/
   19.45 +
   19.46 +/** @file ProgressHandler.hpp
   19.47 + *  @brief Abstract base class 'ProgressHandler'.
   19.48 + */
   19.49 +#pragma once
   19.50 +#ifndef AI_PROGRESSHANDLER_H_INC
   19.51 +#define AI_PROGRESSHANDLER_H_INC
   19.52 +
   19.53 +#include "types.h"
   19.54 +
   19.55 +namespace Assimp    {
   19.56 +
   19.57 +// ------------------------------------------------------------------------------------
   19.58 +/** @brief CPP-API: Abstract interface for custom progress report receivers.
   19.59 + *
   19.60 + *  Each #Importer instance maintains its own #ProgressHandler. The default
   19.61 + *  implementation provided by Assimp doesn't do anything at all. */
   19.62 +class ASSIMP_API ProgressHandler
   19.63 +#ifndef SWIG
   19.64 +    : public Intern::AllocateFromAssimpHeap
   19.65 +#endif
   19.66 +{
   19.67 +protected:
   19.68 +    /// @brief  Default constructor
   19.69 +    ProgressHandler () AI_NO_EXCEPT {
   19.70 +        // empty
   19.71 +    }
   19.72 +
   19.73 +public:
   19.74 +    /// @brief  Virtual destructor.
   19.75 +    virtual ~ProgressHandler () {
   19.76 +    }
   19.77 +
   19.78 +    // -------------------------------------------------------------------
   19.79 +    /** @brief Progress callback.
   19.80 +     *  @param percentage An estimate of the current loading progress,
   19.81 +     *    in percent. Or -1.f if such an estimate is not available.
   19.82 +     *
   19.83 +     *  There are restriction on what you may do from within your
   19.84 +     *  implementation of this method: no exceptions may be thrown and no
   19.85 +     *  non-const #Importer methods may be called. It is
   19.86 +     *  not generally possible to predict the number of callbacks
   19.87 +     *  fired during a single import.
   19.88 +     *
   19.89 +     *  @return Return false to abort loading at the next possible
   19.90 +     *   occasion (loaders and Assimp are generally allowed to perform
   19.91 +     *   all needed cleanup tasks prior to returning control to the
   19.92 +     *   caller). If the loading is aborted, #Importer::ReadFile()
   19.93 +     *   returns always NULL.
   19.94 +     *   */
   19.95 +    virtual bool Update(float percentage = -1.f) = 0;
   19.96 +
   19.97 +    // -------------------------------------------------------------------
   19.98 +    /** @brief Progress callback for file loading steps
   19.99 +     *  @param numberOfSteps The number of total post-processing
  19.100 +     *   steps
  19.101 +     *  @param currentStep The index of the current post-processing
  19.102 +     *   step that will run, or equal to numberOfSteps if all of
  19.103 +     *   them has finished. This number is always strictly monotone
  19.104 +     *   increasing, although not necessarily linearly.
  19.105 +     *
  19.106 +     *  @note This is currently only used at the start and the end
  19.107 +     *   of the file parsing.
  19.108 +     *   */
  19.109 +    virtual void UpdateFileRead(int currentStep /*= 0*/, int numberOfSteps /*= 0*/) {
  19.110 +        float f = numberOfSteps ? currentStep / (float)numberOfSteps : 1.0f;
  19.111 +        Update( f * 0.5f );
  19.112 +    }
  19.113 +
  19.114 +    // -------------------------------------------------------------------
  19.115 +    /** @brief Progress callback for post-processing steps
  19.116 +     *  @param numberOfSteps The number of total post-processing
  19.117 +     *   steps
  19.118 +     *  @param currentStep The index of the current post-processing
  19.119 +     *   step that will run, or equal to numberOfSteps if all of
  19.120 +     *   them has finished. This number is always strictly monotone
  19.121 +     *   increasing, although not necessarily linearly.
  19.122 +     *   */
  19.123 +    virtual void UpdatePostProcess(int currentStep /*= 0*/, int numberOfSteps /*= 0*/) {
  19.124 +        float f = numberOfSteps ? currentStep / (float)numberOfSteps : 1.0f;
  19.125 +        Update( f * 0.5f + 0.5f );
  19.126 +    }
  19.127 +
  19.128 +
  19.129 +    // -------------------------------------------------------------------
  19.130 +    /** @brief Progress callback for export steps.
  19.131 +     *  @param numberOfSteps The number of total processing
  19.132 +     *   steps
  19.133 +     *  @param currentStep The index of the current post-processing
  19.134 +     *   step that will run, or equal to numberOfSteps if all of
  19.135 +     *   them has finished. This number is always strictly monotone
  19.136 +     *   increasing, although not necessarily linearly.
  19.137 +     *   */
  19.138 +    virtual void UpdateFileWrite(int currentStep /*= 0*/, int numberOfSteps /*= 0*/) {
  19.139 +        float f = numberOfSteps ? currentStep / (float)numberOfSteps : 1.0f;
  19.140 +        Update(f * 0.5f);
  19.141 +    }
  19.142 +}; // !class ProgressHandler
  19.143 +
  19.144 +// ------------------------------------------------------------------------------------
  19.145 +
  19.146 +} // Namespace Assimp
  19.147 +
  19.148 +#endif // AI_PROGRESSHANDLER_H_INC
    20.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.2 +++ b/include/miniassimp/TinyFormatter.h	Mon Jan 28 18:19:26 2019 +0200
    20.3 @@ -0,0 +1,166 @@
    20.4 +/*
    20.5 +Open Asset Import Library (assimp)
    20.6 +----------------------------------------------------------------------
    20.7 +
    20.8 +Copyright (c) 2006-2018, assimp team
    20.9 +
   20.10 +
   20.11 +All rights reserved.
   20.12 +
   20.13 +Redistribution and use of this software in source and binary forms,
   20.14 +with or without modification, are permitted provided that the
   20.15 +following conditions are met:
   20.16 +
   20.17 +* Redistributions of source code must retain the above
   20.18 +  copyright notice, this list of conditions and the
   20.19 +  following disclaimer.
   20.20 +
   20.21 +* Redistributions in binary form must reproduce the above
   20.22 +  copyright notice, this list of conditions and the
   20.23 +  following disclaimer in the documentation and/or other
   20.24 +  materials provided with the distribution.
   20.25 +
   20.26 +* Neither the name of the assimp team, nor the names of its
   20.27 +  contributors may be used to endorse or promote products
   20.28 +  derived from this software without specific prior
   20.29 +  written permission of the assimp team.
   20.30 +
   20.31 +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   20.32 +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   20.33 +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
   20.34 +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
   20.35 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   20.36 +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   20.37 +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
   20.38 +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
   20.39 +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   20.40 +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   20.41 +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   20.42 +
   20.43 +----------------------------------------------------------------------
   20.44 +*/
   20.45 +
   20.46 +/** @file  TinyFormatter.h
   20.47 + *  @brief Utility to format log messages more easily. Introduced
   20.48 + *    to get rid of the boost::format dependency. Much slinker,
   20.49 + *    basically just extends stringstream.
   20.50 + */
   20.51 +#ifndef INCLUDED_TINY_FORMATTER_H
   20.52 +#define INCLUDED_TINY_FORMATTER_H
   20.53 +
   20.54 +#include <sstream>
   20.55 +
   20.56 +namespace Assimp {
   20.57 +namespace Formatter {
   20.58 +
   20.59 +// ------------------------------------------------------------------------------------------------
   20.60 +/** stringstream utility. Usage:
   20.61 + *  @code
   20.62 + *  void writelog(const std::string&s);
   20.63 + *  void writelog(const std::wstring&s);
   20.64 + *  ...
   20.65 + *  writelog(format()<< "hi! this is a number: " << 4);
   20.66 + *  writelog(wformat()<< L"hi! this is a number: " << 4);
   20.67 + *
   20.68 + *  @endcode */
   20.69 +template < typename T,
   20.70 +    typename CharTraits = std::char_traits<T>,
   20.71 +    typename Allocator  = std::allocator<T>
   20.72 +>
   20.73 +class basic_formatter
   20.74 +{
   20.75 +
   20.76 +public:
   20.77 +
   20.78 +    typedef class std::basic_string<
   20.79 +        T,CharTraits,Allocator
   20.80 +    > string;
   20.81 +
   20.82 +    typedef class std::basic_ostringstream<
   20.83 +        T,CharTraits,Allocator
   20.84 +    > stringstream;
   20.85 +
   20.86 +public:
   20.87 +
   20.88 +    basic_formatter() {}
   20.89 +
   20.90 +    /* Allow basic_formatter<T>'s to be used almost interchangeably
   20.91 +     * with std::(w)string or const (w)char* arguments because the
   20.92 +     * conversion c'tor is called implicitly. */
   20.93 +    template <typename TT>
   20.94 +    basic_formatter(const TT& sin)  {
   20.95 +        underlying << sin;
   20.96 +    }
   20.97 +
   20.98 +
   20.99 +    // The problem described here:
  20.100 +    // https://sourceforge.net/tracker/?func=detail&atid=1067632&aid=3358562&group_id=226462
  20.101 +    // can also cause trouble here. Apparently, older gcc versions sometimes copy temporaries
  20.102 +    // being bound to const ref& function parameters. Copying streams is not permitted, though.
  20.103 +    // This workaround avoids this by manually specifying a copy ctor.
  20.104 +#if !defined(__GNUC__) || !defined(__APPLE__) || __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
  20.105 +    explicit basic_formatter(const basic_formatter& other) {
  20.106 +        underlying << (string)other;
  20.107 +    }
  20.108 +#endif
  20.109 +
  20.110 +
  20.111 +public:
  20.112 +
  20.113 +    operator string () const {
  20.114 +        return underlying.str();
  20.115 +    }
  20.116 +
  20.117 +
  20.118 +    /* note - this is declared const because binding temporaries does only
  20.119 +     * work for const references, so many function prototypes will
  20.120 +     * include const basic_formatter<T>& s but might still want to
  20.121 +     * modify the formatted string without the need for a full copy.*/
  20.122 +    template <typename TToken>
  20.123 +    const basic_formatter& operator << (const TToken& s) const {
  20.124 +        underlying << s;
  20.125 +        return *this;
  20.126 +    }
  20.127 +
  20.128 +    template <typename TToken>
  20.129 +    basic_formatter& operator << (const TToken& s) {
  20.130 +        underlying << s;
  20.131 +        return *this;
  20.132 +    }
  20.133 +
  20.134 +
  20.135 +    // comma operator overloaded as well, choose your preferred way.
  20.136 +    template <typename TToken>
  20.137 +    const basic_formatter& operator, (const TToken& s) const {
  20.138 +        underlying << s;
  20.139 +        return *this;
  20.140 +    }
  20.141 +
  20.142 +    template <typename TToken>
  20.143 +    basic_formatter& operator, (const TToken& s) {
  20.144 +        underlying << s;
  20.145 +        return *this;
  20.146 +    }
  20.147 +
  20.148 +    // Fix for MSVC8
  20.149 +    // See https://sourceforge.net/projects/assimp/forums/forum/817654/topic/4372824
  20.150 +    template <typename TToken>
  20.151 +    basic_formatter& operator, (TToken& s) {
  20.152 +        underlying << s;
  20.153 +        return *this;
  20.154 +    }
  20.155 +
  20.156 +
  20.157 +private:
  20.158 +    mutable stringstream underlying;
  20.159 +};
  20.160 +
  20.161 +
  20.162 +typedef basic_formatter< char > format;
  20.163 +typedef basic_formatter< wchar_t > wformat;
  20.164 +
  20.165 +} // ! namespace Formatter
  20.166 +
  20.167 +} // ! namespace Assimp
  20.168 +
  20.169 +#endif
    21.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.2 +++ b/include/miniassimp/ai_assert.h	Mon Jan 28 18:19:26 2019 +0200
    21.3 @@ -0,0 +1,54 @@
    21.4 +/*
    21.5 +---------------------------------------------------------------------------
    21.6 +Open Asset Import Library (assimp)
    21.7 +---------------------------------------------------------------------------
    21.8 +
    21.9 +Copyright (c) 2006-2018, assimp team
   21.10 +
   21.11 +
   21.12 +
   21.13 +All rights reserved.
   21.14 +
   21.15 +Redistribution and use of this software in source and binary forms,
   21.16 +with or without modification, are permitted provided that the following
   21.17 +conditions are met:
   21.18 +
   21.19 +* Redistributions of source code must retain the above
   21.20 +  copyright notice, this list of conditions and the
   21.21 +  following disclaimer.
   21.22 +
   21.23 +* Redistributions in binary form must reproduce the above
   21.24 +  copyright notice, this list of conditions and the
   21.25 +  following disclaimer in the documentation and/or other
   21.26 +  materials provided with the distribution.
   21.27 +
   21.28 +* Neither the name of the assimp team, nor the names of its
   21.29 +  contributors may be used to endorse or promote products
   21.30 +  derived from this software without specific prior
   21.31 +  written permission of the assimp team.
   21.32 +
   21.33 +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   21.34 +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   21.35 +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
   21.36 +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
   21.37 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   21.38 +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   21.39 +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
   21.40 +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
   21.41 +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   21.42 +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   21.43 +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   21.44 +---------------------------------------------------------------------------
   21.45 +*/
   21.46 +#pragma once
   21.47 +#ifndef AI_ASSERT_H_INC
   21.48 +#define AI_ASSERT_H_INC
   21.49 +
   21.50 +#ifdef ASSIMP_BUILD_DEBUG
   21.51 +#   include <assert.h>
   21.52 +#   define  ai_assert(expression) assert(expression)
   21.53 +#else
   21.54 +#   define  ai_assert(expression)
   21.55 +#endif // 
   21.56 +
   21.57 +#endif // AI_ASSERT_H_INC
    22.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    22.2 +++ b/include/miniassimp/anim.h	Mon Jan 28 18:19:26 2019 +0200
    22.3 @@ -0,0 +1,577 @@
    22.4 +/*
    22.5 +---------------------------------------------------------------------------
    22.6 +Open Asset Import Library (assimp)
    22.7 +---------------------------------------------------------------------------
    22.8 +
    22.9 +Copyright (c) 2006-2018, assimp team
   22.10 +
   22.11 +
   22.12 +
   22.13 +All rights reserved.
   22.14 +
   22.15 +Redistribution and use of this software in source and binary forms,
   22.16 +with or without modification, are permitted provided that the following
   22.17 +conditions are met:
   22.18 +
   22.19 +* Redistributions of source code must retain the above
   22.20 +  copyright notice, this list of conditions and the
   22.21 +  following disclaimer.
   22.22 +
   22.23 +* Redistributions in binary form must reproduce the above
   22.24 +  copyright notice, this list of conditions and the
   22.25 +  following disclaimer in the documentation and/or other
   22.26 +  materials provided with the distribution.
   22.27 +
   22.28 +* Neither the name of the assimp team, nor the names of its
   22.29 +  contributors may be used to endorse or promote products
   22.30 +  derived from this software without specific prior
   22.31 +  written permission of the assimp team.
   22.32 +
   22.33 +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   22.34 +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   22.35 +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
   22.36 +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
   22.37 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   22.38 +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   22.39 +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
   22.40 +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
   22.41 +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   22.42 +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   22.43 +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   22.44 +---------------------------------------------------------------------------
   22.45 +*/
   22.46 +
   22.47 +/** 
   22.48 +  * @file   anim.h
   22.49 +  * @brief  Defines the data structures in which the imported animations
   22.50 +  *         are returned.
   22.51 +  */
   22.52 +#pragma once
   22.53 +#ifndef AI_ANIM_H_INC
   22.54 +#define AI_ANIM_H_INC
   22.55 +
   22.56 +#include <miniassimp/types.h>
   22.57 +#include <miniassimp/quaternion.h>
   22.58 +
   22.59 +#ifdef __cplusplus
   22.60 +extern "C" {
   22.61 +#endif
   22.62 +
   22.63 +// ---------------------------------------------------------------------------
   22.64 +/** A time-value pair specifying a certain 3D vector for the given time. */
   22.65 +struct aiVectorKey
   22.66 +{
   22.67 +    /** The time of this key */
   22.68 +    double mTime;
   22.69 +
   22.70 +    /** The value of this key */
   22.71 +    C_STRUCT aiVector3D mValue;
   22.72 +
   22.73 +#ifdef __cplusplus
   22.74 +
   22.75 +    /// @brief  The default constructor.
   22.76 +    aiVectorKey() AI_NO_EXCEPT
   22.77 +    : mTime( 0.0 )
   22.78 +    , mValue() {
   22.79 +        // empty
   22.80 +    }
   22.81 +
   22.82 +    /// @brief  Construction from a given time and key value.
   22.83 +
   22.84 +    aiVectorKey(double time, const aiVector3D& value)
   22.85 +    : mTime( time )
   22.86 +    , mValue( value ) {
   22.87 +        // empty
   22.88 +    }
   22.89 +
   22.90 +    typedef aiVector3D elem_type;
   22.91 +
   22.92 +    // Comparison operators. For use with std::find();
   22.93 +    bool operator == (const aiVectorKey& rhs) const {
   22.94 +        return rhs.mValue == this->mValue;
   22.95 +    }
   22.96 +    bool operator != (const aiVectorKey& rhs ) const {
   22.97 +        return rhs.mValue != this->mValue;
   22.98 +    }
   22.99 +
  22.100 +    // Relational operators. For use with std::sort();
  22.101 +    bool operator < (const aiVectorKey& rhs ) const {
  22.102 +        return mTime < rhs.mTime;
  22.103 +    }
  22.104 +    bool operator > (const aiVectorKey& rhs ) const {
  22.105 +        return mTime > rhs.mTime;
  22.106 +    }
  22.107 +#endif // __cplusplus
  22.108 +};
  22.109 +
  22.110 +// ---------------------------------------------------------------------------
  22.111 +/** A time-value pair specifying a rotation for the given time.
  22.112 + *  Rotations are expressed with quaternions. */
  22.113 +struct aiQuatKey
  22.114 +{
  22.115 +    /** The time of this key */
  22.116 +    double mTime;
  22.117 +
  22.118 +    /** The value of this key */
  22.119 +    C_STRUCT aiQuaternion mValue;
  22.120 +
  22.121 +#ifdef __cplusplus
  22.122 +    aiQuatKey() AI_NO_EXCEPT
  22.123 +    : mTime( 0.0 )
  22.124 +    , mValue() {
  22.125 +        // empty
  22.126 +    }
  22.127 +
  22.128 +    /** Construction from a given time and key value */
  22.129 +    aiQuatKey(double time, const aiQuaternion& value)
  22.130 +        :   mTime   (time)
  22.131 +        ,   mValue  (value)
  22.132 +    {}
  22.133 +
  22.134 +    typedef aiQuaternion elem_type;
  22.135 +
  22.136 +    // Comparison operators. For use with std::find();
  22.137 +    bool operator == (const aiQuatKey& rhs ) const {
  22.138 +        return rhs.mValue == this->mValue;
  22.139 +    }
  22.140 +    bool operator != (const aiQuatKey& rhs ) const {
  22.141 +        return rhs.mValue != this->mValue;
  22.142 +    }
  22.143 +
  22.144 +    // Relational operators. For use with std::sort();
  22.145 +    bool operator < (const aiQuatKey& rhs ) const {
  22.146 +        return mTime < rhs.mTime;
  22.147 +    }
  22.148 +    bool operator > (const aiQuatKey& rhs ) const {
  22.149 +        return mTime > rhs.mTime;
  22.150 +    }
  22.151 +#endif
  22.152 +};
  22.153 +
  22.154 +// ---------------------------------------------------------------------------
  22.155 +/** Binds a anim-mesh to a specific point in time. */
  22.156 +struct aiMeshKey
  22.157 +{
  22.158 +    /** The time of this key */
  22.159 +    double mTime;
  22.160 +
  22.161 +    /** Index into the aiMesh::mAnimMeshes array of the
  22.162 +     *  mesh corresponding to the #aiMeshAnim hosting this
  22.163 +     *  key frame. The referenced anim mesh is evaluated
  22.164 +     *  according to the rules defined in the docs for #aiAnimMesh.*/
  22.165 +    unsigned int mValue;
  22.166 +
  22.167 +#ifdef __cplusplus
  22.168 +
  22.169 +    aiMeshKey() AI_NO_EXCEPT
  22.170 +    : mTime(0.0)
  22.171 +    , mValue(0)
  22.172 +    {
  22.173 +    }
  22.174 +
  22.175 +    /** Construction from a given time and key value */
  22.176 +    aiMeshKey(double time, const unsigned int value)
  22.177 +        :   mTime   (time)
  22.178 +        ,   mValue  (value)
  22.179 +    {}
  22.180 +
  22.181 +    typedef unsigned int elem_type;
  22.182 +
  22.183 +    // Comparison operators. For use with std::find();
  22.184 +    bool operator == (const aiMeshKey& o) const {
  22.185 +        return o.mValue == this->mValue;
  22.186 +    }
  22.187 +    bool operator != (const aiMeshKey& o) const {
  22.188 +        return o.mValue != this->mValue;
  22.189 +    }
  22.190 +
  22.191 +    // Relational operators. For use with std::sort();
  22.192 +    bool operator < (const aiMeshKey& o) const {
  22.193 +        return mTime < o.mTime;
  22.194 +    }
  22.195 +    bool operator > (const aiMeshKey& o) const {
  22.196 +        return mTime > o.mTime;
  22.197 +    }
  22.198 +
  22.199 +#endif
  22.200 +};
  22.201 +
  22.202 +// ---------------------------------------------------------------------------
  22.203 +/** Binds a morph anim mesh to a specific point in time. */
  22.204 +struct aiMeshMorphKey
  22.205 +{
  22.206 +    /** The time of this key */
  22.207 +    double mTime;
  22.208 +
  22.209 +    /** The values and weights at the time of this key */
  22.210 +    unsigned int *mValues;
  22.211 +    double *mWeights;
  22.212 +
  22.213 +    /** The number of values and weights */
  22.214 +    unsigned int mNumValuesAndWeights;
  22.215 +#ifdef __cplusplus
  22.216 +	aiMeshMorphKey() AI_NO_EXCEPT
  22.217 +		: mTime(0.0)
  22.218 +		, mValues(0)
  22.219 +		, mWeights(0)
  22.220 +		, mNumValuesAndWeights(0)
  22.221 +	{
  22.222 +
  22.223 +	}
  22.224 +
  22.225 +    ~aiMeshMorphKey()
  22.226 +    {
  22.227 +        if (mNumValuesAndWeights && mValues && mWeights) {
  22.228 +            delete [] mValues;
  22.229 +            delete [] mWeights;
  22.230 +        }
  22.231 +    }
  22.232 +#endif
  22.233 +};
  22.234 +
  22.235 +// ---------------------------------------------------------------------------
  22.236 +/** Defines how an animation channel behaves outside the defined time
  22.237 + *  range. This corresponds to aiNodeAnim::mPreState and
  22.238 + *  aiNodeAnim::mPostState.*/
  22.239 +enum aiAnimBehaviour
  22.240 +{
  22.241 +    /** The value from the default node transformation is taken*/
  22.242 +    aiAnimBehaviour_DEFAULT  = 0x0,
  22.243 +
  22.244 +    /** The nearest key value is used without interpolation */
  22.245 +    aiAnimBehaviour_CONSTANT = 0x1,
  22.246 +
  22.247 +    /** The value of the nearest two keys is linearly
  22.248 +     *  extrapolated for the current time value.*/
  22.249 +    aiAnimBehaviour_LINEAR   = 0x2,
  22.250 +
  22.251 +    /** The animation is repeated.
  22.252 +     *
  22.253 +     *  If the animation key go from n to m and the current
  22.254 +     *  time is t, use the value at (t-n) % (|m-n|).*/
  22.255 +    aiAnimBehaviour_REPEAT   = 0x3,
  22.256 +
  22.257 +    /** This value is not used, it is just here to force the
  22.258 +     *  the compiler to map this enum to a 32 Bit integer  */
  22.259 +#ifndef SWIG
  22.260 +    _aiAnimBehaviour_Force32Bit = INT_MAX
  22.261 +#endif
  22.262 +};
  22.263 +
  22.264 +// ---------------------------------------------------------------------------
  22.265 +/** Describes the animation of a single node. The name specifies the
  22.266 + *  bone/node which is affected by this animation channel. The keyframes
  22.267 + *  are given in three separate series of values, one each for position,
  22.268 + *  rotation and scaling. The transformation matrix computed from these
  22.269 + *  values replaces the node's original transformation matrix at a
  22.270 + *  specific time.
  22.271 + *  This means all keys are absolute and not relative to the bone default pose.
  22.272 + *  The order in which the transformations are applied is
  22.273 + *  - as usual - scaling, rotation, translation.
  22.274 + *
  22.275 + *  @note All keys are returned in their correct, chronological order.
  22.276 + *  Duplicate keys don't pass the validation step. Most likely there
  22.277 + *  will be no negative time values, but they are not forbidden also ( so
  22.278 + *  implementations need to cope with them! ) */
  22.279 +struct aiNodeAnim {
  22.280 +    /** The name of the node affected by this animation. The node
  22.281 +     *  must exist and it must be unique.*/
  22.282 +    C_STRUCT aiString mNodeName;
  22.283 +
  22.284 +    /** The number of position keys */
  22.285 +    unsigned int mNumPositionKeys;
  22.286 +
  22.287 +    /** The position keys of this animation channel. Positions are
  22.288 +     * specified as 3D vector. The array is mNumPositionKeys in size.
  22.289 +     *
  22.290 +     * If there are position keys, there will also be at least one
  22.291 +     * scaling and one rotation key.*/
  22.292 +    C_STRUCT aiVectorKey* mPositionKeys;
  22.293 +
  22.294 +    /** The number of rotation keys */
  22.295 +    unsigned int mNumRotationKeys;
  22.296 +
  22.297 +    /** The rotation keys of this animation channel. Rotations are
  22.298 +     *  given as quaternions,  which are 4D vectors. The array is
  22.299 +     *  mNumRotationKeys in size.
  22.300 +     *
  22.301 +     * If there are rotation keys, there will also be at least one
  22.302 +     * scaling and one position key. */
  22.303 +    C_STRUCT aiQuatKey* mRotationKeys;
  22.304 +
  22.305 +    /** The number of scaling keys */
  22.306 +    unsigned int mNumScalingKeys;
  22.307 +
  22.308 +    /** The scaling keys of this animation channel. Scalings are
  22.309 +     *  specified as 3D vector. The array is mNumScalingKeys in size.
  22.310 +     *
  22.311 +     * If there are scaling keys, there will also be at least one
  22.312 +     * position and one rotation key.*/
  22.313 +    C_STRUCT aiVectorKey* mScalingKeys;
  22.314 +
  22.315 +    /** Defines how the animation behaves before the first
  22.316 +     *  key is encountered.
  22.317 +     *
  22.318 +     *  The default value is aiAnimBehaviour_DEFAULT (the original
  22.319 +     *  transformation matrix of the affected node is used).*/
  22.320 +    C_ENUM aiAnimBehaviour mPreState;
  22.321 +
  22.322 +    /** Defines how the animation behaves after the last
  22.323 +     *  key was processed.
  22.324 +     *
  22.325 +     *  The default value is aiAnimBehaviour_DEFAULT (the original
  22.326 +     *  transformation matrix of the affected node is taken).*/
  22.327 +    C_ENUM aiAnimBehaviour mPostState;
  22.328 +
  22.329 +#ifdef __cplusplus
  22.330 +    aiNodeAnim() AI_NO_EXCEPT
  22.331 +    : mNumPositionKeys( 0 )
  22.332 +    , mPositionKeys( 0 )
  22.333 +    , mNumRotationKeys( 0 )
  22.334 +    , mRotationKeys( 0 )
  22.335 +    , mNumScalingKeys( 0 )
  22.336 +    , mScalingKeys( 0 )
  22.337 +    , mPreState( aiAnimBehaviour_DEFAULT )
  22.338 +    , mPostState( aiAnimBehaviour_DEFAULT ) {
  22.339 +         // empty
  22.340 +    }
  22.341 +
  22.342 +    ~aiNodeAnim() {
  22.343 +        delete [] mPositionKeys;
  22.344 +        delete [] mRotationKeys;
  22.345 +        delete [] mScalingKeys;
  22.346 +    }
  22.347 +#endif // __cplusplus
  22.348 +};
  22.349 +
  22.350 +// ---------------------------------------------------------------------------
  22.351 +/** Describes vertex-based animations for a single mesh or a group of
  22.352 + *  meshes. Meshes carry the animation data for each frame in their
  22.353 + *  aiMesh::mAnimMeshes array. The purpose of aiMeshAnim is to
  22.354 + *  define keyframes linking each mesh attachment to a particular
  22.355 + *  point in time. */
  22.356 +struct aiMeshAnim
  22.357 +{
  22.358 +    /** Name of the mesh to be animated. An empty string is not allowed,
  22.359 +     *  animated meshes need to be named (not necessarily uniquely,
  22.360 +     *  the name can basically serve as wild-card to select a group
  22.361 +     *  of meshes with similar animation setup)*/
  22.362 +    C_STRUCT aiString mName;
  22.363 +
  22.364 +    /** Size of the #mKeys array. Must be 1, at least. */
  22.365 +    unsigned int mNumKeys;
  22.366 +
  22.367 +    /** Key frames of the animation. May not be NULL. */
  22.368 +    C_STRUCT aiMeshKey* mKeys;
  22.369 +
  22.370 +#ifdef __cplusplus
  22.371 +
  22.372 +    aiMeshAnim() AI_NO_EXCEPT
  22.373 +        : mNumKeys()
  22.374 +        , mKeys()
  22.375 +    {}
  22.376 +
  22.377 +    ~aiMeshAnim()
  22.378 +    {
  22.379 +        delete[] mKeys;
  22.380 +    }
  22.381 +
  22.382 +#endif
  22.383 +};
  22.384 +
  22.385 +// ---------------------------------------------------------------------------
  22.386 +/** Describes a morphing animation of a given mesh. */
  22.387 +struct aiMeshMorphAnim
  22.388 +{
  22.389 +    /** Name of the mesh to be animated. An empty string is not allowed,
  22.390 +     *  animated meshes need to be named (not necessarily uniquely,
  22.391 +     *  the name can basically serve as wildcard to select a group
  22.392 +     *  of meshes with similar animation setup)*/
  22.393 +    C_STRUCT aiString mName;
  22.394 +
  22.395 +    /** Size of the #mKeys array. Must be 1, at least. */
  22.396 +    unsigned int mNumKeys;
  22.397 +
  22.398 +    /** Key frames of the animation. May not be NULL. */
  22.399 +    C_STRUCT aiMeshMorphKey* mKeys;
  22.400 +
  22.401 +#ifdef __cplusplus
  22.402 +
  22.403 +    aiMeshMorphAnim() AI_NO_EXCEPT
  22.404 +        : mNumKeys()
  22.405 +        , mKeys()
  22.406 +    {}
  22.407 +
  22.408 +    ~aiMeshMorphAnim()
  22.409 +    {
  22.410 +        delete[] mKeys;
  22.411 +    }
  22.412 +
  22.413 +#endif
  22.414 +};
  22.415 +
  22.416 +// ---------------------------------------------------------------------------
  22.417 +/** An animation consists of key-frame data for a number of nodes. For
  22.418 + *  each node affected by the animation a separate series of data is given.*/
  22.419 +struct aiAnimation {
  22.420 +    /** The name of the animation. If the modeling package this data was
  22.421 +     *  exported from does support only a single animation channel, this
  22.422 +     *  name is usually empty (length is zero). */
  22.423 +    C_STRUCT aiString mName;
  22.424 +
  22.425 +    /** Duration of the animation in ticks.  */
  22.426 +    double mDuration;
  22.427 +
  22.428 +    /** Ticks per second. 0 if not specified in the imported file */
  22.429 +    double mTicksPerSecond;
  22.430 +
  22.431 +    /** The number of bone animation channels. Each channel affects
  22.432 +     *  a single node. */
  22.433 +    unsigned int mNumChannels;
  22.434 +
  22.435 +    /** The node animation channels. Each channel affects a single node.
  22.436 +     *  The array is mNumChannels in size. */
  22.437 +    C_STRUCT aiNodeAnim** mChannels;
  22.438 +
  22.439 +
  22.440 +    /** The number of mesh animation channels. Each channel affects
  22.441 +     *  a single mesh and defines vertex-based animation. */
  22.442 +    unsigned int mNumMeshChannels;
  22.443 +
  22.444 +    /** The mesh animation channels. Each channel affects a single mesh.
  22.445 +     *  The array is mNumMeshChannels in size. */
  22.446 +    C_STRUCT aiMeshAnim** mMeshChannels;
  22.447 +
  22.448 +    /** The number of mesh animation channels. Each channel affects
  22.449 +     *  a single mesh and defines morphing animation. */
  22.450 +    unsigned int mNumMorphMeshChannels;
  22.451 +
  22.452 +    /** The morph mesh animation channels. Each channel affects a single mesh.
  22.453 +     *  The array is mNumMorphMeshChannels in size. */
  22.454 +    C_STRUCT aiMeshMorphAnim **mMorphMeshChannels;
  22.455 +
  22.456 +#ifdef __cplusplus
  22.457 +    aiAnimation() AI_NO_EXCEPT
  22.458 +    : mDuration(-1.)
  22.459 +    , mTicksPerSecond(0.)
  22.460 +    , mNumChannels(0)
  22.461 +    , mChannels(0)
  22.462 +    , mNumMeshChannels(0)
  22.463 +    , mMeshChannels(0)
  22.464 +    , mNumMorphMeshChannels(0)
  22.465 +    , mMorphMeshChannels(0) {
  22.466 +        // empty
  22.467 +    }
  22.468 +
  22.469 +    ~aiAnimation() {
  22.470 +        // DO NOT REMOVE THIS ADDITIONAL CHECK
  22.471 +        if ( mNumChannels && mChannels )  {
  22.472 +            for( unsigned int a = 0; a < mNumChannels; a++) {
  22.473 +                delete mChannels[ a ];
  22.474 +            }
  22.475 +
  22.476 +            delete [] mChannels;
  22.477 +        }
  22.478 +        if (mNumMeshChannels && mMeshChannels)  {
  22.479 +            for( unsigned int a = 0; a < mNumMeshChannels; a++) {
  22.480 +                delete mMeshChannels[a];
  22.481 +            }
  22.482 +
  22.483 +            delete [] mMeshChannels;
  22.484 +        }
  22.485 +        if (mNumMorphMeshChannels && mMorphMeshChannels) {
  22.486 +                for( unsigned int a = 0; a < mNumMorphMeshChannels; a++) {
  22.487 +                        delete mMorphMeshChannels[a];
  22.488 +                }
  22.489 +            
  22.490 +            delete [] mMorphMeshChannels;
  22.491 +        }
  22.492 +    }
  22.493 +#endif // __cplusplus
  22.494 +};
  22.495 +
  22.496 +#ifdef __cplusplus
  22.497 +
  22.498 +}
  22.499 +
  22.500 +/// @brief  Some C++ utilities for inter- and extrapolation
  22.501 +namespace Assimp {
  22.502 +
  22.503 +// ---------------------------------------------------------------------------
  22.504 +/** 
  22.505 +  * @brief CPP-API: Utility class to simplify interpolations of various data types.
  22.506 +  *
  22.507 +  *  The type of interpolation is chosen automatically depending on the
  22.508 +  *  types of the arguments. 
  22.509 +  */
  22.510 +template <typename T>
  22.511 +struct Interpolator
  22.512 +{
  22.513 +    // ------------------------------------------------------------------
  22.514 +    /** @brief Get the result of the interpolation between a,b.
  22.515 +     *
  22.516 +     *  The interpolation algorithm depends on the type of the operands.
  22.517 +     *  aiQuaternion's and aiQuatKey's SLERP, the rest does a simple
  22.518 +     *  linear interpolation. */
  22.519 +    void operator () (T& out,const T& a, const T& b, ai_real d) const {
  22.520 +        out = a + (b-a)*d;
  22.521 +    }
  22.522 +}; // ! Interpolator <T>
  22.523 +
  22.524 +//! @cond Never
  22.525 +
  22.526 +template <>
  22.527 +struct Interpolator <aiQuaternion>  {
  22.528 +    void operator () (aiQuaternion& out,const aiQuaternion& a,
  22.529 +        const aiQuaternion& b, ai_real d) const
  22.530 +    {
  22.531 +        aiQuaternion::Interpolate(out,a,b,d);
  22.532 +    }
  22.533 +}; // ! Interpolator <aiQuaternion>
  22.534 +
  22.535 +template <>
  22.536 +struct Interpolator <unsigned int>  {
  22.537 +    void operator () (unsigned int& out,unsigned int a,
  22.538 +        unsigned int b, ai_real d) const
  22.539 +    {
  22.540 +        out = d>0.5f ? b : a;
  22.541 +    }
  22.542 +}; // ! Interpolator <aiQuaternion>
  22.543 +
  22.544 +template <>
  22.545 +struct Interpolator<aiVectorKey>  {
  22.546 +    void operator () (aiVector3D& out,const aiVectorKey& a,
  22.547 +        const aiVectorKey& b, ai_real d) const
  22.548 +    {
  22.549 +        Interpolator<aiVector3D> ipl;
  22.550 +        ipl(out,a.mValue,b.mValue,d);
  22.551 +    }
  22.552 +}; // ! Interpolator <aiVectorKey>
  22.553 +
  22.554 +template <>
  22.555 +struct Interpolator<aiQuatKey>  {
  22.556 +    void operator () (aiQuaternion& out, const aiQuatKey& a,
  22.557 +        const aiQuatKey& b, ai_real d) const
  22.558 +    {
  22.559 +        Interpolator<aiQuaternion> ipl;
  22.560 +        ipl(out,a.mValue,b.mValue,d);
  22.561 +    }
  22.562 +}; // ! Interpolator <aiQuatKey>
  22.563 +
  22.564 +template <>
  22.565 +struct Interpolator<aiMeshKey>     {
  22.566 +    void operator () (unsigned int& out, const aiMeshKey& a,
  22.567 +        const aiMeshKey& b, ai_real d) const
  22.568 +    {
  22.569 +        Interpolator<unsigned int> ipl;
  22.570 +        ipl(out,a.mValue,b.mValue,d);
  22.571 +    }
  22.572 +}; // ! Interpolator <aiQuatKey>
  22.573 +
  22.574 +//! @endcond
  22.575 +
  22.576 +} //  ! end namespace Assimp
  22.577 +
  22.578 +#endif // __cplusplus
  22.579 +
  22.580 +#endif // AI_ANIM_H_INC
    23.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    23.2 +++ b/include/miniassimp/camera.h	Mon Jan 28 18:19:26 2019 +0200
    23.3 @@ -0,0 +1,226 @@
    23.4 +/*
    23.5 +---------------------------------------------------------------------------
    23.6 +Open Asset Import Library (assimp)
    23.7 +---------------------------------------------------------------------------
    23.8 +
    23.9 +Copyright (c) 2006-2018, assimp team
   23.10 +
   23.11 +
   23.12 +
   23.13 +All rights reserved.
   23.14 +
   23.15 +Redistribution and use of this software in source and binary forms,
   23.16 +with or without modification, are permitted provided that the following
   23.17 +conditions are met:
   23.18 +
   23.19 +* Redistributions of source code must retain the above
   23.20 +  copyright notice, this list of conditions and the
   23.21 +  following disclaimer.
   23.22 +
   23.23 +* Redistributions in binary form must reproduce the above
   23.24 +  copyright notice, this list of conditions and the
   23.25 +  following disclaimer in the documentation and/or other
   23.26 +  materials provided with the distribution.
   23.27 +
   23.28 +* Neither the name of the assimp team, nor the names of its
   23.29 +  contributors may be used to endorse or promote products
   23.30 +  derived from this software without specific prior
   23.31 +  written permission of the assimp team.
   23.32 +
   23.33 +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   23.34 +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   23.35 +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
   23.36 +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
   23.37 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   23.38 +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   23.39 +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
   23.40 +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
   23.41 +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   23.42 +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   23.43 +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   23.44 +---------------------------------------------------------------------------
   23.45 +*/
   23.46 +
   23.47 +/** @file camera.h
   23.48 + *  @brief Defines the aiCamera data structure
   23.49 + */
   23.50 +
   23.51 +#pragma once
   23.52 +#ifndef AI_CAMERA_H_INC
   23.53 +#define AI_CAMERA_H_INC
   23.54 +
   23.55 +#include "types.h"
   23.56 +
   23.57 +#ifdef __cplusplus
   23.58 +extern "C" {
   23.59 +#endif
   23.60 +
   23.61 +// ---------------------------------------------------------------------------
   23.62 +/** Helper structure to describe a virtual camera.
   23.63 + *
   23.64 + * Cameras have a representation in the node graph and can be animated.
   23.65 + * An important aspect is that the camera itself is also part of the
   23.66 + * scenegraph. This means, any values such as the look-at vector are not
   23.67 + * *absolute*, they're <b>relative</b> to the coordinate system defined
   23.68 + * by the node which corresponds to the camera. This allows for camera
   23.69 + * animations. For static cameras parameters like the 'look-at' or 'up' vectors
   23.70 + * are usually specified directly in aiCamera, but beware, they could also
   23.71 + * be encoded in the node transformation. The following (pseudo)code sample
   23.72 + * shows how to do it: <br><br>
   23.73 + * @code
   23.74 + * // Get the camera matrix for a camera at a specific time
   23.75 + * // if the node hierarchy for the camera does not contain
   23.76 + * // at least one animated node this is a static computation
   23.77 + * get-camera-matrix (node sceneRoot, camera cam) : matrix
   23.78 + * {
   23.79 + *    node   cnd = find-node-for-camera(cam)
   23.80 + *    matrix cmt = identity()
   23.81 + *
   23.82 + *    // as usual - get the absolute camera transformation for this frame
   23.83 + *    for each node nd in hierarchy from sceneRoot to cnd
   23.84 + *      matrix cur
   23.85 + *      if (is-animated(nd))
   23.86 + *         cur = eval-animation(nd)
   23.87 + *      else cur = nd->mTransformation;
   23.88 + *      cmt = mult-matrices( cmt, cur )
   23.89 + *    end for
   23.90 + *
   23.91 + *    // now multiply with the camera's own local transform
   23.92 + *    cam = mult-matrices (cam, get-camera-matrix(cmt) )
   23.93 + * }
   23.94 + * @endcode
   23.95 + *
   23.96 + * @note some file formats (such as 3DS, ASE) export a "target point" -
   23.97 + * the point the camera is looking at (it can even be animated). Assimp
   23.98 + * writes the target point as a subnode of the camera's main node,
   23.99 + * called "<camName>.Target". However this is just additional information
  23.100 + * then the transformation tracks of the camera main node make the
  23.101 + * camera already look in the right direction.
  23.102 + *
  23.103 +*/
  23.104 +struct aiCamera
  23.105 +{
  23.106 +    /** The name of the camera.
  23.107 +     *
  23.108 +     *  There must be a node in the scenegraph with the same name.
  23.109 +     *  This node specifies the position of the camera in the scene
  23.110 +     *  hierarchy and can be animated.
  23.111 +     */
  23.112 +    C_STRUCT aiString mName;
  23.113 +
  23.114 +    /** Position of the camera relative to the coordinate space
  23.115 +     *  defined by the corresponding node.
  23.116 +     *
  23.117 +     *  The default value is 0|0|0.
  23.118 +     */
  23.119 +    C_STRUCT aiVector3D mPosition;
  23.120 +
  23.121 +
  23.122 +    /** 'Up' - vector of the camera coordinate system relative to
  23.123 +     *  the coordinate space defined by the corresponding node.
  23.124 +     *
  23.125 +     *  The 'right' vector of the camera coordinate system is
  23.126 +     *  the cross product of  the up and lookAt vectors.
  23.127 +     *  The default value is 0|1|0. The vector
  23.128 +     *  may be normalized, but it needn't.
  23.129 +     */
  23.130 +    C_STRUCT aiVector3D mUp;
  23.131 +
  23.132 +
  23.133 +    /** 'LookAt' - vector of the camera coordinate system relative to
  23.134 +     *  the coordinate space defined by the corresponding node.
  23.135 +     *
  23.136 +     *  This is the viewing direction of the user.
  23.137 +     *  The default value is 0|0|1. The vector
  23.138 +     *  may be normalized, but it needn't.
  23.139 +     */
  23.140 +    C_STRUCT aiVector3D mLookAt;
  23.141 +
  23.142 +
  23.143 +    /** Half horizontal field of view angle, in radians.
  23.144 +     *
  23.145 +     *  The field of view angle is the angle between the center
  23.146 +     *  line of the screen and the left or right border.
  23.147 +     *  The default value is 1/4PI.
  23.148 +     */
  23.149 +    float mHorizontalFOV;
  23.150 +
  23.151 +    /** Distance of the near clipping plane from the camera.
  23.152 +     *
  23.153 +     * The value may not be 0.f (for arithmetic reasons to prevent
  23.154 +     * a division through zero). The default value is 0.1f.
  23.155 +     */
  23.156 +    float mClipPlaneNear;
  23.157 +
  23.158 +    /** Distance of the far clipping plane from the camera.
  23.159 +     *
  23.160 +     * The far clipping plane must, of course, be further away than the
  23.161 +     * near clipping plane. The default value is 1000.f. The ratio
  23.162 +     * between the near and the far plane should not be too
  23.163 +     * large (between 1000-10000 should be ok) to avoid floating-point
  23.164 +     * inaccuracies which could lead to z-fighting.
  23.165 +     */
  23.166 +    float mClipPlaneFar;
  23.167 +
  23.168 +
  23.169 +    /** Screen aspect ratio.
  23.170 +     *
  23.171 +     * This is the ration between the width and the height of the
  23.172 +     * screen. Typical values are 4/3, 1/2 or 1/1. This value is
  23.173 +     * 0 if the aspect ratio is not defined in the source file.
  23.174 +     * 0 is also the default value.
  23.175 +     */
  23.176 +    float mAspect;
  23.177 +
  23.178 +#ifdef __cplusplus
  23.179 +
  23.180 +    aiCamera() AI_NO_EXCEPT
  23.181 +        : mUp               (0.f,1.f,0.f)
  23.182 +        , mLookAt           (0.f,0.f,1.f)
  23.183 +        , mHorizontalFOV    (0.25f * (float)AI_MATH_PI)
  23.184 +        , mClipPlaneNear    (0.1f)
  23.185 +        , mClipPlaneFar     (1000.f)
  23.186 +        , mAspect           (0.f)
  23.187 +    {}
  23.188 +
  23.189 +    /** @brief Get a *right-handed* camera matrix from me
  23.190 +     *  @param out Camera matrix to be filled
  23.191 +     */
  23.192 +    void GetCameraMatrix (aiMatrix4x4& out) const
  23.193 +    {
  23.194 +        /** todo: test ... should work, but i'm not absolutely sure */
  23.195 +
  23.196 +        /** We don't know whether these vectors are already normalized ...*/
  23.197 +        aiVector3D zaxis = mLookAt;     zaxis.Normalize();
  23.198 +        aiVector3D yaxis = mUp;         yaxis.Normalize();
  23.199 +        aiVector3D xaxis = mUp^mLookAt; xaxis.Normalize();
  23.200 +
  23.201 +        out.a4 = -(xaxis * mPosition);
  23.202 +        out.b4 = -(yaxis * mPosition);
  23.203 +        out.c4 = -(zaxis * mPosition);
  23.204 +
  23.205 +        out.a1 = xaxis.x;
  23.206 +        out.a2 = xaxis.y;
  23.207 +        out.a3 = xaxis.z;
  23.208 +
  23.209 +        out.b1 = yaxis.x;
  23.210 +        out.b2 = yaxis.y;
  23.211 +        out.b3 = yaxis.z;
  23.212 +
  23.213 +        out.c1 = zaxis.x;
  23.214 +        out.c2 = zaxis.y;
  23.215 +        out.c3 = zaxis.z;
  23.216 +
  23.217 +        out.d1 = out.d2 = out.d3 = 0.f;
  23.218 +        out.d4 = 1.f;
  23.219 +    }
  23.220 +
  23.221 +#endif
  23.222 +};
  23.223 +
  23.224 +
  23.225 +#ifdef __cplusplus
  23.226 +}
  23.227 +#endif
  23.228 +
  23.229 +#endif // AI_CAMERA_H_INC
    24.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    24.2 +++ b/include/miniassimp/cfileio.h	Mon Jan 28 18:19:26 2019 +0200
    24.3 @@ -0,0 +1,138 @@
    24.4 +/*
    24.5 +---------------------------------------------------------------------------
    24.6 +Open Asset Import Library (assimp)
    24.7 +---------------------------------------------------------------------------
    24.8 +
    24.9 +Copyright (c) 2006-2018, assimp team
   24.10 +
   24.11 +
   24.12 +
   24.13 +All rights reserved.
   24.14 +
   24.15 +Redistribution and use of this software in source and binary forms,
   24.16 +with or without modification, are permitted provided that the following
   24.17 +conditions are met:
   24.18 +
   24.19 +* Redistributions of source code must retain the above
   24.20 +  copyright notice, this list of conditions and the
   24.21 +  following disclaimer.
   24.22 +
   24.23 +* Redistributions in binary form must reproduce the above
   24.24 +  copyright notice, this list of conditions and the
   24.25 +  following disclaimer in the documentation and/or other
   24.26 +  materials provided with the distribution.
   24.27 +
   24.28 +* Neither the name of the assimp team, nor the names of its
   24.29 +  contributors may be used to endorse or promote products
   24.30 +  derived from this software without specific prior
   24.31 +  written permission of the assimp team.
   24.32 +
   24.33 +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   24.34 +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   24.35 +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
   24.36 +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
   24.37 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   24.38 +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   24.39 +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
   24.40 +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
   24.41 +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   24.42 +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   24.43 +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   24.44 +---------------------------------------------------------------------------
   24.45 +*/
   24.46 +
   24.47 +/** @file cfileio.h
   24.48 + *  @brief Defines generic C routines to access memory-mapped files
   24.49 + */
   24.50 +#pragma once
   24.51 +#ifndef AI_FILEIO_H_INC
   24.52 +#define AI_FILEIO_H_INC
   24.53 +
   24.54 +#include <miniassimp/types.h>
   24.55 +#ifdef __cplusplus
   24.56 +extern "C" {
   24.57 +#endif
   24.58 +struct aiFileIO;
   24.59 +struct aiFile;
   24.60 +
   24.61 +// aiFile callbacks
   24.62 +typedef size_t          (*aiFileWriteProc) (C_STRUCT aiFile*,   const char*, size_t, size_t);
   24.63 +typedef size_t          (*aiFileReadProc)  (C_STRUCT aiFile*,   char*, size_t,size_t);
   24.64 +typedef size_t          (*aiFileTellProc)  (C_STRUCT aiFile*);
   24.65 +typedef void            (*aiFileFlushProc) (C_STRUCT aiFile*);
   24.66 +typedef C_ENUM aiReturn (*aiFileSeek)      (C_STRUCT aiFile*, size_t, C_ENUM aiOrigin);
   24.67 +
   24.68 +// aiFileIO callbacks
   24.69 +typedef C_STRUCT aiFile* (*aiFileOpenProc)  (C_STRUCT aiFileIO*, const char*, const char*);
   24.70 +typedef void             (*aiFileCloseProc) (C_STRUCT aiFileIO*, C_STRUCT aiFile*);
   24.71 +
   24.72 +// Represents user-defined data
   24.73 +typedef char* aiUserData;
   24.74 +
   24.75 +// ----------------------------------------------------------------------------------
   24.76 +/** @brief C-API: File system callbacks
   24.77 + *
   24.78 + *  Provided are functions to open and close files. Supply a custom structure to
   24.79 + *  the import function. If you don't, a default implementation is used. Use custom
   24.80 + *  file systems to enable reading from other sources, such as ZIPs
   24.81 + *  or memory locations. */
   24.82 +struct aiFileIO
   24.83 +{
   24.84 +    /** Function used to open a new file
   24.85 +     */
   24.86 +    aiFileOpenProc OpenProc;
   24.87 +
   24.88 +    /** Function used to close an existing file
   24.89 +     */
   24.90 +    aiFileCloseProc CloseProc;
   24.91 +
   24.92 +    /** User-defined, opaque data */
   24.93 +    aiUserData UserData;
   24.94 +};
   24.95 +
   24.96 +// ----------------------------------------------------------------------------------
   24.97 +/** @brief C-API: File callbacks
   24.98 + *
   24.99 + *  Actually, it's a data structure to wrap a set of fXXXX (e.g fopen)
  24.100 + *  replacement functions.
  24.101 + *
  24.102 + *  The default implementation of the functions utilizes the fXXX functions from
  24.103 + *  the CRT. However, you can supply a custom implementation to Assimp by
  24.104 + *  delivering a custom aiFileIO. Use this to enable reading from other sources,
  24.105 + *  such as ZIP archives or memory locations. */
  24.106 +struct aiFile
  24.107 +{
  24.108 +    /** Callback to read from a file */
  24.109 +    aiFileReadProc ReadProc;
  24.110 +
  24.111 +    /** Callback to write to a file */
  24.112 +    aiFileWriteProc WriteProc;
  24.113 +
  24.114 +    /** Callback to retrieve the current position of
  24.115 +     *  the file cursor (ftell())
  24.116 +     */
  24.117 +    aiFileTellProc TellProc;
  24.118 +
  24.119 +    /** Callback to retrieve the size of the file,
  24.120 +     *  in bytes
  24.121 +     */
  24.122 +    aiFileTellProc FileSizeProc;
  24.123 +
  24.124 +    /** Callback to set the current position
  24.125 +     * of the file cursor (fseek())
  24.126 +     */
  24.127 +    aiFileSeek SeekProc;
  24.128 +
  24.129 +    /** Callback to flush the file contents
  24.130 +     */
  24.131 +    aiFileFlushProc FlushProc;
  24.132 +
  24.133 +    /** User-defined, opaque data
  24.134 +     */
  24.135 +    aiUserData UserData;
  24.136 +};
  24.137 +
  24.138 +#ifdef __cplusplus
  24.139 +}
  24.140 +#endif
  24.141 +#endif // AI_FILEIO_H_INC
    25.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    25.2 +++ b/include/miniassimp/cimport.h	Mon Jan 28 18:19:26 2019 +0200
    25.3 @@ -0,0 +1,565 @@
    25.4 +/*
    25.5 +---------------------------------------------------------------------------
    25.6 +Open Asset Import Library (assimp)
    25.7 +---------------------------------------------------------------------------
    25.8 +
    25.9 +Copyright (c) 2006-2018, assimp team
   25.10 +
   25.11 +
   25.12 +
   25.13 +All rights reserved.
   25.14 +
   25.15 +Redistribution and use of this software in source and binary forms,
   25.16 +with or without modification, are permitted provided that the following
   25.17 +conditions are met:
   25.18 +
   25.19 +* Redistributions of source code must retain the above
   25.20 +  copyright notice, this list of conditions and the
   25.21 +  following disclaimer.
   25.22 +
   25.23 +* Redistributions in binary form must reproduce the above
   25.24 +  copyright notice, this list of conditions and the
   25.25 +  following disclaimer in the documentation and/or other
   25.26 +  materials provided with the distribution.
   25.27 +
   25.28 +* Neither the name of the assimp team, nor the names of its
   25.29 +  contributors may be used to endorse or promote products
   25.30 +  derived from this software without specific prior
   25.31 +  written permission of the assimp team.
   25.32 +
   25.33 +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   25.34 +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   25.35 +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
   25.36 +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
   25.37 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   25.38 +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   25.39 +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
   25.40 +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
   25.41 +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   25.42 +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   25.43 +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   25.44 +---------------------------------------------------------------------------
   25.45 +*/
   25.46 +
   25.47 +/** @file  cimport.h
   25.48 + *  @brief Defines the C-API to the Open Asset Import Library.
   25.49 + */
   25.50 +#pragma once
   25.51 +#ifndef AI_ASSIMP_H_INC
   25.52 +#define AI_ASSIMP_H_INC
   25.53 +
   25.54 +#include <miniassimp/types.h>
   25.55 +#include "importerdesc.h"
   25.56 +
   25.57 +#ifdef __cplusplus
   25.58 +extern "C" {
   25.59 +#endif
   25.60 +
   25.61 +struct aiScene;  // aiScene.h
   25.62 +struct aiFileIO; // aiFileIO.h
   25.63 +typedef void (*aiLogStreamCallback)(const char* /* message */, char* /* user */);
   25.64 +
   25.65 +// --------------------------------------------------------------------------------
   25.66 +/** C-API: Represents a log stream. A log stream receives all log messages and
   25.67 + *  streams them _somewhere_.
   25.68 + *  @see aiGetPredefinedLogStream
   25.69 + *  @see aiAttachLogStream
   25.70 + *  @see aiDetachLogStream */
   25.71 +// --------------------------------------------------------------------------------
   25.72 +struct aiLogStream
   25.73 +{
   25.74 +    /** callback to be called */
   25.75 +    aiLogStreamCallback callback;
   25.76 +
   25.77 +    /** user data to be passed to the callback */
   25.78 +    char* user;
   25.79 +};
   25.80 +
   25.81 +
   25.82 +// --------------------------------------------------------------------------------
   25.83 +/** C-API: Represents an opaque set of settings to be used during importing.
   25.84 + *  @see aiCreatePropertyStore
   25.85 + *  @see aiReleasePropertyStore
   25.86 + *  @see aiImportFileExWithProperties
   25.87 + *  @see aiSetPropertyInteger
   25.88 + *  @see aiSetPropertyFloat
   25.89 + *  @see aiSetPropertyString
   25.90 + *  @see aiSetPropertyMatrix
   25.91 + */
   25.92 +// --------------------------------------------------------------------------------
   25.93 +struct aiPropertyStore { char sentinel; };
   25.94 +
   25.95 +/** Our own C boolean type */
   25.96 +typedef int aiBool;
   25.97 +
   25.98 +#define AI_FALSE 0
   25.99 +#define AI_TRUE 1
  25.100 +
  25.101 +// --------------------------------------------------------------------------------
  25.102 +/** Reads the given file and returns its content.
  25.103 + *
  25.104 + * If the call succeeds, the imported data is returned in an aiScene structure.
  25.105 + * The data is intended to be read-only, it stays property of the ASSIMP
  25.106 + * library and will be stable until aiReleaseImport() is called. After you're
  25.107 + * done with it, call aiReleaseImport() to free the resources associated with
  25.108 + * this file. If the import fails, NULL is returned instead. Call
  25.109 + * aiGetErrorString() to retrieve a human-readable error text.
  25.110 + * @param pFile Path and filename of the file to be imported,
  25.111 + *   expected to be a null-terminated c-string. NULL is not a valid value.
  25.112 + * @param pFlags Optional post processing steps to be executed after
  25.113 + *   a successful import. Provide a bitwise combination of the
  25.114 + *   #aiPostProcessSteps flags.
  25.115 + * @return Pointer to the imported data or NULL if the import failed.
  25.116 + */
  25.117 +ASSIMP_API const C_STRUCT aiScene* aiImportFile(
  25.118 +    const char* pFile,
  25.119 +    unsigned int pFlags);
  25.120 +
  25.121 +// --------------------------------------------------------------------------------
  25.122 +/** Reads the given file using user-defined I/O functions and returns
  25.123 + *   its content.
  25.124 + *
  25.125 + * If the call succeeds, the imported data is returned in an aiScene structure.
  25.126 + * The data is intended to be read-only, it stays property of the ASSIMP
  25.127 + * library and will be stable until aiReleaseImport() is called. After you're
  25.128 + * done with it, call aiReleaseImport() to free the resources associated with
  25.129 + * this file. If the import fails, NULL is returned instead. Call
  25.130 + * aiGetErrorString() to retrieve a human-readable error text.
  25.131 + * @param pFile Path and filename of the file to be imported,
  25.132 + *   expected to be a null-terminated c-string. NULL is not a valid value.
  25.133 + * @param pFlags Optional post processing steps to be executed after
  25.134 + *   a successful import. Provide a bitwise combination of the
  25.135 + *   #aiPostProcessSteps flags.
  25.136 + * @param pFS aiFileIO structure. Will be used to open the model file itself
  25.137 + *   and any other files the loader needs to open.  Pass NULL to use the default
  25.138 + *   implementation.
  25.139 + * @return Pointer to the imported data or NULL if the import failed.
  25.140 + * @note Include <aiFileIO.h> for the definition of #aiFileIO.
  25.141 + */
  25.142 +ASSIMP_API const C_STRUCT aiScene* aiImportFileEx(
  25.143 +    const char* pFile,
  25.144 +    unsigned int pFlags,
  25.145 +    C_STRUCT aiFileIO* pFS);
  25.146 +
  25.147 +// --------------------------------------------------------------------------------
  25.148 +/** Same as #aiImportFileEx, but adds an extra parameter containing importer settings.
  25.149 + *
  25.150 + * @param pFile Path and filename of the file to be imported,
  25.151 + *   expected to be a null-terminated c-string. NULL is not a valid value.
  25.152 + * @param pFlags Optional post processing steps to be executed after
  25.153 + *   a successful import. Provide a bitwise combination of the
  25.154 + *   #aiPostProcessSteps flags.
  25.155 + * @param pFS aiFileIO structure. Will be used to open the model file itself
  25.156 + *   and any other files the loader needs to open.  Pass NULL to use the default
  25.157 + *   implementation.
  25.158 + * @param pProps #aiPropertyStore instance containing import settings.
  25.159 + * @return Pointer to the imported data or NULL if the import failed.
  25.160 + * @note Include <aiFileIO.h> for the definition of #aiFileIO.
  25.161 + * @see aiImportFileEx
  25.162 + */
  25.163 +ASSIMP_API const C_STRUCT aiScene* aiImportFileExWithProperties(
  25.164 +    const char* pFile,
  25.165 +    unsigned int pFlags,
  25.166 +    C_STRUCT aiFileIO* pFS,
  25.167 +    const C_STRUCT aiPropertyStore* pProps);
  25.168 +
  25.169 +// --------------------------------------------------------------------------------
  25.170 +/** Reads the given file from a given memory buffer,
  25.171 + *
  25.172 + * If the call succeeds, the contents of the file are returned as a pointer to an
  25.173 + * aiScene object. The returned data is intended to be read-only, the importer keeps
  25.174 + * ownership of the data and will destroy it upon destruction. If the import fails,
  25.175 + * NULL is returned.
  25.176 + * A human-readable error description can be retrieved by calling aiGetErrorString().
  25.177 + * @param pBuffer Pointer to the file data
  25.178 + * @param pLength Length of pBuffer, in bytes
  25.179 + * @param pFlags Optional post processing steps to be executed after
  25.180 + *   a successful import. Provide a bitwise combination of the
  25.181 + *   #aiPostProcessSteps flags. If you wish to inspect the imported
  25.182 + *   scene first in order to fine-tune your post-processing setup,
  25.183 + *   consider to use #aiApplyPostProcessing().
  25.184 + * @param pHint An additional hint to the library. If this is a non empty string,
  25.185 + *   the library looks for a loader to support the file extension specified by pHint
  25.186 + *   and passes the file to the first matching loader. If this loader is unable to
  25.187 + *   completely the request, the library continues and tries to determine the file
  25.188 + *   format on its own, a task that may or may not be successful.
  25.189 + *   Check the return value, and you'll know ...
  25.190 + * @return A pointer to the imported data, NULL if the import failed.
  25.191 + *
  25.192 + * @note This is a straightforward way to decode models from memory
  25.193 + * buffers, but it doesn't handle model formats that spread their
  25.194 + * data across multiple files or even directories. Examples include
  25.195 + * OBJ or MD3, which outsource parts of their material info into
  25.196 + * external scripts. If you need full functionality, provide
  25.197 + * a custom IOSystem to make Assimp find these files and use
  25.198 + * the regular aiImportFileEx()/aiImportFileExWithProperties() API.
  25.199 + */
  25.200 +ASSIMP_API const C_STRUCT aiScene* aiImportFileFromMemory(
  25.201 +    const char* pBuffer,
  25.202 +    unsigned int pLength,
  25.203 +    unsigned int pFlags,
  25.204 +    const char* pHint);
  25.205 +
  25.206 +// --------------------------------------------------------------------------------
  25.207 +/** Same as #aiImportFileFromMemory, but adds an extra parameter containing importer settings.
  25.208 + *
  25.209 + * @param pBuffer Pointer to the file data
  25.210 + * @param pLength Length of pBuffer, in bytes
  25.211 + * @param pFlags Optional post processing steps to be executed after
  25.212 + *   a successful import. Provide a bitwise combination of the
  25.213 + *   #aiPostProcessSteps flags. If you wish to inspect the imported
  25.214 + *   scene first in order to fine-tune your post-processing setup,
  25.215 + *   consider to use #aiApplyPostProcessing().
  25.216 + * @param pHint An additional hint to the library. If this is a non empty string,
  25.217 + *   the library looks for a loader to support the file extension specified by pHint
  25.218 + *   and passes the file to the first matching loader. If this loader is unable to
  25.219 + *   completely the request, the library continues and tries to determine the file
  25.220 + *   format on its own, a task that may or may not be successful.
  25.221 + *   Check the return value, and you'll know ...
  25.222 + * @param pProps #aiPropertyStore instance containing import settings.
  25.223 + * @return A pointer to the imported data, NULL if the import failed.
  25.224 + *
  25.225 + * @note This is a straightforward way to decode models from memory
  25.226 + * buffers, but it doesn't handle model formats that spread their
  25.227 + * data across multiple files or even directories. Examples include
  25.228 + * OBJ or MD3, which outsource parts of their material info into
  25.229 + * external scripts. If you need full functionality, provide
  25.230 + * a custom IOSystem to make Assimp find these files and use
  25.231 + * the regular aiImportFileEx()/aiImportFileExWithProperties() API.
  25.232 + * @see aiImportFileFromMemory
  25.233 + */
  25.234 +ASSIMP_API const C_STRUCT aiScene* aiImportFileFromMemoryWithProperties(
  25.235 +    const char* pBuffer,
  25.236 +    unsigned int pLength,
  25.237 +    unsigned int pFlags,
  25.238 +    const char* pHint,
  25.239 +    const C_STRUCT aiPropertyStore* pProps);
  25.240 +
  25.241 +// --------------------------------------------------------------------------------
  25.242 +/** Apply post-processing to an already-imported scene.
  25.243 + *
  25.244 + * This is strictly equivalent to calling #aiImportFile()/#aiImportFileEx with the
  25.245 + * same flags. However, you can use this separate function to inspect the imported
  25.246 + * scene first to fine-tune your post-processing setup.
  25.247 + * @param pScene Scene to work on.
  25.248 + * @param pFlags Provide a bitwise combination of the #aiPostProcessSteps flags.
  25.249 + * @return A pointer to the post-processed data. Post processing is done in-place,
  25.250 + *   meaning this is still the same #aiScene which you passed for pScene. However,
  25.251 + *   _if_ post-processing failed, the scene could now be NULL. That's quite a rare
  25.252 + *   case, post processing steps are not really designed to 'fail'. To be exact,
  25.253 + *   the #aiProcess_ValidateDataStructure flag is currently the only post processing step
  25.254 + *   which can actually cause the scene to be reset to NULL.
  25.255 + */
  25.256 +ASSIMP_API const C_STRUCT aiScene* aiApplyPostProcessing(
  25.257 +    const C_STRUCT aiScene* pScene,
  25.258 +    unsigned int pFlags);
  25.259 +
  25.260 +// --------------------------------------------------------------------------------
  25.261 +/** Get one of the predefine log streams. This is the quick'n'easy solution to
  25.262 + *  access Assimp's log system. Attaching a log stream can slightly reduce Assimp's
  25.263 + *  overall import performance.
  25.264 + *
  25.265 + *  Usage is rather simple (this will stream the log to a file, named log.txt, and
  25.266 + *  the stdout stream of the process:
  25.267 + *  @code
  25.268 + *    struct aiLogStream c;
  25.269 + *    c = aiGetPredefinedLogStream(aiDefaultLogStream_FILE,"log.txt");
  25.270 + *    aiAttachLogStream(&c);
  25.271 + *    c = aiGetPredefinedLogStream(aiDefaultLogStream_STDOUT,NULL);
  25.272 + *    aiAttachLogStream(&c);
  25.273 + *  @endcode
  25.274 + *
  25.275 + *  @param pStreams One of the #aiDefaultLogStream enumerated values.
  25.276 + *  @param file Solely for the #aiDefaultLogStream_FILE flag: specifies the file to write to.
  25.277 + *    Pass NULL for all other flags.
  25.278 + *  @return The log stream. callback is set to NULL if something went wrong.
  25.279 + */
  25.280 +ASSIMP_API C_STRUCT aiLogStream aiGetPredefinedLogStream(
  25.281 +    C_ENUM aiDefaultLogStream pStreams,
  25.282 +    const char* file);
  25.283 +
  25.284 +// --------------------------------------------------------------------------------
  25.285 +/** Attach a custom log stream to the libraries' logging system.
  25.286 + *
  25.287 + *  Attaching a log stream can slightly reduce Assimp's overall import
  25.288 + *  performance. Multiple log-streams can be attached.
  25.289 + *  @param stream Describes the new log stream.
  25.290 + *  @note To ensure proper destruction of the logging system, you need to manually
  25.291 + *    call aiDetachLogStream() on every single log stream you attach.
  25.292 + *    Alternatively (for the lazy folks) #aiDetachAllLogStreams is provided.
  25.293 + */
  25.294 +ASSIMP_API void aiAttachLogStream(
  25.295 +    const C_STRUCT aiLogStream* stream);
  25.296 +
  25.297 +// --------------------------------------------------------------------------------
  25.298 +/** Enable verbose logging. Verbose logging includes debug-related stuff and
  25.299 + *  detailed import statistics. This can have severe impact on import performance
  25.300 + *  and memory consumption. However, it might be useful to find out why a file
  25.301 + *  didn't read correctly.
  25.302 + *  @param d AI_TRUE or AI_FALSE, your decision.
  25.303 + */
  25.304 +ASSIMP_API void aiEnableVerboseLogging(aiBool d);
  25.305 +
  25.306 +// --------------------------------------------------------------------------------
  25.307 +/** Detach a custom log stream from the libraries' logging system.
  25.308 + *
  25.309 + *  This is the counterpart of #aiAttachLogStream. If you attached a stream,
  25.310 + *  don't forget to detach it again.
  25.311 + *  @param stream The log stream to be detached.
  25.312 + *  @return AI_SUCCESS if the log stream has been detached successfully.
  25.313 + *  @see aiDetachAllLogStreams
  25.314 + */
  25.315 +ASSIMP_API C_ENUM aiReturn aiDetachLogStream(
  25.316 +    const C_STRUCT aiLogStream* stream);
  25.317 +
  25.318 +// --------------------------------------------------------------------------------
  25.319 +/** Detach all active log streams from the libraries' logging system.
  25.320 + *  This ensures that the logging system is terminated properly and all
  25.321 + *  resources allocated by it are actually freed. If you attached a stream,
  25.322 + *  don't forget to detach it again.
  25.323 + *  @see aiAttachLogStream
  25.324 + *  @see aiDetachLogStream
  25.325 + */
  25.326 +ASSIMP_API void aiDetachAllLogStreams(void);
  25.327 +
  25.328 +// --------------------------------------------------------------------------------
  25.329 +/** Releases all resources associated with the given import process.
  25.330 + *
  25.331 + * Call this function after you're done with the imported data.
  25.332 + * @param pScene The imported data to release. NULL is a valid value.
  25.333 + */
  25.334 +ASSIMP_API void aiReleaseImport(
  25.335 +    const C_STRUCT aiScene* pScene);
  25.336 +
  25.337 +// --------------------------------------------------------------------------------
  25.338 +/** Returns the error text of the last failed import process.
  25.339 + *
  25.340 + * @return A textual description of the error that occurred at the last
  25.341 + * import process. NULL if there was no error. There can't be an error if you
  25.342 + * got a non-NULL #aiScene from #aiImportFile/#aiImportFileEx/#aiApplyPostProcessing.
  25.343 + */
  25.344 +ASSIMP_API const char* aiGetErrorString(void);
  25.345 +
  25.346 +// --------------------------------------------------------------------------------
  25.347 +/** Returns whether a given file extension is supported by ASSIMP
  25.348 + *
  25.349 + * @param szExtension Extension for which the function queries support for.
  25.350 + * Must include a leading dot '.'. Example: ".3ds", ".md3"
  25.351 + * @return AI_TRUE if the file extension is supported.
  25.352 + */
  25.353 +ASSIMP_API aiBool aiIsExtensionSupported(
  25.354 +    const char* szExtension);
  25.355 +
  25.356 +// --------------------------------------------------------------------------------
  25.357 +/** Get a list of all file extensions supported by ASSIMP.
  25.358 + *
  25.359 + * If a file extension is contained in the list this does, of course, not
  25.360 + * mean that ASSIMP is able to load all files with this extension.
  25.361 + * @param szOut String to receive the extension list.
  25.362 + * Format of the list: "*.3ds;*.obj;*.dae". NULL is not a valid parameter.
  25.363 + */
  25.364 +ASSIMP_API void aiGetExtensionList(
  25.365 +    C_STRUCT aiString* szOut);
  25.366 +
  25.367 +// --------------------------------------------------------------------------------
  25.368 +/** Get the approximated storage required by an imported asset
  25.369 + * @param pIn Input asset.
  25.370 + * @param in Data structure to be filled.
  25.371 + */
  25.372 +ASSIMP_API void aiGetMemoryRequirements(
  25.373 +    const C_STRUCT aiScene* pIn,
  25.374 +    C_STRUCT aiMemoryInfo* in);
  25.375 +
  25.376 +
  25.377 +
  25.378 +// --------------------------------------------------------------------------------
  25.379 +/** Create an empty property store. Property stores are used to collect import
  25.380 + *  settings.
  25.381 + * @return New property store. Property stores need to be manually destroyed using
  25.382 + *   the #aiReleasePropertyStore API function.
  25.383 + */
  25.384 +ASSIMP_API C_STRUCT aiPropertyStore* aiCreatePropertyStore(void);
  25.385 +
  25.386 +// --------------------------------------------------------------------------------
  25.387 +/** Delete a property store.
  25.388 + * @param p Property store to be deleted.
  25.389 + */
  25.390 +ASSIMP_API void aiReleasePropertyStore(C_STRUCT aiPropertyStore* p);
  25.391 +
  25.392 +// --------------------------------------------------------------------------------
  25.393 +/** Set an integer property.
  25.394 + *
  25.395 + *  This is the C-version of #Assimp::Importer::SetPropertyInteger(). In the C
  25.396 + *  interface, properties are always shared by all imports. It is not possible to
  25.397 + *  specify them per import.
  25.398 + *
  25.399 + * @param store Store to modify. Use #aiCreatePropertyStore to obtain a store.
  25.400 + * @param szName Name of the configuration property to be set. All supported
  25.401 + *   public properties are defined in the config.h header file (AI_CONFIG_XXX).
  25.402 + * @param value New value for the property
  25.403 + */
  25.404 +ASSIMP_API void aiSetImportPropertyInteger(
  25.405 +    C_STRUCT aiPropertyStore* store,
  25.406 +    const char* szName,
  25.407 +    int value);
  25.408 +
  25.409 +// --------------------------------------------------------------------------------
  25.410 +/** Set a floating-point property.
  25.411 + *
  25.412 + *  This is the C-version of #Assimp::Importer::SetPropertyFloat(). In the C
  25.413 + *  interface, properties are always shared by all imports. It is not possible to
  25.414 + *  specify them per import.
  25.415 + *
  25.416 + * @param store Store to modify. Use #aiCreatePropertyStore to obtain a store.
  25.417 + * @param szName Name of the configuration property to be set. All supported
  25.418 + *   public properties are defined in the config.h header file (AI_CONFIG_XXX).
  25.419 + * @param value New value for the property
  25.420 + */
  25.421 +ASSIMP_API void aiSetImportPropertyFloat(
  25.422 +    C_STRUCT aiPropertyStore* store,
  25.423 +    const char* szName,
  25.424 +    ai_real value);
  25.425 +
  25.426 +// --------------------------------------------------------------------------------
  25.427 +/** Set a string property.
  25.428 + *
  25.429 + *  This is the C-version of #Assimp::Importer::SetPropertyString(). In the C
  25.430 + *  interface, properties are always shared by all imports. It is not possible to
  25.431 + *  specify them per import.
  25.432 + *
  25.433 + * @param store Store to modify. Use #aiCreatePropertyStore to obtain a store.
  25.434 + * @param szName Name of the configuration property to be set. All supported
  25.435 + *   public properties are defined in the config.h header file (AI_CONFIG_XXX).
  25.436 + * @param st New value for the property
  25.437 + */
  25.438 +ASSIMP_API void aiSetImportPropertyString(
  25.439 +    C_STRUCT aiPropertyStore* store,
  25.440 +    const char* szName,
  25.441 +    const C_STRUCT aiString* st);
  25.442 +
  25.443 +// --------------------------------------------------------------------------------
  25.444 +/** Set a matrix property.
  25.445 + *
  25.446 + *  This is the C-version of #Assimp::Importer::SetPropertyMatrix(). In the C
  25.447 + *  interface, properties are always shared by all imports. It is not possible to
  25.448 + *  specify them per import.
  25.449 + *
  25.450 + * @param store Store to modify. Use #aiCreatePropertyStore to obtain a store.
  25.451 + * @param szName Name of the configuration property to be set. All supported
  25.452 + *   public properties are defined in the config.h header file (AI_CONFIG_XXX).
  25.453 + * @param mat New value for the property
  25.454 + */
  25.455 +ASSIMP_API void aiSetImportPropertyMatrix(
  25.456 +    C_STRUCT aiPropertyStore* store,
  25.457 +    const char* szName,
  25.458 +    const C_STRUCT aiMatrix4x4* mat);
  25.459 +
  25.460 +// --------------------------------------------------------------------------------
  25.461 +/** Construct a quaternion from a 3x3 rotation matrix.
  25.462 + *  @param quat Receives the output quaternion.
  25.463 + *  @param mat Matrix to 'quaternionize'.
  25.464 + *  @see aiQuaternion(const aiMatrix3x3& pRotMatrix)
  25.465 + */
  25.466 +ASSIMP_API void aiCreateQuaternionFromMatrix(
  25.467 +    C_STRUCT aiQuaternion* quat,
  25.468 +    const C_STRUCT aiMatrix3x3* mat);
  25.469 +
  25.470 +// --------------------------------------------------------------------------------
  25.471 +/** Decompose a transformation matrix into its rotational, translational and
  25.472 + *  scaling components.
  25.473 + *
  25.474 + * @param mat Matrix to decompose
  25.475 + * @param scaling Receives the scaling component
  25.476 + * @param rotation Receives the rotational component
  25.477 + * @param position Receives the translational component.
  25.478 + * @see aiMatrix4x4::Decompose (aiVector3D&, aiQuaternion&, aiVector3D&) const;
  25.479 + */
  25.480 +ASSIMP_API void aiDecomposeMatrix(
  25.481 +    const C_STRUCT aiMatrix4x4* mat,
  25.482 +    C_STRUCT aiVector3D* scaling,
  25.483 +    C_STRUCT aiQuaternion* rotation,
  25.484 +    C_STRUCT aiVector3D* position);
  25.485 +
  25.486 +// --------------------------------------------------------------------------------
  25.487 +/** Transpose a 4x4 matrix.
  25.488 + *  @param mat Pointer to the matrix to be transposed
  25.489 + */
  25.490 +ASSIMP_API void aiTransposeMatrix4(
  25.491 +    C_STRUCT aiMatrix4x4* mat);
  25.492 +
  25.493 +// --------------------------------------------------------------------------------
  25.494 +/** Transpose a 3x3 matrix.
  25.495 + *  @param mat Pointer to the matrix to be transposed
  25.496 + */
  25.497 +ASSIMP_API void aiTransposeMatrix3(
  25.498 +    C_STRUCT aiMatrix3x3* mat);
  25.499 +
  25.500 +// --------------------------------------------------------------------------------
  25.501 +/** Transform a vector by a 3x3 matrix
  25.502 + *  @param vec Vector to be transformed.
  25.503 + *  @param mat Matrix to transform the vector with.
  25.504 + */
  25.505 +ASSIMP_API void aiTransformVecByMatrix3(
  25.506 +    C_STRUCT aiVector3D* vec,
  25.507 +    const C_STRUCT aiMatrix3x3* mat);
  25.508 +
  25.509 +// --------------------------------------------------------------------------------
  25.510 +/** Transform a vector by a 4x4 matrix
  25.511 + *  @param vec Vector to be transformed.
  25.512 + *  @param mat Matrix to transform the vector with.
  25.513 + */
  25.514 +ASSIMP_API void aiTransformVecByMatrix4(
  25.515 +    C_STRUCT aiVector3D* vec,
  25.516 +    const C_STRUCT aiMatrix4x4* mat);
  25.517 +
  25.518 +// --------------------------------------------------------------------------------
  25.519 +/** Multiply two 4x4 matrices.
  25.520 + *  @param dst First factor, receives result.
  25.521 + *  @param src Matrix to be multiplied with 'dst'.
  25.522 + */
  25.523 +ASSIMP_API void aiMultiplyMatrix4(
  25.524 +    C_STRUCT aiMatrix4x4* dst,
  25.525 +    const C_STRUCT aiMatrix4x4* src);
  25.526 +
  25.527 +// --------------------------------------------------------------------------------
  25.528 +/** Multiply two 3x3 matrices.
  25.529 + *  @param dst First factor, receives result.
  25.530 + *  @param src Matrix to be multiplied with 'dst'.
  25.531 + */
  25.532 +ASSIMP_API void aiMultiplyMatrix3(
  25.533 +    C_STRUCT aiMatrix3x3* dst,
  25.534 +    const C_STRUCT aiMatrix3x3* src);
  25.535 +
  25.536 +// --------------------------------------------------------------------------------
  25.537 +/** Get a 3x3 identity matrix.
  25.538 + *  @param mat Matrix to receive its personal identity
  25.539 + */
  25.540 +ASSIMP_API void aiIdentityMatrix3(
  25.541 +    C_STRUCT aiMatrix3x3* mat);
  25.542 +
  25.543 +// --------------------------------------------------------------------------------
  25.544 +/** Get a 4x4 identity matrix.
  25.545 + *  @param mat Matrix to receive its personal identity
  25.546 + */
  25.547 +ASSIMP_API void aiIdentityMatrix4(
  25.548 +    C_STRUCT aiMatrix4x4* mat);
  25.549 +
  25.550 +// --------------------------------------------------------------------------------
  25.551 +/** Returns the number of import file formats available in the current Assimp build.
  25.552 + * Use aiGetImportFormatDescription() to retrieve infos of a specific import format.
  25.553 + */
  25.554 +ASSIMP_API size_t aiGetImportFormatCount(void);
  25.555 +
  25.556 +// --------------------------------------------------------------------------------
  25.557 +/** Returns a description of the nth import file format. Use #aiGetImportFormatCount()
  25.558 + * to learn how many import formats are supported.
  25.559 + * @param pIndex Index of the import format to retrieve information for. Valid range is
  25.560 + *    0 to #aiGetImportFormatCount()
  25.561 + * @return A description of that specific import format. NULL if pIndex is out of range.
  25.562 + */
  25.563 +ASSIMP_API const C_STRUCT aiImporterDesc* aiGetImportFormatDescription( size_t pIndex);
  25.564 +#ifdef __cplusplus
  25.565 +}
  25.566 +#endif
  25.567 +
  25.568 +#endif // AI_ASSIMP_H_INC
    26.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    26.2 +++ b/include/miniassimp/color4.h	Mon Jan 28 18:19:26 2019 +0200
    26.3 @@ -0,0 +1,103 @@
    26.4 +/*
    26.5 +---------------------------------------------------------------------------
    26.6 +Open Asset Import Library (assimp)
    26.7 +---------------------------------------------------------------------------
    26.8 +
    26.9 +Copyright (c) 2006-2018, assimp team
   26.10 +
   26.11 +
   26.12 +
   26.13 +All rights reserved.
   26.14 +
   26.15 +Redistribution and use of this software in source and binary forms,
   26.16 +with or without modification, are permitted provided that the following
   26.17 +conditions are met:
   26.18 +
   26.19 +* Redistributions of source code must retain the above
   26.20 +  copyright notice, this list of conditions and the
   26.21 +  following disclaimer.
   26.22 +
   26.23 +* Redistributions in binary form must reproduce the above
   26.24 +  copyright notice, this list of conditions and the
   26.25 +  following disclaimer in the documentation and/or other
   26.26 +  materials provided with the distribution.
   26.27 +
   26.28 +* Neither the name of the assimp team, nor the names of its
   26.29 +  contributors may be used to endorse or promote products
   26.30 +  derived from this software without specific prior
   26.31 +  written permission of the assimp team.
   26.32 +
   26.33 +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   26.34 +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   26.35 +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
   26.36 +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
   26.37 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   26.38 +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   26.39 +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
   26.40 +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
   26.41 +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   26.42 +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   26.43 +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   26.44 +---------------------------------------------------------------------------
   26.45 +*/
   26.46 +/** @file color4.h
   26.47 + *  @brief RGBA color structure, including operators when compiling in C++
   26.48 + */
   26.49 +#pragma once
   26.50 +#ifndef AI_COLOR4D_H_INC
   26.51 +#define AI_COLOR4D_H_INC
   26.52 +
   26.53 +#include "defs.h"
   26.54 +
   26.55 +#ifdef __cplusplus
   26.56 +
   26.57 +// ----------------------------------------------------------------------------------
   26.58 +/** Represents a color in Red-Green-Blue space including an
   26.59 +*   alpha component. Color values range from 0 to 1. */
   26.60 +// ----------------------------------------------------------------------------------
   26.61 +template <typename TReal>
   26.62 +class aiColor4t
   26.63 +{
   26.64 +public:
   26.65 +    aiColor4t() AI_NO_EXCEPT : r(), g(), b(), a() {}
   26.66 +    aiColor4t (TReal _r, TReal _g, TReal _b, TReal _a)
   26.67 +        : r(_r), g(_g), b(_b), a(_a) {}
   26.68 +    explicit aiColor4t (TReal _r) : r(_r), g(_r), b(_r), a(_r) {}
   26.69 +
   26.70 +public:
   26.71 +    // combined operators
   26.72 +    const aiColor4t& operator += (const aiColor4t& o);
   26.73 +    const aiColor4t& operator -= (const aiColor4t& o);
   26.74 +    const aiColor4t& operator *= (TReal f);
   26.75 +    const aiColor4t& operator /= (TReal f);
   26.76 +
   26.77 +public:
   26.78 +    // comparison
   26.79 +    bool operator == (const aiColor4t& other) const;
   26.80 +    bool operator != (const aiColor4t& other) const;
   26.81 +    bool operator <  (const aiColor4t& other) const;
   26.82 +
   26.83 +    // color tuple access, rgba order
   26.84 +    inline TReal operator[](unsigned int i) const;
   26.85 +    inline TReal& operator[](unsigned int i);
   26.86 +
   26.87 +    /** check whether a color is (close to) black */
   26.88 +    inline bool IsBlack() const;
   26.89 +
   26.90 +public:
   26.91 +
   26.92 +    // Red, green, blue and alpha color values
   26.93 +    TReal r, g, b, a;
   26.94 +};  // !struct aiColor4D
   26.95 +
   26.96 +typedef aiColor4t<ai_real> aiColor4D;
   26.97 +
   26.98 +#else
   26.99 +
  26.100 +struct aiColor4D {
  26.101 +    ai_real r, g, b, a;
  26.102 +};
  26.103 +
  26.104 +#endif // __cplusplus
  26.105 +
  26.106 +#endif // AI_COLOR4D_H_INC
    27.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    27.2 +++ b/include/miniassimp/color4.inl	Mon Jan 28 18:19:26 2019 +0200
    27.3 @@ -0,0 +1,205 @@
    27.4 +/*
    27.5 +---------------------------------------------------------------------------
    27.6 +Open Asset Import Library (assimp)
    27.7 +---------------------------------------------------------------------------
    27.8 +
    27.9 +Copyright (c) 2006-2018, assimp team
   27.10 +
   27.11 +
   27.12 +
   27.13 +All rights reserved.
   27.14 +
   27.15 +Redistribution and use of this software in source and binary forms,
   27.16 +with or without modification, are permitted provided that the following
   27.17 +conditions are met:
   27.18 +
   27.19 +* Redistributions of source code must retain the above
   27.20 +  copyright notice, this list of conditions and the
   27.21 +  following disclaimer.
   27.22 +
   27.23 +* Redistributions in binary form must reproduce the above
   27.24 +  copyright notice, this list of conditions and the
   27.25 +  following disclaimer in the documentation and/or other
   27.26 +  materials provided with the distribution.
   27.27 +
   27.28 +* Neither the name of the assimp team, nor the names of its
   27.29 +  contributors may be used to endorse or promote products
   27.30 +  derived from this software without specific prior
   27.31 +  written permission of the assimp team.
   27.32 +
   27.33 +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   27.34 +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   27.35 +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
   27.36 +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
   27.37 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   27.38 +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   27.39 +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
   27.40 +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
   27.41 +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   27.42 +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   27.43 +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   27.44 +---------------------------------------------------------------------------
   27.45 +*/
   27.46 +
   27.47 +/** @file  color4.inl
   27.48 + *  @brief Inline implementation of aiColor4t<TReal> operators
   27.49 + */
   27.50 +#pragma once
   27.51 +#ifndef AI_COLOR4D_INL_INC
   27.52 +#define AI_COLOR4D_INL_INC
   27.53 +
   27.54 +#ifdef __cplusplus
   27.55 +#include "color4.h"
   27.56 +
   27.57 +// ------------------------------------------------------------------------------------------------
   27.58 +template <typename TReal>
   27.59 +AI_FORCE_INLINE const aiColor4t<TReal>& aiColor4t<TReal>::operator += (const aiColor4t<TReal>& o) {
   27.60 +    r += o.r; g += o.g; b += o.b; a += o.a;
   27.61 +    return *this;
   27.62 +}
   27.63 +// ------------------------------------------------------------------------------------------------
   27.64 +template <typename TReal>
   27.65 +AI_FORCE_INLINE const aiColor4t<TReal>& aiColor4t<TReal>::operator -= (const aiColor4t<TReal>& o) {
   27.66 +    r -= o.r; g -= o.g; b -= o.b; a -= o.a;
   27.67 +    return *this;
   27.68 +}
   27.69 +// ------------------------------------------------------------------------------------------------
   27.70 +template <typename TReal>
   27.71 +AI_FORCE_INLINE const aiColor4t<TReal>& aiColor4t<TReal>::operator *= (TReal f) {
   27.72 +    r *= f; g *= f; b *= f; a *= f;
   27.73 +    return *this;
   27.74 +}
   27.75 +// ------------------------------------------------------------------------------------------------
   27.76 +template <typename TReal>
   27.77 +AI_FORCE_INLINE const aiColor4t<TReal>& aiColor4t<TReal>::operator /= (TReal f) {
   27.78 +    r /= f; g /= f; b /= f; a /= f;
   27.79 +    return *this;
   27.80 +}
   27.81 +// ------------------------------------------------------------------------------------------------
   27.82 +template <typename TReal>
   27.83 +AI_FORCE_INLINE TReal aiColor4t<TReal>::operator[](unsigned int i) const {
   27.84 +    switch ( i ) {
   27.85 +        case 0:
   27.86 +            return r;
   27.87 +        case 1:
   27.88 +            return g;
   27.89 +        case 2:
   27.90 +            return b;
   27.91 +        default:
   27.92 +            break;
   27.93 +    }
   27.94 +    return r;
   27.95 +}
   27.96 +// ------------------------------------------------------------------------------------------------
   27.97 +template <typename TReal>
   27.98 +AI_FORCE_INLINE TReal& aiColor4t<TReal>::operator[](unsigned int i) {
   27.99 +    switch ( i ) {
  27.100 +        case 0:
  27.101 +            return r;
  27.102 +        case 1:
  27.103 +            return g;
  27.104 +        case 2:
  27.105 +            return b;
  27.106 +        default:
  27.107 +            break;
  27.108 +    }
  27.109 +    return r;
  27.110 +}
  27.111 +// ------------------------------------------------------------------------------------------------
  27.112 +template <typename TReal>
  27.113 +AI_FORCE_INLINE bool aiColor4t<TReal>::operator== (const aiColor4t<TReal>& other) const {
  27.114 +    return r == other.r && g == other.g && b == other.b && a == other.a;
  27.115 +}
  27.116 +// ------------------------------------------------------------------------------------------------
  27.117 +template <typename TReal>
  27.118 +AI_FORCE_INLINE bool aiColor4t<TReal>::operator!= (const aiColor4t<TReal>& other) const {
  27.119 +    return r != other.r || g != other.g || b != other.b || a != other.a;
  27.120 +}
  27.121 +// ------------------------------------------------------------------------------------------------
  27.122 +template <typename TReal>
  27.123 +AI_FORCE_INLINE bool aiColor4t<TReal>::operator< (const aiColor4t<TReal>& other) const {
  27.124 +    return r < other.r || (
  27.125 +        r == other.r && (
  27.126 +            g < other.g || (
  27.127 +                g == other.g && (
  27.128 +                    b < other.b || (
  27.129 +                        b == other.b && (
  27.130 +                            a < other.a
  27.131 +                        )
  27.132 +                    )
  27.133 +                )
  27.134 +            )
  27.135 +        )
  27.136 +    );
  27.137 +}
  27.138 +// ------------------------------------------------------------------------------------------------
  27.139 +template <typename TReal>
  27.140 +AI_FORCE_INLINE aiColor4t<TReal> operator + (const aiColor4t<TReal>& v1, const aiColor4t<TReal>& v2)    {
  27.141 +    return aiColor4t<TReal>( v1.r + v2.r, v1.g + v2.g, v1.b + v2.b, v1.a + v2.a);
  27.142 +}
  27.143 +// ------------------------------------------------------------------------------------------------
  27.144 +template <typename TReal>
  27.145 +AI_FORCE_INLINE aiColor4t<TReal> operator - (const aiColor4t<TReal>& v1, const aiColor4t<TReal>& v2)    {
  27.146 +    return aiColor4t<TReal>( v1.r - v2.r, v1.g - v2.g, v1.b - v2.b, v1.a - v2.a);
  27.147 +}
  27.148 +// ------------------------------------------------------------------------------------------------
  27.149 +template <typename TReal>
  27.150 +AI_FORCE_INLINE aiColor4t<TReal> operator * (const aiColor4t<TReal>& v1, const aiColor4t<TReal>& v2)    {
  27.151 +    return aiColor4t<TReal>( v1.r * v2.r, v1.g * v2.g, v1.b * v2.b, v1.a * v2.a);
  27.152 +}
  27.153 +// ------------------------------------------------------------------------------------------------
  27.154 +template <typename TReal>
  27.155 +AI_FORCE_INLINE aiColor4t<TReal> operator / (const aiColor4t<TReal>& v1, const aiColor4t<TReal>& v2)    {
  27.156 +    return aiColor4t<TReal>( v1.r / v2.r, v1.g / v2.g, v1.b / v2.b, v1.a / v2.a);
  27.157 +}
  27.158 +// ------------------------------------------------------------------------------------------------
  27.159 +template <typename TReal>
  27.160 +AI_FORCE_INLINE aiColor4t<TReal> operator * ( TReal f, const aiColor4t<TReal>& v)   {
  27.161 +    return aiColor4t<TReal>( f*v.r, f*v.g, f*v.b, f*v.a);
  27.162 +}
  27.163 +// ------------------------------------------------------------------------------------------------
  27.164 +template <typename TReal>
  27.165 +AI_FORCE_INLINE  aiColor4t<TReal> operator * ( const aiColor4t<TReal>& v, TReal f)  {
  27.166 +    return aiColor4t<TReal>( f*v.r, f*v.g, f*v.b, f*v.a);
  27.167 +}
  27.168 +// ------------------------------------------------------------------------------------------------
  27.169 +template <typename TReal>
  27.170 +AI_FORCE_INLINE  aiColor4t<TReal> operator / ( const aiColor4t<TReal>& v, TReal f)  {
  27.171 +    return v * (1/f);
  27.172 +}
  27.173 +// ------------------------------------------------------------------------------------------------
  27.174 +template <typename TReal>
  27.175 +AI_FORCE_INLINE  aiColor4t<TReal> operator / ( TReal f,const aiColor4t<TReal>& v)   {
  27.176 +    return aiColor4t<TReal>(f,f,f,f)/v;
  27.177 +}
  27.178 +// ------------------------------------------------------------------------------------------------
  27.179 +template <typename TReal>
  27.180 +AI_FORCE_INLINE  aiColor4t<TReal> operator + ( const aiColor4t<TReal>& v, TReal f)  {
  27.181 +    return aiColor4t<TReal>( f+v.r, f+v.g, f+v.b, f+v.a);
  27.182 +}
  27.183 +// ------------------------------------------------------------------------------------------------
  27.184 +template <typename TReal>
  27.185 +AI_FORCE_INLINE  aiColor4t<TReal> operator - ( const aiColor4t<TReal>& v, TReal f)  {
  27.186 +    return aiColor4t<TReal>( v.r-f, v.g-f, v.b-f, v.a-f);
  27.187 +}
  27.188 +// ------------------------------------------------------------------------------------------------
  27.189 +template <typename TReal>
  27.190 +AI_FORCE_INLINE  aiColor4t<TReal> operator + ( TReal f, const aiColor4t<TReal>& v)  {
  27.191 +    return aiColor4t<TReal>( f+v.r, f+v.g, f+v.b, f+v.a);
  27.192 +}
  27.193 +// ------------------------------------------------------------------------------------------------
  27.194 +template <typename TReal>
  27.195 +AI_FORCE_INLINE  aiColor4t<TReal> operator - ( TReal f, const aiColor4t<TReal>& v)  {
  27.196 +    return aiColor4t<TReal>( f-v.r, f-v.g, f-v.b, f-v.a);
  27.197 +}
  27.198 +
  27.199 +// ------------------------------------------------------------------------------------------------
  27.200 +template <typename TReal>
  27.201 +inline bool aiColor4t<TReal> :: IsBlack() const {
  27.202 +    // The alpha component doesn't care here. black is black.
  27.203 +    static const TReal epsilon = 10e-3f;
  27.204 +    return std::fabs( r ) < epsilon && std::fabs( g ) < epsilon && std::fabs( b ) < epsilon;
  27.205 +}
  27.206 +
  27.207 +#endif // __cplusplus
  27.208 +#endif // AI_VECTOR3D_INL_INC
    28.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    28.2 +++ b/include/miniassimp/config.h	Mon Jan 28 18:19:26 2019 +0200
    28.3 @@ -0,0 +1,992 @@
    28.4 +/*
    28.5 +---------------------------------------------------------------------------
    28.6 +Open Asset Import Library (assimp)
    28.7 +---------------------------------------------------------------------------
    28.8 +
    28.9 +Copyright (c) 2006-2018, assimp team
   28.10 +
   28.11 +
   28.12 +All rights reserved.
   28.13 +
   28.14 +Redistribution and use of this software in source and binary forms,
   28.15 +with or without modification, are permitted provided that the following
   28.16 +conditions are met:
   28.17 +
   28.18 +* Redistributions of source code must retain the above
   28.19 +  copyright notice, this list of conditions and the
   28.20 +  following disclaimer.
   28.21 +
   28.22 +* Redistributions in binary form must reproduce the above
   28.23 +  copyright notice, this list of conditions and the
   28.24 +  following disclaimer in the documentation and/or other
   28.25 +  materials provided with the distribution.
   28.26 +
   28.27 +* Neither the name of the assimp team, nor the names of its
   28.28 +  contributors may be used to endorse or promote products
   28.29 +  derived from this software without specific prior
   28.30 +  written permission of the assimp team.
   28.31 +
   28.32 +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   28.33 +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   28.34 +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
   28.35 +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
   28.36 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   28.37 +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   28.38 +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
   28.39 +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
   28.40 +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   28.41 +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   28.42 +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   28.43 +---------------------------------------------------------------------------
   28.44 +*/
   28.45 +
   28.46 +/** @file config.h
   28.47 + *  @brief Defines constants for configurable properties for the library
   28.48 + *
   28.49 + *  Typically these properties are set via
   28.50 + *  #Assimp::Importer::SetPropertyFloat,
   28.51 + *  #Assimp::Importer::SetPropertyInteger or
   28.52 + *  #Assimp::Importer::SetPropertyString,
   28.53 + *  depending on the data type of a property. All properties have a
   28.54 + *  default value. See the doc for the mentioned methods for more details.
   28.55 + *
   28.56 + *  <br><br>
   28.57 + *  The corresponding functions for use with the plain-c API are:
   28.58 + *  #aiSetImportPropertyInteger,
   28.59 + *  #aiSetImportPropertyFloat,
   28.60 + *  #aiSetImportPropertyString
   28.61 + */
   28.62 +#pragma once
   28.63 +#ifndef AI_CONFIG_H_INC
   28.64 +#define AI_CONFIG_H_INC
   28.65 +
   28.66 +
   28.67 +// ###########################################################################
   28.68 +// LIBRARY SETTINGS
   28.69 +// General, global settings
   28.70 +// ###########################################################################
   28.71 +
   28.72 +// ---------------------------------------------------------------------------
   28.73 +/** @brief Enables time measurements.
   28.74 + *
   28.75 + *  If enabled, measures the time needed for each part of the loading
   28.76 + *  process (i.e. IO time, importing, postprocessing, ..) and dumps
   28.77 + *  these timings to the DefaultLogger. See the @link perf Performance
   28.78 + *  Page@endlink for more information on this topic.
   28.79 + *
   28.80 + * Property type: bool. Default value: false.
   28.81 + */
   28.82 +#define AI_CONFIG_GLOB_MEASURE_TIME  \
   28.83 +    "GLOB_MEASURE_TIME"
   28.84 +
   28.85 +
   28.86 +// ---------------------------------------------------------------------------
   28.87 +/** @brief Global setting to disable generation of skeleton dummy meshes
   28.88 + *
   28.89 + * Skeleton dummy meshes are generated as a visualization aid in cases which
   28.90 + * the input data contains no geometry, but only animation data.
   28.91 + * Property data type: bool. Default value: false
   28.92 + */
   28.93 +// ---------------------------------------------------------------------------
   28.94 +#define AI_CONFIG_IMPORT_NO_SKELETON_MESHES \
   28.95 +    "IMPORT_NO_SKELETON_MESHES"
   28.96 +
   28.97 +
   28.98 +
   28.99 +# if 0 // not implemented yet
  28.100 +// ---------------------------------------------------------------------------
  28.101 +/** @brief Set Assimp's multithreading policy.
  28.102 + *
  28.103 + * This setting is ignored if Assimp was built without boost.thread
  28.104 + * support (ASSIMP_BUILD_NO_THREADING, which is implied by ASSIMP_BUILD_BOOST_WORKAROUND).
  28.105 + * Possible values are: -1 to let Assimp decide what to do, 0 to disable
  28.106 + * multithreading entirely and any number larger than 0 to force a specific
  28.107 + * number of threads. Assimp is always free to ignore this settings, which is
  28.108 + * merely a hint. Usually, the default value (-1) will be fine. However, if
  28.109 + * Assimp is used concurrently from multiple user threads, it might be useful
  28.110 + * to limit each Importer instance to a specific number of cores.
  28.111 + *
  28.112 + * For more information, see the @link threading Threading page@endlink.
  28.113 + * Property type: int, default value: -1.
  28.114 + */
  28.115 +#define AI_CONFIG_GLOB_MULTITHREADING  \
  28.116 +    "GLOB_MULTITHREADING"
  28.117 +#endif
  28.118 +
  28.119 +// ###########################################################################
  28.120 +// POST PROCESSING SETTINGS
  28.121 +// Various stuff to fine-tune the behavior of a specific post processing step.
  28.122 +// ###########################################################################
  28.123 +
  28.124 +
  28.125 +// ---------------------------------------------------------------------------
  28.126 +/** @brief Maximum bone count per mesh for the SplitbyBoneCount step.
  28.127 + *
  28.128 + * Meshes are split until the maximum number of bones is reached. The default
  28.129 + * value is AI_SBBC_DEFAULT_MAX_BONES, which may be altered at
  28.130 + * compile-time.
  28.131 + * Property data type: integer.
  28.132 + */
  28.133 +// ---------------------------------------------------------------------------
  28.134 +#define AI_CONFIG_PP_SBBC_MAX_BONES \
  28.135 +    "PP_SBBC_MAX_BONES"
  28.136 +
  28.137 +
  28.138 +// default limit for bone count
  28.139 +#if (!defined AI_SBBC_DEFAULT_MAX_BONES)
  28.140 +#   define AI_SBBC_DEFAULT_MAX_BONES        60
  28.141 +#endif
  28.142 +
  28.143 +
  28.144 +// ---------------------------------------------------------------------------
  28.145 +/** @brief  Specifies the maximum angle that may be between two vertex tangents
  28.146 + *         that their tangents and bi-tangents are smoothed.
  28.147 + *
  28.148 + * This applies to the CalcTangentSpace-Step. The angle is specified
  28.149 + * in degrees. The maximum value is 175.
  28.150 + * Property type: float. Default value: 45 degrees
  28.151 + */
  28.152 +#define AI_CONFIG_PP_CT_MAX_SMOOTHING_ANGLE \
  28.153 +    "PP_CT_MAX_SMOOTHING_ANGLE"
  28.154 +
  28.155 +// ---------------------------------------------------------------------------
  28.156 +/** @brief Source UV channel for tangent space computation.
  28.157 + *
  28.158 + * The specified channel must exist or an error will be raised.
  28.159 + * Property type: integer. Default value: 0
  28.160 + */
  28.161 +// ---------------------------------------------------------------------------
  28.162 +#define AI_CONFIG_PP_CT_TEXTURE_CHANNEL_INDEX \
  28.163 +    "PP_CT_TEXTURE_CHANNEL_INDEX"
  28.164 +
  28.165 +// ---------------------------------------------------------------------------
  28.166 +/** @brief  Specifies the maximum angle that may be between two face normals
  28.167 + *          at the same vertex position that their are smoothed together.
  28.168 + *
  28.169 + * Sometimes referred to as 'crease angle'.
  28.170 + * This applies to the GenSmoothNormals-Step. The angle is specified
  28.171 + * in degrees, so 180 is PI. The default value is 175 degrees (all vertex
  28.172 + * normals are smoothed). The maximum value is 175, too. Property type: float.
  28.173 + * Warning: setting this option may cause a severe loss of performance. The
  28.174 + * performance is unaffected if the #AI_CONFIG_FAVOUR_SPEED flag is set but
  28.175 + * the output quality may be reduced.
  28.176 + */
  28.177 +#define AI_CONFIG_PP_GSN_MAX_SMOOTHING_ANGLE \
  28.178 +    "PP_GSN_MAX_SMOOTHING_ANGLE"
  28.179 +
  28.180 +
  28.181 +// ---------------------------------------------------------------------------
  28.182 +/** @brief Sets the colormap (= palette) to be used to decode embedded
  28.183 + *         textures in MDL (Quake or 3DGS) files.
  28.184 + *
  28.185 + * This must be a valid path to a file. The file is 768 (256*3) bytes
  28.186 + * large and contains RGB triplets for each of the 256 palette entries.
  28.187 + * The default value is colormap.lmp. If the file is not found,
  28.188 + * a default palette (from Quake 1) is used.
  28.189 + * Property type: string.
  28.190 + */
  28.191 +#define AI_CONFIG_IMPORT_MDL_COLORMAP       \
  28.192 +    "IMPORT_MDL_COLORMAP"
  28.193 +
  28.194 +// ---------------------------------------------------------------------------
  28.195 +/** @brief Configures the #aiProcess_RemoveRedundantMaterials step to
  28.196 + *  keep materials matching a name in a given list.
  28.197 + *
  28.198 + * This is a list of 1 to n strings, ' ' serves as delimiter character.
  28.199 + * Identifiers containing whitespaces must be enclosed in *single*
  28.200 + * quotation marks. For example:<tt>
  28.201 + * "keep-me and_me_to anotherMaterialToBeKept \'name with whitespace\'"</tt>.
  28.202 + * If a material matches on of these names, it will not be modified or
  28.203 + * removed by the postprocessing step nor will other materials be replaced
  28.204 + * by a reference to it. <br>
  28.205 + * This option might be useful if you are using some magic material names
  28.206 + * to pass additional semantics through the content pipeline. This ensures
  28.207 + * they won't be optimized away, but a general optimization is still
  28.208 + * performed for materials not contained in the list.
  28.209 + * Property type: String. Default value: n/a
  28.210 + * @note Linefeeds, tabs or carriage returns are treated as whitespace.
  28.211 + *   Material names are case sensitive.
  28.212 + */
  28.213 +#define AI_CONFIG_PP_RRM_EXCLUDE_LIST   \
  28.214 +    "PP_RRM_EXCLUDE_LIST"
  28.215 +
  28.216 +// ---------------------------------------------------------------------------
  28.217 +/** @brief Configures the #aiProcess_PreTransformVertices step to
  28.218 + *  keep the scene hierarchy. Meshes are moved to worldspace, but
  28.219 + *  no optimization is performed (read: meshes with equal materials are not
  28.220 + *  joined. The total number of meshes won't change).
  28.221 + *
  28.222 + * This option could be of use for you if the scene hierarchy contains
  28.223 + * important additional information which you intend to parse.
  28.224 + * For rendering, you can still render all meshes in the scene without
  28.225 + * any transformations.
  28.226 + * Property type: bool. Default value: false.
  28.227 + */
  28.228 +#define AI_CONFIG_PP_PTV_KEEP_HIERARCHY     \
  28.229 +    "PP_PTV_KEEP_HIERARCHY"
  28.230 +
  28.231 +// ---------------------------------------------------------------------------
  28.232 +/** @brief Configures the #aiProcess_PreTransformVertices step to normalize
  28.233 + *  all vertex components into the [-1,1] range. That is, a bounding box
  28.234 + *  for the whole scene is computed, the maximum component is taken and all
  28.235 + *  meshes are scaled appropriately (uniformly of course!).
  28.236 + *  This might be useful if you don't know the spatial dimension of the input
  28.237 + *  data*/
  28.238 +#define AI_CONFIG_PP_PTV_NORMALIZE  \
  28.239 +    "PP_PTV_NORMALIZE"
  28.240 +
  28.241 +// ---------------------------------------------------------------------------
  28.242 +/** @brief Configures the #aiProcess_PreTransformVertices step to use
  28.243 + *  a users defined matrix as the scene root node transformation before
  28.244 + *  transforming vertices.
  28.245 + *  Property type: bool. Default value: false.
  28.246 + */
  28.247 +#define AI_CONFIG_PP_PTV_ADD_ROOT_TRANSFORMATION    \
  28.248 +    "PP_PTV_ADD_ROOT_TRANSFORMATION"
  28.249 +
  28.250 +// ---------------------------------------------------------------------------
  28.251 +/** @brief Configures the #aiProcess_PreTransformVertices step to use
  28.252 + *  a users defined matrix as the scene root node transformation before
  28.253 + *  transforming vertices. This property correspond to the 'a1' component
  28.254 + *  of the transformation matrix.
  28.255 + *  Property type: aiMatrix4x4.
  28.256 + */
  28.257 +#define AI_CONFIG_PP_PTV_ROOT_TRANSFORMATION    \
  28.258 +    "PP_PTV_ROOT_TRANSFORMATION"
  28.259 +
  28.260 +// ---------------------------------------------------------------------------
  28.261 +/** @brief Configures the #aiProcess_FindDegenerates step to
  28.262 + *  remove degenerated primitives from the import - immediately.
  28.263 + *
  28.264 + * The default behaviour converts degenerated triangles to lines and
  28.265 + * degenerated lines to points. See the documentation to the
  28.266 + * #aiProcess_FindDegenerates step for a detailed example of the various ways
  28.267 + * to get rid of these lines and points if you don't want them.
  28.268 + * Property type: bool. Default value: false.
  28.269 + */
  28.270 +#define AI_CONFIG_PP_FD_REMOVE \
  28.271 +    "PP_FD_REMOVE"
  28.272 +
  28.273 +// ---------------------------------------------------------------------------
  28.274 +/**
  28.275 + *  @brief  Configures the #aiProcess_FindDegenerates to check the area of a
  28.276 + *  trinagle to be greates than e-6. If this is not the case the triangle will
  28.277 + *  be removed if #AI_CONFIG_PP_FD_REMOVE is set to true.
  28.278 + */
  28.279 +#define AI_CONFIG_PP_FD_CHECKAREA \
  28.280 +    "PP_FD_CHECKAREA"
  28.281 +
  28.282 +// ---------------------------------------------------------------------------
  28.283 +/** @brief Configures the #aiProcess_OptimizeGraph step to preserve nodes
  28.284 + * matching a name in a given list.
  28.285 + *
  28.286 + * This is a list of 1 to n strings, ' ' serves as delimiter character.
  28.287 + * Identifiers containing whitespaces must be enclosed in *single*
  28.288 + * quotation marks. For example:<tt>
  28.289 + * "keep-me and_me_to anotherNodeToBeKept \'name with whitespace\'"</tt>.
  28.290 + * If a node matches on of these names, it will not be modified or
  28.291 + * removed by the postprocessing step.<br>
  28.292 + * This option might be useful if you are using some magic node names
  28.293 + * to pass additional semantics through the content pipeline. This ensures
  28.294 + * they won't be optimized away, but a general optimization is still
  28.295 + * performed for nodes not contained in the list.
  28.296 + * Property type: String. Default value: n/a
  28.297 + * @note Linefeeds, tabs or carriage returns are treated as whitespace.
  28.298 + *   Node names are case sensitive.
  28.299 + */
  28.300 +#define AI_CONFIG_PP_OG_EXCLUDE_LIST    \
  28.301 +    "PP_OG_EXCLUDE_LIST"
  28.302 +
  28.303 +// ---------------------------------------------------------------------------
  28.304 +/** @brief  Set the maximum number of triangles in a mesh.
  28.305 + *
  28.306 + * This is used by the "SplitLargeMeshes" PostProcess-Step to determine
  28.307 + * whether a mesh must be split or not.
  28.308 + * @note The default value is AI_SLM_DEFAULT_MAX_TRIANGLES
  28.309 + * Property type: integer.
  28.310 + */
  28.311 +#define AI_CONFIG_PP_SLM_TRIANGLE_LIMIT \
  28.312 +    "PP_SLM_TRIANGLE_LIMIT"
  28.313 +
  28.314 +// default value for AI_CONFIG_PP_SLM_TRIANGLE_LIMIT
  28.315 +#if (!defined AI_SLM_DEFAULT_MAX_TRIANGLES)
  28.316 +#   define AI_SLM_DEFAULT_MAX_TRIANGLES     1000000
  28.317 +#endif
  28.318 +
  28.319 +// ---------------------------------------------------------------------------
  28.320 +/** @brief  Set the maximum number of vertices in a mesh.
  28.321 + *
  28.322 + * This is used by the "SplitLargeMeshes" PostProcess-Step to determine
  28.323 + * whether a mesh must be split or not.
  28.324 + * @note The default value is AI_SLM_DEFAULT_MAX_VERTICES
  28.325 + * Property type: integer.
  28.326 + */
  28.327 +#define AI_CONFIG_PP_SLM_VERTEX_LIMIT \
  28.328 +    "PP_SLM_VERTEX_LIMIT"
  28.329 +
  28.330 +// default value for AI_CONFIG_PP_SLM_VERTEX_LIMIT
  28.331 +#if (!defined AI_SLM_DEFAULT_MAX_VERTICES)
  28.332 +#   define AI_SLM_DEFAULT_MAX_VERTICES      1000000
  28.333 +#endif
  28.334 +
  28.335 +// ---------------------------------------------------------------------------
  28.336 +/** @brief Set the maximum number of bones affecting a single vertex
  28.337 + *
  28.338 + * This is used by the #aiProcess_LimitBoneWeights PostProcess-Step.
  28.339 + * @note The default value is AI_LMW_MAX_WEIGHTS
  28.340 + * Property type: integer.*/
  28.341 +#define AI_CONFIG_PP_LBW_MAX_WEIGHTS    \
  28.342 +    "PP_LBW_MAX_WEIGHTS"
  28.343 +
  28.344 +// default value for AI_CONFIG_PP_LBW_MAX_WEIGHTS
  28.345 +#if (!defined AI_LMW_MAX_WEIGHTS)
  28.346 +#   define AI_LMW_MAX_WEIGHTS   0x4
  28.347 +#endif // !! AI_LMW_MAX_WEIGHTS
  28.348 +
  28.349 +// ---------------------------------------------------------------------------
  28.350 +/** @brief Lower the deboning threshold in order to remove more bones.
  28.351 + *
  28.352 + * This is used by the #aiProcess_Debone PostProcess-Step.
  28.353 + * @note The default value is AI_DEBONE_THRESHOLD
  28.354 + * Property type: float.*/
  28.355 +#define AI_CONFIG_PP_DB_THRESHOLD \
  28.356 +    "PP_DB_THRESHOLD"
  28.357 +
  28.358 +// default value for AI_CONFIG_PP_LBW_MAX_WEIGHTS
  28.359 +#if (!defined AI_DEBONE_THRESHOLD)
  28.360 +#   define AI_DEBONE_THRESHOLD  1.0f
  28.361 +#endif // !! AI_DEBONE_THRESHOLD
  28.362 +
  28.363 +// ---------------------------------------------------------------------------
  28.364 +/** @brief Require all bones qualify for deboning before removing any
  28.365 + *
  28.366 + * This is used by the #aiProcess_Debone PostProcess-Step.
  28.367 + * @note The default value is 0
  28.368 + * Property type: bool.*/
  28.369 +#define AI_CONFIG_PP_DB_ALL_OR_NONE \
  28.370 +    "PP_DB_ALL_OR_NONE"
  28.371 +
  28.372 +/** @brief Default value for the #AI_CONFIG_PP_ICL_PTCACHE_SIZE property
  28.373 + */
  28.374 +#ifndef PP_ICL_PTCACHE_SIZE
  28.375 +#   define PP_ICL_PTCACHE_SIZE 12
  28.376 +#endif
  28.377 +
  28.378 +// ---------------------------------------------------------------------------
  28.379 +/** @brief Set the size of the post-transform vertex cache to optimize the
  28.380 + *    vertices for. This configures the #aiProcess_ImproveCacheLocality step.
  28.381 + *
  28.382 + * The size is given in vertices. Of course you can't know how the vertex
  28.383 + * format will exactly look like after the import returns, but you can still
  28.384 + * guess what your meshes will probably have.
  28.385 + * @note The default value is #PP_ICL_PTCACHE_SIZE. That results in slight
  28.386 + * performance improvements for most nVidia/AMD cards since 2002.
  28.387 + * Property type: integer.
  28.388 + */
  28.389 +#define AI_CONFIG_PP_ICL_PTCACHE_SIZE   "PP_ICL_PTCACHE_SIZE"
  28.390 +
  28.391 +// ---------------------------------------------------------------------------
  28.392 +/** @brief Enumerates components of the aiScene and aiMesh data structures
  28.393 + *  that can be excluded from the import using the #aiProcess_RemoveComponent step.
  28.394 + *
  28.395 + *  See the documentation to #aiProcess_RemoveComponent for more details.
  28.396 + */
  28.397 +enum aiComponent
  28.398 +{
  28.399 +    /** Normal vectors */
  28.400 +#ifdef SWIG
  28.401 +    aiComponent_NORMALS = 0x2,
  28.402 +#else
  28.403 +    aiComponent_NORMALS = 0x2u,
  28.404 +#endif
  28.405 +
  28.406 +    /** Tangents and bitangents go always together ... */
  28.407 +#ifdef SWIG
  28.408 +    aiComponent_TANGENTS_AND_BITANGENTS = 0x4,
  28.409 +#else
  28.410 +    aiComponent_TANGENTS_AND_BITANGENTS = 0x4u,
  28.411 +#endif
  28.412 +
  28.413 +    /** ALL color sets
  28.414 +     * Use aiComponent_COLORn(N) to specify the N'th set */
  28.415 +    aiComponent_COLORS = 0x8,
  28.416 +
  28.417 +    /** ALL texture UV sets
  28.418 +     * aiComponent_TEXCOORDn(N) to specify the N'th set  */
  28.419 +    aiComponent_TEXCOORDS = 0x10,
  28.420 +
  28.421 +    /** Removes all bone weights from all meshes.
  28.422 +     * The scenegraph nodes corresponding to the bones are NOT removed.
  28.423 +     * use the #aiProcess_OptimizeGraph step to do this */
  28.424 +    aiComponent_BONEWEIGHTS = 0x20,
  28.425 +
  28.426 +    /** Removes all node animations (aiScene::mAnimations).
  28.427 +     * The corresponding scenegraph nodes are NOT removed.
  28.428 +     * use the #aiProcess_OptimizeGraph step to do this */
  28.429 +    aiComponent_ANIMATIONS = 0x40,
  28.430 +
  28.431 +    /** Removes all embedded textures (aiScene::mTextures) */
  28.432 +    aiComponent_TEXTURES = 0x80,
  28.433 +
  28.434 +    /** Removes all light sources (aiScene::mLights).
  28.435 +     * The corresponding scenegraph nodes are NOT removed.
  28.436 +     * use the #aiProcess_OptimizeGraph step to do this */
  28.437 +    aiComponent_LIGHTS = 0x100,
  28.438 +
  28.439 +    /** Removes all cameras (aiScene::mCameras).
  28.440 +     * The corresponding scenegraph nodes are NOT removed.
  28.441 +     * use the #aiProcess_OptimizeGraph step to do this */
  28.442 +    aiComponent_CAMERAS = 0x200,
  28.443 +
  28.444 +    /** Removes all meshes (aiScene::mMeshes). */
  28.445 +    aiComponent_MESHES = 0x400,
  28.446 +
  28.447 +    /** Removes all materials. One default material will
  28.448 +     * be generated, so aiScene::mNumMaterials will be 1. */
  28.449 +    aiComponent_MATERIALS = 0x800,
  28.450 +
  28.451 +
  28.452 +    /** This value is not used. It is just there to force the
  28.453 +     *  compiler to map this enum to a 32 Bit integer. */
  28.454 +#ifndef SWIG
  28.455 +    _aiComponent_Force32Bit = 0x9fffffff
  28.456 +#endif
  28.457 +};
  28.458 +
  28.459 +// Remove a specific color channel 'n'
  28.460 +#define aiComponent_COLORSn(n) (1u << (n+20u))
  28.461 +
  28.462 +// Remove a specific UV channel 'n'
  28.463 +#define aiComponent_TEXCOORDSn(n) (1u << (n+25u))
  28.464 +
  28.465 +// ---------------------------------------------------------------------------
  28.466 +/** @brief Input parameter to the #aiProcess_RemoveComponent step:
  28.467 + *  Specifies the parts of the data structure to be removed.
  28.468 + *
  28.469 + * See the documentation to this step for further details. The property
  28.470 + * is expected to be an integer, a bitwise combination of the
  28.471 + * #aiComponent flags defined above in this header. The default
  28.472 + * value is 0. Important: if no valid mesh is remaining after the
  28.473 + * step has been executed (e.g you thought it was funny to specify ALL
  28.474 + * of the flags defined above) the import FAILS. Mainly because there is
  28.475 + * no data to work on anymore ...
  28.476 + */
  28.477 +#define AI_CONFIG_PP_RVC_FLAGS              \
  28.478 +    "PP_RVC_FLAGS"
  28.479 +
  28.480 +// ---------------------------------------------------------------------------
  28.481 +/** @brief Input parameter to the #aiProcess_SortByPType step:
  28.482 + *  Specifies which primitive types are removed by the step.
  28.483 + *
  28.484 + *  This is a bitwise combination of the aiPrimitiveType flags.
  28.485 + *  Specifying all of them is illegal, of course. A typical use would
  28.486 + *  be to exclude all line and point meshes from the import. This
  28.487 + *  is an integer property, its default value is 0.
  28.488 + */
  28.489 +#define AI_CONFIG_PP_SBP_REMOVE             \
  28.490 +    "PP_SBP_REMOVE"
  28.491 +
  28.492 +// ---------------------------------------------------------------------------
  28.493 +/** @brief Input parameter to the #aiProcess_FindInvalidData step:
  28.494 + *  Specifies the floating-point accuracy for animation values. The step
  28.495 + *  checks for animation tracks where all frame values are absolutely equal
  28.496 + *  and removes them. This tweakable controls the epsilon for floating-point
  28.497 + *  comparisons - two keys are considered equal if the invariant
  28.498 + *  abs(n0-n1)>epsilon holds true for all vector respectively quaternion
  28.499 + *  components. The default value is 0.f - comparisons are exact then.
  28.500 + */
  28.501 +#define AI_CONFIG_PP_FID_ANIM_ACCURACY              \
  28.502 +    "PP_FID_ANIM_ACCURACY"
  28.503 +
  28.504 +// ---------------------------------------------------------------------------
  28.505 +/** @brief Input parameter to the #aiProcess_FindInvalidData step:
  28.506 + *  Set to true to ignore texture coordinates. This may be useful if you have
  28.507 + *  to assign different kind of textures like one for the summer or one for the winter.
  28.508 + */
  28.509 +#define AI_CONFIG_PP_FID_IGNORE_TEXTURECOORDS        \
  28.510 +    "PP_FID_IGNORE_TEXTURECOORDS"
  28.511 +
  28.512 +// TransformUVCoords evaluates UV scalings
  28.513 +#define AI_UVTRAFO_SCALING 0x1
  28.514 +
  28.515 +// TransformUVCoords evaluates UV rotations
  28.516 +#define AI_UVTRAFO_ROTATION 0x2
  28.517 +
  28.518 +// TransformUVCoords evaluates UV translation
  28.519 +#define AI_UVTRAFO_TRANSLATION 0x4
  28.520 +
  28.521 +// Everything baked together -> default value
  28.522 +#define AI_UVTRAFO_ALL (AI_UVTRAFO_SCALING | AI_UVTRAFO_ROTATION | AI_UVTRAFO_TRANSLATION)
  28.523 +
  28.524 +// ---------------------------------------------------------------------------
  28.525 +/** @brief Input parameter to the #aiProcess_TransformUVCoords step:
  28.526 + *  Specifies which UV transformations are evaluated.
  28.527 + *
  28.528 + *  This is a bitwise combination of the AI_UVTRAFO_XXX flags (integer
  28.529 + *  property, of course). By default all transformations are enabled
  28.530 + * (AI_UVTRAFO_ALL).
  28.531 + */
  28.532 +#define AI_CONFIG_PP_TUV_EVALUATE               \
  28.533 +    "PP_TUV_EVALUATE"
  28.534 +
  28.535 +// ---------------------------------------------------------------------------
  28.536 +/** @brief A hint to assimp to favour speed against import quality.
  28.537 + *
  28.538 + * Enabling this option may result in faster loading, but it needn't.
  28.539 + * It represents just a hint to loaders and post-processing steps to use
  28.540 + * faster code paths, if possible.
  28.541 + * This property is expected to be an integer, != 0 stands for true.
  28.542 + * The default value is 0.
  28.543 + */
  28.544 +#define AI_CONFIG_FAVOUR_SPEED              \
  28.545 + "FAVOUR_SPEED"
  28.546 +
  28.547 +
  28.548 +// ###########################################################################
  28.549 +// IMPORTER SETTINGS
  28.550 +// Various stuff to fine-tune the behaviour of specific importer plugins.
  28.551 +// ###########################################################################
  28.552 +
  28.553 +
  28.554 +// ---------------------------------------------------------------------------
  28.555 +/** @brief Set whether the fbx importer will merge all geometry layers present
  28.556 + *    in the source file or take only the first.
  28.557 + *
  28.558 + * The default value is true (1)
  28.559 + * Property type: bool
  28.560 + */
  28.561 +#define AI_CONFIG_IMPORT_FBX_READ_ALL_GEOMETRY_LAYERS \
  28.562 +    "IMPORT_FBX_READ_ALL_GEOMETRY_LAYERS"
  28.563 +
  28.564 +// ---------------------------------------------------------------------------
  28.565 +/** @brief Set whether the fbx importer will read all materials present in the
  28.566 + *    source file or take only the referenced materials.
  28.567 + *
  28.568 + * This is void unless IMPORT_FBX_READ_MATERIALS=1.
  28.569 + *
  28.570 + * The default value is false (0)
  28.571 + * Property type: bool
  28.572 + */
  28.573 +#define AI_CONFIG_IMPORT_FBX_READ_ALL_MATERIALS \
  28.574 +    "IMPORT_FBX_READ_ALL_MATERIALS"
  28.575 +
  28.576 +// ---------------------------------------------------------------------------
  28.577 +/** @brief Set whether the fbx importer will read materials.
  28.578 + *
  28.579 + * The default value is true (1)
  28.580 + * Property type: bool
  28.581 + */
  28.582 +#define AI_CONFIG_IMPORT_FBX_READ_MATERIALS \
  28.583 +    "IMPORT_FBX_READ_MATERIALS"
  28.584 +
  28.585 +// ---------------------------------------------------------------------------
  28.586 +/** @brief Set whether the fbx importer will read embedded textures.
  28.587 + *
  28.588 + * The default value is true (1)
  28.589 + * Property type: bool
  28.590 + */
  28.591 +#define AI_CONFIG_IMPORT_FBX_READ_TEXTURES \
  28.592 +    "IMPORT_FBX_READ_TEXTURES"
  28.593 +
  28.594 +// ---------------------------------------------------------------------------
  28.595 +/** @brief Set whether the fbx importer will read cameras.
  28.596 + *
  28.597 + * The default value is true (1)
  28.598 + * Property type: bool
  28.599 + */
  28.600 +#define AI_CONFIG_IMPORT_FBX_READ_CAMERAS \
  28.601 +    "IMPORT_FBX_READ_CAMERAS"
  28.602 +
  28.603 +// ---------------------------------------------------------------------------
  28.604 +/** @brief Set whether the fbx importer will read light sources.
  28.605 + *
  28.606 + * The default value is true (1)
  28.607 + * Property type: bool
  28.608 + */
  28.609 +#define AI_CONFIG_IMPORT_FBX_READ_LIGHTS \
  28.610 +    "IMPORT_FBX_READ_LIGHTS"
  28.611 +
  28.612 +// ---------------------------------------------------------------------------
  28.613 +/** @brief Set whether the fbx importer will read animations.
  28.614 + *
  28.615 + * The default value is true (1)
  28.616 + * Property type: bool
  28.617 + */
  28.618 +#define AI_CONFIG_IMPORT_FBX_READ_ANIMATIONS \
  28.619 +    "IMPORT_FBX_READ_ANIMATIONS"
  28.620 +
  28.621 +// ---------------------------------------------------------------------------
  28.622 +/** @brief Set whether the fbx importer will act in strict mode in which only
  28.623 + *    FBX 2013 is supported and any other sub formats are rejected. FBX 2013
  28.624 + *    is the primary target for the importer, so this format is best
  28.625 + *    supported and well-tested.
  28.626 + *
  28.627 + * The default value is false (0)
  28.628 + * Property type: bool
  28.629 + */
  28.630 +#define AI_CONFIG_IMPORT_FBX_STRICT_MODE \
  28.631 +    "IMPORT_FBX_STRICT_MODE"
  28.632 +
  28.633 +// ---------------------------------------------------------------------------
  28.634 +/** @brief Set whether the fbx importer will preserve pivot points for
  28.635 + *    transformations (as extra nodes). If set to false, pivots and offsets
  28.636 + *    will be evaluated whenever possible.
  28.637 + *
  28.638 + * The default value is true (1)
  28.639 + * Property type: bool
  28.640 + */
  28.641 +#define AI_CONFIG_IMPORT_FBX_PRESERVE_PIVOTS \
  28.642 +    "IMPORT_FBX_PRESERVE_PIVOTS"
  28.643 +
  28.644 +// ---------------------------------------------------------------------------
  28.645 +/** @brief Specifies whether the importer will drop empty animation curves or
  28.646 + *    animation curves which match the bind pose transformation over their
  28.647 + *    entire defined range.
  28.648 + *
  28.649 + * The default value is true (1)
  28.650 + * Property type: bool
  28.651 + */
  28.652 +#define AI_CONFIG_IMPORT_FBX_OPTIMIZE_EMPTY_ANIMATION_CURVES \
  28.653 +    "IMPORT_FBX_OPTIMIZE_EMPTY_ANIMATION_CURVES"
  28.654 +
  28.655 +// ---------------------------------------------------------------------------
  28.656 +/** @brief Set whether the fbx importer will use the legacy embedded texture naming.
  28.657 +*
  28.658 +* The default value is false (0)
  28.659 +* Property type: bool
  28.660 +*/
  28.661 +#define AI_CONFIG_IMPORT_FBX_EMBEDDED_TEXTURES_LEGACY_NAMING \
  28.662 +	"AI_CONFIG_IMPORT_FBX_EMBEDDED_TEXTURES_LEGACY_NAMING"
  28.663 +	
  28.664 +// ---------------------------------------------------------------------------
  28.665 +/** @brief  Set the vertex animation keyframe to be imported
  28.666 + *
  28.667 + * ASSIMP does not support vertex keyframes (only bone animation is supported).
  28.668 + * The library reads only one frame of models with vertex animations.
  28.669 + * By default this is the first frame.
  28.670 + * \note The default value is 0. This option applies to all importers.
  28.671 + *   However, it is also possible to override the global setting
  28.672 + *   for a specific loader. You can use the AI_CONFIG_IMPORT_XXX_KEYFRAME
  28.673 + *   options (where XXX is a placeholder for the file format for which you
  28.674 + *   want to override the global setting).
  28.675 + * Property type: integer.
  28.676 + */
  28.677 +#define AI_CONFIG_IMPORT_GLOBAL_KEYFRAME    "IMPORT_GLOBAL_KEYFRAME"
  28.678 +
  28.679 +#define AI_CONFIG_IMPORT_MD3_KEYFRAME       "IMPORT_MD3_KEYFRAME"
  28.680 +#define AI_CONFIG_IMPORT_MD2_KEYFRAME       "IMPORT_MD2_KEYFRAME"
  28.681 +#define AI_CONFIG_IMPORT_MDL_KEYFRAME       "IMPORT_MDL_KEYFRAME"
  28.682 +#define AI_CONFIG_IMPORT_MDC_KEYFRAME       "IMPORT_MDC_KEYFRAME"
  28.683 +#define AI_CONFIG_IMPORT_SMD_KEYFRAME       "IMPORT_SMD_KEYFRAME"
  28.684 +#define AI_CONFIG_IMPORT_UNREAL_KEYFRAME    "IMPORT_UNREAL_KEYFRAME"
  28.685 +
  28.686 +// ---------------------------------------------------------------------------
  28.687 +/** Smd load multiple animations
  28.688 + *
  28.689 + *  Property type: bool. Default value: true.
  28.690 + */
  28.691 +#define AI_CONFIG_IMPORT_SMD_LOAD_ANIMATION_LIST "IMPORT_SMD_LOAD_ANIMATION_LIST"
  28.692 +
  28.693 +// ---------------------------------------------------------------------------
  28.694 +/** @brief  Configures the AC loader to collect all surfaces which have the
  28.695 + *    "Backface cull" flag set in separate meshes.
  28.696 + *
  28.697 + *  Property type: bool. Default value: true.
  28.698 + */
  28.699 +#define AI_CONFIG_IMPORT_AC_SEPARATE_BFCULL \
  28.700 +    "IMPORT_AC_SEPARATE_BFCULL"
  28.701 +
  28.702 +// ---------------------------------------------------------------------------
  28.703 +/** @brief  Configures whether the AC loader evaluates subdivision surfaces (
  28.704 + *  indicated by the presence of the 'subdiv' attribute in the file). By
  28.705 + *  default, Assimp performs the subdivision using the standard
  28.706 + *  Catmull-Clark algorithm
  28.707 + *
  28.708 + * * Property type: bool. Default value: true.
  28.709 + */
  28.710 +#define AI_CONFIG_IMPORT_AC_EVAL_SUBDIVISION    \
  28.711 +    "IMPORT_AC_EVAL_SUBDIVISION"
  28.712 +
  28.713 +// ---------------------------------------------------------------------------
  28.714 +/** @brief  Configures the UNREAL 3D loader to separate faces with different
  28.715 + *    surface flags (e.g. two-sided vs. single-sided).
  28.716 + *
  28.717 + * * Property type: bool. Default value: true.
  28.718 + */
  28.719 +#define AI_CONFIG_IMPORT_UNREAL_HANDLE_FLAGS \
  28.720 +    "UNREAL_HANDLE_FLAGS"
  28.721 +
  28.722 +// ---------------------------------------------------------------------------
  28.723 +/** @brief Configures the terragen import plugin to compute uv's for
  28.724 + *  terrains, if not given. Furthermore a default texture is assigned.
  28.725 + *
  28.726 + * UV coordinates for terrains are so simple to compute that you'll usually
  28.727 + * want to compute them on your own, if you need them. This option is intended
  28.728 + * for model viewers which want to offer an easy way to apply textures to
  28.729 + * terrains.
  28.730 + * * Property type: bool. Default value: false.
  28.731 + */
  28.732 +#define AI_CONFIG_IMPORT_TER_MAKE_UVS \
  28.733 +    "IMPORT_TER_MAKE_UVS"
  28.734 +
  28.735 +// ---------------------------------------------------------------------------
  28.736 +/** @brief  Configures the ASE loader to always reconstruct normal vectors
  28.737 + *  basing on the smoothing groups loaded from the file.
  28.738 + *
  28.739 + * Some ASE files have carry invalid normals, other don't.
  28.740 + * * Property type: bool. Default value: true.
  28.741 + */
  28.742 +#define AI_CONFIG_IMPORT_ASE_RECONSTRUCT_NORMALS    \
  28.743 +    "IMPORT_ASE_RECONSTRUCT_NORMALS"
  28.744 +
  28.745 +// ---------------------------------------------------------------------------
  28.746 +/** @brief  Configures the M3D loader to detect and process multi-part
  28.747 + *    Quake player models.
  28.748 + *
  28.749 + * These models usually consist of 3 files, lower.md3, upper.md3 and
  28.750 + * head.md3. If this property is set to true, Assimp will try to load and
  28.751 + * combine all three files if one of them is loaded.
  28.752 + * Property type: bool. Default value: true.
  28.753 + */
  28.754 +#define AI_CONFIG_IMPORT_MD3_HANDLE_MULTIPART \
  28.755 +    "IMPORT_MD3_HANDLE_MULTIPART"
  28.756 +
  28.757 +// ---------------------------------------------------------------------------
  28.758 +/** @brief  Tells the MD3 loader which skin files to load.
  28.759 + *
  28.760 + * When loading MD3 files, Assimp checks whether a file
  28.761 + * [md3_file_name]_[skin_name].skin is existing. These files are used by
  28.762 + * Quake III to be able to assign different skins (e.g. red and blue team)
  28.763 + * to models. 'default', 'red', 'blue' are typical skin names.
  28.764 + * Property type: String. Default value: "default".
  28.765 + */
  28.766 +#define AI_CONFIG_IMPORT_MD3_SKIN_NAME \
  28.767 +    "IMPORT_MD3_SKIN_NAME"
  28.768 +
  28.769 +// ---------------------------------------------------------------------------
  28.770 +/** @brief  Specify the Quake 3 shader file to be used for a particular
  28.771 + *  MD3 file. This can also be a search path.
  28.772 + *
  28.773 + * By default Assimp's behaviour is as follows: If a MD3 file
  28.774 + * <tt>any_path/models/any_q3_subdir/model_name/file_name.md3</tt> is
  28.775 + * loaded, the library tries to locate the corresponding shader file in
  28.776 + * <tt>any_path/scripts/model_name.shader</tt>. This property overrides this
  28.777 + * behaviour. It can either specify a full path to the shader to be loaded
  28.778 + * or alternatively the path (relative or absolute) to the directory where
  28.779 + * the shaders for all MD3s to be loaded reside. Assimp attempts to open
  28.780 + * <tt>IMPORT_MD3_SHADER_SRC/model_name.shader</tt> first, <tt>IMPORT_MD3_SHADER_SRC/file_name.shader</tt>
  28.781 + * is the fallback file. Note that IMPORT_MD3_SHADER_SRC should have a terminal (back)slash.
  28.782 + * Property type: String. Default value: n/a.
  28.783 + */
  28.784 +#define AI_CONFIG_IMPORT_MD3_SHADER_SRC \
  28.785 +    "IMPORT_MD3_SHADER_SRC"
  28.786 +
  28.787 +// ---------------------------------------------------------------------------
  28.788 +/** @brief  Configures the LWO loader to load just one layer from the model.
  28.789 + *
  28.790 + * LWO files consist of layers and in some cases it could be useful to load
  28.791 + * only one of them. This property can be either a string - which specifies
  28.792 + * the name of the layer - or an integer - the index of the layer. If the
  28.793 + * property is not set the whole LWO model is loaded. Loading fails if the
  28.794 + * requested layer is not available. The layer index is zero-based and the
  28.795 + * layer name may not be empty.<br>
  28.796 + * Property type: Integer. Default value: all layers are loaded.
  28.797 + */
  28.798 +#define AI_CONFIG_IMPORT_LWO_ONE_LAYER_ONLY         \
  28.799 +    "IMPORT_LWO_ONE_LAYER_ONLY"
  28.800 +
  28.801 +// ---------------------------------------------------------------------------
  28.802 +/** @brief  Configures the MD5 loader to not load the MD5ANIM file for
  28.803 + *  a MD5MESH file automatically.
  28.804 + *
  28.805 + * The default strategy is to look for a file with the same name but the
  28.806 + * MD5ANIM extension in the same directory. If it is found, it is loaded
  28.807 + * and combined with the MD5MESH file. This configuration option can be
  28.808 + * used to disable this behaviour.
  28.809 + *
  28.810 + * * Property type: bool. Default value: false.
  28.811 + */
  28.812 +#define AI_CONFIG_IMPORT_MD5_NO_ANIM_AUTOLOAD           \
  28.813 +    "IMPORT_MD5_NO_ANIM_AUTOLOAD"
  28.814 +
  28.815 +// ---------------------------------------------------------------------------
  28.816 +/** @brief Defines the begin of the time range for which the LWS loader
  28.817 + *    evaluates animations and computes aiNodeAnim's.
  28.818 + *
  28.819 + * Assimp provides full conversion of LightWave's envelope system, including
  28.820 + * pre and post conditions. The loader computes linearly subsampled animation
  28.821 + * chanels with the frame rate given in the LWS file. This property defines
  28.822 + * the start time. Note: animation channels are only generated if a node
  28.823 + * has at least one envelope with more tan one key assigned. This property.
  28.824 + * is given in frames, '0' is the first frame. By default, if this property
  28.825 + * is not set, the importer takes the animation start from the input LWS
  28.826 + * file ('FirstFrame' line)<br>
  28.827 + * Property type: Integer. Default value: taken from file.
  28.828 + *
  28.829 + * @see AI_CONFIG_IMPORT_LWS_ANIM_END - end of the imported time range
  28.830 + */
  28.831 +#define AI_CONFIG_IMPORT_LWS_ANIM_START         \
  28.832 +    "IMPORT_LWS_ANIM_START"
  28.833 +#define AI_CONFIG_IMPORT_LWS_ANIM_END           \
  28.834 +    "IMPORT_LWS_ANIM_END"
  28.835 +
  28.836 +// ---------------------------------------------------------------------------
  28.837 +/** @brief Defines the output frame rate of the IRR loader.
  28.838 + *
  28.839 + * IRR animations are difficult to convert for Assimp and there will
  28.840 + * always be a loss of quality. This setting defines how many keys per second
  28.841 + * are returned by the converter.<br>
  28.842 + * Property type: integer. Default value: 100
  28.843 + */
  28.844 +#define AI_CONFIG_IMPORT_IRR_ANIM_FPS               \
  28.845 +    "IMPORT_IRR_ANIM_FPS"
  28.846 +
  28.847 +// ---------------------------------------------------------------------------
  28.848 +/** @brief Ogre Importer will try to find referenced materials from this file.
  28.849 + *
  28.850 + * Ogre meshes reference with material names, this does not tell Assimp the file
  28.851 + * where it is located in. Assimp will try to find the source file in the following
  28.852 + * order: <material-name>.material, <mesh-filename-base>.material and
  28.853 + * lastly the material name defined by this config property.
  28.854 + * <br>
  28.855 + * Property type: String. Default value: Scene.material.
  28.856 + */
  28.857 +#define AI_CONFIG_IMPORT_OGRE_MATERIAL_FILE \
  28.858 +    "IMPORT_OGRE_MATERIAL_FILE"
  28.859 +
  28.860 +// ---------------------------------------------------------------------------
  28.861 +/** @brief Ogre Importer detect the texture usage from its filename.
  28.862 + *
  28.863 + * Ogre material texture units do not define texture type, the textures usage
  28.864 + * depends on the used shader or Ogre's fixed pipeline. If this config property
  28.865 + * is true Assimp will try to detect the type from the textures filename postfix:
  28.866 + * _n, _nrm, _nrml, _normal, _normals and _normalmap for normal map, _s, _spec,
  28.867 + * _specular and _specularmap for specular map, _l, _light, _lightmap, _occ
  28.868 + * and _occlusion for light map, _disp and _displacement for displacement map.
  28.869 + * The matching is case insensitive. Post fix is taken between the last
  28.870 + * underscore and the last period.
  28.871 + * Default behavior is to detect type from lower cased texture unit name by
  28.872 + * matching against: normalmap, specularmap, lightmap and displacementmap.
  28.873 + * For both cases if no match is found aiTextureType_DIFFUSE is used.
  28.874 + * <br>
  28.875 + * Property type: Bool. Default value: false.
  28.876 + */
  28.877 +#define AI_CONFIG_IMPORT_OGRE_TEXTURETYPE_FROM_FILENAME \
  28.878 +    "IMPORT_OGRE_TEXTURETYPE_FROM_FILENAME"
  28.879 +
  28.880 + /** @brief Specifies whether the Android JNI asset extraction is supported.
  28.881 +  *
  28.882 +  * Turn on this option if you want to manage assets in native
  28.883 +  * Android application without having to keep the internal directory and asset
  28.884 +  * manager pointer.
  28.885 +  */
  28.886 + #define AI_CONFIG_ANDROID_JNI_ASSIMP_MANAGER_SUPPORT "AI_CONFIG_ANDROID_JNI_ASSIMP_MANAGER_SUPPORT"
  28.887 +
  28.888 +// ---------------------------------------------------------------------------
  28.889 +/** @brief Specifies whether the IFC loader skips over IfcSpace elements.
  28.890 + *
  28.891 + * IfcSpace elements (and their geometric representations) are used to
  28.892 + * represent, well, free space in a building storey.<br>
  28.893 + * Property type: Bool. Default value: true.
  28.894 + */
  28.895 +#define AI_CONFIG_IMPORT_IFC_SKIP_SPACE_REPRESENTATIONS "IMPORT_IFC_SKIP_SPACE_REPRESENTATIONS"
  28.896 +
  28.897 +// ---------------------------------------------------------------------------
  28.898 +/** @brief Specifies whether the IFC loader will use its own, custom triangulation
  28.899 + *   algorithm to triangulate wall and floor meshes.
  28.900 + *
  28.901 + * If this property is set to false, walls will be either triangulated by
  28.902 + * #aiProcess_Triangulate or will be passed through as huge polygons with
  28.903 + * faked holes (i.e. holes that are connected with the outer boundary using
  28.904 + * a dummy edge). It is highly recommended to set this property to true
  28.905 + * if you want triangulated data because #aiProcess_Triangulate is known to
  28.906 + * have problems with the kind of polygons that the IFC loader spits out for
  28.907 + * complicated meshes.
  28.908 + * Property type: Bool. Default value: true.
  28.909 + */
  28.910 +#define AI_CONFIG_IMPORT_IFC_CUSTOM_TRIANGULATION "IMPORT_IFC_CUSTOM_TRIANGULATION"
  28.911 +
  28.912 +// ---------------------------------------------------------------------------
  28.913 +/** @brief  Set the tessellation conic angle for IFC smoothing curves.
  28.914 + *
  28.915 + * This is used by the IFC importer to determine the tessellation parameter
  28.916 + * for smoothing curves.
  28.917 + * @note The default value is AI_IMPORT_IFC_DEFAULT_SMOOTHING_ANGLE and the
  28.918 + * accepted values are in range [5.0, 120.0].
  28.919 + * Property type: Float.
  28.920 + */
  28.921 +#define AI_CONFIG_IMPORT_IFC_SMOOTHING_ANGLE "IMPORT_IFC_SMOOTHING_ANGLE"
  28.922 +
  28.923 +// default value for AI_CONFIG_IMPORT_IFC_SMOOTHING_ANGLE
  28.924 +#if (!defined AI_IMPORT_IFC_DEFAULT_SMOOTHING_ANGLE)
  28.925 +#   define AI_IMPORT_IFC_DEFAULT_SMOOTHING_ANGLE 10.0f
  28.926 +#endif
  28.927 +
  28.928 +// ---------------------------------------------------------------------------
  28.929 +/** @brief  Set the tessellation for IFC cylindrical shapes.
  28.930 + *
  28.931 + * This is used by the IFC importer to determine the tessellation parameter
  28.932 + * for cylindrical shapes, i.e. the number of segments used to approximate a circle.
  28.933 + * @note The default value is AI_IMPORT_IFC_DEFAULT_CYLINDRICAL_TESSELLATION and the
  28.934 + * accepted values are in range [3, 180].
  28.935 + * Property type: Integer.
  28.936 + */
  28.937 +#define AI_CONFIG_IMPORT_IFC_CYLINDRICAL_TESSELLATION "IMPORT_IFC_CYLINDRICAL_TESSELLATION"
  28.938 +
  28.939 +// default value for AI_CONFIG_IMPORT_IFC_CYLINDRICAL_TESSELLATION
  28.940 +#if (!defined AI_IMPORT_IFC_DEFAULT_CYLINDRICAL_TESSELLATION)
  28.941 +#   define AI_IMPORT_IFC_DEFAULT_CYLINDRICAL_TESSELLATION 32
  28.942 +#endif
  28.943 +
  28.944 +// ---------------------------------------------------------------------------
  28.945 +/** @brief Specifies whether the Collada loader will ignore the provided up direction.
  28.946 + *
  28.947 + * If this property is set to true, the up direction provided in the file header will
  28.948 + * be ignored and the file will be loaded as is.
  28.949 + * Property type: Bool. Default value: false.
  28.950 + */
  28.951 +#define AI_CONFIG_IMPORT_COLLADA_IGNORE_UP_DIRECTION "IMPORT_COLLADA_IGNORE_UP_DIRECTION"
  28.952 +
  28.953 +// ---------------------------------------------------------------------------
  28.954 +/** @brief Specifies whether the Collada loader should use Collada names as node names.
  28.955 + *
  28.956 + * If this property is set to true, the Collada names will be used as the
  28.957 + * node name. The default is to use the id tag (resp. sid tag, if no id tag is present)
  28.958 + * instead.
  28.959 + * Property type: Bool. Default value: false.
  28.960 + */
  28.961 +#define AI_CONFIG_IMPORT_COLLADA_USE_COLLADA_NAMES "IMPORT_COLLADA_USE_COLLADA_NAMES"
  28.962 +
  28.963 +// ---------- All the Export defines ------------
  28.964 +
  28.965 +/** @brief Specifies the xfile use double for real values of float
  28.966 + *
  28.967 + * Property type: Bool. Default value: false.
  28.968 + */
  28.969 +
  28.970 +#define AI_CONFIG_EXPORT_XFILE_64BIT "EXPORT_XFILE_64BIT"
  28.971 +
  28.972 +/**
  28.973 + *
  28.974 + */
  28.975 +#define AI_CONFIG_EXPORT_POINT_CLOUDS "EXPORT_POINT_CLOUDS"
  28.976 +
  28.977 +/**
  28.978 + *  @brief  Specifies a gobal key factor for scale, float value
  28.979 + */
  28.980 +#define AI_CONFIG_GLOBAL_SCALE_FACTOR_KEY "GLOBAL_SCALE_FACTOR"
  28.981 +
  28.982 +#if (!defined AI_CONFIG_GLOBAL_SCALE_FACTOR_DEFAULT)
  28.983 +#   define AI_CONFIG_GLOBAL_SCALE_FACTOR_DEFAULT  1.0f
  28.984 +#endif // !! AI_DEBONE_THRESHOLD
  28.985 +
  28.986 +// ---------- All the Build/Compile-time defines ------------
  28.987 +
  28.988 +/** @brief Specifies if double precision is supported inside assimp
  28.989 + *
  28.990 + * Property type: Bool. Default value: undefined.
  28.991 + */
  28.992 +
  28.993 +/* #undef ASSIMP_DOUBLE_PRECISION */
  28.994 +
  28.995 +#endif // !! AI_CONFIG_H_INC
    29.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    29.2 +++ b/include/miniassimp/defs.h	Mon Jan 28 18:19:26 2019 +0200
    29.3 @@ -0,0 +1,295 @@
    29.4 +/*
    29.5 +---------------------------------------------------------------------------
    29.6 +Open Asset Import Library (assimp)
    29.7 +---------------------------------------------------------------------------
    29.8 +
    29.9 +Copyright (c) 2006-2018, assimp team
   29.10 +
   29.11 +
   29.12 +
   29.13 +All rights reserved.
   29.14 +
   29.15 +Redistribution and use of this software in source and binary forms,
   29.16 +with or without modification, are permitted provided that the following
   29.17 +conditions are met:
   29.18 +
   29.19 +* Redistributions of source code must retain the above
   29.20 +  copyright notice, this list of conditions and the
   29.21 +  following disclaimer.
   29.22 +
   29.23 +* Redistributions in binary form must reproduce the above
   29.24 +  copyright notice, this list of conditions and the
   29.25 +  following disclaimer in the documentation and/or other
   29.26 +  materials provided with the distribution.
   29.27 +
   29.28 +* Neither the name of the assimp team, nor the names of its
   29.29 +  contributors may be used to endorse or promote products
   29.30 +  derived from this software without specific prior
   29.31 +  written permission of the assimp team.
   29.32 +
   29.33 +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   29.34 +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   29.35 +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
   29.36 +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
   29.37 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   29.38 +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   29.39 +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
   29.40 +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
   29.41 +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   29.42 +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   29.43 +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   29.44 +---------------------------------------------------------------------------
   29.45 +*/
   29.46 +
   29.47 +/** @file defs.h
   29.48 + *  @brief Assimp build configuration setup. See the notes in the comment
   29.49 + *  blocks to find out how to customize _your_ Assimp build.
   29.50 + */
   29.51 +
   29.52 +#pragma once
   29.53 +#ifndef AI_DEFINES_H_INC
   29.54 +#define AI_DEFINES_H_INC
   29.55 +
   29.56 +#include <miniassimp/config.h>
   29.57 +
   29.58 +//////////////////////////////////////////////////////////////////////////
   29.59 +/* Define ASSIMP_BUILD_NO_XX_IMPORTER to disable a specific
   29.60 + * file format loader. The loader is be excluded from the
   29.61 + * build in this case. 'XX' stands for the most common file
   29.62 + * extension of the file format. E.g.:
   29.63 + * ASSIMP_BUILD_NO_X_IMPORTER disables the X loader.
   29.64 + *
   29.65 + * If you're unsure about that, take a look at the implementation of the
   29.66 + * import plugin you wish to disable. You'll find the right define in the
   29.67 + * first lines of the corresponding unit.
   29.68 + *
   29.69 + * Other (mixed) configuration switches are listed here:
   29.70 + *    ASSIMP_BUILD_NO_COMPRESSED_X
   29.71 + *      - Disable support for compressed X files (zip)
   29.72 + *    ASSIMP_BUILD_NO_COMPRESSED_BLEND
   29.73 + *      - Disable support for compressed Blender files (zip)
   29.74 + *    ASSIMP_BUILD_NO_COMPRESSED_IFC
   29.75 + *      - Disable support for IFCZIP files (unzip)
   29.76 + */
   29.77 +//////////////////////////////////////////////////////////////////////////
   29.78 +
   29.79 +#ifndef ASSIMP_BUILD_NO_COMPRESSED_X
   29.80 +#   define ASSIMP_BUILD_NEED_Z_INFLATE
   29.81 +#endif
   29.82 +
   29.83 +#ifndef ASSIMP_BUILD_NO_COMPRESSED_BLEND
   29.84 +#   define ASSIMP_BUILD_NEED_Z_INFLATE
   29.85 +#endif
   29.86 +
   29.87 +#ifndef ASSIMP_BUILD_NO_COMPRESSED_IFC
   29.88 +#   define ASSIMP_BUILD_NEED_Z_INFLATE
   29.89 +#   define ASSIMP_BUILD_NEED_UNZIP
   29.90 +#endif
   29.91 +
   29.92 +#ifndef ASSIMP_BUILD_NO_Q3BSP_IMPORTER
   29.93 +#   define ASSIMP_BUILD_NEED_Z_INFLATE
   29.94 +#   define ASSIMP_BUILD_NEED_UNZIP
   29.95 +#endif
   29.96 +
   29.97 +//////////////////////////////////////////////////////////////////////////
   29.98 +/* Define ASSIMP_BUILD_NO_XX_PROCESS to disable a specific
   29.99 + * post processing step. This is the current list of process names ('XX'):
  29.100 + * CALCTANGENTS
  29.101 + * JOINVERTICES
  29.102 + * TRIANGULATE
  29.103 + * DROPFACENORMALS
  29.104 + * GENFACENORMALS
  29.105 + * GENVERTEXNORMALS
  29.106 + * REMOVEVC
  29.107 + * SPLITLARGEMESHES
  29.108 + * PRETRANSFORMVERTICES
  29.109 + * LIMITBONEWEIGHTS
  29.110 + * VALIDATEDS
  29.111 + * IMPROVECACHELOCALITY
  29.112 + * FIXINFACINGNORMALS
  29.113 + * REMOVE_REDUNDANTMATERIALS
  29.114 + * OPTIMIZEGRAPH
  29.115 + * SORTBYPTYPE
  29.116 + * FINDINVALIDDATA
  29.117 + * TRANSFORMTEXCOORDS
  29.118 + * GENUVCOORDS
  29.119 + * ENTITYMESHBUILDER
  29.120 + * EMBEDTEXTURES
  29.121 + * MAKELEFTHANDED
  29.122 + * FLIPUVS
  29.123 + * FLIPWINDINGORDER
  29.124 + * OPTIMIZEMESHES
  29.125 + * OPTIMIZEANIMS
  29.126 + * OPTIMIZEGRAPH
  29.127 + * GENENTITYMESHES
  29.128 + * FIXTEXTUREPATHS */
  29.129 +//////////////////////////////////////////////////////////////////////////
  29.130 +
  29.131 +#ifdef _MSC_VER
  29.132 +#   undef ASSIMP_API
  29.133 +
  29.134 +    //////////////////////////////////////////////////////////////////////////
  29.135 +    /* Define 'ASSIMP_BUILD_DLL_EXPORT' to build a DLL of the library */
  29.136 +    //////////////////////////////////////////////////////////////////////////
  29.137 +#   ifdef ASSIMP_BUILD_DLL_EXPORT
  29.138 +#       define ASSIMP_API __declspec(dllexport)
  29.139 +#       define ASSIMP_API_WINONLY __declspec(dllexport)
  29.140 +#       pragma warning (disable : 4251)
  29.141 +
  29.142 +    //////////////////////////////////////////////////////////////////////////
  29.143 +    /* Define 'ASSIMP_DLL' before including Assimp to link to ASSIMP in
  29.144 +     * an external DLL under Windows. Default is static linkage. */
  29.145 +    //////////////////////////////////////////////////////////////////////////
  29.146 +#   elif (defined ASSIMP_DLL)
  29.147 +#       define ASSIMP_API __declspec(dllimport)
  29.148 +#       define ASSIMP_API_WINONLY __declspec(dllimport)
  29.149 +#   else
  29.150 +#       define ASSIMP_API
  29.151 +#       define ASSIMP_API_WINONLY
  29.152 +#   endif
  29.153 +
  29.154 +    /* Force the compiler to inline a function, if possible
  29.155 +     */
  29.156 +#   define AI_FORCE_INLINE __forceinline
  29.157 +
  29.158 +    /* Tells the compiler that a function never returns. Used in code analysis
  29.159 +     * to skip dead paths (e.g. after an assertion evaluated to false). */
  29.160 +#   define AI_WONT_RETURN __declspec(noreturn)
  29.161 +
  29.162 +#elif defined(SWIG)
  29.163 +
  29.164 +    /* Do nothing, the relevant defines are all in AssimpSwigPort.i */
  29.165 +
  29.166 +#else
  29.167 +
  29.168 +#   define AI_WONT_RETURN
  29.169 +
  29.170 +#   define ASSIMP_API
  29.171 +#   define ASSIMP_API_WINONLY
  29.172 +#   define AI_FORCE_INLINE inline
  29.173 +#endif // (defined _MSC_VER)
  29.174 +
  29.175 +#ifdef __GNUC__
  29.176 +#   define AI_WONT_RETURN_SUFFIX  __attribute__((noreturn))
  29.177 +#else
  29.178 +#   define AI_WONT_RETURN_SUFFIX
  29.179 +#endif // (defined __clang__)
  29.180 +
  29.181 +#ifdef __cplusplus
  29.182 +    /* No explicit 'struct' and 'enum' tags for C++, this keeps showing up
  29.183 +     * in doxydocs.
  29.184 +     */
  29.185 +#   define C_STRUCT
  29.186 +#   define C_ENUM
  29.187 +#else
  29.188 +    //////////////////////////////////////////////////////////////////////////
  29.189 +    /* To build the documentation, make sure ASSIMP_DOXYGEN_BUILD
  29.190 +     * is defined by Doxygen's preprocessor. The corresponding
  29.191 +     * entries in the DOXYFILE are: */
  29.192 +    //////////////////////////////////////////////////////////////////////////
  29.193 +#if 0
  29.194 +    ENABLE_PREPROCESSING   = YES
  29.195 +    MACRO_EXPANSION        = YES
  29.196 +    EXPAND_ONLY_PREDEF     = YES
  29.197 +    SEARCH_INCLUDES        = YES
  29.198 +    INCLUDE_PATH           =
  29.199 +    INCLUDE_FILE_PATTERNS  =
  29.200 +    PREDEFINED             = ASSIMP_DOXYGEN_BUILD=1
  29.201 +    EXPAND_AS_DEFINED      = C_STRUCT C_ENUM
  29.202 +    SKIP_FUNCTION_MACROS   = YES
  29.203 +#endif
  29.204 +    //////////////////////////////////////////////////////////////////////////
  29.205 +    /* Doxygen gets confused if we use c-struct typedefs to avoid
  29.206 +     * the explicit 'struct' notation. This trick here has the same
  29.207 +     * effect as the TYPEDEF_HIDES_STRUCT option, but we don't need
  29.208 +     * to typedef all structs/enums. */
  29.209 +     //////////////////////////////////////////////////////////////////////////
  29.210 +#   if (defined ASSIMP_DOXYGEN_BUILD)
  29.211 +#       define C_STRUCT
  29.212 +#       define C_ENUM
  29.213 +#   else
  29.214 +#       define C_STRUCT struct
  29.215 +#       define C_ENUM   enum
  29.216 +#   endif
  29.217 +#endif
  29.218 +
  29.219 +#if (defined(__BORLANDC__) || defined (__BCPLUSPLUS__))
  29.220 +#error Currently, Borland is unsupported. Feel free to port Assimp.
  29.221 +
  29.222 +// "W8059 Packgröße der Struktur geändert"
  29.223 +
  29.224 +#endif
  29.225 +
  29.226 +
  29.227 +    //////////////////////////////////////////////////////////////////////////
  29.228 +    /* Define ASSIMP_BUILD_SINGLETHREADED to compile assimp
  29.229 +     * without threading support. The library doesn't utilize
  29.230 +     * threads then and is itself not threadsafe. */
  29.231 +    //////////////////////////////////////////////////////////////////////////
  29.232 +#ifndef ASSIMP_BUILD_SINGLETHREADED
  29.233 +#   define ASSIMP_BUILD_SINGLETHREADED
  29.234 +#endif
  29.235 +
  29.236 +#if defined(_DEBUG) || ! defined(NDEBUG)
  29.237 +#   define ASSIMP_BUILD_DEBUG
  29.238 +#endif
  29.239 +
  29.240 +    //////////////////////////////////////////////////////////////////////////
  29.241 +    /* Define ASSIMP_DOUBLE_PRECISION to compile assimp
  29.242 +     * with double precision support (64-bit). */
  29.243 +    //////////////////////////////////////////////////////////////////////////
  29.244 +
  29.245 +#ifdef ASSIMP_DOUBLE_PRECISION
  29.246 +    typedef double ai_real;
  29.247 +    typedef signed long long int ai_int;
  29.248 +    typedef unsigned long long int ai_uint;
  29.249 +#else // ASSIMP_DOUBLE_PRECISION
  29.250 +    typedef float ai_real;
  29.251 +    typedef signed int ai_int;
  29.252 +    typedef unsigned int ai_uint;
  29.253 +#endif // ASSIMP_DOUBLE_PRECISION
  29.254 +
  29.255 +    //////////////////////////////////////////////////////////////////////////
  29.256 +    /* Useful constants */
  29.257 +    //////////////////////////////////////////////////////////////////////////
  29.258 +
  29.259 +/* This is PI. Hi PI. */
  29.260 +#define AI_MATH_PI          (3.141592653589793238462643383279 )
  29.261 +#define AI_MATH_TWO_PI      (AI_MATH_PI * 2.0)
  29.262 +#define AI_MATH_HALF_PI     (AI_MATH_PI * 0.5)
  29.263 +
  29.264 +/* And this is to avoid endless casts to float */
  29.265 +#define AI_MATH_PI_F        (3.1415926538f)
  29.266 +#define AI_MATH_TWO_PI_F    (AI_MATH_PI_F * 2.0f)
  29.267 +#define AI_MATH_HALF_PI_F   (AI_MATH_PI_F * 0.5f)
  29.268 +
  29.269 +/* Tiny macro to convert from radians to degrees and back */
  29.270 +#define AI_DEG_TO_RAD(x) ((x)*(ai_real)0.0174532925)
  29.271 +#define AI_RAD_TO_DEG(x) ((x)*(ai_real)57.2957795)
  29.272 +
  29.273 +/* Support for big-endian builds */
  29.274 +#if defined(__BYTE_ORDER__)
  29.275 +#   if (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
  29.276 +#       if !defined(__BIG_ENDIAN__)
  29.277 +#           define __BIG_ENDIAN__
  29.278 +#       endif
  29.279 +#   else /* little endian */
  29.280 +#       if defined (__BIG_ENDIAN__)
  29.281 +#           undef __BIG_ENDIAN__
  29.282 +#       endif
  29.283 +#   endif
  29.284 +#endif
  29.285 +#if defined(__BIG_ENDIAN__)
  29.286 +#   define AI_BUILD_BIG_ENDIAN
  29.287 +#endif
  29.288 +
  29.289 +
  29.290 +/* To avoid running out of memory
  29.291 + * This can be adjusted for specific use cases
  29.292 + * It's NOT a total limit, just a limit for individual allocations
  29.293 + */
  29.294 +#define AI_MAX_ALLOC(type) ((256U * 1024 * 1024) / sizeof(type))
  29.295 +
  29.296 +#define AI_NO_EXCEPT
  29.297 +
  29.298 +#endif // !! AI_DEFINES_H_INC
    30.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    30.2 +++ b/include/miniassimp/importerdesc.h	Mon Jan 28 18:19:26 2019 +0200
    30.3 @@ -0,0 +1,146 @@
    30.4 +/*
    30.5 +---------------------------------------------------------------------------
    30.6 +Open Asset Import Library (assimp)
    30.7 +---------------------------------------------------------------------------
    30.8 +
    30.9 +Copyright (c) 2006-2018, assimp team
   30.10 +
   30.11 +
   30.12 +
   30.13 +All rights reserved.
   30.14 +
   30.15 +Redistribution and use of this software in source and binary forms,
   30.16 +with or without modification, are permitted provided that the following
   30.17 +conditions are met:
   30.18 +
   30.19 +* Redistributions of source code must retain the above
   30.20 +  copyright notice, this list of conditions and the
   30.21 +  following disclaimer.
   30.22 +
   30.23 +* Redistributions in binary form must reproduce the above
   30.24 +  copyright notice, this list of conditions and the
   30.25 +  following disclaimer in the documentation and/or other
   30.26 +  materials provided with the distribution.
   30.27 +
   30.28 +* Neither the name of the assimp team, nor the names of its
   30.29 +  contributors may be used to endorse or promote products
   30.30 +  derived from this software without specific prior
   30.31 +  written permission of the assimp team.
   30.32 +
   30.33 +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   30.34 +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   30.35 +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
   30.36 +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
   30.37 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   30.38 +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   30.39 +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
   30.40 +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
   30.41 +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   30.42 +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   30.43 +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   30.44 +---------------------------------------------------------------------------
   30.45 +*/
   30.46 +
   30.47 +/** @file importerdesc.h
   30.48 + *  @brief #aiImporterFlags, aiImporterDesc implementation.
   30.49 + */
   30.50 +#pragma once
   30.51 +#ifndef AI_IMPORTER_DESC_H_INC
   30.52 +#define AI_IMPORTER_DESC_H_INC
   30.53 +
   30.54 +
   30.55 +/** Mixed set of flags for #aiImporterDesc, indicating some features
   30.56 +  *  common to many importers*/
   30.57 +enum aiImporterFlags
   30.58 +{
   30.59 +    /** Indicates that there is a textual encoding of the
   30.60 +     *  file format; and that it is supported.*/
   30.61 +    aiImporterFlags_SupportTextFlavour = 0x1,
   30.62 +
   30.63 +    /** Indicates that there is a binary encoding of the
   30.64 +     *  file format; and that it is supported.*/
   30.65 +    aiImporterFlags_SupportBinaryFlavour = 0x2,
   30.66 +
   30.67 +    /** Indicates that there is a compressed encoding of the
   30.68 +     *  file format; and that it is supported.*/
   30.69 +    aiImporterFlags_SupportCompressedFlavour = 0x4,
   30.70 +
   30.71 +    /** Indicates that the importer reads only a very particular
   30.72 +      * subset of the file format. This happens commonly for
   30.73 +      * declarative or procedural formats which cannot easily
   30.74 +      * be mapped to #aiScene */
   30.75 +    aiImporterFlags_LimitedSupport = 0x8,
   30.76 +
   30.77 +    /** Indicates that the importer is highly experimental and
   30.78 +      * should be used with care. This only happens for trunk
   30.79 +      * (i.e. SVN) versions, experimental code is not included
   30.80 +      * in releases. */
   30.81 +    aiImporterFlags_Experimental = 0x10
   30.82 +};
   30.83 +
   30.84 +
   30.85 +/** Meta information about a particular importer. Importers need to fill
   30.86 + *  this structure, but they can freely decide how talkative they are.
   30.87 + *  A common use case for loader meta info is a user interface
   30.88 + *  in which the user can choose between various import/export file
   30.89 + *  formats. Building such an UI by hand means a lot of maintenance
   30.90 + *  as importers/exporters are added to Assimp, so it might be useful
   30.91 + *  to have a common mechanism to query some rough importer
   30.92 + *  characteristics. */
   30.93 +struct aiImporterDesc
   30.94 +{
   30.95 +    /** Full name of the importer (i.e. Blender3D importer)*/
   30.96 +    const char* mName;
   30.97 +
   30.98 +    /** Original author (left blank if unknown or whole assimp team) */
   30.99 +    const char* mAuthor;
  30.100 +
  30.101 +    /** Current maintainer, left blank if the author maintains */
  30.102 +    const char* mMaintainer;
  30.103 +
  30.104 +    /** Implementation comments, i.e. unimplemented features*/
  30.105 +    const char* mComments;
  30.106 +
  30.107 +    /** These flags indicate some characteristics common to many
  30.108 +        importers. */
  30.109 +    unsigned int mFlags;
  30.110 +
  30.111 +    /** Minimum format version that can be loaded im major.minor format,
  30.112 +        both are set to 0 if there is either no version scheme
  30.113 +        or if the loader doesn't care. */
  30.114 +    unsigned int mMinMajor;
  30.115 +    unsigned int mMinMinor;
  30.116 +
  30.117 +    /** Maximum format version that can be loaded im major.minor format,
  30.118 +        both are set to 0 if there is either no version scheme
  30.119 +        or if the loader doesn't care. Loaders that expect to be
  30.120 +        forward-compatible to potential future format versions should
  30.121 +        indicate  zero, otherwise they should specify the current
  30.122 +        maximum version.*/
  30.123 +    unsigned int mMaxMajor;
  30.124 +    unsigned int mMaxMinor;
  30.125 +
  30.126 +    /** List of file extensions this importer can handle.
  30.127 +        List entries are separated by space characters.
  30.128 +        All entries are lower case without a leading dot (i.e.
  30.129 +        "xml dae" would be a valid value. Note that multiple
  30.130 +        importers may respond to the same file extension -
  30.131 +        assimp calls all importers in the order in which they
  30.132 +        are registered and each importer gets the opportunity
  30.133 +        to load the file until one importer "claims" the file. Apart
  30.134 +        from file extension checks, importers typically use
  30.135 +        other methods to quickly reject files (i.e. magic
  30.136 +        words) so this does not mean that common or generic
  30.137 +        file extensions such as XML would be tediously slow. */
  30.138 +    const char* mFileExtensions;
  30.139 +};
  30.140 +
  30.141 +/** \brief  Returns the Importer description for a given extension.
  30.142 +
  30.143 +Will return a NULL-pointer if no assigned importer desc. was found for the given extension
  30.144 +    \param  extension   [in] The extension to look for
  30.145 +    \return A pointer showing to the ImporterDesc, \see aiImporterDesc.
  30.146 +*/
  30.147 +ASSIMP_API const C_STRUCT aiImporterDesc* aiGetImporterDesc( const char *extension );
  30.148 +
  30.149 +#endif // AI_IMPORTER_DESC_H_INC
    31.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    31.2 +++ b/include/miniassimp/light.h	Mon Jan 28 18:19:26 2019 +0200
    31.3 @@ -0,0 +1,259 @@
    31.4 +/*
    31.5 +---------------------------------------------------------------------------
    31.6 +Open Asset Import Library (assimp)
    31.7 +---------------------------------------------------------------------------
    31.8 +
    31.9 +Copyright (c) 2006-2018, assimp team
   31.10 +
   31.11 +
   31.12 +
   31.13 +All rights reserved.
   31.14 +
   31.15 +Redistribution and use of this software in source and binary forms,
   31.16 +with or without modification, are permitted provided that the following
   31.17 +conditions are met:
   31.18 +
   31.19 +* Redistributions of source code must retain the above
   31.20 +  copyright notice, this list of conditions and the
   31.21 +  following disclaimer.
   31.22 +
   31.23 +* Redistributions in binary form must reproduce the above
   31.24 +  copyright notice, this list of conditions and the
   31.25 +  following disclaimer in the documentation and/or other
   31.26 +  materials provided with the distribution.
   31.27 +
   31.28 +* Neither the name of the assimp team, nor the names of its
   31.29 +  contributors may be used to endorse or promote products
   31.30 +  derived from this software without specific prior
   31.31 +  written permission of the assimp team.
   31.32 +
   31.33 +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   31.34 +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   31.35 +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
   31.36 +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
   31.37 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   31.38 +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   31.39 +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
   31.40 +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
   31.41 +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   31.42 +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   31.43 +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   31.44 +---------------------------------------------------------------------------
   31.45 +*/
   31.46 +
   31.47 +/** @file light.h
   31.48 + *  @brief Defines the aiLight data structure
   31.49 + */
   31.50 +
   31.51 +#pragma once
   31.52 +#ifndef AI_LIGHT_H_INC
   31.53 +#define AI_LIGHT_H_INC
   31.54 +
   31.55 +#include "types.h"
   31.56 +
   31.57 +#ifdef __cplusplus
   31.58 +extern "C" {
   31.59 +#endif
   31.60 +
   31.61 +// ---------------------------------------------------------------------------
   31.62 +/** Enumerates all supported types of light sources.
   31.63 + */
   31.64 +enum aiLightSourceType
   31.65 +{
   31.66 +    aiLightSource_UNDEFINED     = 0x0,
   31.67 +
   31.68 +    //! A directional light source has a well-defined direction
   31.69 +    //! but is infinitely far away. That's quite a good
   31.70 +    //! approximation for sun light.
   31.71 +    aiLightSource_DIRECTIONAL   = 0x1,
   31.72 +
   31.73 +    //! A point light source has a well-defined position
   31.74 +    //! in space but no direction - it emits light in all
   31.75 +    //! directions. A normal bulb is a point light.
   31.76 +    aiLightSource_POINT         = 0x2,
   31.77 +
   31.78 +    //! A spot light source emits light in a specific
   31.79 +    //! angle. It has a position and a direction it is pointing to.
   31.80 +    //! A good example for a spot light is a light spot in
   31.81 +    //! sport arenas.
   31.82 +    aiLightSource_SPOT          = 0x3,
   31.83 +
   31.84 +    //! The generic light level of the world, including the bounces
   31.85 +    //! of all other light sources.
   31.86 +    //! Typically, there's at most one ambient light in a scene.
   31.87 +    //! This light type doesn't have a valid position, direction, or
   31.88 +    //! other properties, just a color.
   31.89 +    aiLightSource_AMBIENT       = 0x4,
   31.90 +
   31.91 +    //! An area light is a rectangle with predefined size that uniformly
   31.92 +    //! emits light from one of its sides. The position is center of the
   31.93 +    //! rectangle and direction is its normal vector.
   31.94 +    aiLightSource_AREA          = 0x5,
   31.95 +
   31.96 +    /** This value is not used. It is just there to force the
   31.97 +     *  compiler to map this enum to a 32 Bit integer.
   31.98 +     */
   31.99 +#ifndef SWIG
  31.100 +    _aiLightSource_Force32Bit = INT_MAX
  31.101 +#endif
  31.102 +};
  31.103 +
  31.104 +// ---------------------------------------------------------------------------
  31.105 +/** Helper structure to describe a light source.
  31.106 + *
  31.107 + *  Assimp supports multiple sorts of light sources, including
  31.108 + *  directional, point and spot lights. All of them are defined with just
  31.109 + *  a single structure and distinguished by their parameters.
  31.110 + *  Note - some file formats (such as 3DS, ASE) export a "target point" -
  31.111 + *  the point a spot light is looking at (it can even be animated). Assimp
  31.112 + *  writes the target point as a subnode of a spotlights's main node,
  31.113 + *  called "<spotName>.Target". However, this is just additional information
  31.114 + *  then, the transformation tracks of the main node make the
  31.115 + *  spot light already point in the right direction.
  31.116 +*/
  31.117 +struct aiLight
  31.118 +{
  31.119 +    /** The name of the light source.
  31.120 +     *
  31.121 +     *  There must be a node in the scenegraph with the same name.
  31.122 +     *  This node specifies the position of the light in the scene
  31.123 +     *  hierarchy and can be animated.
  31.124 +     */
  31.125 +    C_STRUCT aiString mName;
  31.126 +
  31.127 +    /** The type of the light source.
  31.128 +     *
  31.129 +     * aiLightSource_UNDEFINED is not a valid value for this member.
  31.130 +     */
  31.131 +    C_ENUM aiLightSourceType mType;
  31.132 +
  31.133 +    /** Position of the light source in space. Relative to the
  31.134 +     *  transformation of the node corresponding to the light.
  31.135 +     *
  31.136 +     *  The position is undefined for directional lights.
  31.137 +     */
  31.138 +    C_STRUCT aiVector3D mPosition;
  31.139 +
  31.140 +    /** Direction of the light source in space. Relative to the
  31.141 +     *  transformation of the node corresponding to the light.
  31.142 +     *
  31.143 +     *  The direction is undefined for point lights. The vector
  31.144 +     *  may be normalized, but it needn't.
  31.145 +     */
  31.146 +    C_STRUCT aiVector3D mDirection;
  31.147 +
  31.148 +    /** Up direction of the light source in space. Relative to the
  31.149 +     *  transformation of the node corresponding to the light.
  31.150 +     *
  31.151 +     *  The direction is undefined for point lights. The vector
  31.152 +     *  may be normalized, but it needn't.
  31.153 +     */
  31.154 +    C_STRUCT aiVector3D mUp;
  31.155 +
  31.156 +    /** Constant light attenuation factor.
  31.157 +     *
  31.158 +     *  The intensity of the light source at a given distance 'd' from
  31.159 +     *  the light's position is
  31.160 +     *  @code
  31.161 +     *  Atten = 1/( att0 + att1 * d + att2 * d*d)
  31.162 +     *  @endcode
  31.163 +     *  This member corresponds to the att0 variable in the equation.
  31.164 +     *  Naturally undefined for directional lights.
  31.165 +     */
  31.166 +    float mAttenuationConstant;
  31.167 +
  31.168 +    /** Linear light attenuation factor.
  31.169 +     *
  31.170 +     *  The intensity of the light source at a given distance 'd' from
  31.171 +     *  the light's position is
  31.172 +     *  @code
  31.173 +     *  Atten = 1/( att0 + att1 * d + att2 * d*d)
  31.174 +     *  @endcode
  31.175 +     *  This member corresponds to the att1 variable in the equation.
  31.176 +     *  Naturally undefined for directional lights.
  31.177 +     */
  31.178 +    float mAttenuationLinear;
  31.179 +
  31.180 +    /** Quadratic light attenuation factor.
  31.181 +     *
  31.182 +     *  The intensity of the light source at a given distance 'd' from
  31.183 +     *  the light's position is
  31.184 +     *  @code
  31.185 +     *  Atten = 1/( att0 + att1 * d + att2 * d*d)
  31.186 +     *  @endcode
  31.187 +     *  This member corresponds to the att2 variable in the equation.
  31.188 +     *  Naturally undefined for directional lights.
  31.189 +     */
  31.190 +    float mAttenuationQuadratic;
  31.191 +
  31.192 +    /** Diffuse color of the light source
  31.193 +     *
  31.194 +     *  The diffuse light color is multiplied with the diffuse
  31.195 +     *  material color to obtain the final color that contributes
  31.196 +     *  to the diffuse shading term.
  31.197 +     */
  31.198 +    C_STRUCT aiColor3D mColorDiffuse;
  31.199 +
  31.200 +    /** Specular color of the light source
  31.201 +     *
  31.202 +     *  The specular light color is multiplied with the specular
  31.203 +     *  material color to obtain the final color that contributes
  31.204 +     *  to the specular shading term.
  31.205 +     */
  31.206 +    C_STRUCT aiColor3D mColorSpecular;
  31.207 +
  31.208 +    /** Ambient color of the light source
  31.209 +     *
  31.210 +     *  The ambient light color is multiplied with the ambient
  31.211 +     *  material color to obtain the final color that contributes
  31.212 +     *  to the ambient shading term. Most renderers will ignore
  31.213 +     *  this value it, is just a remaining of the fixed-function pipeline
  31.214 +     *  that is still supported by quite many file formats.
  31.215 +     */
  31.216 +    C_STRUCT aiColor3D mColorAmbient;
  31.217 +
  31.218 +    /** Inner angle of a spot light's light cone.
  31.219 +     *
  31.220 +     *  The spot light has maximum influence on objects inside this
  31.221 +     *  angle. The angle is given in radians. It is 2PI for point
  31.222 +     *  lights and undefined for directional lights.
  31.223 +     */
  31.224 +    float mAngleInnerCone;
  31.225 +
  31.226 +    /** Outer angle of a spot light's light cone.
  31.227 +     *
  31.228 +     *  The spot light does not affect objects outside this angle.
  31.229 +     *  The angle is given in radians. It is 2PI for point lights and
  31.230 +     *  undefined for directional lights. The outer angle must be
  31.231 +     *  greater than or equal to the inner angle.
  31.232 +     *  It is assumed that the application uses a smooth
  31.233 +     *  interpolation between the inner and the outer cone of the
  31.234 +     *  spot light.
  31.235 +     */
  31.236 +    float mAngleOuterCone;
  31.237 +
  31.238 +    /** Size of area light source. */
  31.239 +    C_STRUCT aiVector2D mSize;
  31.240 +
  31.241 +#ifdef __cplusplus
  31.242 +
  31.243 +    aiLight() AI_NO_EXCEPT
  31.244 +        :   mType                 (aiLightSource_UNDEFINED)
  31.245 +        ,   mAttenuationConstant  (0.f)
  31.246 +        ,   mAttenuationLinear    (1.f)
  31.247 +        ,   mAttenuationQuadratic (0.f)
  31.248 +        ,   mAngleInnerCone       ((float)AI_MATH_TWO_PI)
  31.249 +        ,   mAngleOuterCone       ((float)AI_MATH_TWO_PI)
  31.250 +        ,   mSize                 (0.f, 0.f)
  31.251 +    {
  31.252 +    }
  31.253 +
  31.254 +#endif
  31.255 +};
  31.256 +
  31.257 +#ifdef __cplusplus
  31.258 +}
  31.259 +#endif 
  31.260 +
  31.261 +
  31.262 +#endif // !! AI_LIGHT_H_INC
    32.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    32.2 +++ b/include/miniassimp/material.h	Mon Jan 28 18:19:26 2019 +0200
    32.3 @@ -0,0 +1,1576 @@
    32.4 +/*
    32.5 +---------------------------------------------------------------------------
    32.6 +Open Asset Import Library (assimp)
    32.7 +---------------------------------------------------------------------------
    32.8 +
    32.9 +Copyright (c) 2006-2018, assimp team
   32.10 +
   32.11 +
   32.12 +
   32.13 +All rights reserved.
   32.14 +
   32.15 +Redistribution and use of this software in source and binary forms,
   32.16 +with or without modification, are permitted provided that the following
   32.17 +conditions are met:
   32.18 +
   32.19 +* Redistributions of source code must retain the above
   32.20 +  copyright notice, this list of conditions and the
   32.21 +  following disclaimer.
   32.22 +
   32.23 +* Redistributions in binary form must reproduce the above
   32.24 +  copyright notice, this list of conditions and the
   32.25 +  following disclaimer in the documentation and/or other
   32.26 +  materials provided with the distribution.
   32.27 +
   32.28 +* Neither the name of the assimp team, nor the names of its
   32.29 +  contributors may be used to endorse or promote products
   32.30 +  derived from this software without specific prior
   32.31 +  written permission of the assimp team.
   32.32 +
   32.33 +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   32.34 +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   32.35 +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
   32.36 +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
   32.37 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   32.38 +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   32.39 +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
   32.40 +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
   32.41 +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   32.42 +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   32.43 +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   32.44 +---------------------------------------------------------------------------
   32.45 +*/
   32.46 +
   32.47 +/** @file material.h
   32.48 + *  @brief Defines the material system of the library
   32.49 + */
   32.50 +#pragma once
   32.51 +#ifndef AI_MATERIAL_H_INC
   32.52 +#define AI_MATERIAL_H_INC
   32.53 +
   32.54 +#include "types.h"
   32.55 +
   32.56 +#ifdef __cplusplus
   32.57 +extern "C" {
   32.58 +#endif
   32.59 +
   32.60 +// Name for default materials (2nd is used if meshes have UV coords)
   32.61 +#define AI_DEFAULT_MATERIAL_NAME          "DefaultMaterial"
   32.62 +
   32.63 +// ---------------------------------------------------------------------------
   32.64 +/** @brief Defines how the Nth texture of a specific type is combined with
   32.65 + *  the result of all previous layers.
   32.66 + *
   32.67 + *  Example (left: key, right: value): <br>
   32.68 + *  @code
   32.69 + *  DiffColor0     - gray
   32.70 + *  DiffTextureOp0 - aiTextureOpMultiply
   32.71 + *  DiffTexture0   - tex1.png
   32.72 + *  DiffTextureOp0 - aiTextureOpAdd
   32.73 + *  DiffTexture1   - tex2.png
   32.74 + *  @endcode
   32.75 + *  Written as equation, the final diffuse term for a specific pixel would be:
   32.76 + *  @code
   32.77 + *  diffFinal = DiffColor0 * sampleTex(DiffTexture0,UV0) +
   32.78 + *     sampleTex(DiffTexture1,UV0) * diffContrib;
   32.79 + *  @endcode
   32.80 + *  where 'diffContrib' is the intensity of the incoming light for that pixel.
   32.81 + */
   32.82 +enum aiTextureOp
   32.83 +{
   32.84 +    /** T = T1 * T2 */
   32.85 +    aiTextureOp_Multiply = 0x0,
   32.86 +
   32.87 +    /** T = T1 + T2 */
   32.88 +    aiTextureOp_Add = 0x1,
   32.89 +
   32.90 +    /** T = T1 - T2 */
   32.91 +    aiTextureOp_Subtract = 0x2,
   32.92 +
   32.93 +    /** T = T1 / T2 */
   32.94 +    aiTextureOp_Divide = 0x3,
   32.95 +
   32.96 +    /** T = (T1 + T2) - (T1 * T2) */
   32.97 +    aiTextureOp_SmoothAdd = 0x4,
   32.98 +
   32.99 +    /** T = T1 + (T2-0.5) */
  32.100 +    aiTextureOp_SignedAdd = 0x5,
  32.101 +
  32.102 +
  32.103 +#ifndef SWIG
  32.104 +    _aiTextureOp_Force32Bit = INT_MAX
  32.105 +#endif
  32.106 +};
  32.107 +
  32.108 +// ---------------------------------------------------------------------------
  32.109 +/** @brief Defines how UV coordinates outside the [0...1] range are handled.
  32.110 + *
  32.111 + *  Commonly referred to as 'wrapping mode'.
  32.112 + */
  32.113 +enum aiTextureMapMode
  32.114 +{
  32.115 +    /** A texture coordinate u|v is translated to u%1|v%1
  32.116 +     */
  32.117 +    aiTextureMapMode_Wrap = 0x0,
  32.118 +
  32.119 +    /** Texture coordinates outside [0...1]
  32.120 +     *  are clamped to the nearest valid value.
  32.121 +     */
  32.122 +    aiTextureMapMode_Clamp = 0x1,
  32.123 +
  32.124 +    /** If the texture coordinates for a pixel are outside [0...1]
  32.125 +     *  the texture is not applied to that pixel
  32.126 +     */
  32.127 +    aiTextureMapMode_Decal = 0x3,
  32.128 +
  32.129 +    /** A texture coordinate u|v becomes u%1|v%1 if (u-(u%1))%2 is zero and
  32.130 +     *  1-(u%1)|1-(v%1) otherwise
  32.131 +     */
  32.132 +    aiTextureMapMode_Mirror = 0x2,
  32.133 +
  32.134 +#ifndef SWIG
  32.135 +    _aiTextureMapMode_Force32Bit = INT_MAX
  32.136 +#endif
  32.137 +};
  32.138 +
  32.139 +// ---------------------------------------------------------------------------
  32.140 +/** @brief Defines how the mapping coords for a texture are generated.
  32.141 + *
  32.142 + *  Real-time applications typically require full UV coordinates, so the use of
  32.143 + *  the aiProcess_GenUVCoords step is highly recommended. It generates proper
  32.144 + *  UV channels for non-UV mapped objects, as long as an accurate description
  32.145 + *  how the mapping should look like (e.g spherical) is given.
  32.146 + *  See the #AI_MATKEY_MAPPING property for more details.
  32.147 + */
  32.148 +enum aiTextureMapping
  32.149 +{
  32.150 +    /** The mapping coordinates are taken from an UV channel.
  32.151 +     *
  32.152 +     *  The #AI_MATKEY_UVWSRC key specifies from which UV channel
  32.153 +     *  the texture coordinates are to be taken from (remember,
  32.154 +     *  meshes can have more than one UV channel).
  32.155 +    */
  32.156 +    aiTextureMapping_UV = 0x0,
  32.157 +
  32.158 +     /** Spherical mapping */
  32.159 +    aiTextureMapping_SPHERE = 0x1,
  32.160 +
  32.161 +     /** Cylindrical mapping */
  32.162 +    aiTextureMapping_CYLINDER = 0x2,
  32.163 +
  32.164 +     /** Cubic mapping */
  32.165 +    aiTextureMapping_BOX = 0x3,
  32.166 +
  32.167 +     /** Planar mapping */
  32.168 +    aiTextureMapping_PLANE = 0x4,
  32.169 +
  32.170 +     /** Undefined mapping. Have fun. */
  32.171 +    aiTextureMapping_OTHER = 0x5,
  32.172 +
  32.173 +
  32.174 +#ifndef SWIG
  32.175 +    _aiTextureMapping_Force32Bit = INT_MAX
  32.176 +#endif
  32.177 +};
  32.178 +
  32.179 +// ---------------------------------------------------------------------------
  32.180 +/** @brief Defines the purpose of a texture
  32.181 + *
  32.182 + *  This is a very difficult topic. Different 3D packages support different
  32.183 + *  kinds of textures. For very common texture types, such as bumpmaps, the
  32.184 + *  rendering results depend on implementation details in the rendering
  32.185 + *  pipelines of these applications. Assimp loads all texture references from
  32.186 + *  the model file and tries to determine which of the predefined texture
  32.187 + *  types below is the best choice to match the original use of the texture
  32.188 + *  as closely as possible.<br>
  32.189 + *
  32.190 + *  In content pipelines you'll usually define how textures have to be handled,
  32.191 + *  and the artists working on models have to conform to this specification,
  32.192 + *  regardless which 3D tool they're using.
  32.193 + */
  32.194 +enum aiTextureType
  32.195 +{
  32.196 +    /** Dummy value.
  32.197 +     *
  32.198 +     *  No texture, but the value to be used as 'texture semantic'
  32.199 +     *  (#aiMaterialProperty::mSemantic) for all material properties
  32.200 +     *  *not* related to textures.
  32.201 +     */
  32.202 +    aiTextureType_NONE = 0x0,
  32.203 +
  32.204 +
  32.205 +
  32.206 +    /** The texture is combined with the result of the diffuse
  32.207 +     *  lighting equation.
  32.208 +     */
  32.209 +    aiTextureType_DIFFUSE = 0x1,
  32.210 +
  32.211 +    /** The texture is combined with the result of the specular
  32.212 +     *  lighting equation.
  32.213 +     */
  32.214 +    aiTextureType_SPECULAR = 0x2,
  32.215 +
  32.216 +    /** The texture is combined with the result of the ambient
  32.217 +     *  lighting equation.
  32.218 +     */
  32.219 +    aiTextureType_AMBIENT = 0x3,
  32.220 +
  32.221 +    /** The texture is added to the result of the lighting
  32.222 +     *  calculation. It isn't influenced by incoming light.
  32.223 +     */
  32.224 +    aiTextureType_EMISSIVE = 0x4,
  32.225 +
  32.226 +    /** The texture is a height map.
  32.227 +     *
  32.228 +     *  By convention, higher gray-scale values stand for
  32.229 +     *  higher elevations from the base height.
  32.230 +     */
  32.231 +    aiTextureType_HEIGHT = 0x5,
  32.232 +
  32.233 +    /** The texture is a (tangent space) normal-map.
  32.234 +     *
  32.235 +     *  Again, there are several conventions for tangent-space
  32.236 +     *  normal maps. Assimp does (intentionally) not
  32.237 +     *  distinguish here.
  32.238 +     */
  32.239 +    aiTextureType_NORMALS = 0x6,
  32.240 +
  32.241 +    /** The texture defines the glossiness of the material.
  32.242 +     *
  32.243 +     *  The glossiness is in fact the exponent of the specular
  32.244 +     *  (phong) lighting equation. Usually there is a conversion
  32.245 +     *  function defined to map the linear color values in the
  32.246 +     *  texture to a suitable exponent. Have fun.
  32.247 +    */
  32.248 +    aiTextureType_SHININESS = 0x7,
  32.249 +
  32.250 +    /** The texture defines per-pixel opacity.
  32.251 +     *
  32.252 +     *  Usually 'white' means opaque and 'black' means
  32.253 +     *  'transparency'. Or quite the opposite. Have fun.
  32.254 +    */
  32.255 +    aiTextureType_OPACITY = 0x8,
  32.256 +
  32.257 +    /** Displacement texture
  32.258 +     *
  32.259 +     *  The exact purpose and format is application-dependent.
  32.260 +     *  Higher color values stand for higher vertex displacements.
  32.261 +    */
  32.262 +    aiTextureType_DISPLACEMENT = 0x9,
  32.263 +
  32.264 +    /** Lightmap texture (aka Ambient Occlusion)
  32.265 +     *
  32.266 +     *  Both 'Lightmaps' and dedicated 'ambient occlusion maps' are
  32.267 +     *  covered by this material property. The texture contains a
  32.268 +     *  scaling value for the final color value of a pixel. Its
  32.269 +     *  intensity is not affected by incoming light.
  32.270 +    */
  32.271 +    aiTextureType_LIGHTMAP = 0xA,
  32.272 +
  32.273 +    /** Reflection texture
  32.274 +     *
  32.275 +     * Contains the color of a perfect mirror reflection.
  32.276 +     * Rarely used, almost never for real-time applications.
  32.277 +    */
  32.278 +    aiTextureType_REFLECTION = 0xB,
  32.279 +
  32.280 +    /** Unknown texture
  32.281 +     *
  32.282 +     *  A texture reference that does not match any of the definitions
  32.283 +     *  above is considered to be 'unknown'. It is still imported,
  32.284 +     *  but is excluded from any further postprocessing.
  32.285 +    */
  32.286 +    aiTextureType_UNKNOWN = 0xC,
  32.287 +
  32.288 +
  32.289 +#ifndef SWIG
  32.290 +    _aiTextureType_Force32Bit = INT_MAX
  32.291 +#endif
  32.292 +};
  32.293 +
  32.294 +#define AI_TEXTURE_TYPE_MAX  aiTextureType_UNKNOWN
  32.295 +
  32.296 +// ---------------------------------------------------------------------------
  32.297 +/** @brief Defines all shading models supported by the library
  32.298 + *
  32.299 + *  The list of shading modes has been taken from Blender.
  32.300 + *  See Blender documentation for more information. The API does
  32.301 + *  not distinguish between "specular" and "diffuse" shaders (thus the
  32.302 + *  specular term for diffuse shading models like Oren-Nayar remains
  32.303 + *  undefined). <br>
  32.304 + *  Again, this value is just a hint. Assimp tries to select the shader whose
  32.305 + *  most common implementation matches the original rendering results of the
  32.306 + *  3D modeller which wrote a particular model as closely as possible.
  32.307 + */
  32.308 +enum aiShadingMode
  32.309 +{
  32.310 +    /** Flat shading. Shading is done on per-face base,
  32.311 +     *  diffuse only. Also known as 'faceted shading'.
  32.312 +     */
  32.313 +    aiShadingMode_Flat = 0x1,
  32.314 +
  32.315 +    /** Simple Gouraud shading.
  32.316 +     */
  32.317 +    aiShadingMode_Gouraud = 0x2,
  32.318 +
  32.319 +    /** Phong-Shading -
  32.320 +     */
  32.321 +    aiShadingMode_Phong = 0x3,
  32.322 +
  32.323 +    /** Phong-Blinn-Shading
  32.324 +     */
  32.325 +    aiShadingMode_Blinn = 0x4,
  32.326 +
  32.327 +    /** Toon-Shading per pixel
  32.328 +     *
  32.329 +     *  Also known as 'comic' shader.
  32.330 +     */
  32.331 +    aiShadingMode_Toon = 0x5,
  32.332 +
  32.333 +    /** OrenNayar-Shading per pixel
  32.334 +     *
  32.335 +     *  Extension to standard Lambertian shading, taking the
  32.336 +     *  roughness of the material into account
  32.337 +     */
  32.338 +    aiShadingMode_OrenNayar = 0x6,
  32.339 +
  32.340 +    /** Minnaert-Shading per pixel
  32.341 +     *
  32.342 +     *  Extension to standard Lambertian shading, taking the
  32.343 +     *  "darkness" of the material into account
  32.344 +     */
  32.345 +    aiShadingMode_Minnaert = 0x7,
  32.346 +
  32.347 +    /** CookTorrance-Shading per pixel
  32.348 +     *
  32.349 +     *  Special shader for metallic surfaces.
  32.350 +     */
  32.351 +    aiShadingMode_CookTorrance = 0x8,
  32.352 +
  32.353 +    /** No shading at all. Constant light influence of 1.0.
  32.354 +    */
  32.355 +    aiShadingMode_NoShading = 0x9,
  32.356 +
  32.357 +     /** Fresnel shading
  32.358 +     */
  32.359 +    aiShadingMode_Fresnel = 0xa,
  32.360 +
  32.361 +
  32.362 +#ifndef SWIG
  32.363 +    _aiShadingMode_Force32Bit = INT_MAX
  32.364 +#endif
  32.365 +};
  32.366 +
  32.367 +
  32.368 +// ---------------------------------------------------------------------------
  32.369 +/** @brief Defines some mixed flags for a particular texture.
  32.370 + *
  32.371 + *  Usually you'll instruct your cg artists how textures have to look like ...
  32.372 + *  and how they will be processed in your application. However, if you use
  32.373 + *  Assimp for completely generic loading purposes you might also need to
  32.374 + *  process these flags in order to display as many 'unknown' 3D models as
  32.375 + *  possible correctly.
  32.376 + *
  32.377 + *  This corresponds to the #AI_MATKEY_TEXFLAGS property.
  32.378 +*/
  32.379 +enum aiTextureFlags
  32.380 +{
  32.381 +    /** The texture's color values have to be inverted (componentwise 1-n)
  32.382 +     */
  32.383 +    aiTextureFlags_Invert = 0x1,
  32.384 +
  32.385 +    /** Explicit request to the application to process the alpha channel
  32.386 +     *  of the texture.
  32.387 +     *
  32.388 +     *  Mutually exclusive with #aiTextureFlags_IgnoreAlpha. These
  32.389 +     *  flags are set if the library can say for sure that the alpha
  32.390 +     *  channel is used/is not used. If the model format does not
  32.391 +     *  define this, it is left to the application to decide whether
  32.392 +     *  the texture alpha channel - if any - is evaluated or not.
  32.393 +     */
  32.394 +    aiTextureFlags_UseAlpha = 0x2,
  32.395 +
  32.396 +    /** Explicit request to the application to ignore the alpha channel
  32.397 +     *  of the texture.
  32.398 +     *
  32.399 +     *  Mutually exclusive with #aiTextureFlags_UseAlpha.
  32.400 +     */
  32.401 +    aiTextureFlags_IgnoreAlpha = 0x4,
  32.402 +
  32.403 +#ifndef SWIG
  32.404 +      _aiTextureFlags_Force32Bit = INT_MAX
  32.405 +#endif
  32.406 +};
  32.407 +
  32.408 +
  32.409 +// ---------------------------------------------------------------------------
  32.410 +/** @brief Defines alpha-blend flags.
  32.411 + *
  32.412 + *  If you're familiar with OpenGL or D3D, these flags aren't new to you.
  32.413 + *  They define *how* the final color value of a pixel is computed, basing
  32.414 + *  on the previous color at that pixel and the new color value from the
  32.415 + *  material.
  32.416 + *  The blend formula is:
  32.417 + *  @code
  32.418 + *    SourceColor * SourceBlend + DestColor * DestBlend
  32.419 + *  @endcode
  32.420 + *  where DestColor is the previous color in the framebuffer at this
  32.421 + *  position and SourceColor is the material color before the transparency
  32.422 + *  calculation.<br>
  32.423 + *  This corresponds to the #AI_MATKEY_BLEND_FUNC property.
  32.424 +*/
  32.425 +enum aiBlendMode
  32.426 +{
  32.427 +    /**
  32.428 +     *  Formula:
  32.429 +     *  @code
  32.430 +     *  SourceColor*SourceAlpha + DestColor*(1-SourceAlpha)
  32.431 +     *  @endcode
  32.432 +     */
  32.433 +    aiBlendMode_Default = 0x0,
  32.434 +
  32.435 +    /** Additive blending
  32.436 +     *
  32.437 +     *  Formula:
  32.438 +     *  @code
  32.439 +     *  SourceColor*1 + DestColor*1
  32.440 +     *  @endcode
  32.441 +     */
  32.442 +    aiBlendMode_Additive = 0x1,
  32.443 +
  32.444 +    // we don't need more for the moment, but we might need them
  32.445 +    // in future versions ...
  32.446 +
  32.447 +#ifndef SWIG
  32.448 +    _aiBlendMode_Force32Bit = INT_MAX
  32.449 +#endif
  32.450 +};
  32.451 +
  32.452 +
  32.453 +#include "./Compiler/pushpack1.h"
  32.454 +
  32.455 +// ---------------------------------------------------------------------------
  32.456 +/** @brief Defines how an UV channel is transformed.
  32.457 + *
  32.458 + *  This is just a helper structure for the #AI_MATKEY_UVTRANSFORM key.
  32.459 + *  See its documentation for more details.
  32.460 + *
  32.461 + *  Typically you'll want to build a matrix of this information. However,
  32.462 + *  we keep separate scaling/translation/rotation values to make it
  32.463 + *  easier to process and optimize UV transformations internally.
  32.464 + */
  32.465 +struct aiUVTransform
  32.466 +{
  32.467 +    /** Translation on the u and v axes.
  32.468 +     *
  32.469 +     *  The default value is (0|0).
  32.470 +     */
  32.471 +    C_STRUCT aiVector2D mTranslation;
  32.472 +
  32.473 +    /** Scaling on the u and v axes.
  32.474 +     *
  32.475 +     *  The default value is (1|1).
  32.476 +     */
  32.477 +    C_STRUCT aiVector2D mScaling;
  32.478 +
  32.479 +    /** Rotation - in counter-clockwise direction.
  32.480 +     *
  32.481 +     *  The rotation angle is specified in radians. The
  32.482 +     *  rotation center is 0.5f|0.5f. The default value
  32.483 +     *  0.f.
  32.484 +     */
  32.485 +    ai_real mRotation;
  32.486 +
  32.487 +
  32.488 +#ifdef __cplusplus
  32.489 +    aiUVTransform() AI_NO_EXCEPT
  32.490 +        :   mTranslation (0.0,0.0)
  32.491 +        ,   mScaling    (1.0,1.0)
  32.492 +        ,   mRotation   (0.0)
  32.493 +    {
  32.494 +        // nothing to be done here ...
  32.495 +    }
  32.496 +#endif
  32.497 +
  32.498 +};
  32.499 +
  32.500 +#include "./Compiler/poppack1.h"
  32.501 +
  32.502 +//! @cond AI_DOX_INCLUDE_INTERNAL
  32.503 +// ---------------------------------------------------------------------------
  32.504 +/** @brief A very primitive RTTI system for the contents of material
  32.505 + *  properties.
  32.506 + */
  32.507 +enum aiPropertyTypeInfo
  32.508 +{
  32.509 +    /** Array of single-precision (32 Bit) floats
  32.510 +     *
  32.511 +     *  It is possible to use aiGetMaterialInteger[Array]() (or the C++-API
  32.512 +     *  aiMaterial::Get()) to query properties stored in floating-point format.
  32.513 +     *  The material system performs the type conversion automatically.
  32.514 +    */
  32.515 +    aiPTI_Float   = 0x1,
  32.516 +
  32.517 +    /** Array of double-precision (64 Bit) floats
  32.518 +     *
  32.519 +     *  It is possible to use aiGetMaterialInteger[Array]() (or the C++-API
  32.520 +     *  aiMaterial::Get()) to query properties stored in floating-point format.
  32.521 +     *  The material system performs the type conversion automatically.
  32.522 +    */
  32.523 +    aiPTI_Double   = 0x2,
  32.524 +
  32.525 +    /** The material property is an aiString.
  32.526 +     *
  32.527 +     *  Arrays of strings aren't possible, aiGetMaterialString() (or the
  32.528 +     *  C++-API aiMaterial::Get()) *must* be used to query a string property.
  32.529 +    */
  32.530 +    aiPTI_String  = 0x3,
  32.531 +
  32.532 +    /** Array of (32 Bit) integers
  32.533 +     *
  32.534 +     *  It is possible to use aiGetMaterialFloat[Array]() (or the C++-API
  32.535 +     *  aiMaterial::Get()) to query properties stored in integer format.
  32.536 +     *  The material system performs the type conversion automatically.
  32.537 +    */
  32.538 +    aiPTI_Integer = 0x4,
  32.539 +
  32.540 +
  32.541 +    /** Simple binary buffer, content undefined. Not convertible to anything.
  32.542 +    */
  32.543 +    aiPTI_Buffer  = 0x5,
  32.544 +
  32.545 +
  32.546 +     /** This value is not used. It is just there to force the
  32.547 +     *  compiler to map this enum to a 32 Bit integer.
  32.548 +     */
  32.549 +#ifndef SWIG
  32.550 +     _aiPTI_Force32Bit = INT_MAX
  32.551 +#endif
  32.552 +};
  32.553 +
  32.554 +// ---------------------------------------------------------------------------
  32.555 +/** @brief Data structure for a single material property
  32.556 + *
  32.557 + *  As an user, you'll probably never need to deal with this data structure.
  32.558 + *  Just use the provided aiGetMaterialXXX() or aiMaterial::Get() family
  32.559 + *  of functions to query material properties easily. Processing them
  32.560 + *  manually is faster, but it is not the recommended way. It isn't worth
  32.561 + *  the effort. <br>
  32.562 + *  Material property names follow a simple scheme:
  32.563 + *  @code
  32.564 + *    $<name>
  32.565 + *    ?<name>
  32.566 + *       A public property, there must be corresponding AI_MATKEY_XXX define
  32.567 + *       2nd: Public, but ignored by the #aiProcess_RemoveRedundantMaterials
  32.568 + *       post-processing step.
  32.569 + *    ~<name>
  32.570 + *       A temporary property for internal use.
  32.571 + *  @endcode
  32.572 + *  @see aiMaterial
  32.573 + */
  32.574 +struct aiMaterialProperty
  32.575 +{
  32.576 +    /** Specifies the name of the property (key)
  32.577 +     *  Keys are generally case insensitive.
  32.578 +     */
  32.579 +    C_STRUCT aiString mKey;
  32.580 +
  32.581 +    /** Textures: Specifies their exact usage semantic.
  32.582 +     * For non-texture properties, this member is always 0
  32.583 +     * (or, better-said, #aiTextureType_NONE).
  32.584 +     */
  32.585 +    unsigned int mSemantic;
  32.586 +
  32.587 +    /** Textures: Specifies the index of the texture.
  32.588 +     *  For non-texture properties, this member is always 0.
  32.589 +     */
  32.590 +    unsigned int mIndex;
  32.591 +
  32.592 +    /** Size of the buffer mData is pointing to, in bytes.
  32.593 +     *  This value may not be 0.
  32.594 +     */
  32.595 +    unsigned int mDataLength;
  32.596 +
  32.597 +    /** Type information for the property.
  32.598 +     *
  32.599 +     * Defines the data layout inside the data buffer. This is used
  32.600 +     * by the library internally to perform debug checks and to
  32.601 +     * utilize proper type conversions.
  32.602 +     * (It's probably a hacky solution, but it works.)
  32.603 +     */
  32.604 +    C_ENUM aiPropertyTypeInfo mType;
  32.605 +
  32.606 +    /** Binary buffer to hold the property's value.
  32.607 +     * The size of the buffer is always mDataLength.
  32.608 +     */
  32.609 +    char* mData;
  32.610 +
  32.611 +#ifdef __cplusplus
  32.612 +
  32.613 +    aiMaterialProperty() AI_NO_EXCEPT
  32.614 +    : mSemantic( 0 )
  32.615 +    , mIndex( 0 )
  32.616 +    , mDataLength( 0 )
  32.617 +    , mType( aiPTI_Float )
  32.618 +    , mData(0) {
  32.619 +        // empty
  32.620 +    }
  32.621 +
  32.622 +    ~aiMaterialProperty()   {
  32.623 +        delete[] mData;
  32.624 +        mData = 0;
  32.625 +    }
  32.626 +
  32.627 +#endif
  32.628 +};
  32.629 +//! @endcond
  32.630 +
  32.631 +#ifdef __cplusplus
  32.632 +} // We need to leave the "C" block here to allow template member functions
  32.633 +#endif
  32.634 +
  32.635 +// ---------------------------------------------------------------------------
  32.636 +/** @brief Data structure for a material
  32.637 +*
  32.638 +*  Material data is stored using a key-value structure. A single key-value
  32.639 +*  pair is called a 'material property'. C++ users should use the provided
  32.640 +*  member functions of aiMaterial to process material properties, C users
  32.641 +*  have to stick with the aiMaterialGetXXX family of unbound functions.
  32.642 +*  The library defines a set of standard keys (AI_MATKEY_XXX).
  32.643 +*/
  32.644 +#ifdef __cplusplus
  32.645 +struct ASSIMP_API aiMaterial
  32.646 +#else
  32.647 +struct aiMaterial
  32.648 +#endif
  32.649 +{
  32.650 +
  32.651 +#ifdef __cplusplus
  32.652 +
  32.653 +public:
  32.654 +
  32.655 +    aiMaterial();
  32.656 +    ~aiMaterial();
  32.657 +
  32.658 +    // -------------------------------------------------------------------
  32.659 +    /**
  32.660 +      * @brief  Returns the name of the material.
  32.661 +      * @return The name of the material.
  32.662 +      */
  32.663 +    // -------------------------------------------------------------------
  32.664 +    aiString GetName();
  32.665 +
  32.666 +    // -------------------------------------------------------------------
  32.667 +    /** @brief Retrieve an array of Type values with a specific key
  32.668 +     *  from the material
  32.669 +     *
  32.670 +     * @param pKey Key to search for. One of the AI_MATKEY_XXX constants.
  32.671 +     * @param type .. set by AI_MATKEY_XXX
  32.672 +     * @param idx .. set by AI_MATKEY_XXX
  32.673 +     * @param pOut Pointer to a buffer to receive the result.
  32.674 +     * @param pMax Specifies the size of the given buffer, in Type's.
  32.675 +     * Receives the number of values (not bytes!) read.
  32.676 +     * NULL is a valid value for this parameter.
  32.677 +     */
  32.678 +    template <typename Type>
  32.679 +    aiReturn Get(const char* pKey,unsigned int type,
  32.680 +        unsigned int idx, Type* pOut, unsigned int* pMax) const;
  32.681 +
  32.682 +    aiReturn Get(const char* pKey,unsigned int type,
  32.683 +        unsigned int idx, int* pOut, unsigned int* pMax) const;
  32.684 +
  32.685 +    aiReturn Get(const char* pKey,unsigned int type,
  32.686 +        unsigned int idx, ai_real* pOut, unsigned int* pMax) const;
  32.687 +
  32.688 +    // -------------------------------------------------------------------
  32.689 +    /** @brief Retrieve a Type value with a specific key
  32.690 +     *  from the material
  32.691 +     *
  32.692 +     * @param pKey Key to search for. One of the AI_MATKEY_XXX constants.
  32.693 +    * @param type Specifies the type of the texture to be retrieved (
  32.694 +    *    e.g. diffuse, specular, height map ...)
  32.695 +    * @param idx Index of the texture to be retrieved.
  32.696 +     * @param pOut Reference to receive the output value
  32.697 +     */
  32.698 +    template <typename Type>
  32.699 +    aiReturn Get(const char* pKey,unsigned int type,
  32.700 +        unsigned int idx,Type& pOut) const;
  32.701 +
  32.702 +
  32.703 +    aiReturn Get(const char* pKey,unsigned int type,
  32.704 +        unsigned int idx, int& pOut) const;
  32.705 +
  32.706 +    aiReturn Get(const char* pKey,unsigned int type,
  32.707 +        unsigned int idx, ai_real& pOut) const;
  32.708 +
  32.709 +    aiReturn Get(const char* pKey,unsigned int type,
  32.710 +        unsigned int idx, aiString& pOut) const;
  32.711 +
  32.712 +    aiReturn Get(const char* pKey,unsigned int type,
  32.713 +        unsigned int idx, aiColor3D& pOut) const;
  32.714 +
  32.715 +    aiReturn Get(const char* pKey,unsigned int type,
  32.716 +        unsigned int idx, aiColor4D& pOut) const;
  32.717 +
  32.718 +    aiReturn Get(const char* pKey,unsigned int type,
  32.719 +        unsigned int idx, aiUVTransform& pOut) const;
  32.720 +
  32.721 +    // -------------------------------------------------------------------
  32.722 +    /** Get the number of textures for a particular texture type.
  32.723 +     *  @param type Texture type to check for
  32.724 +     *  @return Number of textures for this type.
  32.725 +     *  @note A texture can be easily queried using #GetTexture() */
  32.726 +    unsigned int GetTextureCount(aiTextureType type) const;
  32.727 +
  32.728 +    // -------------------------------------------------------------------
  32.729 +    /** Helper function to get all parameters pertaining to a
  32.730 +     *  particular texture slot from a material.
  32.731 +     *
  32.732 +     *  This function is provided just for convenience, you could also
  32.733 +     *  read the single material properties manually.
  32.734 +     *  @param type Specifies the type of the texture to be retrieved (
  32.735 +     *    e.g. diffuse, specular, height map ...)
  32.736 +     *  @param index Index of the texture to be retrieved. The function fails
  32.737 +     *    if there is no texture of that type with this index.
  32.738 +     *    #GetTextureCount() can be used to determine the number of textures
  32.739 +     *    per texture type.
  32.740 +     *  @param path Receives the path to the texture.
  32.741 +     *    If the texture is embedded, receives a '*' followed by the id of
  32.742 +     *    the texture (for the textures stored in the corresponding scene) which
  32.743 +     *    can be converted to an int using a function like atoi.
  32.744 +     *    NULL is a valid value.
  32.745 +     *  @param mapping The texture mapping.
  32.746 +     *    NULL is allowed as value.
  32.747 +     *  @param uvindex Receives the UV index of the texture.
  32.748 +     *    NULL is a valid value.
  32.749 +     *  @param blend Receives the blend factor for the texture
  32.750 +     *    NULL is a valid value.
  32.751 +     *  @param op Receives the texture operation to be performed between
  32.752 +     *    this texture and the previous texture. NULL is allowed as value.
  32.753 +     *  @param mapmode Receives the mapping modes to be used for the texture.
  32.754 +     *    The parameter may be NULL but if it is a valid pointer it MUST
  32.755 +     *    point to an array of 3 aiTextureMapMode's (one for each
  32.756 +     *    axis: UVW order (=XYZ)).
  32.757 +     */
  32.758 +    // -------------------------------------------------------------------
  32.759 +    aiReturn GetTexture(aiTextureType type,
  32.760 +        unsigned int  index,
  32.761 +        C_STRUCT aiString* path,
  32.762 +        aiTextureMapping* mapping   = NULL,
  32.763 +        unsigned int* uvindex       = NULL,
  32.764 +        ai_real* blend              = NULL,
  32.765 +        aiTextureOp* op             = NULL,
  32.766 +        aiTextureMapMode* mapmode   = NULL) const;
  32.767 +
  32.768 +
  32.769 +    // Setters
  32.770 +
  32.771 +
  32.772 +    // ------------------------------------------------------------------------------
  32.773 +    /** @brief Add a property with a given key and type info to the material
  32.774 +     *  structure
  32.775 +     *
  32.776 +     *  @param pInput Pointer to input data
  32.777 +     *  @param pSizeInBytes Size of input data
  32.778 +     *  @param pKey Key/Usage of the property (AI_MATKEY_XXX)
  32.779 +     *  @param type Set by the AI_MATKEY_XXX macro
  32.780 +     *  @param index Set by the AI_MATKEY_XXX macro
  32.781 +     *  @param pType Type information hint */
  32.782 +    aiReturn AddBinaryProperty (const void* pInput,
  32.783 +        unsigned int pSizeInBytes,
  32.784 +        const char* pKey,
  32.785 +        unsigned int type ,
  32.786 +        unsigned int index ,
  32.787 +        aiPropertyTypeInfo pType);
  32.788 +
  32.789 +    // ------------------------------------------------------------------------------
  32.790 +    /** @brief Add a string property with a given key and type info to the
  32.791 +     *  material structure
  32.792 +     *
  32.793 +     *  @param pInput Input string
  32.794 +     *  @param pKey Key/Usage of the property (AI_MATKEY_XXX)
  32.795 +     *  @param type Set by the AI_MATKEY_XXX macro
  32.796 +     *  @param index Set by the AI_MATKEY_XXX macro */
  32.797 +    aiReturn AddProperty (const aiString* pInput,
  32.798 +        const char* pKey,
  32.799 +        unsigned int type  = 0,
  32.800 +        unsigned int index = 0);
  32.801 +
  32.802 +    // ------------------------------------------------------------------------------
  32.803 +    /** @brief Add a property with a given key to the material structure
  32.804 +     *  @param pInput Pointer to the input data
  32.805 +     *  @param pNumValues Number of values in the array
  32.806 +     *  @param pKey Key/Usage of the property (AI_MATKEY_XXX)
  32.807 +     *  @param type Set by the AI_MATKEY_XXX macro
  32.808 +     *  @param index Set by the AI_MATKEY_XXX macro  */
  32.809 +    template<class TYPE>
  32.810 +    aiReturn AddProperty (const TYPE* pInput,
  32.811 +        unsigned int pNumValues,
  32.812 +        const char* pKey,
  32.813 +        unsigned int type  = 0,
  32.814 +        unsigned int index = 0);
  32.815 +
  32.816 +    aiReturn AddProperty (const aiVector3D* pInput,
  32.817 +        unsigned int pNumValues,
  32.818 +        const char* pKey,
  32.819 +        unsigned int type  = 0,
  32.820 +        unsigned int index = 0);
  32.821 +
  32.822 +    aiReturn AddProperty (const aiColor3D* pInput,
  32.823 +        unsigned int pNumValues,
  32.824 +        const char* pKey,
  32.825 +        unsigned int type  = 0,
  32.826 +        unsigned int index = 0);
  32.827 +
  32.828 +    aiReturn AddProperty (const aiColor4D* pInput,
  32.829 +        unsigned int pNumValues,
  32.830 +        const char* pKey,
  32.831 +        unsigned int type  = 0,
  32.832 +        unsigned int index = 0);
  32.833 +
  32.834 +    aiReturn AddProperty (const int* pInput,
  32.835 +        unsigned int pNumValues,
  32.836 +        const char* pKey,
  32.837 +        unsigned int type  = 0,
  32.838 +        unsigned int index = 0);
  32.839 +
  32.840 +    aiReturn AddProperty (const float* pInput,
  32.841 +        unsigned int pNumValues,
  32.842 +        const char* pKey,
  32.843 +        unsigned int type  = 0,
  32.844 +        unsigned int index = 0);
  32.845 +
  32.846 +    aiReturn AddProperty (const double* pInput,
  32.847 +        unsigned int pNumValues,
  32.848 +        const char* pKey,
  32.849 +        unsigned int type  = 0,
  32.850 +        unsigned int index = 0);
  32.851 +
  32.852 +    aiReturn AddProperty (const aiUVTransform* pInput,
  32.853 +        unsigned int pNumValues,
  32.854 +        const char* pKey,
  32.855 +        unsigned int type  = 0,
  32.856 +        unsigned int index = 0);
  32.857 +
  32.858 +    // ------------------------------------------------------------------------------
  32.859 +    /** @brief Remove a given key from the list.
  32.860 +     *
  32.861 +     *  The function fails if the key isn't found
  32.862 +     *  @param pKey Key to be deleted
  32.863 +     *  @param type Set by the AI_MATKEY_XXX macro
  32.864 +     *  @param index Set by the AI_MATKEY_XXX macro  */
  32.865 +    aiReturn RemoveProperty (const char* pKey,
  32.866 +        unsigned int type  = 0,
  32.867 +        unsigned int index = 0);
  32.868 +
  32.869 +    // ------------------------------------------------------------------------------
  32.870 +    /** @brief Removes all properties from the material.
  32.871 +     *
  32.872 +     *  The data array remains allocated so adding new properties is quite fast.  */
  32.873 +    void Clear();
  32.874 +
  32.875 +    // ------------------------------------------------------------------------------
  32.876 +    /** Copy the property list of a material
  32.877 +     *  @param pcDest Destination material
  32.878 +     *  @param pcSrc Source material
  32.879 +     */
  32.880 +    static void CopyPropertyList(aiMaterial* pcDest,
  32.881 +        const aiMaterial* pcSrc);
  32.882 +
  32.883 +
  32.884 +#endif
  32.885 +
  32.886 +    /** List of all material properties loaded. */
  32.887 +    C_STRUCT aiMaterialProperty** mProperties;
  32.888 +
  32.889 +    /** Number of properties in the data base */
  32.890 +    unsigned int mNumProperties;
  32.891 +
  32.892 +     /** Storage allocated */
  32.893 +    unsigned int mNumAllocated;
  32.894 +};
  32.895 +
  32.896 +// Go back to extern "C" again
  32.897 +#ifdef __cplusplus
  32.898 +extern "C" {
  32.899 +#endif
  32.900 +
  32.901 +// ---------------------------------------------------------------------------
  32.902 +#define AI_MATKEY_NAME "?mat.name",0,0
  32.903 +#define AI_MATKEY_TWOSIDED "$mat.twosided",0,0
  32.904 +#define AI_MATKEY_SHADING_MODEL "$mat.shadingm",0,0
  32.905 +#define AI_MATKEY_ENABLE_WIREFRAME "$mat.wireframe",0,0
  32.906 +#define AI_MATKEY_BLEND_FUNC "$mat.blend",0,0
  32.907 +#define AI_MATKEY_OPACITY "$mat.opacity",0,0
  32.908 +#define AI_MATKEY_BUMPSCALING "$mat.bumpscaling",0,0
  32.909 +#define AI_MATKEY_SHININESS "$mat.shininess",0,0
  32.910 +#define AI_MATKEY_REFLECTIVITY "$mat.reflectivity",0,0
  32.911 +#define AI_MATKEY_SHININESS_STRENGTH "$mat.shinpercent",0,0
  32.912 +#define AI_MATKEY_REFRACTI "$mat.refracti",0,0
  32.913 +#define AI_MATKEY_COLOR_DIFFUSE "$clr.diffuse",0,0
  32.914 +#define AI_MATKEY_COLOR_AMBIENT "$clr.ambient",0,0
  32.915 +#define AI_MATKEY_COLOR_SPECULAR "$clr.specular",0,0
  32.916 +#define AI_MATKEY_COLOR_EMISSIVE "$clr.emissive",0,0
  32.917 +#define AI_MATKEY_COLOR_TRANSPARENT "$clr.transparent",0,0
  32.918 +#define AI_MATKEY_COLOR_REFLECTIVE "$clr.reflective",0,0
  32.919 +#define AI_MATKEY_GLOBAL_BACKGROUND_IMAGE "?bg.global",0,0
  32.920 +
  32.921 +// ---------------------------------------------------------------------------
  32.922 +// Pure key names for all texture-related properties
  32.923 +//! @cond MATS_DOC_FULL
  32.924 +#define _AI_MATKEY_TEXTURE_BASE         "$tex.file"
  32.925 +#define _AI_MATKEY_UVWSRC_BASE          "$tex.uvwsrc"
  32.926 +#define _AI_MATKEY_TEXOP_BASE           "$tex.op"
  32.927 +#define _AI_MATKEY_MAPPING_BASE         "$tex.mapping"
  32.928 +#define _AI_MATKEY_TEXBLEND_BASE        "$tex.blend"
  32.929 +#define _AI_MATKEY_MAPPINGMODE_U_BASE   "$tex.mapmodeu"
  32.930 +#define _AI_MATKEY_MAPPINGMODE_V_BASE   "$tex.mapmodev"
  32.931 +#define _AI_MATKEY_TEXMAP_AXIS_BASE     "$tex.mapaxis"
  32.932 +#define _AI_MATKEY_UVTRANSFORM_BASE     "$tex.uvtrafo"
  32.933 +#define _AI_MATKEY_TEXFLAGS_BASE        "$tex.flags"
  32.934 +//! @endcond
  32.935 +
  32.936 +// ---------------------------------------------------------------------------
  32.937 +#define AI_MATKEY_TEXTURE(type, N) _AI_MATKEY_TEXTURE_BASE,type,N
  32.938 +
  32.939 +// For backward compatibility and simplicity
  32.940 +//! @cond MATS_DOC_FULL
  32.941 +#define AI_MATKEY_TEXTURE_DIFFUSE(N)    \
  32.942 +    AI_MATKEY_TEXTURE(aiTextureType_DIFFUSE,N)
  32.943 +
  32.944 +#define AI_MATKEY_TEXTURE_SPECULAR(N)   \
  32.945 +    AI_MATKEY_TEXTURE(aiTextureType_SPECULAR,N)
  32.946 +
  32.947 +#define AI_MATKEY_TEXTURE_AMBIENT(N)    \
  32.948 +    AI_MATKEY_TEXTURE(aiTextureType_AMBIENT,N)
  32.949 +
  32.950 +#define AI_MATKEY_TEXTURE_EMISSIVE(N)   \
  32.951 +    AI_MATKEY_TEXTURE(aiTextureType_EMISSIVE,N)
  32.952 +
  32.953 +#define AI_MATKEY_TEXTURE_NORMALS(N)    \
  32.954 +    AI_MATKEY_TEXTURE(aiTextureType_NORMALS,N)
  32.955 +
  32.956 +#define AI_MATKEY_TEXTURE_HEIGHT(N) \
  32.957 +    AI_MATKEY_TEXTURE(aiTextureType_HEIGHT,N)
  32.958 +
  32.959 +#define AI_MATKEY_TEXTURE_SHININESS(N)  \
  32.960 +    AI_MATKEY_TEXTURE(aiTextureType_SHININESS,N)
  32.961 +
  32.962 +#define AI_MATKEY_TEXTURE_OPACITY(N)    \
  32.963 +    AI_MATKEY_TEXTURE(aiTextureType_OPACITY,N)
  32.964 +
  32.965 +#define AI_MATKEY_TEXTURE_DISPLACEMENT(N)   \
  32.966 +    AI_MATKEY_TEXTURE(aiTextureType_DISPLACEMENT,N)
  32.967 +
  32.968 +#define AI_MATKEY_TEXTURE_LIGHTMAP(N)   \
  32.969 +    AI_MATKEY_TEXTURE(aiTextureType_LIGHTMAP,N)
  32.970 +
  32.971 +#define AI_MATKEY_TEXTURE_REFLECTION(N) \
  32.972 +    AI_MATKEY_TEXTURE(aiTextureType_REFLECTION,N)
  32.973 +
  32.974 +//! @endcond
  32.975 +
  32.976 +// ---------------------------------------------------------------------------
  32.977 +#define AI_MATKEY_UVWSRC(type, N) _AI_MATKEY_UVWSRC_BASE,type,N
  32.978 +
  32.979 +// For backward compatibility and simplicity
  32.980 +//! @cond MATS_DOC_FULL
  32.981 +#define AI_MATKEY_UVWSRC_DIFFUSE(N) \
  32.982 +    AI_MATKEY_UVWSRC(aiTextureType_DIFFUSE,N)
  32.983 +
  32.984 +#define AI_MATKEY_UVWSRC_SPECULAR(N)    \
  32.985 +    AI_MATKEY_UVWSRC(aiTextureType_SPECULAR,N)
  32.986 +
  32.987 +#define AI_MATKEY_UVWSRC_AMBIENT(N) \
  32.988 +    AI_MATKEY_UVWSRC(aiTextureType_AMBIENT,N)
  32.989 +
  32.990 +#define AI_MATKEY_UVWSRC_EMISSIVE(N)    \
  32.991 +    AI_MATKEY_UVWSRC(aiTextureType_EMISSIVE,N)
  32.992 +
  32.993 +#define AI_MATKEY_UVWSRC_NORMALS(N) \
  32.994 +    AI_MATKEY_UVWSRC(aiTextureType_NORMALS,N)
  32.995 +
  32.996 +#define AI_MATKEY_UVWSRC_HEIGHT(N)  \
  32.997 +    AI_MATKEY_UVWSRC(aiTextureType_HEIGHT,N)
  32.998 +
  32.999 +#define AI_MATKEY_UVWSRC_SHININESS(N)   \
 32.1000 +    AI_MATKEY_UVWSRC(aiTextureType_SHININESS,N)
 32.1001 +
 32.1002 +#define AI_MATKEY_UVWSRC_OPACITY(N) \
 32.1003 +    AI_MATKEY_UVWSRC(aiTextureType_OPACITY,N)
 32.1004 +
 32.1005 +#define AI_MATKEY_UVWSRC_DISPLACEMENT(N)    \
 32.1006 +    AI_MATKEY_UVWSRC(aiTextureType_DISPLACEMENT,N)
 32.1007 +
 32.1008 +#define AI_MATKEY_UVWSRC_LIGHTMAP(N)    \
 32.1009 +    AI_MATKEY_UVWSRC(aiTextureType_LIGHTMAP,N)
 32.1010 +
 32.1011 +#define AI_MATKEY_UVWSRC_REFLECTION(N)  \
 32.1012 +    AI_MATKEY_UVWSRC(aiTextureType_REFLECTION,N)
 32.1013 +
 32.1014 +//! @endcond
 32.1015 +// ---------------------------------------------------------------------------
 32.1016 +#define AI_MATKEY_TEXOP(type, N) _AI_MATKEY_TEXOP_BASE,type,N
 32.1017 +
 32.1018 +// For backward compatibility and simplicity
 32.1019 +//! @cond MATS_DOC_FULL
 32.1020 +#define AI_MATKEY_TEXOP_DIFFUSE(N)  \
 32.1021 +    AI_MATKEY_TEXOP(aiTextureType_DIFFUSE,N)
 32.1022 +
 32.1023 +#define AI_MATKEY_TEXOP_SPECULAR(N) \
 32.1024 +    AI_MATKEY_TEXOP(aiTextureType_SPECULAR,N)
 32.1025 +
 32.1026 +#define AI_MATKEY_TEXOP_AMBIENT(N)  \
 32.1027 +    AI_MATKEY_TEXOP(aiTextureType_AMBIENT,N)
 32.1028 +
 32.1029 +#define AI_MATKEY_TEXOP_EMISSIVE(N) \
 32.1030 +    AI_MATKEY_TEXOP(aiTextureType_EMISSIVE,N)
 32.1031 +
 32.1032 +#define AI_MATKEY_TEXOP_NORMALS(N)  \
 32.1033 +    AI_MATKEY_TEXOP(aiTextureType_NORMALS,N)
 32.1034 +
 32.1035 +#define AI_MATKEY_TEXOP_HEIGHT(N)   \
 32.1036 +    AI_MATKEY_TEXOP(aiTextureType_HEIGHT,N)
 32.1037 +
 32.1038 +#define AI_MATKEY_TEXOP_SHININESS(N)    \
 32.1039 +    AI_MATKEY_TEXOP(aiTextureType_SHININESS,N)
 32.1040 +
 32.1041 +#define AI_MATKEY_TEXOP_OPACITY(N)  \
 32.1042 +    AI_MATKEY_TEXOP(aiTextureType_OPACITY,N)
 32.1043 +
 32.1044 +#define AI_MATKEY_TEXOP_DISPLACEMENT(N) \
 32.1045 +    AI_MATKEY_TEXOP(aiTextureType_DISPLACEMENT,N)
 32.1046 +
 32.1047 +#define AI_MATKEY_TEXOP_LIGHTMAP(N) \
 32.1048 +    AI_MATKEY_TEXOP(aiTextureType_LIGHTMAP,N)
 32.1049 +
 32.1050 +#define AI_MATKEY_TEXOP_REFLECTION(N)   \
 32.1051 +    AI_MATKEY_TEXOP(aiTextureType_REFLECTION,N)
 32.1052 +
 32.1053 +//! @endcond
 32.1054 +// ---------------------------------------------------------------------------
 32.1055 +#define AI_MATKEY_MAPPING(type, N) _AI_MATKEY_MAPPING_BASE,type,N
 32.1056 +
 32.1057 +// For backward compatibility and simplicity
 32.1058 +//! @cond MATS_DOC_FULL
 32.1059 +#define AI_MATKEY_MAPPING_DIFFUSE(N)    \
 32.1060 +    AI_MATKEY_MAPPING(aiTextureType_DIFFUSE,N)
 32.1061 +
 32.1062 +#define AI_MATKEY_MAPPING_SPECULAR(N)   \
 32.1063 +    AI_MATKEY_MAPPING(aiTextureType_SPECULAR,N)
 32.1064 +
 32.1065 +#define AI_MATKEY_MAPPING_AMBIENT(N)    \
 32.1066 +    AI_MATKEY_MAPPING(aiTextureType_AMBIENT,N)
 32.1067 +
 32.1068 +#define AI_MATKEY_MAPPING_EMISSIVE(N)   \
 32.1069 +    AI_MATKEY_MAPPING(aiTextureType_EMISSIVE,N)
 32.1070 +
 32.1071 +#define AI_MATKEY_MAPPING_NORMALS(N)    \
 32.1072 +    AI_MATKEY_MAPPING(aiTextureType_NORMALS,N)
 32.1073 +
 32.1074 +#define AI_MATKEY_MAPPING_HEIGHT(N) \
 32.1075 +    AI_MATKEY_MAPPING(aiTextureType_HEIGHT,N)
 32.1076 +
 32.1077 +#define AI_MATKEY_MAPPING_SHININESS(N)  \
 32.1078 +    AI_MATKEY_MAPPING(aiTextureType_SHININESS,N)
 32.1079 +
 32.1080 +#define AI_MATKEY_MAPPING_OPACITY(N)    \
 32.1081 +    AI_MATKEY_MAPPING(aiTextureType_OPACITY,N)
 32.1082 +
 32.1083 +#define AI_MATKEY_MAPPING_DISPLACEMENT(N)   \
 32.1084 +    AI_MATKEY_MAPPING(aiTextureType_DISPLACEMENT,N)
 32.1085 +
 32.1086 +#define AI_MATKEY_MAPPING_LIGHTMAP(N)   \
 32.1087 +    AI_MATKEY_MAPPING(aiTextureType_LIGHTMAP,N)
 32.1088 +
 32.1089 +#define AI_MATKEY_MAPPING_REFLECTION(N) \
 32.1090 +    AI_MATKEY_MAPPING(aiTextureType_REFLECTION,N)
 32.1091 +
 32.1092 +//! @endcond
 32.1093 +// ---------------------------------------------------------------------------
 32.1094 +#define AI_MATKEY_TEXBLEND(type, N) _AI_MATKEY_TEXBLEND_BASE,type,N
 32.1095 +
 32.1096 +// For backward compatibility and simplicity
 32.1097 +//! @cond MATS_DOC_FULL
 32.1098 +#define AI_MATKEY_TEXBLEND_DIFFUSE(N)   \
 32.1099 +    AI_MATKEY_TEXBLEND(aiTextureType_DIFFUSE,N)
 32.1100 +
 32.1101 +#define AI_MATKEY_TEXBLEND_SPECULAR(N)  \
 32.1102 +    AI_MATKEY_TEXBLEND(aiTextureType_SPECULAR,N)
 32.1103 +
 32.1104 +#define AI_MATKEY_TEXBLEND_AMBIENT(N)   \
 32.1105 +    AI_MATKEY_TEXBLEND(aiTextureType_AMBIENT,N)
 32.1106 +
 32.1107 +#define AI_MATKEY_TEXBLEND_EMISSIVE(N)  \
 32.1108 +    AI_MATKEY_TEXBLEND(aiTextureType_EMISSIVE,N)
 32.1109 +
 32.1110 +#define AI_MATKEY_TEXBLEND_NORMALS(N)   \
 32.1111 +    AI_MATKEY_TEXBLEND(aiTextureType_NORMALS,N)
 32.1112 +
 32.1113 +#define AI_MATKEY_TEXBLEND_HEIGHT(N)    \
 32.1114 +    AI_MATKEY_TEXBLEND(aiTextureType_HEIGHT,N)
 32.1115 +
 32.1116 +#define AI_MATKEY_TEXBLEND_SHININESS(N) \
 32.1117 +    AI_MATKEY_TEXBLEND(aiTextureType_SHININESS,N)
 32.1118 +
 32.1119 +#define AI_MATKEY_TEXBLEND_OPACITY(N)   \
 32.1120 +    AI_MATKEY_TEXBLEND(aiTextureType_OPACITY,N)
 32.1121 +
 32.1122 +#define AI_MATKEY_TEXBLEND_DISPLACEMENT(N)  \
 32.1123 +    AI_MATKEY_TEXBLEND(aiTextureType_DISPLACEMENT,N)
 32.1124 +
 32.1125 +#define AI_MATKEY_TEXBLEND_LIGHTMAP(N)  \
 32.1126 +    AI_MATKEY_TEXBLEND(aiTextureType_LIGHTMAP,N)
 32.1127 +
 32.1128 +#define AI_MATKEY_TEXBLEND_REFLECTION(N)    \
 32.1129 +    AI_MATKEY_TEXBLEND(aiTextureType_REFLECTION,N)
 32.1130 +
 32.1131 +//! @endcond
 32.1132 +// ---------------------------------------------------------------------------
 32.1133 +#define AI_MATKEY_MAPPINGMODE_U(type, N) _AI_MATKEY_MAPPINGMODE_U_BASE,type,N
 32.1134 +
 32.1135 +// For backward compatibility and simplicity
 32.1136 +//! @cond MATS_DOC_FULL
 32.1137 +#define AI_MATKEY_MAPPINGMODE_U_DIFFUSE(N)  \
 32.1138 +    AI_MATKEY_MAPPINGMODE_U(aiTextureType_DIFFUSE,N)
 32.1139 +
 32.1140 +#define AI_MATKEY_MAPPINGMODE_U_SPECULAR(N) \
 32.1141 +    AI_MATKEY_MAPPINGMODE_U(aiTextureType_SPECULAR,N)
 32.1142 +
 32.1143 +#define AI_MATKEY_MAPPINGMODE_U_AMBIENT(N)  \
 32.1144 +    AI_MATKEY_MAPPINGMODE_U(aiTextureType_AMBIENT,N)
 32.1145 +
 32.1146 +#define AI_MATKEY_MAPPINGMODE_U_EMISSIVE(N) \
 32.1147 +    AI_MATKEY_MAPPINGMODE_U(aiTextureType_EMISSIVE,N)
 32.1148 +
 32.1149 +#define AI_MATKEY_MAPPINGMODE_U_NORMALS(N)  \
 32.1150 +    AI_MATKEY_MAPPINGMODE_U(aiTextureType_NORMALS,N)
 32.1151 +
 32.1152 +#define AI_MATKEY_MAPPINGMODE_U_HEIGHT(N)   \
 32.1153 +    AI_MATKEY_MAPPINGMODE_U(aiTextureType_HEIGHT,N)
 32.1154 +
 32.1155 +#define AI_MATKEY_MAPPINGMODE_U_SHININESS(N)    \
 32.1156 +    AI_MATKEY_MAPPINGMODE_U(aiTextureType_SHININESS,N)
 32.1157 +
 32.1158 +#define AI_MATKEY_MAPPINGMODE_U_OPACITY(N)  \
 32.1159 +    AI_MATKEY_MAPPINGMODE_U(aiTextureType_OPACITY,N)
 32.1160 +
 32.1161 +#define AI_MATKEY_MAPPINGMODE_U_DISPLACEMENT(N) \
 32.1162 +    AI_MATKEY_MAPPINGMODE_U(aiTextureType_DISPLACEMENT,N)
 32.1163 +
 32.1164 +#define AI_MATKEY_MAPPINGMODE_U_LIGHTMAP(N) \
 32.1165 +    AI_MATKEY_MAPPINGMODE_U(aiTextureType_LIGHTMAP,N)
 32.1166 +
 32.1167 +#define AI_MATKEY_MAPPINGMODE_U_REFLECTION(N)   \
 32.1168 +    AI_MATKEY_MAPPINGMODE_U(aiTextureType_REFLECTION,N)
 32.1169 +
 32.1170 +//! @endcond
 32.1171 +// ---------------------------------------------------------------------------
 32.1172 +#define AI_MATKEY_MAPPINGMODE_V(type, N) _AI_MATKEY_MAPPINGMODE_V_BASE,type,N
 32.1173 +
 32.1174 +// For backward compatibility and simplicity
 32.1175 +//! @cond MATS_DOC_FULL
 32.1176 +#define AI_MATKEY_MAPPINGMODE_V_DIFFUSE(N)  \
 32.1177 +    AI_MATKEY_MAPPINGMODE_V(aiTextureType_DIFFUSE,N)
 32.1178 +
 32.1179 +#define AI_MATKEY_MAPPINGMODE_V_SPECULAR(N) \
 32.1180 +    AI_MATKEY_MAPPINGMODE_V(aiTextureType_SPECULAR,N)
 32.1181 +
 32.1182 +#define AI_MATKEY_MAPPINGMODE_V_AMBIENT(N)  \
 32.1183 +    AI_MATKEY_MAPPINGMODE_V(aiTextureType_AMBIENT,N)
 32.1184 +
 32.1185 +#define AI_MATKEY_MAPPINGMODE_V_EMISSIVE(N) \
 32.1186 +    AI_MATKEY_MAPPINGMODE_V(aiTextureType_EMISSIVE,N)
 32.1187 +
 32.1188 +#define AI_MATKEY_MAPPINGMODE_V_NORMALS(N)  \
 32.1189 +    AI_MATKEY_MAPPINGMODE_V(aiTextureType_NORMALS,N)
 32.1190 +
 32.1191 +#define AI_MATKEY_MAPPINGMODE_V_HEIGHT(N)   \
 32.1192 +    AI_MATKEY_MAPPINGMODE_V(aiTextureType_HEIGHT,N)
 32.1193 +
 32.1194 +#define AI_MATKEY_MAPPINGMODE_V_SHININESS(N)    \
 32.1195 +    AI_MATKEY_MAPPINGMODE_V(aiTextureType_SHININESS,N)
 32.1196 +
 32.1197 +#define AI_MATKEY_MAPPINGMODE_V_OPACITY(N)  \
 32.1198 +    AI_MATKEY_MAPPINGMODE_V(aiTextureType_OPACITY,N)
 32.1199 +
 32.1200 +#define AI_MATKEY_MAPPINGMODE_V_DISPLACEMENT(N) \
 32.1201 +    AI_MATKEY_MAPPINGMODE_V(aiTextureType_DISPLACEMENT,N)
 32.1202 +
 32.1203 +#define AI_MATKEY_MAPPINGMODE_V_LIGHTMAP(N) \
 32.1204 +    AI_MATKEY_MAPPINGMODE_V(aiTextureType_LIGHTMAP,N)
 32.1205 +
 32.1206 +#define AI_MATKEY_MAPPINGMODE_V_REFLECTION(N)   \
 32.1207 +    AI_MATKEY_MAPPINGMODE_V(aiTextureType_REFLECTION,N)
 32.1208 +
 32.1209 +//! @endcond
 32.1210 +// ---------------------------------------------------------------------------
 32.1211 +#define AI_MATKEY_TEXMAP_AXIS(type, N) _AI_MATKEY_TEXMAP_AXIS_BASE,type,N
 32.1212 +
 32.1213 +// For backward compatibility and simplicity
 32.1214 +//! @cond MATS_DOC_FULL
 32.1215 +#define AI_MATKEY_TEXMAP_AXIS_DIFFUSE(N)    \
 32.1216 +    AI_MATKEY_TEXMAP_AXIS(aiTextureType_DIFFUSE,N)
 32.1217 +
 32.1218 +#define AI_MATKEY_TEXMAP_AXIS_SPECULAR(N)   \
 32.1219 +    AI_MATKEY_TEXMAP_AXIS(aiTextureType_SPECULAR,N)
 32.1220 +
 32.1221 +#define AI_MATKEY_TEXMAP_AXIS_AMBIENT(N)    \
 32.1222 +    AI_MATKEY_TEXMAP_AXIS(aiTextureType_AMBIENT,N)
 32.1223 +
 32.1224 +#define AI_MATKEY_TEXMAP_AXIS_EMISSIVE(N)   \
 32.1225 +    AI_MATKEY_TEXMAP_AXIS(aiTextureType_EMISSIVE,N)
 32.1226 +
 32.1227 +#define AI_MATKEY_TEXMAP_AXIS_NORMALS(N)    \
 32.1228 +    AI_MATKEY_TEXMAP_AXIS(aiTextureType_NORMALS,N)
 32.1229 +
 32.1230 +#define AI_MATKEY_TEXMAP_AXIS_HEIGHT(N) \
 32.1231 +    AI_MATKEY_TEXMAP_AXIS(aiTextureType_HEIGHT,N)
 32.1232 +
 32.1233 +#define AI_MATKEY_TEXMAP_AXIS_SHININESS(N)  \
 32.1234 +    AI_MATKEY_TEXMAP_AXIS(aiTextureType_SHININESS,N)
 32.1235 +
 32.1236 +#define AI_MATKEY_TEXMAP_AXIS_OPACITY(N)    \
 32.1237 +    AI_MATKEY_TEXMAP_AXIS(aiTextureType_OPACITY,N)
 32.1238 +
 32.1239 +#define AI_MATKEY_TEXMAP_AXIS_DISPLACEMENT(N)   \
 32.1240 +    AI_MATKEY_TEXMAP_AXIS(aiTextureType_DISPLACEMENT,N)
 32.1241 +
 32.1242 +#define AI_MATKEY_TEXMAP_AXIS_LIGHTMAP(N)   \
 32.1243 +    AI_MATKEY_TEXMAP_AXIS(aiTextureType_LIGHTMAP,N)
 32.1244 +
 32.1245 +#define AI_MATKEY_TEXMAP_AXIS_REFLECTION(N) \
 32.1246 +    AI_MATKEY_TEXMAP_AXIS(aiTextureType_REFLECTION,N)
 32.1247 +
 32.1248 +//! @endcond
 32.1249 +// ---------------------------------------------------------------------------
 32.1250 +#define AI_MATKEY_UVTRANSFORM(type, N) _AI_MATKEY_UVTRANSFORM_BASE,type,N
 32.1251 +
 32.1252 +// For backward compatibility and simplicity
 32.1253 +//! @cond MATS_DOC_FULL
 32.1254 +#define AI_MATKEY_UVTRANSFORM_DIFFUSE(N)    \
 32.1255 +    AI_MATKEY_UVTRANSFORM(aiTextureType_DIFFUSE,N)
 32.1256 +
 32.1257 +#define AI_MATKEY_UVTRANSFORM_SPECULAR(N)   \
 32.1258 +    AI_MATKEY_UVTRANSFORM(aiTextureType_SPECULAR,N)
 32.1259 +
 32.1260 +#define AI_MATKEY_UVTRANSFORM_AMBIENT(N)    \
 32.1261 +    AI_MATKEY_UVTRANSFORM(aiTextureType_AMBIENT,N)
 32.1262 +
 32.1263 +#define AI_MATKEY_UVTRANSFORM_EMISSIVE(N)   \
 32.1264 +    AI_MATKEY_UVTRANSFORM(aiTextureType_EMISSIVE,N)
 32.1265 +
 32.1266 +#define AI_MATKEY_UVTRANSFORM_NORMALS(N)    \
 32.1267 +    AI_MATKEY_UVTRANSFORM(aiTextureType_NORMALS,N)
 32.1268 +
 32.1269 +#define AI_MATKEY_UVTRANSFORM_HEIGHT(N) \
 32.1270 +    AI_MATKEY_UVTRANSFORM(aiTextureType_HEIGHT,N)
 32.1271 +
 32.1272 +#define AI_MATKEY_UVTRANSFORM_SHININESS(N)  \
 32.1273 +    AI_MATKEY_UVTRANSFORM(aiTextureType_SHININESS,N)
 32.1274 +
 32.1275 +#define AI_MATKEY_UVTRANSFORM_OPACITY(N)    \
 32.1276 +    AI_MATKEY_UVTRANSFORM(aiTextureType_OPACITY,N)
 32.1277 +
 32.1278 +#define AI_MATKEY_UVTRANSFORM_DISPLACEMENT(N)   \
 32.1279 +    AI_MATKEY_UVTRANSFORM(aiTextureType_DISPLACEMENT,N)
 32.1280 +
 32.1281 +#define AI_MATKEY_UVTRANSFORM_LIGHTMAP(N)   \
 32.1282 +    AI_MATKEY_UVTRANSFORM(aiTextureType_LIGHTMAP,N)
 32.1283 +
 32.1284 +#define AI_MATKEY_UVTRANSFORM_REFLECTION(N) \
 32.1285 +    AI_MATKEY_UVTRANSFORM(aiTextureType_REFLECTION,N)
 32.1286 +
 32.1287 +#define AI_MATKEY_UVTRANSFORM_UNKNOWN(N)    \
 32.1288 +    AI_MATKEY_UVTRANSFORM(aiTextureType_UNKNOWN,N)
 32.1289 +
 32.1290 +//! @endcond
 32.1291 +// ---------------------------------------------------------------------------
 32.1292 +#define AI_MATKEY_TEXFLAGS(type, N) _AI_MATKEY_TEXFLAGS_BASE,type,N
 32.1293 +
 32.1294 +// For backward compatibility and simplicity
 32.1295 +//! @cond MATS_DOC_FULL
 32.1296 +#define AI_MATKEY_TEXFLAGS_DIFFUSE(N)   \
 32.1297 +    AI_MATKEY_TEXFLAGS(aiTextureType_DIFFUSE,N)
 32.1298 +
 32.1299 +#define AI_MATKEY_TEXFLAGS_SPECULAR(N)  \
 32.1300 +    AI_MATKEY_TEXFLAGS(aiTextureType_SPECULAR,N)
 32.1301 +
 32.1302 +#define AI_MATKEY_TEXFLAGS_AMBIENT(N)   \
 32.1303 +    AI_MATKEY_TEXFLAGS(aiTextureType