Merge branch 'master' into issue_1660
This commit is contained in:
@@ -50,7 +50,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "TargetAnimation.h"
|
||||
#include <assimp/scene.h>
|
||||
#include <assimp/DefaultLogger.hpp>
|
||||
#include "StringComparison.h"
|
||||
#include <assimp/StringComparison.h>
|
||||
#include <memory>
|
||||
#include <cctype>
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "3DSHelper.h"
|
||||
#include <assimp/SceneCombiner.h>
|
||||
#include "SplitLargeMeshes.h"
|
||||
#include "StringComparison.h"
|
||||
#include <assimp/StringComparison.h>
|
||||
#include <assimp/IOSystem.hpp>
|
||||
#include <assimp/DefaultLogger.hpp>
|
||||
#include <assimp/Exporter.hpp>
|
||||
|
||||
+1
-1
@@ -48,7 +48,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <map>
|
||||
#include <memory>
|
||||
|
||||
#include "StreamWriter.h"
|
||||
#include <assimp/StreamWriter.h>
|
||||
#include <assimp/material.h>
|
||||
|
||||
struct aiScene;
|
||||
|
||||
+4
-4
@@ -44,10 +44,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#ifndef AI_3DSFILEHELPER_H_INC
|
||||
#define AI_3DSFILEHELPER_H_INC
|
||||
|
||||
#include "SpatialSort.h"
|
||||
#include "SmoothingGroups.h"
|
||||
#include "StringUtils.h"
|
||||
#include "qnan.h"
|
||||
#include <assimp/SpatialSort.h>
|
||||
#include <assimp/SmoothingGroups.h>
|
||||
#include <assimp/StringUtils.h>
|
||||
#include <assimp/qnan.h>
|
||||
#include <assimp/material.h>
|
||||
#include <assimp/camera.h>
|
||||
#include <assimp/light.h>
|
||||
|
||||
+2
-2
@@ -51,12 +51,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
// internal headers
|
||||
#include "3DSLoader.h"
|
||||
#include "Macros.h"
|
||||
#include <assimp/Macros.h>
|
||||
#include <assimp/IOSystem.hpp>
|
||||
#include <assimp/scene.h>
|
||||
#include <assimp/DefaultLogger.hpp>
|
||||
#include <assimp/importerdesc.h>
|
||||
#include "StringComparison.h"
|
||||
#include <assimp/StringComparison.h>
|
||||
|
||||
using namespace Assimp;
|
||||
|
||||
|
||||
+2
-2
@@ -46,13 +46,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#ifndef AI_3DSIMPORTER_H_INC
|
||||
#define AI_3DSIMPORTER_H_INC
|
||||
|
||||
#include "BaseImporter.h"
|
||||
#include <assimp/BaseImporter.h>
|
||||
#include <assimp/types.h>
|
||||
|
||||
#ifndef ASSIMP_BUILD_NO_3DS_IMPORTER
|
||||
|
||||
#include "3DSHelper.h"
|
||||
#include "StreamReader.h"
|
||||
#include <assimp/StreamReader.h>
|
||||
|
||||
struct aiNode;
|
||||
|
||||
|
||||
+4
-4
@@ -49,11 +49,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
// internal headers
|
||||
#include "ACLoader.h"
|
||||
#include "ParsingUtils.h"
|
||||
#include "fast_atof.h"
|
||||
#include "Subdivision.h"
|
||||
#include <assimp/ParsingUtils.h>
|
||||
#include <assimp/fast_atof.h>
|
||||
#include <assimp/Subdivision.h>
|
||||
#include "Importer.h"
|
||||
#include "BaseImporter.h"
|
||||
#include <assimp/BaseImporter.h>
|
||||
#include <assimp/Importer.hpp>
|
||||
#include <assimp/light.h>
|
||||
#include <assimp/DefaultLogger.hpp>
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "BaseImporter.h"
|
||||
#include <assimp/BaseImporter.h>
|
||||
#include <assimp/types.h>
|
||||
|
||||
struct aiNode;
|
||||
|
||||
@@ -51,7 +51,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "AMFImporter.hpp"
|
||||
#include "AMFImporter_Macro.hpp"
|
||||
|
||||
#include "fast_atof.h"
|
||||
#include <assimp/fast_atof.h>
|
||||
#include <assimp/DefaultIOSystem.h>
|
||||
|
||||
// Header files, stdlib.
|
||||
|
||||
@@ -56,8 +56,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <assimp/DefaultLogger.hpp>
|
||||
#include <assimp/importerdesc.h>
|
||||
#include "assimp/types.h"
|
||||
#include "BaseImporter.h"
|
||||
#include "irrXMLWrapper.h"
|
||||
#include <assimp/BaseImporter.h>
|
||||
#include <assimp/irrXMLWrapper.h>
|
||||
|
||||
// Header files, stdlib.
|
||||
#include <set>
|
||||
|
||||
@@ -51,8 +51,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
// Header files, Assimp.
|
||||
#include <assimp/SceneCombiner.h>
|
||||
#include "StandardShapes.h"
|
||||
#include "StringUtils.h"
|
||||
#include <assimp/StandardShapes.h>
|
||||
#include <assimp/StringUtils.h>
|
||||
|
||||
// Header files, stdlib.
|
||||
#include <iterator>
|
||||
|
||||
+3
-3
@@ -50,8 +50,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
// internal headers
|
||||
#include "ASELoader.h"
|
||||
#include "StringComparison.h"
|
||||
#include "SkeletonMeshBuilder.h"
|
||||
#include <assimp/StringComparison.h>
|
||||
#include <assimp/SkeletonMeshBuilder.h>
|
||||
#include "TargetAnimation.h"
|
||||
#include <assimp/Importer.hpp>
|
||||
#include <assimp/IOSystem.hpp>
|
||||
@@ -62,7 +62,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <memory>
|
||||
|
||||
// utilities
|
||||
#include "fast_atof.h"
|
||||
#include <assimp/fast_atof.h>
|
||||
|
||||
using namespace Assimp;
|
||||
using namespace Assimp::ASE;
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#ifndef AI_ASELOADER_H_INCLUDED
|
||||
#define AI_ASELOADER_H_INCLUDED
|
||||
|
||||
#include "BaseImporter.h"
|
||||
#include <assimp/BaseImporter.h>
|
||||
#include <assimp/types.h>
|
||||
#include "ASEParser.h"
|
||||
|
||||
|
||||
+1
-1
@@ -51,7 +51,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
// internal headers
|
||||
#include "TextureTransform.h"
|
||||
#include "ASELoader.h"
|
||||
#include "fast_atof.h"
|
||||
#include <assimp/fast_atof.h>
|
||||
#include <assimp/DefaultLogger.hpp>
|
||||
|
||||
using namespace Assimp;
|
||||
|
||||
+2
-2
@@ -52,8 +52,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#ifndef ASSIMP_BUILD_NO_3DS_IMPORTER
|
||||
|
||||
// for some helper routines like IsSpace()
|
||||
#include "ParsingUtils.h"
|
||||
#include "qnan.h"
|
||||
#include <assimp/ParsingUtils.h>
|
||||
#include <assimp/qnan.h>
|
||||
|
||||
// ASE is quite similar to 3ds. We can reuse some structures
|
||||
#include "3DSLoader.h"
|
||||
|
||||
@@ -47,7 +47,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <assimp/IOSystem.hpp>
|
||||
#include <assimp/Exporter.hpp>
|
||||
#include "ProcessHelper.h"
|
||||
#include "Exceptional.h"
|
||||
#include <assimp/Exceptional.h>
|
||||
|
||||
#ifdef ASSIMP_BUILD_NO_OWN_ZLIB
|
||||
# include <zlib.h>
|
||||
|
||||
@@ -51,7 +51,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
// internal headers
|
||||
#include "AssbinLoader.h"
|
||||
#include "assbin_chunks.h"
|
||||
#include "MemoryIOWrapper.h"
|
||||
#include <assimp/MemoryIOWrapper.h>
|
||||
#include <assimp/mesh.h>
|
||||
#include <assimp/anim.h>
|
||||
#include <assimp/scene.h>
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#ifndef AI_ASSBINIMPORTER_H_INC
|
||||
#define AI_ASSBINIMPORTER_H_INC
|
||||
|
||||
#include "BaseImporter.h"
|
||||
#include <assimp/BaseImporter.h>
|
||||
|
||||
struct aiMesh;
|
||||
struct aiNode;
|
||||
|
||||
+3
-3
@@ -50,12 +50,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <assimp/importerdesc.h>
|
||||
#include <assimp/scene.h>
|
||||
|
||||
#include "GenericProperty.h"
|
||||
#include <assimp/GenericProperty.h>
|
||||
#include "CInterfaceIOWrapper.h"
|
||||
#include "Importer.h"
|
||||
#include "Exceptional.h"
|
||||
#include <assimp/Exceptional.h>
|
||||
#include "ScenePrivate.h"
|
||||
#include "BaseImporter.h"
|
||||
#include <assimp/BaseImporter.h>
|
||||
#include <list>
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -51,7 +51,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "B3DImporter.h"
|
||||
#include "TextureTransform.h"
|
||||
#include "ConvertToLHProcess.h"
|
||||
#include "StringUtils.h"
|
||||
#include <assimp/StringUtils.h>
|
||||
#include <memory>
|
||||
#include <assimp/IOSystem.hpp>
|
||||
#include <assimp/anim.h>
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <assimp/types.h>
|
||||
#include <assimp/mesh.h>
|
||||
#include <assimp/material.h>
|
||||
#include "BaseImporter.h"
|
||||
#include <assimp/BaseImporter.h>
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
+3
-3
@@ -45,11 +45,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#ifndef ASSIMP_BUILD_NO_BVH_IMPORTER
|
||||
|
||||
#include "BVHLoader.h"
|
||||
#include "fast_atof.h"
|
||||
#include "SkeletonMeshBuilder.h"
|
||||
#include <assimp/fast_atof.h>
|
||||
#include <assimp/SkeletonMeshBuilder.h>
|
||||
#include <assimp/Importer.hpp>
|
||||
#include <memory>
|
||||
#include "TinyFormatter.h"
|
||||
#include <assimp/TinyFormatter.h>
|
||||
#include <assimp/IOSystem.hpp>
|
||||
#include <assimp/scene.h>
|
||||
#include <assimp/importerdesc.h>
|
||||
|
||||
+1
-1
@@ -48,7 +48,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#ifndef AI_BVHLOADER_H_INC
|
||||
#define AI_BVHLOADER_H_INC
|
||||
|
||||
#include "BaseImporter.h"
|
||||
#include <assimp/BaseImporter.h>
|
||||
|
||||
struct aiNode;
|
||||
|
||||
|
||||
@@ -44,10 +44,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* @brief Implementation of BaseImporter
|
||||
*/
|
||||
|
||||
#include "BaseImporter.h"
|
||||
#include <assimp/BaseImporter.h>
|
||||
#include "FileSystemFilter.h"
|
||||
#include "Importer.h"
|
||||
#include "ByteSwapper.h"
|
||||
#include <assimp/ByteSwapper.h>
|
||||
#include <assimp/scene.h>
|
||||
#include <assimp/Importer.hpp>
|
||||
#include <assimp/postprocess.h>
|
||||
|
||||
@@ -1,361 +0,0 @@
|
||||
/*
|
||||
Open Asset Import Library (assimp)
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2017, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use of this software in source and binary forms,
|
||||
with or without modification, are permitted provided that the
|
||||
following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer in the documentation and/or other
|
||||
materials provided with the distribution.
|
||||
|
||||
* Neither the name of the assimp team, nor the names of its
|
||||
contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior
|
||||
written permission of the assimp team.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/** @file Definition of the base class for all importer worker classes. */
|
||||
#ifndef INCLUDED_AI_BASEIMPORTER_H
|
||||
#define INCLUDED_AI_BASEIMPORTER_H
|
||||
|
||||
#include "Exceptional.h"
|
||||
|
||||
#include <vector>
|
||||
#include <set>
|
||||
#include <assimp/types.h>
|
||||
#include <assimp/ProgressHandler.hpp>
|
||||
|
||||
struct aiScene;
|
||||
struct aiImporterDesc;
|
||||
|
||||
namespace Assimp {
|
||||
|
||||
class Importer;
|
||||
class IOSystem;
|
||||
class BaseProcess;
|
||||
class SharedPostProcessInfo;
|
||||
class IOStream;
|
||||
|
||||
// utility to do char4 to uint32 in a portable manner
|
||||
#define AI_MAKE_MAGIC(string) ((uint32_t)((string[0] << 24) + \
|
||||
(string[1] << 16) + (string[2] << 8) + string[3]))
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
/** FOR IMPORTER PLUGINS ONLY: The BaseImporter defines a common interface
|
||||
* for all importer worker classes.
|
||||
*
|
||||
* The interface defines two functions: CanRead() is used to check if the
|
||||
* importer can handle the format of the given file. If an implementation of
|
||||
* this function returns true, the importer then calls ReadFile() which
|
||||
* imports the given file. ReadFile is not overridable, it just calls
|
||||
* InternReadFile() and catches any ImportErrorException that might occur.
|
||||
*/
|
||||
class ASSIMP_API BaseImporter
|
||||
{
|
||||
friend class Importer;
|
||||
|
||||
public:
|
||||
|
||||
/** Constructor to be privately used by #Importer */
|
||||
BaseImporter();
|
||||
|
||||
/** Destructor, private as well */
|
||||
virtual ~BaseImporter();
|
||||
|
||||
public:
|
||||
// -------------------------------------------------------------------
|
||||
/** Returns whether the class can handle the format of the given file.
|
||||
*
|
||||
* The implementation should be as quick as possible. A check for
|
||||
* the file extension is enough. If no suitable loader is found with
|
||||
* this strategy, CanRead() is called again, the 'checkSig' parameter
|
||||
* set to true this time. Now the implementation is expected to
|
||||
* perform a full check of the file structure, possibly searching the
|
||||
* first bytes of the file for magic identifiers or keywords.
|
||||
*
|
||||
* @param pFile Path and file name of the file to be examined.
|
||||
* @param pIOHandler The IO handler to use for accessing any file.
|
||||
* @param checkSig Set to true if this method is called a second time.
|
||||
* This time, the implementation may take more time to examine the
|
||||
* contents of the file to be loaded for magic bytes, keywords, etc
|
||||
* to be able to load files with unknown/not existent file extensions.
|
||||
* @return true if the class can read this file, false if not.
|
||||
*/
|
||||
virtual bool CanRead(
|
||||
const std::string& pFile,
|
||||
IOSystem* pIOHandler,
|
||||
bool checkSig
|
||||
) const = 0;
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** Imports the given file and returns the imported data.
|
||||
* If the import succeeds, ownership of the data is transferred to
|
||||
* the caller. If the import fails, NULL is returned. The function
|
||||
* takes care that any partially constructed data is destroyed
|
||||
* beforehand.
|
||||
*
|
||||
* @param pImp #Importer object hosting this loader.
|
||||
* @param pFile Path of the file to be imported.
|
||||
* @param pIOHandler IO-Handler used to open this and possible other files.
|
||||
* @return The imported data or NULL if failed. If it failed a
|
||||
* human-readable error description can be retrieved by calling
|
||||
* GetErrorText()
|
||||
*
|
||||
* @note This function is not intended to be overridden. Implement
|
||||
* InternReadFile() to do the import. If an exception is thrown somewhere
|
||||
* in InternReadFile(), this function will catch it and transform it into
|
||||
* a suitable response to the caller.
|
||||
*/
|
||||
aiScene* ReadFile(
|
||||
const Importer* pImp,
|
||||
const std::string& pFile,
|
||||
IOSystem* pIOHandler
|
||||
);
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** Returns the error description of the last error that occurred.
|
||||
* @return A description of the last error that occurred. An empty
|
||||
* string if there was no error.
|
||||
*/
|
||||
const std::string& GetErrorText() const {
|
||||
return m_ErrorText;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** Called prior to ReadFile().
|
||||
* The function is a request to the importer to update its configuration
|
||||
* basing on the Importer's configuration property list.
|
||||
* @param pImp Importer instance
|
||||
*/
|
||||
virtual void SetupProperties(
|
||||
const Importer* pImp
|
||||
);
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** Called by #Importer::GetImporterInfo to get a description of
|
||||
* some loader features. Importers must provide this information. */
|
||||
virtual const aiImporterDesc* GetInfo() const = 0;
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** Called by #Importer::GetExtensionList for each loaded importer.
|
||||
* Take the extension list contained in the structure returned by
|
||||
* #GetInfo and insert all file extensions into the given set.
|
||||
* @param extension set to collect file extensions in*/
|
||||
void GetExtensionList(std::set<std::string>& extensions);
|
||||
|
||||
protected:
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** Imports the given file into the given scene structure. The
|
||||
* function is expected to throw an ImportErrorException if there is
|
||||
* an error. If it terminates normally, the data in aiScene is
|
||||
* expected to be correct. Override this function to implement the
|
||||
* actual importing.
|
||||
* <br>
|
||||
* The output scene must meet the following requirements:<br>
|
||||
* <ul>
|
||||
* <li>At least a root node must be there, even if its only purpose
|
||||
* is to reference one mesh.</li>
|
||||
* <li>aiMesh::mPrimitiveTypes may be 0. The types of primitives
|
||||
* in the mesh are determined automatically in this case.</li>
|
||||
* <li>the vertex data is stored in a pseudo-indexed "verbose" format.
|
||||
* In fact this means that every vertex that is referenced by
|
||||
* a face is unique. Or the other way round: a vertex index may
|
||||
* not occur twice in a single aiMesh.</li>
|
||||
* <li>aiAnimation::mDuration may be -1. Assimp determines the length
|
||||
* of the animation automatically in this case as the length of
|
||||
* the longest animation channel.</li>
|
||||
* <li>aiMesh::mBitangents may be NULL if tangents and normals are
|
||||
* given. In this case bitangents are computed as the cross product
|
||||
* between normal and tangent.</li>
|
||||
* <li>There needn't be a material. If none is there a default material
|
||||
* is generated. However, it is recommended practice for loaders
|
||||
* to generate a default material for yourself that matches the
|
||||
* default material setting for the file format better than Assimp's
|
||||
* generic default material. Note that default materials *should*
|
||||
* be named AI_DEFAULT_MATERIAL_NAME if they're just color-shaded
|
||||
* or AI_DEFAULT_TEXTURED_MATERIAL_NAME if they define a (dummy)
|
||||
* texture. </li>
|
||||
* </ul>
|
||||
* If the AI_SCENE_FLAGS_INCOMPLETE-Flag is <b>not</b> set:<ul>
|
||||
* <li> at least one mesh must be there</li>
|
||||
* <li> there may be no meshes with 0 vertices or faces</li>
|
||||
* </ul>
|
||||
* This won't be checked (except by the validation step): Assimp will
|
||||
* crash if one of the conditions is not met!
|
||||
*
|
||||
* @param pFile Path of the file to be imported.
|
||||
* @param pScene The scene object to hold the imported data.
|
||||
* NULL is not a valid parameter.
|
||||
* @param pIOHandler The IO handler to use for any file access.
|
||||
* NULL is not a valid parameter. */
|
||||
virtual void InternReadFile(
|
||||
const std::string& pFile,
|
||||
aiScene* pScene,
|
||||
IOSystem* pIOHandler
|
||||
) = 0;
|
||||
|
||||
public: // static utilities
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** A utility for CanRead().
|
||||
*
|
||||
* The function searches the header of a file for a specific token
|
||||
* and returns true if this token is found. This works for text
|
||||
* files only. There is a rudimentary handling of UNICODE files.
|
||||
* The comparison is case independent.
|
||||
*
|
||||
* @param pIOSystem IO System to work with
|
||||
* @param file File name of the file
|
||||
* @param tokens List of tokens to search for
|
||||
* @param numTokens Size of the token array
|
||||
* @param searchBytes Number of bytes to be searched for the tokens.
|
||||
*/
|
||||
static bool SearchFileHeaderForToken(
|
||||
IOSystem* pIOSystem,
|
||||
const std::string& file,
|
||||
const char** tokens,
|
||||
unsigned int numTokens,
|
||||
unsigned int searchBytes = 200,
|
||||
bool tokensSol = false);
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** @brief Check whether a file has a specific file extension
|
||||
* @param pFile Input file
|
||||
* @param ext0 Extension to check for. Lowercase characters only, no dot!
|
||||
* @param ext1 Optional second extension
|
||||
* @param ext2 Optional third extension
|
||||
* @note Case-insensitive
|
||||
*/
|
||||
static bool SimpleExtensionCheck (
|
||||
const std::string& pFile,
|
||||
const char* ext0,
|
||||
const char* ext1 = NULL,
|
||||
const char* ext2 = NULL);
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** @brief Extract file extension from a string
|
||||
* @param pFile Input file
|
||||
* @return Extension without trailing dot, all lowercase
|
||||
*/
|
||||
static std::string GetExtension (
|
||||
const std::string& pFile);
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** @brief Check whether a file starts with one or more magic tokens
|
||||
* @param pFile Input file
|
||||
* @param pIOHandler IO system to be used
|
||||
* @param magic n magic tokens
|
||||
* @params num Size of magic
|
||||
* @param offset Offset from file start where tokens are located
|
||||
* @param Size of one token, in bytes. Maximally 16 bytes.
|
||||
* @return true if one of the given tokens was found
|
||||
*
|
||||
* @note For convenience, the check is also performed for the
|
||||
* byte-swapped variant of all tokens (big endian). Only for
|
||||
* tokens of size 2,4.
|
||||
*/
|
||||
static bool CheckMagicToken(
|
||||
IOSystem* pIOHandler,
|
||||
const std::string& pFile,
|
||||
const void* magic,
|
||||
unsigned int num,
|
||||
unsigned int offset = 0,
|
||||
unsigned int size = 4);
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** An utility for all text file loaders. It converts a file to our
|
||||
* UTF8 character set. Errors are reported, but ignored.
|
||||
*
|
||||
* @param data File buffer to be converted to UTF8 data. The buffer
|
||||
* is resized as appropriate. */
|
||||
static void ConvertToUTF8(
|
||||
std::vector<char>& data);
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** An utility for all text file loaders. It converts a file from our
|
||||
* UTF8 character set back to ISO-8859-1. Errors are reported, but ignored.
|
||||
*
|
||||
* @param data File buffer to be converted from UTF8 to ISO-8859-1. The buffer
|
||||
* is resized as appropriate. */
|
||||
static void ConvertUTF8toISO8859_1(
|
||||
std::string& data);
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/// @brief Enum to define, if empty files are ok or not.
|
||||
enum TextFileMode {
|
||||
ALLOW_EMPTY,
|
||||
FORBID_EMPTY
|
||||
};
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** Utility for text file loaders which copies the contents of the
|
||||
* file into a memory buffer and converts it to our UTF8
|
||||
* representation.
|
||||
* @param stream Stream to read from.
|
||||
* @param data Output buffer to be resized and filled with the
|
||||
* converted text file data. The buffer is terminated with
|
||||
* a binary 0.
|
||||
* @param mode Whether it is OK to load empty text files. */
|
||||
static void TextFileToBuffer(
|
||||
IOStream* stream,
|
||||
std::vector<char>& data,
|
||||
TextFileMode mode = FORBID_EMPTY);
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** Utility function to move a std::vector into a aiScene array
|
||||
* @param vec The vector to be moved
|
||||
* @param out The output pointer to the allocated array.
|
||||
* @param numOut The output count of elements copied. */
|
||||
template<typename T>
|
||||
AI_FORCE_INLINE
|
||||
static void CopyVector(
|
||||
std::vector<T>& vec,
|
||||
T*& out,
|
||||
unsigned int& outLength)
|
||||
{
|
||||
outLength = unsigned(vec.size());
|
||||
if (outLength) {
|
||||
out = new T[outLength];
|
||||
std::swap_ranges(vec.begin(), vec.end(), out);
|
||||
}
|
||||
}
|
||||
|
||||
protected:
|
||||
/// Error description in case there was one.
|
||||
std::string m_ErrorText;
|
||||
/// Currently set progress handler.
|
||||
ProgressHandler* m_progress;
|
||||
};
|
||||
|
||||
|
||||
|
||||
} // end of namespace Assimp
|
||||
|
||||
#endif // AI_BASEIMPORTER_H_INC
|
||||
@@ -42,7 +42,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
/** @file Implementation of BaseProcess */
|
||||
|
||||
#include "BaseImporter.h"
|
||||
#include <assimp/BaseImporter.h>
|
||||
#include "BaseProcess.h"
|
||||
#include <assimp/DefaultLogger.hpp>
|
||||
#include <assimp/scene.h>
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#define INCLUDED_AI_BASEPROCESS_H
|
||||
|
||||
#include <map>
|
||||
#include "GenericProperty.h"
|
||||
#include <assimp/GenericProperty.h>
|
||||
|
||||
struct aiScene;
|
||||
|
||||
|
||||
+2
-2
@@ -47,10 +47,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
|
||||
#include "Bitmap.h"
|
||||
#include <assimp/Bitmap.h>
|
||||
#include <assimp/texture.h>
|
||||
#include <assimp/IOStream.hpp>
|
||||
#include "ByteSwapper.h"
|
||||
#include <assimp/ByteSwapper.h>
|
||||
|
||||
namespace Assimp {
|
||||
|
||||
|
||||
-123
@@ -1,123 +0,0 @@
|
||||
/*
|
||||
---------------------------------------------------------------------------
|
||||
Open Asset Import Library (assimp)
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2017, assimp team
|
||||
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use of this software in source and binary forms,
|
||||
with or without modification, are permitted provided that the following
|
||||
conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer in the documentation and/or other
|
||||
materials provided with the distribution.
|
||||
|
||||
* Neither the name of the assimp team, nor the names of its
|
||||
contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior
|
||||
written permission of the assimp team.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/** @file Bitmap.h
|
||||
* @brief Defines bitmap format helper for textures
|
||||
*
|
||||
* Used for file formats which embed their textures into the model file.
|
||||
*/
|
||||
|
||||
#ifndef AI_BITMAP_H_INC
|
||||
#define AI_BITMAP_H_INC
|
||||
|
||||
#include <stdint.h>
|
||||
#include <cstddef>
|
||||
|
||||
struct aiTexture;
|
||||
|
||||
namespace Assimp {
|
||||
|
||||
class IOStream;
|
||||
|
||||
class Bitmap {
|
||||
protected:
|
||||
|
||||
struct Header {
|
||||
uint16_t type;
|
||||
uint32_t size;
|
||||
uint16_t reserved1;
|
||||
uint16_t reserved2;
|
||||
uint32_t offset;
|
||||
|
||||
// We define the struct size because sizeof(Header) might return a wrong result because of structure padding.
|
||||
// Moreover, we must use this ugly and error prone syntax because Visual Studio neither support constexpr or sizeof(name_of_field).
|
||||
static const std::size_t header_size =
|
||||
sizeof(uint16_t) + // type
|
||||
sizeof(uint32_t) + // size
|
||||
sizeof(uint16_t) + // reserved1
|
||||
sizeof(uint16_t) + // reserved2
|
||||
sizeof(uint32_t); // offset
|
||||
};
|
||||
|
||||
struct DIB {
|
||||
uint32_t size;
|
||||
int32_t width;
|
||||
int32_t height;
|
||||
uint16_t planes;
|
||||
uint16_t bits_per_pixel;
|
||||
uint32_t compression;
|
||||
uint32_t image_size;
|
||||
int32_t x_resolution;
|
||||
int32_t y_resolution;
|
||||
uint32_t nb_colors;
|
||||
uint32_t nb_important_colors;
|
||||
|
||||
// We define the struct size because sizeof(DIB) might return a wrong result because of structure padding.
|
||||
// Moreover, we must use this ugly and error prone syntax because Visual Studio neither support constexpr or sizeof(name_of_field).
|
||||
static const std::size_t dib_size =
|
||||
sizeof(uint32_t) + // size
|
||||
sizeof(int32_t) + // width
|
||||
sizeof(int32_t) + // height
|
||||
sizeof(uint16_t) + // planes
|
||||
sizeof(uint16_t) + // bits_per_pixel
|
||||
sizeof(uint32_t) + // compression
|
||||
sizeof(uint32_t) + // image_size
|
||||
sizeof(int32_t) + // x_resolution
|
||||
sizeof(int32_t) + // y_resolution
|
||||
sizeof(uint32_t) + // nb_colors
|
||||
sizeof(uint32_t); // nb_important_colors
|
||||
};
|
||||
|
||||
static const std::size_t mBytesPerPixel = 4;
|
||||
|
||||
public:
|
||||
static void Save(aiTexture* texture, IOStream* file);
|
||||
|
||||
protected:
|
||||
static void WriteHeader(Header& header, IOStream* file);
|
||||
static void WriteDIB(DIB& dib, IOStream* file);
|
||||
static void WriteData(aiTexture* texture, IOStream* file);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // AI_BITMAP_H_INC
|
||||
+1
-1
@@ -44,7 +44,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#ifndef INCLUDED_AI_BLEND_BMESH_H
|
||||
#define INCLUDED_AI_BLEND_BMESH_H
|
||||
|
||||
#include "LogAux.h"
|
||||
#include <assimp/LogAux.h>
|
||||
|
||||
namespace Assimp
|
||||
{
|
||||
|
||||
+3
-3
@@ -47,9 +47,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#ifndef ASSIMP_BUILD_NO_BLEND_IMPORTER
|
||||
#include "BlenderDNA.h"
|
||||
#include "StreamReader.h"
|
||||
#include "fast_atof.h"
|
||||
#include "TinyFormatter.h"
|
||||
#include <assimp/StreamReader.h>
|
||||
#include <assimp/fast_atof.h>
|
||||
#include <assimp/TinyFormatter.h>
|
||||
|
||||
using namespace Assimp;
|
||||
using namespace Assimp::Blender;
|
||||
|
||||
+2
-2
@@ -46,8 +46,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#ifndef INCLUDED_AI_BLEND_DNA_H
|
||||
#define INCLUDED_AI_BLEND_DNA_H
|
||||
|
||||
#include "BaseImporter.h"
|
||||
#include "StreamReader.h"
|
||||
#include <assimp/BaseImporter.h>
|
||||
#include <assimp/StreamReader.h>
|
||||
#include <assimp/DefaultLogger.hpp>
|
||||
#include <stdint.h>
|
||||
#include <memory>
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#define INCLUDED_AI_BLEND_DNA_INL
|
||||
|
||||
#include <memory>
|
||||
#include "TinyFormatter.h"
|
||||
#include <assimp/TinyFormatter.h>
|
||||
|
||||
namespace Assimp {
|
||||
namespace Blender {
|
||||
|
||||
@@ -53,13 +53,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "BlenderIntermediate.h"
|
||||
#include "BlenderModifier.h"
|
||||
#include "BlenderBMesh.h"
|
||||
#include "StringUtils.h"
|
||||
#include <assimp/StringUtils.h>
|
||||
#include <assimp/scene.h>
|
||||
#include <assimp/importerdesc.h>
|
||||
|
||||
#include "StringComparison.h"
|
||||
#include "StreamReader.h"
|
||||
#include "MemoryIOWrapper.h"
|
||||
#include <assimp/StringComparison.h>
|
||||
#include <assimp/StreamReader.h>
|
||||
#include <assimp/MemoryIOWrapper.h>
|
||||
|
||||
#include <cctype>
|
||||
|
||||
|
||||
@@ -45,8 +45,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#ifndef INCLUDED_AI_BLEND_LOADER_H
|
||||
#define INCLUDED_AI_BLEND_LOADER_H
|
||||
|
||||
#include "BaseImporter.h"
|
||||
#include "LogAux.h"
|
||||
#include <assimp/BaseImporter.h>
|
||||
#include <assimp/LogAux.h>
|
||||
#include <memory>
|
||||
|
||||
struct aiNode;
|
||||
|
||||
@@ -47,7 +47,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include "BlenderModifier.h"
|
||||
#include <assimp/SceneCombiner.h>
|
||||
#include "Subdivision.h"
|
||||
#include <assimp/Subdivision.h>
|
||||
#include <assimp/scene.h>
|
||||
#include <memory>
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#define INCLUDED_AI_BLEND_MODIFIER_H
|
||||
|
||||
#include "BlenderIntermediate.h"
|
||||
#include "TinyFormatter.h"
|
||||
#include <assimp/TinyFormatter.h>
|
||||
|
||||
namespace Assimp {
|
||||
namespace Blender {
|
||||
|
||||
@@ -58,7 +58,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# define ASSIMP_BLEND_WITH_POLY_2_TRI 1
|
||||
#endif
|
||||
|
||||
#include "LogAux.h"
|
||||
#include <assimp/LogAux.h>
|
||||
|
||||
#if ASSIMP_BLEND_WITH_GLU_TESSELLATE
|
||||
|
||||
|
||||
@@ -1,337 +0,0 @@
|
||||
/*
|
||||
---------------------------------------------------------------------------
|
||||
Open Asset Import Library (assimp)
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2017, assimp team
|
||||
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use of this software in source and binary forms,
|
||||
with or without modification, are permitted provided that the following
|
||||
conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer in the documentation and/or other
|
||||
materials provided with the distribution.
|
||||
|
||||
* Neither the name of the assimp team, nor the names of its
|
||||
contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior
|
||||
written permission of the assimp team.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/** @file Provides cheat implementations for IOSystem and IOStream to
|
||||
* redirect exporter output to a blob chain.*/
|
||||
|
||||
#ifndef AI_BLOBIOSYSTEM_H_INCLUDED
|
||||
#define AI_BLOBIOSYSTEM_H_INCLUDED
|
||||
|
||||
#include <assimp/IOStream.hpp>
|
||||
#include <assimp/cexport.h>
|
||||
#include <assimp/IOSystem.hpp>
|
||||
#include <assimp/DefaultLogger.hpp>
|
||||
#include <stdint.h>
|
||||
#include <set>
|
||||
#include <vector>
|
||||
|
||||
namespace Assimp {
|
||||
class BlobIOSystem;
|
||||
|
||||
// --------------------------------------------------------------------------------------------
|
||||
/** Redirect IOStream to a blob */
|
||||
// --------------------------------------------------------------------------------------------
|
||||
class BlobIOStream : public IOStream
|
||||
{
|
||||
public:
|
||||
|
||||
BlobIOStream(BlobIOSystem* creator, const std::string& file, size_t initial = 4096)
|
||||
: buffer()
|
||||
, cur_size()
|
||||
, file_size()
|
||||
, cursor()
|
||||
, initial(initial)
|
||||
, file(file)
|
||||
, creator(creator)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
virtual ~BlobIOStream();
|
||||
|
||||
public:
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
aiExportDataBlob* GetBlob()
|
||||
{
|
||||
aiExportDataBlob* blob = new aiExportDataBlob();
|
||||
blob->size = file_size;
|
||||
blob->data = buffer;
|
||||
|
||||
buffer = NULL;
|
||||
|
||||
return blob;
|
||||
}
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
virtual size_t Read( void *,
|
||||
size_t,
|
||||
size_t )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
virtual size_t Write(const void* pvBuffer,
|
||||
size_t pSize,
|
||||
size_t pCount)
|
||||
{
|
||||
pSize *= pCount;
|
||||
if (cursor + pSize > cur_size) {
|
||||
Grow(cursor + pSize);
|
||||
}
|
||||
|
||||
memcpy(buffer+cursor, pvBuffer, pSize);
|
||||
cursor += pSize;
|
||||
|
||||
file_size = std::max(file_size,cursor);
|
||||
return pCount;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
virtual aiReturn Seek(size_t pOffset,
|
||||
aiOrigin pOrigin)
|
||||
{
|
||||
switch(pOrigin)
|
||||
{
|
||||
case aiOrigin_CUR:
|
||||
cursor += pOffset;
|
||||
break;
|
||||
|
||||
case aiOrigin_END:
|
||||
cursor = file_size - pOffset;
|
||||
break;
|
||||
|
||||
case aiOrigin_SET:
|
||||
cursor = pOffset;
|
||||
break;
|
||||
|
||||
default:
|
||||
return AI_FAILURE;
|
||||
}
|
||||
|
||||
if (cursor > file_size) {
|
||||
Grow(cursor);
|
||||
}
|
||||
|
||||
file_size = std::max(cursor,file_size);
|
||||
return AI_SUCCESS;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
virtual size_t Tell() const
|
||||
{
|
||||
return cursor;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
virtual size_t FileSize() const
|
||||
{
|
||||
return file_size;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
virtual void Flush()
|
||||
{
|
||||
// ignore
|
||||
}
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
void Grow(size_t need = 0)
|
||||
{
|
||||
// 1.5 and phi are very heap-friendly growth factors (the first
|
||||
// allows for frequent re-use of heap blocks, the second
|
||||
// forms a fibonacci sequence with similar characteristics -
|
||||
// since this heavily depends on the heap implementation
|
||||
// and other factors as well, i'll just go with 1.5 since
|
||||
// it is quicker to compute).
|
||||
size_t new_size = std::max(initial, std::max( need, cur_size+(cur_size>>1) ));
|
||||
|
||||
const uint8_t* const old = buffer;
|
||||
buffer = new uint8_t[new_size];
|
||||
|
||||
if (old) {
|
||||
memcpy(buffer,old,cur_size);
|
||||
delete[] old;
|
||||
}
|
||||
|
||||
cur_size = new_size;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
uint8_t* buffer;
|
||||
size_t cur_size,file_size, cursor, initial;
|
||||
|
||||
const std::string file;
|
||||
BlobIOSystem* const creator;
|
||||
};
|
||||
|
||||
|
||||
#define AI_BLOBIO_MAGIC "$blobfile"
|
||||
|
||||
// --------------------------------------------------------------------------------------------
|
||||
/** Redirect IOSystem to a blob */
|
||||
// --------------------------------------------------------------------------------------------
|
||||
class BlobIOSystem : public IOSystem
|
||||
{
|
||||
|
||||
friend class BlobIOStream;
|
||||
typedef std::pair<std::string, aiExportDataBlob*> BlobEntry;
|
||||
|
||||
public:
|
||||
|
||||
BlobIOSystem()
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~BlobIOSystem()
|
||||
{
|
||||
for(BlobEntry& blobby : blobs) {
|
||||
delete blobby.second;
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
const char* GetMagicFileName() const
|
||||
{
|
||||
return AI_BLOBIO_MAGIC;
|
||||
}
|
||||
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
aiExportDataBlob* GetBlobChain()
|
||||
{
|
||||
// one must be the master
|
||||
aiExportDataBlob* master = NULL, *cur;
|
||||
for(const BlobEntry& blobby : blobs) {
|
||||
if (blobby.first == AI_BLOBIO_MAGIC) {
|
||||
master = blobby.second;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!master) {
|
||||
DefaultLogger::get()->error("BlobIOSystem: no data written or master file was not closed properly.");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
master->name.Set("");
|
||||
|
||||
cur = master;
|
||||
for(const BlobEntry& blobby : blobs) {
|
||||
if (blobby.second == master) {
|
||||
continue;
|
||||
}
|
||||
|
||||
cur->next = blobby.second;
|
||||
cur = cur->next;
|
||||
|
||||
// extract the file extension from the file written
|
||||
const std::string::size_type s = blobby.first.find_first_of('.');
|
||||
cur->name.Set(s == std::string::npos ? blobby.first : blobby.first.substr(s+1));
|
||||
}
|
||||
|
||||
// give up blob ownership
|
||||
blobs.clear();
|
||||
return master;
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
virtual bool Exists( const char* pFile) const {
|
||||
return created.find(std::string(pFile)) != created.end();
|
||||
}
|
||||
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
virtual char getOsSeparator() const {
|
||||
return '/';
|
||||
}
|
||||
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
virtual IOStream* Open(const char* pFile,
|
||||
const char* pMode)
|
||||
{
|
||||
if (pMode[0] != 'w') {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
created.insert(std::string(pFile));
|
||||
return new BlobIOStream(this,std::string(pFile));
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
virtual void Close( IOStream* pFile)
|
||||
{
|
||||
delete pFile;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
void OnDestruct(const std::string& filename, BlobIOStream* child)
|
||||
{
|
||||
// we don't know in which the files are closed, so we
|
||||
// can't reliably say that the first must be the master
|
||||
// file ...
|
||||
blobs.push_back( BlobEntry(filename,child->GetBlob()) );
|
||||
}
|
||||
|
||||
private:
|
||||
std::set<std::string> created;
|
||||
std::vector< BlobEntry > blobs;
|
||||
};
|
||||
|
||||
|
||||
// --------------------------------------------------------------------------------------------
|
||||
BlobIOStream :: ~BlobIOStream()
|
||||
{
|
||||
creator->OnDestruct(file,this);
|
||||
delete[] buffer;
|
||||
}
|
||||
|
||||
|
||||
} // end Assimp
|
||||
|
||||
#endif
|
||||
@@ -1,287 +0,0 @@
|
||||
/*
|
||||
Open Asset Import Library (assimp)
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2017, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use of this software in source and binary forms,
|
||||
with or without modification, are permitted provided that the
|
||||
following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer in the documentation and/or other
|
||||
materials provided with the distribution.
|
||||
|
||||
* Neither the name of the assimp team, nor the names of its
|
||||
contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior
|
||||
written permission of the assimp team.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/** @file Helper class tp perform various byte oder swappings
|
||||
(e.g. little to big endian) */
|
||||
#ifndef AI_BYTESWAPPER_H_INC
|
||||
#define AI_BYTESWAPPER_H_INC
|
||||
|
||||
#include <assimp/ai_assert.h>
|
||||
#include <assimp/types.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#if _MSC_VER >= 1400
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
namespace Assimp {
|
||||
// --------------------------------------------------------------------------------------
|
||||
/** Defines some useful byte order swap routines.
|
||||
*
|
||||
* This is required to read big-endian model formats on little-endian machines,
|
||||
* and vice versa. Direct use of this class is DEPRECATED. Use #StreamReader instead. */
|
||||
// --------------------------------------------------------------------------------------
|
||||
class ByteSwap
|
||||
{
|
||||
ByteSwap() {}
|
||||
|
||||
public:
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
/** Swap two bytes of data
|
||||
* @param[inout] _szOut A void* to save the reintcasts for the caller. */
|
||||
static inline void Swap2(void* _szOut)
|
||||
{
|
||||
ai_assert(_szOut);
|
||||
|
||||
#if _MSC_VER >= 1400
|
||||
uint16_t* const szOut = reinterpret_cast<uint16_t*>(_szOut);
|
||||
*szOut = _byteswap_ushort(*szOut);
|
||||
#else
|
||||
uint8_t* const szOut = reinterpret_cast<uint8_t*>(_szOut);
|
||||
std::swap(szOut[0],szOut[1]);
|
||||
#endif
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
/** Swap four bytes of data
|
||||
* @param[inout] _szOut A void* to save the reintcasts for the caller. */
|
||||
static inline void Swap4(void* _szOut)
|
||||
{
|
||||
ai_assert(_szOut);
|
||||
|
||||
#if _MSC_VER >= 1400
|
||||
uint32_t* const szOut = reinterpret_cast<uint32_t*>(_szOut);
|
||||
*szOut = _byteswap_ulong(*szOut);
|
||||
#else
|
||||
uint8_t* const szOut = reinterpret_cast<uint8_t*>(_szOut);
|
||||
std::swap(szOut[0],szOut[3]);
|
||||
std::swap(szOut[1],szOut[2]);
|
||||
#endif
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
/** Swap eight bytes of data
|
||||
* @param[inout] _szOut A void* to save the reintcasts for the caller. */
|
||||
static inline void Swap8(void* _szOut)
|
||||
{
|
||||
ai_assert(_szOut);
|
||||
|
||||
#if _MSC_VER >= 1400
|
||||
uint64_t* const szOut = reinterpret_cast<uint64_t*>(_szOut);
|
||||
*szOut = _byteswap_uint64(*szOut);
|
||||
#else
|
||||
uint8_t* const szOut = reinterpret_cast<uint8_t*>(_szOut);
|
||||
std::swap(szOut[0],szOut[7]);
|
||||
std::swap(szOut[1],szOut[6]);
|
||||
std::swap(szOut[2],szOut[5]);
|
||||
std::swap(szOut[3],szOut[4]);
|
||||
#endif
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
/** ByteSwap a float. Not a joke.
|
||||
* @param[inout] fOut ehm. .. */
|
||||
static inline void Swap(float* fOut) {
|
||||
Swap4(fOut);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
/** ByteSwap a double. Not a joke.
|
||||
* @param[inout] fOut ehm. .. */
|
||||
static inline void Swap(double* fOut) {
|
||||
Swap8(fOut);
|
||||
}
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
/** ByteSwap an int16t. Not a joke.
|
||||
* @param[inout] fOut ehm. .. */
|
||||
static inline void Swap(int16_t* fOut) {
|
||||
Swap2(fOut);
|
||||
}
|
||||
|
||||
static inline void Swap(uint16_t* fOut) {
|
||||
Swap2(fOut);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
/** ByteSwap an int32t. Not a joke.
|
||||
* @param[inout] fOut ehm. .. */
|
||||
static inline void Swap(int32_t* fOut){
|
||||
Swap4(fOut);
|
||||
}
|
||||
|
||||
static inline void Swap(uint32_t* fOut){
|
||||
Swap4(fOut);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
/** ByteSwap an int64t. Not a joke.
|
||||
* @param[inout] fOut ehm. .. */
|
||||
static inline void Swap(int64_t* fOut) {
|
||||
Swap8(fOut);
|
||||
}
|
||||
|
||||
static inline void Swap(uint64_t* fOut) {
|
||||
Swap8(fOut);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
//! Templatized ByteSwap
|
||||
//! \returns param tOut as swapped
|
||||
template<typename Type>
|
||||
static inline Type Swapped(Type tOut)
|
||||
{
|
||||
return _swapper<Type,sizeof(Type)>()(tOut);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
template <typename T, size_t size> struct _swapper;
|
||||
};
|
||||
|
||||
template <typename T> struct ByteSwap::_swapper<T,2> {
|
||||
T operator() (T tOut) {
|
||||
Swap2(&tOut);
|
||||
return tOut;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T> struct ByteSwap::_swapper<T,4> {
|
||||
T operator() (T tOut) {
|
||||
Swap4(&tOut);
|
||||
return tOut;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T> struct ByteSwap::_swapper<T,8> {
|
||||
T operator() (T tOut) {
|
||||
Swap8(&tOut);
|
||||
return tOut;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// --------------------------------------------------------------------------------------
|
||||
// ByteSwap macros for BigEndian/LittleEndian support
|
||||
// --------------------------------------------------------------------------------------
|
||||
#if (defined AI_BUILD_BIG_ENDIAN)
|
||||
# define AI_LE(t) (t)
|
||||
# define AI_BE(t) ByteSwap::Swapped(t)
|
||||
# define AI_LSWAP2(p)
|
||||
# define AI_LSWAP4(p)
|
||||
# define AI_LSWAP8(p)
|
||||
# define AI_LSWAP2P(p)
|
||||
# define AI_LSWAP4P(p)
|
||||
# define AI_LSWAP8P(p)
|
||||
# define LE_NCONST const
|
||||
# define AI_SWAP2(p) ByteSwap::Swap2(&(p))
|
||||
# define AI_SWAP4(p) ByteSwap::Swap4(&(p))
|
||||
# define AI_SWAP8(p) ByteSwap::Swap8(&(p))
|
||||
# define AI_SWAP2P(p) ByteSwap::Swap2((p))
|
||||
# define AI_SWAP4P(p) ByteSwap::Swap4((p))
|
||||
# define AI_SWAP8P(p) ByteSwap::Swap8((p))
|
||||
# define BE_NCONST
|
||||
#else
|
||||
# define AI_BE(t) (t)
|
||||
# define AI_LE(t) ByteSwap::Swapped(t)
|
||||
# define AI_SWAP2(p)
|
||||
# define AI_SWAP4(p)
|
||||
# define AI_SWAP8(p)
|
||||
# define AI_SWAP2P(p)
|
||||
# define AI_SWAP4P(p)
|
||||
# define AI_SWAP8P(p)
|
||||
# define BE_NCONST const
|
||||
# define AI_LSWAP2(p) ByteSwap::Swap2(&(p))
|
||||
# define AI_LSWAP4(p) ByteSwap::Swap4(&(p))
|
||||
# define AI_LSWAP8(p) ByteSwap::Swap8(&(p))
|
||||
# define AI_LSWAP2P(p) ByteSwap::Swap2((p))
|
||||
# define AI_LSWAP4P(p) ByteSwap::Swap4((p))
|
||||
# define AI_LSWAP8P(p) ByteSwap::Swap8((p))
|
||||
# define LE_NCONST
|
||||
#endif
|
||||
|
||||
|
||||
namespace Intern {
|
||||
|
||||
// --------------------------------------------------------------------------------------------
|
||||
template <typename T, bool doit>
|
||||
struct ByteSwapper {
|
||||
void operator() (T* inout) {
|
||||
ByteSwap::Swap(inout);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct ByteSwapper<T,false> {
|
||||
void operator() (T*) {
|
||||
}
|
||||
};
|
||||
|
||||
// --------------------------------------------------------------------------------------------
|
||||
template <bool SwapEndianess, typename T, bool RuntimeSwitch>
|
||||
struct Getter {
|
||||
void operator() (T* inout, bool le) {
|
||||
#ifdef AI_BUILD_BIG_ENDIAN
|
||||
le = le;
|
||||
#else
|
||||
le = !le;
|
||||
#endif
|
||||
if (le) {
|
||||
ByteSwapper<T,(sizeof(T)>1?true:false)> () (inout);
|
||||
}
|
||||
else ByteSwapper<T,false> () (inout);
|
||||
}
|
||||
};
|
||||
|
||||
template <bool SwapEndianess, typename T>
|
||||
struct Getter<SwapEndianess,T,false> {
|
||||
|
||||
void operator() (T* inout, bool /*le*/) {
|
||||
// static branch
|
||||
ByteSwapper<T,(SwapEndianess && sizeof(T)>1)> () (inout);
|
||||
}
|
||||
};
|
||||
} // end Intern
|
||||
} // end Assimp
|
||||
|
||||
#endif //!! AI_BYTESWAPPER_H_INC
|
||||
@@ -51,7 +51,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#endif
|
||||
|
||||
#include "C4DImporter.h"
|
||||
#include "TinyFormatter.h"
|
||||
#include <assimp/TinyFormatter.h>
|
||||
#include <memory>
|
||||
#include <assimp/IOSystem.hpp>
|
||||
#include <assimp/scene.h>
|
||||
|
||||
+2
-2
@@ -44,8 +44,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#ifndef INCLUDED_AI_CINEMA_4D_LOADER_H
|
||||
#define INCLUDED_AI_CINEMA_4D_LOADER_H
|
||||
|
||||
#include "BaseImporter.h"
|
||||
#include "LogAux.h"
|
||||
#include <assimp/BaseImporter.h>
|
||||
#include <assimp/LogAux.h>
|
||||
|
||||
#include <map>
|
||||
struct aiNode;
|
||||
|
||||
+36
-30
@@ -98,6 +98,40 @@ SET( PUBLIC_HEADERS
|
||||
${HEADER_PATH}/DefaultIOStream.h
|
||||
${HEADER_PATH}/DefaultIOSystem.h
|
||||
${HEADER_PATH}/SceneCombiner.h
|
||||
${HEADER_PATH}/fast_atof.h
|
||||
${HEADER_PATH}/qnan.h
|
||||
${HEADER_PATH}/BaseImporter.h
|
||||
${HEADER_PATH}/Hash.h
|
||||
${HEADER_PATH}/MemoryIOWrapper.h
|
||||
${HEADER_PATH}/ParsingUtils.h
|
||||
${HEADER_PATH}/StreamReader.h
|
||||
${HEADER_PATH}/StreamWriter.h
|
||||
${HEADER_PATH}/StringComparison.h
|
||||
${HEADER_PATH}/StringUtils.h
|
||||
${HEADER_PATH}/SGSpatialSort.h
|
||||
${HEADER_PATH}/GenericProperty.h
|
||||
${HEADER_PATH}/SpatialSort.h
|
||||
${HEADER_PATH}/SkeletonMeshBuilder.h
|
||||
${HEADER_PATH}/SmoothingGroups.h
|
||||
${HEADER_PATH}/SmoothingGroups.inl
|
||||
${HEADER_PATH}/StandardShapes.h
|
||||
${HEADER_PATH}/RemoveComments.h
|
||||
${HEADER_PATH}/Subdivision.h
|
||||
${HEADER_PATH}/Vertex.h
|
||||
${HEADER_PATH}/LineSplitter.h
|
||||
${HEADER_PATH}/TinyFormatter.h
|
||||
${HEADER_PATH}/Profiler.h
|
||||
${HEADER_PATH}/LogAux.h
|
||||
${HEADER_PATH}/Bitmap.h
|
||||
${HEADER_PATH}/XMLTools.h
|
||||
${HEADER_PATH}/IOStreamBuffer.h
|
||||
${HEADER_PATH}/CreateAnimMesh.h
|
||||
${HEADER_PATH}/irrXMLWrapper.h
|
||||
${HEADER_PATH}/BlobIOSystem.h
|
||||
${HEADER_PATH}/MathFunctions.h
|
||||
${HEADER_PATH}/Macros.h
|
||||
${HEADER_PATH}/Exceptional.h
|
||||
${HEADER_PATH}/ByteSwapper.h
|
||||
)
|
||||
|
||||
SET( Core_SRCS
|
||||
@@ -117,68 +151,40 @@ SET( Logging_SRCS
|
||||
SOURCE_GROUP(Logging FILES ${Logging_SRCS})
|
||||
|
||||
SET( Common_SRCS
|
||||
fast_atof.h
|
||||
qnan.h
|
||||
BaseImporter.cpp
|
||||
BaseImporter.h
|
||||
BaseProcess.cpp
|
||||
BaseProcess.h
|
||||
Importer.h
|
||||
ScenePrivate.h
|
||||
PostStepRegistry.cpp
|
||||
ImporterRegistry.cpp
|
||||
ByteSwapper.h
|
||||
DefaultProgressHandler.h
|
||||
DefaultIOStream.cpp
|
||||
DefaultIOSystem.cpp
|
||||
CInterfaceIOWrapper.cpp
|
||||
CInterfaceIOWrapper.h
|
||||
Hash.h
|
||||
Importer.cpp
|
||||
IFF.h
|
||||
MemoryIOWrapper.h
|
||||
ParsingUtils.h
|
||||
StreamReader.h
|
||||
StreamWriter.h
|
||||
StringComparison.h
|
||||
StringUtils.h
|
||||
SGSpatialSort.cpp
|
||||
SGSpatialSort.h
|
||||
VertexTriangleAdjacency.cpp
|
||||
VertexTriangleAdjacency.h
|
||||
GenericProperty.h
|
||||
SpatialSort.cpp
|
||||
SpatialSort.h
|
||||
SceneCombiner.cpp
|
||||
ScenePreprocessor.cpp
|
||||
ScenePreprocessor.h
|
||||
SkeletonMeshBuilder.cpp
|
||||
SkeletonMeshBuilder.h
|
||||
SplitByBoneCountProcess.cpp
|
||||
SplitByBoneCountProcess.h
|
||||
ScaleProcess.cpp
|
||||
ScaleProcess.h
|
||||
SmoothingGroups.h
|
||||
StandardShapes.cpp
|
||||
StandardShapes.h
|
||||
TargetAnimation.cpp
|
||||
TargetAnimation.h
|
||||
RemoveComments.cpp
|
||||
RemoveComments.h
|
||||
Subdivision.cpp
|
||||
Subdivision.h
|
||||
scene.cpp
|
||||
Vertex.h
|
||||
LineSplitter.h
|
||||
TinyFormatter.h
|
||||
Profiler.h
|
||||
LogAux.h
|
||||
Bitmap.cpp
|
||||
Bitmap.h
|
||||
XMLTools.h
|
||||
Version.cpp
|
||||
IOStreamBuffer.h
|
||||
CreateAnimMesh.h
|
||||
CreateAnimMesh.cpp
|
||||
)
|
||||
SOURCE_GROUP(Common FILES ${Common_SRCS})
|
||||
@@ -574,7 +580,7 @@ SET( PostProcessing_SRCS
|
||||
)
|
||||
SOURCE_GROUP( PostProcessing FILES ${PostProcessing_SRCS})
|
||||
|
||||
SET( IrrXML_SRCS irrXMLWrapper.h )
|
||||
SET( IrrXML_SRCS ${HEADER_PATH}/irrXMLWrapper.h )
|
||||
SOURCE_GROUP( IrrXML FILES ${IrrXML_SRCS})
|
||||
|
||||
ADD_ASSIMP_IMPORTER( Q3D
|
||||
@@ -705,7 +711,7 @@ SOURCE_GROUP( Step FILES ${Step_SRCS})
|
||||
SET( Exporter_SRCS
|
||||
Exporter.cpp
|
||||
AssimpCExport.cpp
|
||||
BlobIOSystem.h
|
||||
${HEADER_PATH}/BlobIOSystem.h
|
||||
)
|
||||
SOURCE_GROUP( Exporter FILES ${Exporter_SRCS})
|
||||
|
||||
|
||||
+5
-5
@@ -47,12 +47,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "COBLoader.h"
|
||||
#include "COBScene.h"
|
||||
|
||||
#include "StreamReader.h"
|
||||
#include "ParsingUtils.h"
|
||||
#include "fast_atof.h"
|
||||
#include <assimp/StreamReader.h>
|
||||
#include <assimp/ParsingUtils.h>
|
||||
#include <assimp/fast_atof.h>
|
||||
|
||||
#include "LineSplitter.h"
|
||||
#include "TinyFormatter.h"
|
||||
#include <assimp/LineSplitter.h>
|
||||
#include <assimp/TinyFormatter.h>
|
||||
#include <memory>
|
||||
#include <assimp/IOSystem.hpp>
|
||||
#include <assimp/DefaultLogger.hpp>
|
||||
|
||||
+2
-2
@@ -45,8 +45,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#ifndef INCLUDED_AI_COB_LOADER_H
|
||||
#define INCLUDED_AI_COB_LOADER_H
|
||||
|
||||
#include "BaseImporter.h"
|
||||
#include "StreamReader.h"
|
||||
#include <assimp/BaseImporter.h>
|
||||
#include <assimp/StreamReader.h>
|
||||
|
||||
struct aiNode;
|
||||
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <deque>
|
||||
#include <map>
|
||||
|
||||
#include "BaseImporter.h"
|
||||
#include <assimp/BaseImporter.h>
|
||||
#include <assimp/material.h>
|
||||
|
||||
namespace Assimp {
|
||||
|
||||
+3
-3
@@ -49,9 +49,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#ifndef ASSIMP_BUILD_NO_CSM_IMPORTER
|
||||
|
||||
#include "CSMLoader.h"
|
||||
#include "SkeletonMeshBuilder.h"
|
||||
#include "ParsingUtils.h"
|
||||
#include "fast_atof.h"
|
||||
#include <assimp/SkeletonMeshBuilder.h>
|
||||
#include <assimp/ParsingUtils.h>
|
||||
#include <assimp/fast_atof.h>
|
||||
#include <assimp/Importer.hpp>
|
||||
#include <memory>
|
||||
#include <assimp/IOSystem.hpp>
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#ifndef INCLUDED_AI_CSM_LOADER_H
|
||||
#define INCLUDED_AI_CSM_LOADER_H
|
||||
|
||||
#include "BaseImporter.h"
|
||||
#include <assimp/BaseImporter.h>
|
||||
|
||||
namespace Assimp {
|
||||
|
||||
|
||||
@@ -47,8 +47,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
// internal headers
|
||||
#include "CalcTangentsProcess.h"
|
||||
#include "ProcessHelper.h"
|
||||
#include "TinyFormatter.h"
|
||||
#include "qnan.h"
|
||||
#include <assimp/TinyFormatter.h>
|
||||
#include <assimp/qnan.h>
|
||||
|
||||
using namespace Assimp;
|
||||
|
||||
|
||||
@@ -43,17 +43,17 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#ifndef ASSIMP_BUILD_NO_COLLADA_EXPORTER
|
||||
|
||||
#include "ColladaExporter.h"
|
||||
#include "Bitmap.h"
|
||||
#include "fast_atof.h"
|
||||
#include <assimp/Bitmap.h>
|
||||
#include <assimp/fast_atof.h>
|
||||
#include <assimp/SceneCombiner.h>
|
||||
#include "StringUtils.h"
|
||||
#include "XMLTools.h"
|
||||
#include <assimp/StringUtils.h>
|
||||
#include <assimp/XMLTools.h>
|
||||
#include <assimp/DefaultIOSystem.h>
|
||||
#include <assimp/IOSystem.hpp>
|
||||
#include <assimp/Exporter.hpp>
|
||||
#include <assimp/scene.h>
|
||||
|
||||
#include "Exceptional.h"
|
||||
#include <assimp/Exceptional.h>
|
||||
|
||||
#include <memory>
|
||||
#include <ctime>
|
||||
|
||||
@@ -54,7 +54,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
#include "StringUtils.h"
|
||||
#include <assimp/StringUtils.h>
|
||||
|
||||
struct aiScene;
|
||||
struct aiNode;
|
||||
|
||||
@@ -53,10 +53,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <assimp/importerdesc.h>
|
||||
|
||||
#include "ColladaParser.h"
|
||||
#include "fast_atof.h"
|
||||
#include "ParsingUtils.h"
|
||||
#include "SkeletonMeshBuilder.h"
|
||||
#include "CreateAnimMesh.h"
|
||||
#include <assimp/fast_atof.h>
|
||||
#include <assimp/ParsingUtils.h>
|
||||
#include <assimp/SkeletonMeshBuilder.h>
|
||||
#include <assimp/CreateAnimMesh.h>
|
||||
|
||||
#include "time.h"
|
||||
#include "math.h"
|
||||
|
||||
@@ -44,7 +44,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#ifndef AI_COLLADALOADER_H_INC
|
||||
#define AI_COLLADALOADER_H_INC
|
||||
|
||||
#include "BaseImporter.h"
|
||||
#include <assimp/BaseImporter.h>
|
||||
#include "ColladaParser.h"
|
||||
|
||||
struct aiNode;
|
||||
|
||||
@@ -49,13 +49,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <sstream>
|
||||
#include <stdarg.h>
|
||||
#include "ColladaParser.h"
|
||||
#include "fast_atof.h"
|
||||
#include "ParsingUtils.h"
|
||||
#include "StringUtils.h"
|
||||
#include <assimp/fast_atof.h>
|
||||
#include <assimp/ParsingUtils.h>
|
||||
#include <assimp/StringUtils.h>
|
||||
#include <assimp/DefaultLogger.hpp>
|
||||
#include <assimp/IOSystem.hpp>
|
||||
#include <assimp/light.h>
|
||||
#include "TinyFormatter.h"
|
||||
#include <assimp/TinyFormatter.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
|
||||
@@ -46,10 +46,10 @@
|
||||
#ifndef AI_COLLADAPARSER_H_INC
|
||||
#define AI_COLLADAPARSER_H_INC
|
||||
|
||||
#include "irrXMLWrapper.h"
|
||||
#include <assimp/irrXMLWrapper.h>
|
||||
#include "ColladaHelper.h"
|
||||
#include <assimp/ai_assert.h>
|
||||
#include "TinyFormatter.h"
|
||||
#include <assimp/TinyFormatter.h>
|
||||
|
||||
namespace Assimp
|
||||
{
|
||||
|
||||
@@ -44,7 +44,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include "ComputeUVMappingProcess.h"
|
||||
#include "ProcessHelper.h"
|
||||
#include "Exceptional.h"
|
||||
#include <assimp/Exceptional.h>
|
||||
|
||||
using namespace Assimp;
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "CreateAnimMesh.h"
|
||||
#include <assimp/CreateAnimMesh.h>
|
||||
|
||||
namespace Assimp {
|
||||
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
/*
|
||||
Open Asset Import Library (assimp)
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2017, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use of this software in source and binary forms,
|
||||
with or without modification, are permitted provided that the
|
||||
following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer in the documentation and/or other
|
||||
materials provided with the distribution.
|
||||
|
||||
* Neither the name of the assimp team, nor the names of its
|
||||
contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior
|
||||
written permission of the assimp team.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/** @file CreateAnimMesh.h
|
||||
* Create AnimMesh from Mesh
|
||||
*/
|
||||
#ifndef INCLUDED_AI_CREATE_ANIM_MESH_H
|
||||
#define INCLUDED_AI_CREATE_ANIM_MESH_H
|
||||
|
||||
#include <assimp/mesh.h>
|
||||
|
||||
namespace Assimp {
|
||||
|
||||
/** Create aiAnimMesh from aiMesh. */
|
||||
aiAnimMesh *aiCreateAnimMesh(const aiMesh *mesh);
|
||||
|
||||
} // end of namespace Assimp
|
||||
#endif // INCLUDED_AI_CREATE_ANIM_MESH_H
|
||||
|
||||
@@ -49,7 +49,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <assimp/Exporter.hpp>
|
||||
#include <assimp/DefaultLogger.hpp>
|
||||
|
||||
#include "Exceptional.h"
|
||||
#include <assimp/Exceptional.h>
|
||||
#include "3MFXmlTags.h"
|
||||
#include "D3MFOpcPackage.h"
|
||||
|
||||
|
||||
@@ -47,8 +47,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <assimp/IOSystem.hpp>
|
||||
#include <assimp/DefaultLogger.hpp>
|
||||
#include <assimp/importerdesc.h>
|
||||
#include "StringComparison.h"
|
||||
#include "StringUtils.h"
|
||||
#include <assimp/StringComparison.h>
|
||||
#include <assimp/StringUtils.h>
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
@@ -58,7 +58,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include "D3MFOpcPackage.h"
|
||||
#include <contrib/unzip/unzip.h>
|
||||
#include "irrXMLWrapper.h"
|
||||
#include <assimp/irrXMLWrapper.h>
|
||||
#include "3MFXmlTags.h"
|
||||
|
||||
namespace Assimp {
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#ifndef AI_D3MFLOADER_H_INCLUDED
|
||||
#define AI_D3MFLOADER_H_INCLUDED
|
||||
|
||||
#include "BaseImporter.h"
|
||||
#include <assimp/BaseImporter.h>
|
||||
|
||||
namespace Assimp {
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#ifndef ASSIMP_BUILD_NO_3MF_IMPORTER
|
||||
|
||||
#include "D3MFOpcPackage.h"
|
||||
#include "Exceptional.h"
|
||||
#include <assimp/Exceptional.h>
|
||||
|
||||
#include <assimp/IOStream.hpp>
|
||||
#include <assimp/IOSystem.hpp>
|
||||
|
||||
@@ -45,7 +45,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <memory>
|
||||
|
||||
#include <assimp/IOSystem.hpp>
|
||||
#include "irrXMLWrapper.h"
|
||||
#include <assimp/irrXMLWrapper.h>
|
||||
|
||||
namespace Assimp {
|
||||
namespace D3MF {
|
||||
|
||||
+4
-4
@@ -46,10 +46,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#ifndef INCLUDED_DXFHELPER_H
|
||||
#define INCLUDED_DXFHELPER_H
|
||||
|
||||
#include "LineSplitter.h"
|
||||
#include "TinyFormatter.h"
|
||||
#include "StreamReader.h"
|
||||
#include "fast_atof.h"
|
||||
#include <assimp/LineSplitter.h>
|
||||
#include <assimp/TinyFormatter.h>
|
||||
#include <assimp/StreamReader.h>
|
||||
#include <assimp/fast_atof.h>
|
||||
#include <vector>
|
||||
#include <assimp/DefaultLogger.hpp>
|
||||
|
||||
|
||||
+2
-2
@@ -48,9 +48,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#ifndef ASSIMP_BUILD_NO_DXF_IMPORTER
|
||||
|
||||
#include "DXFLoader.h"
|
||||
#include "ParsingUtils.h"
|
||||
#include <assimp/ParsingUtils.h>
|
||||
#include "ConvertToLHProcess.h"
|
||||
#include "fast_atof.h"
|
||||
#include <assimp/fast_atof.h>
|
||||
|
||||
#include "DXFHelper.h"
|
||||
#include <assimp/IOSystem.hpp>
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#ifndef AI_DXFLOADER_H_INCLUDED
|
||||
#define AI_DXFLOADER_H_INCLUDED
|
||||
|
||||
#include "BaseImporter.h"
|
||||
#include <assimp/BaseImporter.h>
|
||||
#include <map>
|
||||
|
||||
namespace Assimp {
|
||||
|
||||
@@ -41,7 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
/** @file Default implementation of IOSystem using the standard C file functions */
|
||||
|
||||
#include "StringComparison.h"
|
||||
#include <assimp/StringComparison.h>
|
||||
|
||||
#include <assimp/DefaultIOSystem.h>
|
||||
#include <assimp/DefaultIOStream.h>
|
||||
|
||||
@@ -49,7 +49,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "Win32DebugLogStream.h"
|
||||
#include "StdOStreamLogStream.h"
|
||||
#include "FileLogStream.h"
|
||||
#include "StringUtils.h"
|
||||
#include <assimp/StringUtils.h>
|
||||
|
||||
#include <assimp/DefaultIOSystem.h>
|
||||
#include <assimp/NullLogger.hpp>
|
||||
|
||||
@@ -40,7 +40,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "EmbedTexturesProcess.h"
|
||||
#include "ParsingUtils.h"
|
||||
#include <assimp/ParsingUtils.h>
|
||||
#include "ProcessHelper.h"
|
||||
|
||||
#include <fstream>
|
||||
|
||||
@@ -1,125 +0,0 @@
|
||||
/*
|
||||
Open Asset Import Library (assimp)
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2008, assimp team
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use of this software in source and binary forms,
|
||||
with or without modification, are permitted provided that the
|
||||
following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer in the documentation and/or other
|
||||
materials provided with the distribution.
|
||||
|
||||
* Neither the name of the assimp team, nor the names of its
|
||||
contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior
|
||||
written permission of the assimp team.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef INCLUDED_EXCEPTIONAL_H
|
||||
#define INCLUDED_EXCEPTIONAL_H
|
||||
|
||||
#include <stdexcept>
|
||||
#include <assimp/DefaultIOStream.h>
|
||||
using std::runtime_error;
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning(disable : 4275)
|
||||
#endif
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
/** FOR IMPORTER PLUGINS ONLY: Simple exception class to be thrown if an
|
||||
* unrecoverable error occurs while importing. Loading APIs return
|
||||
* NULL instead of a valid aiScene then. */
|
||||
class DeadlyImportError
|
||||
: public runtime_error
|
||||
{
|
||||
public:
|
||||
/** Constructor with arguments */
|
||||
explicit DeadlyImportError( const std::string& errorText)
|
||||
: runtime_error(errorText)
|
||||
{
|
||||
}
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
typedef DeadlyImportError DeadlyExportError;
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning(default : 4275)
|
||||
#endif
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
template <typename T>
|
||||
struct ExceptionSwallower {
|
||||
T operator ()() const {
|
||||
return T();
|
||||
}
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
template <typename T>
|
||||
struct ExceptionSwallower<T*> {
|
||||
T* operator ()() const {
|
||||
return NULL;
|
||||
}
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
template <>
|
||||
struct ExceptionSwallower<aiReturn> {
|
||||
aiReturn operator ()() const {
|
||||
try {
|
||||
throw;
|
||||
}
|
||||
catch (std::bad_alloc&) {
|
||||
return aiReturn_OUTOFMEMORY;
|
||||
}
|
||||
catch (...) {
|
||||
return aiReturn_FAILURE;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
template <>
|
||||
struct ExceptionSwallower<void> {
|
||||
void operator ()() const {
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
#define ASSIMP_BEGIN_EXCEPTION_REGION()\
|
||||
{\
|
||||
try {
|
||||
|
||||
#define ASSIMP_END_EXCEPTION_REGION(type)\
|
||||
} catch(...) {\
|
||||
return ExceptionSwallower<type>()();\
|
||||
}\
|
||||
}
|
||||
|
||||
#endif // INCLUDED_EXCEPTIONAL_H
|
||||
+2
-2
@@ -53,7 +53,7 @@ Here we implement only the C++ interface (Assimp::Exporter).
|
||||
|
||||
#ifndef ASSIMP_BUILD_NO_EXPORT
|
||||
|
||||
#include "BlobIOSystem.h"
|
||||
#include <assimp/BlobIOSystem.h>
|
||||
#include <assimp/SceneCombiner.h>
|
||||
#include "BaseProcess.h"
|
||||
#include "Importer.h" // need this for GetPostProcessingStepInstanceList()
|
||||
@@ -61,7 +61,7 @@ Here we implement only the C++ interface (Assimp::Exporter).
|
||||
#include "JoinVerticesProcess.h"
|
||||
#include "MakeVerboseFormat.h"
|
||||
#include "ConvertToLHProcess.h"
|
||||
#include "Exceptional.h"
|
||||
#include <assimp/Exceptional.h>
|
||||
#include "ScenePrivate.h"
|
||||
#include <memory>
|
||||
|
||||
|
||||
@@ -50,8 +50,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "FBXUtil.h"
|
||||
#include <assimp/defs.h>
|
||||
#include <stdint.h>
|
||||
#include "Exceptional.h"
|
||||
#include "ByteSwapper.h"
|
||||
#include <assimp/Exceptional.h>
|
||||
#include <assimp/ByteSwapper.h>
|
||||
|
||||
namespace Assimp {
|
||||
namespace FBX {
|
||||
|
||||
@@ -52,7 +52,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "FBXUtil.h"
|
||||
#include "FBXProperties.h"
|
||||
#include "FBXImporter.h"
|
||||
#include "StringComparison.h"
|
||||
#include <assimp/StringComparison.h>
|
||||
|
||||
#include <assimp/scene.h>
|
||||
|
||||
|
||||
@@ -53,8 +53,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "FBXDocument.h"
|
||||
#include "FBXConverter.h"
|
||||
|
||||
#include "StreamReader.h"
|
||||
#include "MemoryIOWrapper.h"
|
||||
#include <assimp/StreamReader.h>
|
||||
#include <assimp/MemoryIOWrapper.h>
|
||||
#include <assimp/Importer.hpp>
|
||||
#include <assimp/importerdesc.h>
|
||||
|
||||
|
||||
+2
-2
@@ -45,8 +45,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#ifndef INCLUDED_AI_FBX_IMPORTER_H
|
||||
#define INCLUDED_AI_FBX_IMPORTER_H
|
||||
|
||||
#include "BaseImporter.h"
|
||||
#include "LogAux.h"
|
||||
#include <assimp/BaseImporter.h>
|
||||
#include <assimp/LogAux.h>
|
||||
|
||||
#include "FBXImportSettings.h"
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "FBXImportSettings.h"
|
||||
#include "FBXDocumentUtil.h"
|
||||
#include "FBXProperties.h"
|
||||
#include "ByteSwapper.h"
|
||||
#include <assimp/ByteSwapper.h>
|
||||
|
||||
namespace Assimp {
|
||||
namespace FBX {
|
||||
|
||||
+3
-3
@@ -56,9 +56,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "FBXParser.h"
|
||||
#include "FBXUtil.h"
|
||||
|
||||
#include "ParsingUtils.h"
|
||||
#include "fast_atof.h"
|
||||
#include "ByteSwapper.h"
|
||||
#include <assimp/ParsingUtils.h>
|
||||
#include <assimp/fast_atof.h>
|
||||
#include <assimp/ByteSwapper.h>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
|
||||
+2
-2
@@ -48,8 +48,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <stdint.h>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include "LogAux.h"
|
||||
#include "fast_atof.h"
|
||||
#include <assimp/LogAux.h>
|
||||
#include <assimp/fast_atof.h>
|
||||
|
||||
#include "FBXCompileConfig.h"
|
||||
#include "FBXTokenizer.h"
|
||||
|
||||
@@ -48,11 +48,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
// tab width for logging columns
|
||||
#define ASSIMP_FBX_TAB_WIDTH 4
|
||||
|
||||
#include "ParsingUtils.h"
|
||||
#include <assimp/ParsingUtils.h>
|
||||
|
||||
#include "FBXTokenizer.h"
|
||||
#include "FBXUtil.h"
|
||||
#include "Exceptional.h"
|
||||
#include <assimp/Exceptional.h>
|
||||
|
||||
namespace Assimp {
|
||||
namespace FBX {
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "FBXUtil.h"
|
||||
#include "FBXTokenizer.h"
|
||||
|
||||
#include "TinyFormatter.h"
|
||||
#include <assimp/TinyFormatter.h>
|
||||
#include <string>
|
||||
|
||||
#ifndef ASSIMP_BUILD_NO_FBX_IMPORTER
|
||||
|
||||
+5
-5
@@ -46,7 +46,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#ifndef ASSIMP_BUILD_NO_X3D_IMPORTER
|
||||
|
||||
#include "FIReader.hpp"
|
||||
#include "StringUtils.h"
|
||||
#include <assimp/StringUtils.h>
|
||||
|
||||
// Workaround for issue #1361
|
||||
// https://github.com/assimp/assimp/issues/1361
|
||||
@@ -54,13 +54,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# define _GLIBCXX_USE_C99 1
|
||||
#endif
|
||||
|
||||
#include "Exceptional.h"
|
||||
#include <assimp/Exceptional.h>
|
||||
#include <assimp/IOStream.hpp>
|
||||
#include <assimp/types.h>
|
||||
#include "MemoryIOWrapper.h"
|
||||
#include "irrXMLWrapper.h"
|
||||
#include <assimp/MemoryIOWrapper.h>
|
||||
#include <assimp/irrXMLWrapper.h>
|
||||
#include "../contrib/utf8cpp/source/utf8.h"
|
||||
#include "fast_atof.h"
|
||||
#include <assimp/fast_atof.h>
|
||||
#include <stack>
|
||||
#include <map>
|
||||
#include <iostream>
|
||||
|
||||
@@ -47,8 +47,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include "../include/assimp/IOSystem.hpp"
|
||||
#include "../include/assimp/DefaultLogger.hpp"
|
||||
#include "fast_atof.h"
|
||||
#include "ParsingUtils.h"
|
||||
#include "../include/assimp/fast_atof.h"
|
||||
#include "../include/assimp/ParsingUtils.h"
|
||||
|
||||
namespace Assimp {
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
// internal headers
|
||||
#include "ProcessHelper.h"
|
||||
#include "FindDegenerates.h"
|
||||
#include "Exceptional.h"
|
||||
#include <assimp/Exceptional.h>
|
||||
|
||||
using namespace Assimp;
|
||||
|
||||
|
||||
@@ -50,9 +50,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
// internal headers
|
||||
#include "FindInvalidDataProcess.h"
|
||||
#include "ProcessHelper.h"
|
||||
#include "Macros.h"
|
||||
#include "Exceptional.h"
|
||||
#include "qnan.h"
|
||||
#include <assimp/Macros.h>
|
||||
#include <assimp/Exceptional.h>
|
||||
#include <assimp/qnan.h>
|
||||
|
||||
using namespace Assimp;
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
// internal headers
|
||||
#include "FixNormalsStep.h"
|
||||
#include "StringUtils.h"
|
||||
#include <assimp/StringUtils.h>
|
||||
#include <assimp/DefaultLogger.hpp>
|
||||
#include <assimp/postprocess.h>
|
||||
#include <assimp/scene.h>
|
||||
|
||||
@@ -49,8 +49,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <assimp/postprocess.h>
|
||||
#include <assimp/scene.h>
|
||||
#include <assimp/DefaultLogger.hpp>
|
||||
#include "Exceptional.h"
|
||||
#include "qnan.h"
|
||||
#include <assimp/Exceptional.h>
|
||||
#include <assimp/qnan.h>
|
||||
|
||||
|
||||
using namespace Assimp;
|
||||
|
||||
@@ -49,8 +49,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
// internal headers
|
||||
#include "GenVertexNormalsProcess.h"
|
||||
#include "ProcessHelper.h"
|
||||
#include "Exceptional.h"
|
||||
#include "qnan.h"
|
||||
#include <assimp/Exceptional.h>
|
||||
#include <assimp/qnan.h>
|
||||
|
||||
using namespace Assimp;
|
||||
|
||||
|
||||
@@ -1,126 +0,0 @@
|
||||
/*
|
||||
Open Asset Import Library (assimp)
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2017, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use of this software in source and binary forms,
|
||||
with or without modification, are permitted provided that the
|
||||
following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer in the documentation and/or other
|
||||
materials provided with the distribution.
|
||||
|
||||
* Neither the name of the assimp team, nor the names of its
|
||||
contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior
|
||||
written permission of the assimp team.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef AI_GENERIC_PROPERTY_H_INCLUDED
|
||||
#define AI_GENERIC_PROPERTY_H_INCLUDED
|
||||
|
||||
#include <assimp/Importer.hpp>
|
||||
#include <assimp/ai_assert.h>
|
||||
#include "Hash.h"
|
||||
#include <map>
|
||||
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
template <class T>
|
||||
inline bool SetGenericProperty(std::map< unsigned int, T >& list,
|
||||
const char* szName, const T& value)
|
||||
{
|
||||
ai_assert(NULL != szName);
|
||||
const uint32_t hash = SuperFastHash(szName);
|
||||
|
||||
typename std::map<unsigned int, T>::iterator it = list.find(hash);
|
||||
if (it == list.end()) {
|
||||
list.insert(std::pair<unsigned int, T>( hash, value ));
|
||||
return false;
|
||||
}
|
||||
(*it).second = value;
|
||||
return true;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
template <class T>
|
||||
inline const T& GetGenericProperty(const std::map< unsigned int, T >& list,
|
||||
const char* szName, const T& errorReturn)
|
||||
{
|
||||
ai_assert(NULL != szName);
|
||||
const uint32_t hash = SuperFastHash(szName);
|
||||
|
||||
typename std::map<unsigned int, T>::const_iterator it = list.find(hash);
|
||||
if (it == list.end())
|
||||
return errorReturn;
|
||||
|
||||
return (*it).second;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// Special version for pointer types - they will be deleted when replaced with another value
|
||||
// passing NULL removes the whole property
|
||||
template <class T>
|
||||
inline void SetGenericPropertyPtr(std::map< unsigned int, T* >& list,
|
||||
const char* szName, T* value, bool* bWasExisting = NULL)
|
||||
{
|
||||
ai_assert(NULL != szName);
|
||||
const uint32_t hash = SuperFastHash(szName);
|
||||
|
||||
typename std::map<unsigned int, T*>::iterator it = list.find(hash);
|
||||
if (it == list.end()) {
|
||||
if (bWasExisting)
|
||||
*bWasExisting = false;
|
||||
|
||||
list.insert(std::pair<unsigned int,T*>( hash, value ));
|
||||
return;
|
||||
}
|
||||
if ((*it).second != value) {
|
||||
delete (*it).second;
|
||||
(*it).second = value;
|
||||
}
|
||||
if (!value) {
|
||||
list.erase(it);
|
||||
}
|
||||
if (bWasExisting)
|
||||
*bWasExisting = true;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
template <class T>
|
||||
inline bool HasGenericProperty(const std::map< unsigned int, T >& list,
|
||||
const char* szName)
|
||||
{
|
||||
ai_assert(NULL != szName);
|
||||
const uint32_t hash = SuperFastHash(szName);
|
||||
|
||||
typename std::map<unsigned int, T>::const_iterator it = list.find(hash);
|
||||
if (it == list.end()) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // !! AI_GENERIC_PROPERTY_H_INCLUDED
|
||||
+1
-1
@@ -46,7 +46,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#define AI_HMPLOADER_H_INCLUDED
|
||||
|
||||
// internal headers
|
||||
#include "BaseImporter.h"
|
||||
#include <assimp/BaseImporter.h>
|
||||
#include "MDLLoader.h"
|
||||
#include "HMPFileData.h"
|
||||
|
||||
|
||||
-117
@@ -1,117 +0,0 @@
|
||||
/*
|
||||
Open Asset Import Library (assimp)
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2017, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use of this software in source and binary forms,
|
||||
with or without modification, are permitted provided that the
|
||||
following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer in the documentation and/or other
|
||||
materials provided with the distribution.
|
||||
|
||||
* Neither the name of the assimp team, nor the names of its
|
||||
contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior
|
||||
written permission of the assimp team.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef AI_HASH_H_INCLUDED
|
||||
#define AI_HASH_H_INCLUDED
|
||||
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// Hashing function taken from
|
||||
// http://www.azillionmonkeys.com/qed/hash.html
|
||||
// (incremental version)
|
||||
//
|
||||
// This code is Copyright 2004-2008 by Paul Hsieh. It is used here in the belief that
|
||||
// Assimp's license is considered compatible with Pauls's derivative license as specified
|
||||
// on his web page.
|
||||
//
|
||||
// (stdint.h should have been been included here)
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#undef get16bits
|
||||
#if (defined(__GNUC__) && defined(__i386__)) || defined(__WATCOMC__) \
|
||||
|| defined(_MSC_VER) || defined (__BORLANDC__) || defined (__TURBOC__)
|
||||
#define get16bits(d) (*((const uint16_t *) (d)))
|
||||
#endif
|
||||
|
||||
#if !defined (get16bits)
|
||||
#define get16bits(d) ((((uint32_t)(((const uint8_t *)(d))[1])) << 8)\
|
||||
+(uint32_t)(((const uint8_t *)(d))[0]) )
|
||||
#endif
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
inline uint32_t SuperFastHash (const char * data, uint32_t len = 0, uint32_t hash = 0) {
|
||||
uint32_t tmp;
|
||||
int rem;
|
||||
|
||||
if (!data) return 0;
|
||||
if (!len)len = (uint32_t)::strlen(data);
|
||||
|
||||
rem = len & 3;
|
||||
len >>= 2;
|
||||
|
||||
/* Main loop */
|
||||
for (;len > 0; len--) {
|
||||
hash += get16bits (data);
|
||||
tmp = (get16bits (data+2) << 11) ^ hash;
|
||||
hash = (hash << 16) ^ tmp;
|
||||
data += 2*sizeof (uint16_t);
|
||||
hash += hash >> 11;
|
||||
}
|
||||
|
||||
/* Handle end cases */
|
||||
switch (rem) {
|
||||
case 3: hash += get16bits (data);
|
||||
hash ^= hash << 16;
|
||||
hash ^= data[sizeof (uint16_t)] << 18;
|
||||
hash += hash >> 11;
|
||||
break;
|
||||
case 2: hash += get16bits (data);
|
||||
hash ^= hash << 11;
|
||||
hash += hash >> 17;
|
||||
break;
|
||||
case 1: hash += *data;
|
||||
hash ^= hash << 10;
|
||||
hash += hash >> 1;
|
||||
}
|
||||
|
||||
/* Force "avalanching" of final 127 bits */
|
||||
hash ^= hash << 3;
|
||||
hash += hash >> 5;
|
||||
hash ^= hash << 4;
|
||||
hash += hash >> 17;
|
||||
hash ^= hash << 25;
|
||||
hash += hash >> 6;
|
||||
|
||||
return hash;
|
||||
}
|
||||
|
||||
#endif // !! AI_HASH_H_INCLUDED
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
#ifndef AI_IFF_H_INCLUDED
|
||||
#define AI_IFF_H_INCLUDED
|
||||
|
||||
#include "ByteSwapper.h"
|
||||
#include <assimp/ByteSwapper.h>
|
||||
|
||||
namespace Assimp {
|
||||
namespace IFF {
|
||||
|
||||
@@ -1,350 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
/*
|
||||
Open Asset Import Library (assimp)
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2017, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use of this software in source and binary forms,
|
||||
with or without modification, are permitted provided that the
|
||||
following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer in the documentation and/or other
|
||||
materials provided with the distribution.
|
||||
|
||||
* Neither the name of the assimp team, nor the names of its
|
||||
contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior
|
||||
written permission of the assimp team.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include <assimp/types.h>
|
||||
#include <assimp/IOStream.hpp>
|
||||
#include "ParsingUtils.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace Assimp {
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
/**
|
||||
* Implementation of a cached stream buffer.
|
||||
*/
|
||||
template<class T>
|
||||
class IOStreamBuffer {
|
||||
public:
|
||||
/// @brief The class constructor.
|
||||
IOStreamBuffer( size_t cache = 4096 * 4096 );
|
||||
|
||||
/// @brief The class destructor.
|
||||
~IOStreamBuffer();
|
||||
|
||||
/// @brief Will open the cached access for a given stream.
|
||||
/// @param stream The stream to cache.
|
||||
/// @return true if successful.
|
||||
bool open( IOStream *stream );
|
||||
|
||||
/// @brief Will close the cached access.
|
||||
/// @return true if successful.
|
||||
bool close();
|
||||
|
||||
/// @brief Returns the file-size.
|
||||
/// @return The file-size.
|
||||
size_t size() const;
|
||||
|
||||
/// @brief Returns the cache size.
|
||||
/// @return The cache size.
|
||||
size_t cacheSize() const;
|
||||
|
||||
/// @brief Will read the next block.
|
||||
/// @return true if successful.
|
||||
bool readNextBlock();
|
||||
|
||||
/// @brief Returns the number of blocks to read.
|
||||
/// @return The number of blocks.
|
||||
size_t getNumBlocks() const;
|
||||
|
||||
/// @brief Returns the current block index.
|
||||
/// @return The current block index.
|
||||
size_t getCurrentBlockIndex() const;
|
||||
|
||||
/// @brief Returns the current file pos.
|
||||
/// @return The current file pos.
|
||||
size_t getFilePos() const;
|
||||
|
||||
/// @brief Will read the next line.
|
||||
/// @param buffer The buffer for the next line.
|
||||
/// @return true if successful.
|
||||
bool getNextDataLine( std::vector<T> &buffer, T continuationToken );
|
||||
|
||||
/// @brief Will read the next line ascii or binary end line char.
|
||||
/// @param buffer The buffer for the next line.
|
||||
/// @return true if successful.
|
||||
bool getNextLine(std::vector<T> &buffer);
|
||||
|
||||
/// @brief Will read the next block.
|
||||
/// @param buffer The buffer for the next block.
|
||||
/// @return true if successful.
|
||||
bool getNextBlock( std::vector<T> &buffer );
|
||||
|
||||
private:
|
||||
IOStream *m_stream;
|
||||
size_t m_filesize;
|
||||
size_t m_cacheSize;
|
||||
size_t m_numBlocks;
|
||||
size_t m_blockIdx;
|
||||
std::vector<T> m_cache;
|
||||
size_t m_cachePos;
|
||||
size_t m_filePos;
|
||||
};
|
||||
|
||||
template<class T>
|
||||
inline
|
||||
IOStreamBuffer<T>::IOStreamBuffer( size_t cache )
|
||||
: m_stream( nullptr )
|
||||
, m_filesize( 0 )
|
||||
, m_cacheSize( cache )
|
||||
, m_numBlocks( 0 )
|
||||
, m_blockIdx( 0 )
|
||||
, m_cachePos( 0 )
|
||||
, m_filePos( 0 ) {
|
||||
m_cache.resize( cache );
|
||||
std::fill( m_cache.begin(), m_cache.end(), '\n' );
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline
|
||||
IOStreamBuffer<T>::~IOStreamBuffer() {
|
||||
// empty
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline
|
||||
bool IOStreamBuffer<T>::open( IOStream *stream ) {
|
||||
// file still opened!
|
||||
if ( nullptr != m_stream ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Invalid stream pointer
|
||||
if ( nullptr == stream ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
m_stream = stream;
|
||||
m_filesize = m_stream->FileSize();
|
||||
if ( m_filesize == 0 ) {
|
||||
return false;
|
||||
}
|
||||
if ( m_filesize < m_cacheSize ) {
|
||||
m_cacheSize = m_filesize;
|
||||
}
|
||||
|
||||
m_numBlocks = m_filesize / m_cacheSize;
|
||||
if ( ( m_filesize % m_cacheSize ) > 0 ) {
|
||||
m_numBlocks++;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline
|
||||
bool IOStreamBuffer<T>::close() {
|
||||
if ( nullptr == m_stream ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// init counters and state vars
|
||||
m_stream = nullptr;
|
||||
m_filesize = 0;
|
||||
m_numBlocks = 0;
|
||||
m_blockIdx = 0;
|
||||
m_cachePos = 0;
|
||||
m_filePos = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline
|
||||
size_t IOStreamBuffer<T>::size() const {
|
||||
return m_filesize;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline
|
||||
size_t IOStreamBuffer<T>::cacheSize() const {
|
||||
return m_cacheSize;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline
|
||||
bool IOStreamBuffer<T>::readNextBlock() {
|
||||
m_stream->Seek( m_filePos, aiOrigin_SET );
|
||||
size_t readLen = m_stream->Read( &m_cache[ 0 ], sizeof( T ), m_cacheSize );
|
||||
if ( readLen == 0 ) {
|
||||
return false;
|
||||
}
|
||||
if ( readLen < m_cacheSize ) {
|
||||
m_cacheSize = readLen;
|
||||
}
|
||||
m_filePos += m_cacheSize;
|
||||
m_cachePos = 0;
|
||||
m_blockIdx++;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline
|
||||
size_t IOStreamBuffer<T>::getNumBlocks() const {
|
||||
return m_numBlocks;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline
|
||||
size_t IOStreamBuffer<T>::getCurrentBlockIndex() const {
|
||||
return m_blockIdx;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline
|
||||
size_t IOStreamBuffer<T>::getFilePos() const {
|
||||
return m_filePos;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline
|
||||
bool IOStreamBuffer<T>::getNextDataLine( std::vector<T> &buffer, T continuationToken ) {
|
||||
buffer.resize( m_cacheSize );
|
||||
if ( m_cachePos == m_cacheSize || 0 == m_filePos ) {
|
||||
if ( !readNextBlock() ) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool continuationFound( false ), endOfDataLine( false );
|
||||
size_t i = 0;
|
||||
while ( !endOfDataLine ) {
|
||||
if ( continuationToken == m_cache[ m_cachePos ] ) {
|
||||
continuationFound = true;
|
||||
++m_cachePos;
|
||||
}
|
||||
if ( IsLineEnd( m_cache[ m_cachePos ] ) ) {
|
||||
if ( !continuationFound ) {
|
||||
// the end of the data line
|
||||
break;
|
||||
} else {
|
||||
// skip line end
|
||||
while ( m_cache[m_cachePos] != '\n') {
|
||||
++m_cachePos;
|
||||
}
|
||||
++m_cachePos;
|
||||
continuationFound = false;
|
||||
}
|
||||
}
|
||||
|
||||
buffer[ i ] = m_cache[ m_cachePos ];
|
||||
m_cachePos++;
|
||||
i++;
|
||||
if ( m_cachePos >= m_cacheSize ) {
|
||||
if ( !readNextBlock() ) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
buffer[ i ] = '\n';
|
||||
m_cachePos++;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static
|
||||
inline
|
||||
bool isEndOfCache( size_t pos, size_t cacheSize ) {
|
||||
return ( pos == cacheSize );
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline
|
||||
bool IOStreamBuffer<T>::getNextLine(std::vector<T> &buffer) {
|
||||
buffer.resize(m_cacheSize);
|
||||
if ( isEndOfCache( m_cachePos, m_cacheSize ) || 0 == m_filePos) {
|
||||
if (!readNextBlock()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (IsLineEnd(m_cache[m_cachePos])) {
|
||||
// skip line end
|
||||
while (m_cache[m_cachePos] != '\n') {
|
||||
++m_cachePos;
|
||||
}
|
||||
++m_cachePos;
|
||||
if ( isEndOfCache( m_cachePos, m_cacheSize ) ) {
|
||||
if ( !readNextBlock() ) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
size_t i = 0;
|
||||
while (!IsLineEnd(m_cache[ m_cachePos ])) {
|
||||
buffer[i] = m_cache[ m_cachePos ];
|
||||
m_cachePos++;
|
||||
i++;
|
||||
if (m_cachePos >= m_cacheSize) {
|
||||
if (!readNextBlock()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
buffer[i] = '\n';
|
||||
m_cachePos++;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline
|
||||
bool IOStreamBuffer<T>::getNextBlock( std::vector<T> &buffer) {
|
||||
//just return the last blockvalue if getNextLine was used before
|
||||
if ( m_cachePos != 0) {
|
||||
buffer = std::vector<T>(m_cache.begin() + m_cachePos, m_cache.end());
|
||||
m_cachePos = 0;
|
||||
}
|
||||
else {
|
||||
if ( !readNextBlock() )
|
||||
return false;
|
||||
|
||||
buffer = std::vector<T>(m_cache.begin(), m_cache.end());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
} // !ns Assimp
|
||||
+5
-5
@@ -49,16 +49,16 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#ifndef ASSIMP_BUILD_NO_IRR_IMPORTER
|
||||
|
||||
#include "IRRLoader.h"
|
||||
#include "ParsingUtils.h"
|
||||
#include "fast_atof.h"
|
||||
#include "GenericProperty.h"
|
||||
#include <assimp/ParsingUtils.h>
|
||||
#include <assimp/fast_atof.h>
|
||||
#include <assimp/GenericProperty.h>
|
||||
|
||||
#include <assimp/SceneCombiner.h>
|
||||
#include "StandardShapes.h"
|
||||
#include <assimp/StandardShapes.h>
|
||||
#include "Importer.h"
|
||||
|
||||
// We need MathFunctions.h to compute the lcm/gcd of a number
|
||||
#include "MathFunctions.h"
|
||||
#include <assimp/MathFunctions.h>
|
||||
#include <memory>
|
||||
#include <assimp/DefaultLogger.hpp>
|
||||
#include <assimp/mesh.h>
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "IRRShared.h"
|
||||
#include <assimp/SceneCombiner.h>
|
||||
#include "Importer.h"
|
||||
#include "StringUtils.h"
|
||||
#include <assimp/StringUtils.h>
|
||||
#include <assimp/anim.h>
|
||||
|
||||
namespace Assimp {
|
||||
|
||||
@@ -47,8 +47,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#ifndef ASSIMP_BUILD_NO_IRRMESH_IMPORTER
|
||||
|
||||
#include "IRRMeshLoader.h"
|
||||
#include "ParsingUtils.h"
|
||||
#include "fast_atof.h"
|
||||
#include <assimp/ParsingUtils.h>
|
||||
#include <assimp/fast_atof.h>
|
||||
#include <memory>
|
||||
#include <assimp/IOSystem.hpp>
|
||||
#include <assimp/mesh.h>
|
||||
@@ -56,7 +56,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <assimp/material.h>
|
||||
#include <assimp/scene.h>
|
||||
#include <assimp/importerdesc.h>
|
||||
#include "Macros.h"
|
||||
#include <assimp/Macros.h>
|
||||
|
||||
using namespace Assimp;
|
||||
using namespace irr;
|
||||
|
||||
@@ -46,7 +46,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#ifndef AI_IRRMESHLOADER_H_INCLUDED
|
||||
#define AI_IRRMESHLOADER_H_INCLUDED
|
||||
|
||||
#include "BaseImporter.h"
|
||||
#include <assimp/BaseImporter.h>
|
||||
#include "IRRShared.h"
|
||||
|
||||
#ifndef ASSIMP_BUILD_NO_IRRMESH_IMPORTER
|
||||
|
||||
+2
-2
@@ -50,8 +50,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#if !(defined(ASSIMP_BUILD_NO_IRR_IMPORTER) && defined(ASSIMP_BUILD_NO_IRRMESH_IMPORTER))
|
||||
|
||||
#include "IRRShared.h"
|
||||
#include "ParsingUtils.h"
|
||||
#include "fast_atof.h"
|
||||
#include <assimp/ParsingUtils.h>
|
||||
#include <assimp/fast_atof.h>
|
||||
#include <assimp/DefaultLogger.hpp>
|
||||
#include <assimp/material.h>
|
||||
|
||||
|
||||
+2
-2
@@ -7,8 +7,8 @@
|
||||
#ifndef INCLUDED_AI_IRRSHARED_H
|
||||
#define INCLUDED_AI_IRRSHARED_H
|
||||
|
||||
#include "irrXMLWrapper.h"
|
||||
#include "BaseImporter.h"
|
||||
#include <assimp/irrXMLWrapper.h>
|
||||
#include <assimp/BaseImporter.h>
|
||||
#include <stdint.h>
|
||||
|
||||
struct aiMaterial;
|
||||
|
||||
+7
-7
@@ -64,19 +64,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
// Internal headers
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#include "Importer.h"
|
||||
#include "BaseImporter.h"
|
||||
#include <assimp/BaseImporter.h>
|
||||
#include "BaseProcess.h"
|
||||
|
||||
#include "DefaultProgressHandler.h"
|
||||
#include "GenericProperty.h"
|
||||
#include <assimp/GenericProperty.h>
|
||||
#include "ProcessHelper.h"
|
||||
#include "ScenePreprocessor.h"
|
||||
#include "ScenePrivate.h"
|
||||
#include "MemoryIOWrapper.h"
|
||||
#include "Profiler.h"
|
||||
#include "TinyFormatter.h"
|
||||
#include "Exceptional.h"
|
||||
#include "Profiler.h"
|
||||
#include <assimp/MemoryIOWrapper.h>
|
||||
#include <assimp/Profiler.h>
|
||||
#include <assimp/TinyFormatter.h>
|
||||
#include <assimp/Exceptional.h>
|
||||
#include <assimp/Profiler.h>
|
||||
#include <set>
|
||||
#include <memory>
|
||||
#include <cctype>
|
||||
|
||||
@@ -59,7 +59,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include "IFCUtil.h"
|
||||
|
||||
#include "code/MemoryIOWrapper.h"
|
||||
#include <assimp/MemoryIOWrapper.h>
|
||||
#include <assimp/scene.h>
|
||||
#include <assimp/Importer.hpp>
|
||||
#include <assimp/importerdesc.h>
|
||||
@@ -931,7 +931,7 @@ void ProcessSpatialStructures(ConversionData& conv)
|
||||
conv.out->mRootNode->mParent = NULL;
|
||||
conv.out->mRootNode->mNumChildren = static_cast<unsigned int>(nb_nodes);
|
||||
conv.out->mRootNode->mChildren = new aiNode*[conv.out->mRootNode->mNumChildren];
|
||||
|
||||
|
||||
for (size_t i = 0; i < nb_nodes; ++i) {
|
||||
aiNode* node = nodes[i];
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user