Merge branch 'master' into fix-logger-comments

This commit is contained in:
krishty
2021-08-11 12:16:58 +02:00
committed by GitHub
189 changed files with 1241 additions and 1209 deletions

View File

@@ -154,7 +154,7 @@ public:
/** Returns the exception of the last exception that occurred.
* Note: Exceptions are not the only source of error details, so GetErrorText
* should be consulted too.
* @return The last exception that occurred.
* @return The last exception that occurred.
*/
const std::exception_ptr& GetException() const {
return m_Exception;

View File

@@ -1,7 +1,7 @@
// ===============================================================================
// May be included multiple times - resets structure packing to the defaults
// for all supported compilers. Reverts the changes made by #include <pushpack1.h>
// May be included multiple times - resets structure packing to the defaults
// for all supported compilers. Reverts the changes made by #include <pushpack1.h>
//
// Currently this works on the following compilers:
// MSVC 7,8,9

View File

@@ -1,7 +1,7 @@
// ===============================================================================
// May be included multiple times - sets structure packing to 1
// May be included multiple times - sets structure packing to 1
// for all supported compilers. #include <poppack1.h> reverts the changes.
//
// Currently this works on the following compilers:
@@ -37,7 +37,7 @@
#if defined(_MSC_VER)
// C4103: Packing was changed after the inclusion of the header, probably missing #pragma pop
# pragma warning (disable : 4103)
# pragma warning (disable : 4103)
#endif
#define AI_PUSHPACK_IS_DEFINED

View File

@@ -59,7 +59,7 @@ using std::runtime_error;
class ASSIMP_API DeadlyErrorBase : public runtime_error {
protected:
DeadlyErrorBase(Assimp::Formatter::format f);
template<typename... T, typename U>
DeadlyErrorBase(Assimp::Formatter::format f, U&& u, T&&... args) :
DeadlyErrorBase(std::move(f << std::forward<U>(u)), std::forward<T>(args)...) {}

View File

@@ -390,7 +390,7 @@ public:
* @see SetPropertyInteger()
*/
bool SetPropertyMatrix(const char *szName, const aiMatrix4x4 &sValue);
bool SetPropertyCallback(const char *szName, const std::function<void *(void *)> &f);
// -------------------------------------------------------------------

View File

@@ -81,7 +81,7 @@ public:
/// @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;
@@ -278,7 +278,7 @@ bool IOStreamBuffer<T>::getNextDataLine( std::vector<T> &buffer, T continuationT
}
}
}
buffer[ i ] = '\n';
++m_cachePos;
@@ -334,7 +334,7 @@ template<class T>
AI_FORCE_INLINE
bool IOStreamBuffer<T>::getNextBlock( std::vector<T> &buffer) {
// Return the last block-value if getNextLine was used before
if ( 0 != m_cachePos ) {
if ( 0 != m_cachePos ) {
buffer = std::vector<T>( m_cache.begin() + m_cachePos, m_cache.end() );
m_cachePos = 0;
} else {

View File

@@ -62,9 +62,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "types.h"
#ifdef _WIN32
# include <direct.h>
# include <stdlib.h>
# include <stdio.h>
# include <direct.h>
# include <stdlib.h>
# include <stdio.h>
#else
# include <sys/stat.h>
# include <sys/types.h>
@@ -84,7 +84,7 @@ namespace Assimp {
* to the importer library. If you implement this interface, you also want to
* supply a custom implementation for IOStream.
*
* @see Importer::SetIOHandler()
* @see Importer::SetIOHandler()
*/
class ASSIMP_API IOSystem
#ifndef SWIG

View File

@@ -112,7 +112,7 @@ public:
/** @brief Writes a debug message
* @param message Debug message*/
void verboseDebug(const char* message);
template<typename... T>
void verboseDebug(T&&... args) {
verboseDebug(formatMessage(std::forward<T>(args)...).c_str());

View File

@@ -57,7 +57,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <stdint.h>
namespace Assimp {
#define AI_MEMORYIO_MAGIC_FILENAME "$$$___magic___$$$"
#define AI_MEMORYIO_MAGIC_FILENAME_LENGTH 17
@@ -85,7 +85,7 @@ public:
size_t Read(void* pvBuffer, size_t pSize, size_t pCount) {
ai_assert(nullptr != pvBuffer);
ai_assert(0 != pSize);
const size_t cnt = std::min( pCount, (length-pos) / pSize);
const size_t ofs = pSize * cnt;
@@ -209,7 +209,7 @@ public:
return existing_io ? existing_io->ComparePaths(one, second) : false;
}
bool PushDirectory( const std::string &path ) override {
bool PushDirectory( const std::string &path ) override {
return existing_io ? existing_io->PushDirectory(path) : false;
}

View File

@@ -53,17 +53,17 @@ Based on CppCon 2016: Chandler Carruth "High Performance Code 201: Hybrid Data S
namespace Assimp {
// --------------------------------------------------------------------------------------------
/// @brief Small vector with inplace storage.
/// @brief Small vector with inplace storage.
///
/// Reduces heap allocations when list is shorter. It uses a small array for a dedicated size.
/// When the growing gets bigger than this small cache a dynamic growing algorithm will be
/// When the growing gets bigger than this small cache a dynamic growing algorithm will be
/// used.
// --------------------------------------------------------------------------------------------
template<typename T, unsigned int Capacity>
class SmallVector {
public:
/// @brief The default class constructor.
SmallVector() :
SmallVector() :
mStorage(mInplaceStorage),
mSize(0),
mCapacity(Capacity) {
@@ -84,7 +84,7 @@ public:
mStorage[mSize++] = item;
return;
}
push_back_and_grow(item);
}

View File

@@ -7,8 +7,8 @@ Copyright (c) 2006-2021, 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
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
@@ -25,16 +25,16 @@ conditions are met:
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
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
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
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
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.
---------------------------------------------------------------------------
*/
@@ -77,7 +77,7 @@ void ComputeNormalsWithSmoothingsGroups(MeshWithSmoothingGroups<T>& sMesh)
sMesh.mNormals[face.mIndices[c]] = vNor;
}
// calculate the position bounds so we have a reliable epsilon to check position differences against
// calculate the position bounds so we have a reliable epsilon to check position differences against
aiVector3D minVec( 1e10f, 1e10f, 1e10f), maxVec( -1e10f, -1e10f, -1e10f);
for( unsigned int a = 0; a < sMesh.mPositions.size(); a++)
{
@@ -91,7 +91,7 @@ void ComputeNormalsWithSmoothingsGroups(MeshWithSmoothingGroups<T>& sMesh)
const float posEpsilon = (maxVec - minVec).Length() * 1e-5f;
std::vector<aiVector3D> avNormals;
avNormals.resize(sMesh.mNormals.size());
// now generate the spatial sort tree
SGSpatialSort sSort;
for( typename std::vector<T>::iterator i = sMesh.mFaces.begin();

View File

@@ -94,7 +94,7 @@ using XmlAttribute = pugi::xml_attribute;
/// }
/// }
/// @endcode
/// @tparam TNodeType
/// @tparam TNodeType
template <class TNodeType>
class TXmlParser {
public:
@@ -123,7 +123,7 @@ public:
/// @brief Will search for a child-node by its name
/// @param name [in] The name of the child-node.
/// @return The node instance or nullptr, if nothing was found.
/// @return The node instance or nullptr, if nothing was found.
TNodeType *findNode(const std::string &name) {
if (name.empty()) {
return nullptr;
@@ -162,12 +162,12 @@ public:
mData.resize(len + 1);
memset(&mData[0], '\0', len + 1);
stream->Read(&mData[0], 1, len);
mDoc = new pugi::xml_document();
pugi::xml_parse_result parse_result = mDoc->load_string(&mData[0], pugi::parse_full);
if (parse_result.status == pugi::status_ok) {
return true;
}
}
ASSIMP_LOG_DEBUG("Error while parse xml.", std::string(parse_result.description()), " @ ", parse_result.offset);
@@ -457,7 +457,7 @@ public:
}
private:
XmlNode &mParent;
XmlNode &mParent;
std::vector<XmlNode> mNodes;
size_t mIndex;
};

View File

@@ -57,7 +57,7 @@ namespace Assimp
#else
# define ai_assert(expression)
# define ai_assert_entry()
# define ai_assert_entry()
#endif // ASSIMP_BUILD_DEBUG
#endif // AI_ASSERT_H_INC

View File

@@ -39,7 +39,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
---------------------------------------------------------------------------
*/
/**
/**
* @file anim.h
* @brief Defines the data structures in which the imported animations
* are returned.
@@ -478,11 +478,11 @@ struct aiAnimation {
namespace Assimp {
// ---------------------------------------------------------------------------
/**
/**
* @brief CPP-API: Utility class to simplify interpolations of various data types.
*
* The type of interpolation is chosen automatically depending on the
* types of the arguments.
* types of the arguments.
*/
template <typename T>
struct Interpolator {

View File

@@ -894,7 +894,7 @@ ASSIMP_API float aiMatrix3Determinant(
// --------------------------------------------------------------------------------
/** Get a 3x3 rotation matrix around the Z axis.
* @param mat Receives the output matrix
* @param mat Receives the output matrix
* @param angle Rotation angle, in radians
*/
ASSIMP_API void aiMatrix3RotationZ(
@@ -903,7 +903,7 @@ ASSIMP_API void aiMatrix3RotationZ(
// --------------------------------------------------------------------------------
/** Returns a 3x3 rotation matrix for a rotation around an arbitrary axis.
* @param mat Receives the output matrix
* @param mat Receives the output matrix
* @param axis Rotation axis, should be a normalized vector
* @param angle Rotation angle, in radians
*/
@@ -914,7 +914,7 @@ ASSIMP_API void aiMatrix3FromRotationAroundAxis(
// --------------------------------------------------------------------------------
/** Get a 3x3 translation matrix.
* @param mat Receives the output matrix
* @param mat Receives the output matrix
* @param translation The translation vector
*/
ASSIMP_API void aiMatrix3Translation(
@@ -923,7 +923,7 @@ ASSIMP_API void aiMatrix3Translation(
// --------------------------------------------------------------------------------
/** Create a 3x3 matrix that rotates one vector to another vector.
* @param mat Receives the output matrix
* @param mat Receives the output matrix
* @param from Vector to rotate from
* @param to Vector to rotate to
*/
@@ -1059,7 +1059,7 @@ ASSIMP_API void aiMatrix4DecomposeNoScaling(
// --------------------------------------------------------------------------------
/** Creates a 4x4 matrix from a set of euler angles.
* @param mat Receives the output matrix
* @param mat Receives the output matrix
* @param x Rotation angle for the x-axis, in radians
* @param y Rotation angle for the y-axis, in radians
* @param z Rotation angle for the z-axis, in radians
@@ -1137,7 +1137,7 @@ ASSIMP_API void aiMatrix4FromTo(
// --------------------------------------------------------------------------------
/** Create a Quaternion from euler angles.
* @param q Receives the output quaternion
* @param q Receives the output quaternion
* @param x Rotation angle for the x-axis, in radians
* @param y Rotation angle for the y-axis, in radians
* @param z Rotation angle for the z-axis, in radians

View File

@@ -161,7 +161,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#pragma warning(disable : 4251)
#endif
/* Force the compiler to inline a function, if possible */
#define AI_FORCE_INLINE inline
#define AI_FORCE_INLINE inline
/* Tells the compiler that a function never returns. Used in code analysis
* to skip dead paths (e.g. after an assertion evaluated to false). */

View File

@@ -257,7 +257,7 @@ struct aiLight
#ifdef __cplusplus
}
#endif
#endif
#endif // !! AI_LIGHT_H_INC

View File

@@ -194,8 +194,8 @@ enum aiTextureType {
*/
aiTextureType_NONE = 0,
/** LEGACY API MATERIALS
* Legacy refers to materials which
/** LEGACY API MATERIALS
* Legacy refers to materials which
* Were originally implemented in the specifications around 2000.
* These must never be removed, as most engines support them.
*/
@@ -339,9 +339,9 @@ ASSIMP_API const char *TextureTypeToString(enum aiTextureType in);
// ---------------------------------------------------------------------------
/** @brief Defines all shading models supported by the library
*
*
* Property: #AI_MATKEY_SHADING_MODEL
*
*
* The list of shading modes has been taken from Blender.
* See Blender documentation for more information. The API does
* not distinguish between "specular" and "diffuse" shaders (thus the

View File

@@ -230,7 +230,7 @@ public:
* @param out Receives the output matrix
* @return Reference to the output matrix
*/
static aiMatrix4x4t& Translation( const aiVector3t<TReal>& v,
static aiMatrix4x4t& Translation( const aiVector3t<TReal>& v,
aiMatrix4x4t& out);
// -------------------------------------------------------------------

View File

@@ -421,7 +421,7 @@ void aiMatrix4x4t<TReal>::Decompose(aiVector3t<TReal>& pScaling, aiVector3t<TRea
and post-multiplication of column vectors,
the rotation matrix for an euler XYZ rotation is M = Rz * Ry * Rx.
combining gives:
| CE BDE-AF ADE+BF 0 |
M = | CF BDF+AE ADF-BE 0 |
| -D CB AC 0 |

View File

@@ -400,17 +400,17 @@ enum aiPrimitiveType {
/**
* A flag to determine whether this triangles only mesh is NGON encoded.
*
*
* NGON encoding is a special encoding that tells whether 2 or more consecutive triangles
* should be considered as a triangle fan. This is identified by looking at the first vertex index.
* 2 consecutive triangles with the same 1st vertex index are part of the same
* NGON.
*
* At the moment, only quads (concave or convex) are supported, meaning that polygons are 'seen' as
*
* At the moment, only quads (concave or convex) are supported, meaning that polygons are 'seen' as
* triangles, as usual after a triangulation pass.
*
*
* To get an NGON encoded mesh, please use the aiProcess_Triangulate post process.
*
*
* @see aiProcess_Triangulate
* @link https://github.com/KhronosGroup/glTF/pull/1620
*/

View File

@@ -211,10 +211,10 @@ enum aiPostProcessSteps
*
* If the resulting scene can be reduced to a single mesh, with a single
* material, no lights, and no cameras, then the output scene will contain
* only a root node (with no children) that references the single mesh.
* only a root node (with no children) that references the single mesh.
* Otherwise, the output scene will be reduced to a root node with a single
* level of child nodes, each one referencing one mesh, and each mesh
* referencing one material.
* level of child nodes, each one referencing one mesh, and each mesh
* referencing one material.
*
* In either case, for rendering, you can
* simply render all meshes in order - you don't need to pay
@@ -328,12 +328,12 @@ enum aiPostProcessSteps
// -------------------------------------------------------------------------
/**
/**
* This step generically populates aiBone->mArmature and aiBone->mNode generically
* The point of these is it saves you later having to calculate these elements
* This is useful when handling rest information or skin information
* If you have multiple armatures on your models we strongly recommend enabling this
* Instead of writing your own multi-root, multi-armature lookups we have done the
* If you have multiple armatures on your models we strongly recommend enabling this
* Instead of writing your own multi-root, multi-armature lookups we have done the
* hard work for you :)
*/
aiProcess_PopulateArmatureData = 0x4000,
@@ -579,7 +579,7 @@ enum aiPostProcessSteps
* of the imported model. And if so, it uses that.
*/
aiProcess_EmbedTextures = 0x10000000,
// aiProcess_GenEntityMeshes = 0x100000,
// aiProcess_OptimizeAnimations = 0x200000
// aiProcess_FixTexturePaths = 0x200000

View File

@@ -70,7 +70,7 @@ extern "C" {
#endif
// -------------------------------------------------------------------------------
/**
/**
* A node in the imported hierarchy.
*
* Each node has name, a parent node (except for the root node),
@@ -149,12 +149,12 @@ struct ASSIMP_API aiNode
* @param name Name to search for
* @return nullptr or a valid Node if the search was successful.
*/
inline
inline
const aiNode* FindNode(const aiString& name) const {
return FindNode(name.data);
}
inline
inline
aiNode* FindNode(const aiString& name) {
return FindNode(name.data);
}
@@ -353,34 +353,34 @@ struct aiScene
//! Check whether the scene contains meshes
//! Unless no special scene flags are set this will always be true.
inline bool HasMeshes() const {
return mMeshes != nullptr && mNumMeshes > 0;
inline bool HasMeshes() const {
return mMeshes != nullptr && mNumMeshes > 0;
}
//! Check whether the scene contains materials
//! Unless no special scene flags are set this will always be true.
inline bool HasMaterials() const {
return mMaterials != nullptr && mNumMaterials > 0;
inline bool HasMaterials() const {
return mMaterials != nullptr && mNumMaterials > 0;
}
//! Check whether the scene contains lights
inline bool HasLights() const {
return mLights != nullptr && mNumLights > 0;
inline bool HasLights() const {
return mLights != nullptr && mNumLights > 0;
}
//! Check whether the scene contains textures
inline bool HasTextures() const {
return mTextures != nullptr && mNumTextures > 0;
return mTextures != nullptr && mNumTextures > 0;
}
//! Check whether the scene contains cameras
inline bool HasCameras() const {
return mCameras != nullptr && mNumCameras > 0;
return mCameras != nullptr && mNumCameras > 0;
}
//! Check whether the scene contains animations
inline bool HasAnimations() const {
return mAnimations != nullptr && mNumAnimations > 0;
inline bool HasAnimations() const {
return mAnimations != nullptr && mNumAnimations > 0;
}
//! Returns a short filename from a full path

View File

@@ -190,7 +190,7 @@ aiVector2t<TReal> operator + (const aiVector2t<TReal>& v1, const aiVector2t<TRea
// ------------------------------------------------------------------------------------------------
// symmetric subtraction
template <typename TReal>
inline
inline
aiVector2t<TReal> operator - (const aiVector2t<TReal>& v1, const aiVector2t<TReal>& v2) {
return aiVector2t<TReal>( v1.x - v2.x, v1.y - v2.y);
}
@@ -198,7 +198,7 @@ aiVector2t<TReal> operator - (const aiVector2t<TReal>& v1, const aiVector2t<TRea
// ------------------------------------------------------------------------------------------------
// scalar product
template <typename TReal>
inline
inline
TReal operator * (const aiVector2t<TReal>& v1, const aiVector2t<TReal>& v2) {
return v1.x*v2.x + v1.y*v2.y;
}
@@ -206,7 +206,7 @@ TReal operator * (const aiVector2t<TReal>& v1, const aiVector2t<TReal>& v2) {
// ------------------------------------------------------------------------------------------------
// scalar multiplication
template <typename TReal>
inline
inline
aiVector2t<TReal> operator * ( TReal f, const aiVector2t<TReal>& v) {
return aiVector2t<TReal>( f*v.x, f*v.y);
}
@@ -214,7 +214,7 @@ aiVector2t<TReal> operator * ( TReal f, const aiVector2t<TReal>& v) {
// ------------------------------------------------------------------------------------------------
// and the other way around
template <typename TReal>
inline
inline
aiVector2t<TReal> operator * ( const aiVector2t<TReal>& v, TReal f) {
return aiVector2t<TReal>( f*v.x, f*v.y);
}
@@ -222,7 +222,7 @@ aiVector2t<TReal> operator * ( const aiVector2t<TReal>& v, TReal f) {
// ------------------------------------------------------------------------------------------------
// scalar division
template <typename TReal>
inline
inline
aiVector2t<TReal> operator / ( const aiVector2t<TReal>& v, TReal f) {
return v * (1/f);
}
@@ -230,7 +230,7 @@ aiVector2t<TReal> operator / ( const aiVector2t<TReal>& v, TReal f) {
// ------------------------------------------------------------------------------------------------
// vector division
template <typename TReal>
inline
inline
aiVector2t<TReal> operator / ( const aiVector2t<TReal>& v, const aiVector2t<TReal>& v2) {
return aiVector2t<TReal>(v.x / v2.x,v.y / v2.y);
}
@@ -238,7 +238,7 @@ aiVector2t<TReal> operator / ( const aiVector2t<TReal>& v, const aiVector2t<TRea
// ------------------------------------------------------------------------------------------------
// vector negation
template <typename TReal>
inline
inline
aiVector2t<TReal> operator - ( const aiVector2t<TReal>& v) {
return aiVector2t<TReal>( -v.x, -v.y);
}