Преглед на файлове

Refactoring: use using types (#6266)

* Refactoring: use using types

---------

Co-authored-by: Kim Kulling <[email protected]>
Kim Kulling преди 1 седмица
родител
ревизия
9f4e7c6d8d
променени са 34 файла, в които са добавени 119 реда и са изтрити 109 реда
  1. 1 1
      code/AssetLib/3DS/3DSConverter.cpp
  2. 1 1
      code/AssetLib/3MF/3MFTypes.h
  3. 3 3
      code/AssetLib/AC/ACLoader.cpp
  4. 1 1
      code/AssetLib/AC/ACLoader.h
  5. 0 2
      code/AssetLib/AMF/AMFImporter.hpp
  6. 3 3
      code/AssetLib/ASE/ASELoader.cpp
  7. 3 3
      code/AssetLib/Blender/BlenderLoader.cpp
  8. 8 8
      code/AssetLib/C4D/C4DImporter.cpp
  9. 5 4
      code/AssetLib/C4D/C4DImporter.h
  10. 1 1
      code/AssetLib/Collada/ColladaLoader.cpp
  11. 2 2
      code/AssetLib/Collada/ColladaLoader.h
  12. 29 30
      code/AssetLib/FBX/FBXConverter.cpp
  13. 2 2
      code/AssetLib/FBX/FBXConverter.h
  14. 3 3
      code/AssetLib/Irr/IRRLoader.cpp
  15. 2 2
      code/AssetLib/Irr/IRRLoader.h
  16. 1 1
      code/AssetLib/Irr/IRRMeshLoader.cpp
  17. 1 1
      code/AssetLib/LWO/LWOLoader.cpp
  18. 2 2
      code/AssetLib/MDL/MDLLoader.cpp
  19. 1 1
      code/AssetLib/Q3BSP/Q3BSPFileImporter.cpp
  20. 1 1
      code/AssetLib/SIB/SIBImporter.cpp
  21. 1 1
      code/AssetLib/STL/STLLoader.cpp
  22. 1 1
      code/AssetLib/X/XFileImporter.cpp
  23. 1 1
      code/AssetLib/XGL/XGLLoader.cpp
  24. 1 1
      code/AssetLib/glTF/glTFImporter.cpp
  25. 13 14
      code/Common/SceneCombiner.cpp
  26. 3 3
      code/Common/Subdivision.cpp
  27. 2 2
      code/PostProcessing/PretransformVertices.cpp
  28. 1 1
      code/PostProcessing/PretransformVertices.h
  29. 1 1
      code/PostProcessing/SortByPTypeProcess.cpp
  30. 2 0
      include/assimp/Importer.hpp
  31. 6 6
      include/assimp/SceneCombiner.h
  32. 11 0
      include/assimp/types.h
  33. 5 5
      packaging/windows-innosetup/script_x64.iss
  34. 1 1
      test/unit/utSceneCombiner.cpp

+ 1 - 1
code/AssetLib/3DS/3DSConverter.cpp

@@ -319,7 +319,7 @@ void Discreet3DSImporter::ConvertMaterial(Material &oldMat, aiMaterial &mat) {
 // ------------------------------------------------------------------------------------------------
 // Split meshes by their materials and generate output aiMesh'es
 void Discreet3DSImporter::ConvertMeshes(aiScene *pcOut) {
-    std::vector<aiMesh *> avOutMeshes;
+    MeshArray avOutMeshes;
     avOutMeshes.reserve(mScene->mMeshes.size() * 2);
 
     unsigned int iFaceCnt = 0, num = 0;

+ 1 - 1
code/AssetLib/3MF/3MFTypes.h

@@ -157,7 +157,7 @@ struct Component {
 
 class Object : public Resource {
 public:
-    std::vector<aiMesh *> mMeshes;
+    MeshArray mMeshes;
     std::vector<unsigned int> mMeshIndex;
     std::vector<Component> mComponents;
     std::string mName;

+ 3 - 3
code/AssetLib/AC/ACLoader.cpp

@@ -392,7 +392,7 @@ void AC3DImporter::ConvertMaterial(const Object &object,
 // ------------------------------------------------------------------------------------------------
 // Converts the loaded data to the internal verbose representation
 aiNode *AC3DImporter::ConvertObjectSection(Object &object,
-        std::vector<aiMesh *> &meshes,
+        MeshArray &meshes,
         std::vector<aiMaterial *> &outMaterials,
         const std::vector<Material> &materials,
         aiNode *parent) {
@@ -677,7 +677,7 @@ aiNode *AC3DImporter::ConvertObjectSection(Object &object,
                     std::unique_ptr<Subdivider> div(Subdivider::Create(Subdivider::CATMULL_CLARKE));
                     ASSIMP_LOG_INFO("AC3D: Evaluating subdivision surface: ", object.name);
 
-                    std::vector<aiMesh *> cpy(meshes.size() - oldm, nullptr);
+                    MeshArray cpy(meshes.size() - oldm, nullptr);
                     div->Subdivide(&meshes[oldm], cpy.size(), &cpy.front(), object.subDiv, true);
                     std::copy(cpy.begin(), cpy.end(), meshes.begin() + oldm);
 
@@ -813,7 +813,7 @@ void AC3DImporter::InternReadFile(const std::string &pFile,
     }
 
     mNumMeshes += (mNumMeshes >> 2u) + 1;
-    std::vector<aiMesh *> meshes;
+    MeshArray meshes;
     meshes.reserve(mNumMeshes);
 
     std::vector<aiMaterial *> omaterials;

+ 1 - 1
code/AssetLib/AC/ACLoader.h

@@ -226,7 +226,7 @@ private:
      *  @param materials Material list
      *  @param Scenegraph node for the object */
     aiNode *ConvertObjectSection(Object &object,
-            std::vector<aiMesh *> &meshes,
+            MeshArray &meshes,
             std::vector<aiMaterial *> &outMaterials,
             const std::vector<Material> &materials,
             aiNode *parent = nullptr);

+ 0 - 2
code/AssetLib/AMF/AMFImporter.hpp

@@ -99,8 +99,6 @@ namespace Assimp {
 ///
 class AMFImporter : public BaseImporter {
     using AMFMetaDataArray = std::vector<AMFMetadata *>;
-    using MeshArray = std::vector<aiMesh *>;
-    using NodeArray = std::vector<aiNode *>;
 
 public:
     struct SPP_Material;

+ 3 - 3
code/AssetLib/ASE/ASELoader.cpp

@@ -162,7 +162,7 @@ void ASEImporter::InternReadFile(const std::string &pFile,
 
         // process all meshes
         bool tookNormals = false;
-        std::vector<aiMesh *> avOutMeshes;
+        MeshArray avOutMeshes;
         avOutMeshes.reserve(mParser->m_vMeshes.size() * 2);
         for (std::vector<ASE::Mesh>::iterator i = mParser->m_vMeshes.begin(); i != mParser->m_vMeshes.end(); ++i) {
             if ((*i).bSkip) {
@@ -187,7 +187,7 @@ void ASEImporter::InternReadFile(const std::string &pFile,
         // Now build the output mesh list. Remove dummies
         pScene->mNumMeshes = (unsigned int)avOutMeshes.size();
         aiMesh **pp = pScene->mMeshes = new aiMesh *[pScene->mNumMeshes];
-        for (std::vector<aiMesh *>::const_iterator i = avOutMeshes.begin(); i != avOutMeshes.end(); ++i) {
+        for (MeshArray::const_iterator i = avOutMeshes.begin(); i != avOutMeshes.end(); ++i) {
             if (!(*i)->mNumFaces) {
                 continue;
             }
@@ -902,7 +902,7 @@ void ASEImporter::ConvertMaterial(ASE::Material &mat) {
 
 // ------------------------------------------------------------------------------------------------
 // Build output meshes
-void ASEImporter::ConvertMeshes(ASE::Mesh &mesh, std::vector<aiMesh *> &avOutMeshes) {
+void ASEImporter::ConvertMeshes(ASE::Mesh &mesh, MeshArray &avOutMeshes) {
     // validate the material index of the mesh
     if (mesh.iMaterialIndex >= mParser->m_vMaterials.size()) {
         mesh.iMaterialIndex = (unsigned int)mParser->m_vMaterials.size() - 1;

+ 3 - 3
code/AssetLib/Blender/BlenderLoader.cpp

@@ -961,7 +961,7 @@ void BlenderImporter::ConvertMesh(const Scene & /*in*/, const Object * /*obj*/,
         if (mesh->totface > static_cast<int>(mesh->mtface.size())) {
             ThrowException("Number of UV faces is larger than the corresponding UV face array (#1)");
         }
-        for (std::vector<aiMesh *>::iterator it = temp->begin() + old; it != temp->end(); ++it) {
+        for (MeshArray::iterator it = temp->begin() + old; it != temp->end(); ++it) {
             ai_assert(0 != (*it)->mNumVertices);
             ai_assert(0 != (*it)->mNumFaces);
             const auto itMatTexUvMapping = matTexUvMappings.find((*it)->mMaterialIndex);
@@ -1030,7 +1030,7 @@ void BlenderImporter::ConvertMesh(const Scene & /*in*/, const Object * /*obj*/,
         if (mesh->totface > static_cast<int>(mesh->tface.size())) {
             ThrowException("Number of faces is larger than the corresponding UV face array (#2)");
         }
-        for (std::vector<aiMesh *>::iterator it = temp->begin() + old; it != temp->end(); ++it) {
+        for (MeshArray::iterator it = temp->begin() + old; it != temp->end(); ++it) {
             ai_assert(0 != (*it)->mNumVertices);
             ai_assert(0 != (*it)->mNumFaces);
 
@@ -1057,7 +1057,7 @@ void BlenderImporter::ConvertMesh(const Scene & /*in*/, const Object * /*obj*/,
         if (mesh->totface > static_cast<int>((mesh->mcol.size() / 4))) {
             ThrowException("Number of faces is larger than the corresponding color face array");
         }
-        for (std::vector<aiMesh *>::iterator it = temp->begin() + old; it != temp->end(); ++it) {
+        for (MeshArray::iterator it = temp->begin() + old; it != temp->end(); ++it) {
             ai_assert(0 != (*it)->mNumVertices);
             ai_assert(0 != (*it)->mNumFaces);
 

+ 8 - 8
code/AssetLib/C4D/C4DImporter.cpp

@@ -166,10 +166,10 @@ void C4DImporter::InternReadFile( const std::string& pFile, aiScene* pScene, IOS
     // copy meshes over
     pScene->mNumMeshes = static_cast<unsigned int>(meshes.size());
     pScene->mMeshes = new aiMesh*[pScene->mNumMeshes]();
-    std::copy(meshes.begin(), meshes.end(), pScene->mMeshes);
+    std::copy(mMeshes.begin(), mMeshes.end(), pScene->mMeshes);
 
     // copy materials over, adding a default material if necessary
-    unsigned int mat_count = static_cast<unsigned int>(materials.size());
+    unsigned int mat_count = static_cast<unsigned int>(mMaterials.size());
     for(aiMesh* mesh : meshes) {
         ai_assert(mesh->mMaterialIndex <= mat_count);
         if(mesh->mMaterialIndex >= mat_count) {
@@ -179,14 +179,14 @@ void C4DImporter::InternReadFile( const std::string& pFile, aiScene* pScene, IOS
             const aiString name(AI_DEFAULT_MATERIAL_NAME);
             def_material->AddProperty(&name, AI_MATKEY_NAME);
 
-            materials.push_back(def_material.release());
+            mMaterials.push_back(def_material.release());
             break;
         }
     }
 
     pScene->mNumMaterials = static_cast<unsigned int>(materials.size());
     pScene->mMaterials = new aiMaterial*[pScene->mNumMaterials]();
-    std::copy(materials.begin(), materials.end(), pScene->mMaterials);
+    std::copy(mMaterials.begin(), mMaterials.end(), pScene->mMaterials);
 }
 
 // ------------------------------------------------------------------------------------------------
@@ -251,8 +251,8 @@ void C4DImporter::ReadMaterials(BaseMaterial* mat) {
     while (mat) {
         if (mat->GetType() == Mmaterial) {
             aiMaterial* out = new aiMaterial();
-            material_mapping[mat] = static_cast<unsigned int>(materials.size());
-            materials.push_back(out);
+            mMaterialMapping[mat] = static_cast<unsigned int>(mMaterials.size());
+            mMaterials.push_back(out);
 
             auto const ai_name = aiStringFrom(mat->GetName());
             out->AddProperty(&ai_name, AI_MATKEY_NAME);
@@ -289,7 +289,7 @@ void C4DImporter::ReadMaterials(BaseMaterial* mat) {
 // ------------------------------------------------------------------------------------------------
 void C4DImporter::RecurseHierarchy(BaseObject* object, aiNode* parent) {
     ai_assert(parent != nullptr );
-    std::vector<aiNode*> nodes;
+    NodeArray nodes;
 
     // based on Cineware sample code
     while (object) {
@@ -577,7 +577,7 @@ aiMesh* C4DImporter::ReadMesh(BaseObject* object) {
 unsigned int C4DImporter::ResolveMaterial(PolygonObject* obj) {
     ai_assert(obj != nullptr);
 
-    const unsigned int mat_count = static_cast<unsigned int>(materials.size());
+    const unsigned int mat_count = static_cast<unsigned int>(mMaterials.size());
 
     BaseTag* tag = obj->GetTag(Ttexture);
     if(tag == nullptr) {

+ 5 - 4
code/AssetLib/C4D/C4DImporter.h

@@ -97,11 +97,12 @@ private:
 
     bool ReadShader(aiMaterial* out, cineware::BaseShader* shader);
 
-    std::vector<aiMesh*> meshes;
-    std::vector<aiMaterial*> materials;
+  private:
+    MeshArray mMeshes;
+    MaterialArray materials;
 
-    typedef std::map<cineware::BaseMaterial*, unsigned int> MaterialMap;
-    MaterialMap material_mapping;
+    using MaterialMap = std::map<cineware::BaseMaterial*, unsigned int> ;
+    MaterialMap mMaterialMapping;
 
 }; // !class C4DImporter
 

+ 1 - 1
code/AssetLib/Collada/ColladaLoader.cpp

@@ -668,7 +668,7 @@ aiMesh *ColladaLoader::CreateMesh(const ColladaParser &pParser, const Mesh *pSrc
     }
 
     // create morph target meshes if any
-    std::vector<aiMesh *> targetMeshes;
+    MeshArray targetMeshes;
     std::vector<float> targetWeights;
     Collada::MorphMethod method = Normalized;
 

+ 2 - 2
code/AssetLib/Collada/ColladaLoader.h

@@ -206,10 +206,10 @@ private:
     std::map<std::string, size_t> mMaterialIndexByName;
 
     /** Accumulated meshes for the target scene */
-    std::vector<aiMesh *> mMeshes;
+    MeshArray mMeshes;
 
     /** Accumulated morph target meshes */
-    std::vector<aiMesh *> mTargetMeshes;
+    MeshArray mTargetMeshes;
 
     /** Temporary material list */
     std::vector<std::pair<Collada::Effect *, aiMaterial *>> newMats;

+ 29 - 30
code/AssetLib/FBX/FBXConverter.cpp

@@ -72,7 +72,7 @@ namespace FBX {
 
 using namespace Util;
 
-#define MAGIC_NODE_TAG "_$AssimpFbx$"
+static constexpr char MAGIC_NODE_TAG[] = "_$AssimpFbx$";
 
 #define CONVERT_FBX_TIME(time) static_cast<double>(time) / 46186158000LL
 
@@ -125,21 +125,10 @@ static void correctRootTransform(const aiScene *scene) {
 
 FBXConverter::FBXConverter(aiScene *out, const Document &doc, bool removeEmptyBones) :
         defaultMaterialIndex(),
-        mMeshes(),
-        lights(),
-        cameras(),
-        textures(),
-        materials_converted(),
-        textures_converted(),
-        meshes_converted(),
-        node_anim_chain_bits(),
-        mNodeNames(),
         anim_fps(),
         mSceneOut(out),
         doc(doc),
         mRemoveEmptyBones(removeEmptyBones) {
-
-
     // animations need to be converted first since this will
     // populate the node_anim_chain_bits map, which is needed
     // to determine which nodes need to be generated.
@@ -162,7 +151,7 @@ FBXConverter::FBXConverter(aiScene *out, const Document &doc, bool removeEmptyBo
                 continue;
             }
 
-            const Material *mat = dynamic_cast<const Material *>(ob);
+            auto mat = dynamic_cast<const Material *>(ob);
             if (mat) {
 
                 if (materials_converted.find(mat) == materials_converted.end()) {
@@ -222,7 +211,6 @@ static std::string getAncestorBaseName(const aiNode *node) {
     return std::string(nodeName, length);
 }
 
-// Make unique name
 std::string FBXConverter::MakeUniqueNodeName(const Model *const model, const aiNode &parent) {
     std::string original_name = FixNodeName(model->Name());
     if (original_name.empty()) {
@@ -236,9 +224,18 @@ std::string FBXConverter::MakeUniqueNodeName(const Model *const model, const aiN
 /// This struct manages nodes which may or may not end up in the node hierarchy.
 /// When a node becomes a child of another node, that node becomes its owner and mOwnership should be released.
 struct FBXConverter::PotentialNode {
-    PotentialNode() : mOwnership(new aiNode), mNode(mOwnership.get()) {}
-    PotentialNode(const std::string& name) : mOwnership(new aiNode(name)), mNode(mOwnership.get()) {}
-    aiNode* operator->() { return mNode; }
+    PotentialNode() : mOwnership(new aiNode), mNode(mOwnership.get()) {
+        // empty
+    }
+    
+    explicit PotentialNode(const std::string& name) : mOwnership(new aiNode(name)), mNode(mOwnership.get()) {
+        // empty
+    }
+    
+    aiNode* operator->() {
+        return mNode;
+    }
+
     std::unique_ptr<aiNode> mOwnership;
     aiNode* mNode;
 };
@@ -1092,14 +1089,14 @@ aiMesh *FBXConverter::SetupEmptyMesh(const Geometry &mesh, aiNode *parent) {
 }
 
 static aiSkeleton *createAiSkeleton(SkeletonBoneContainer &sbc) {
-    if (sbc.MeshArray.empty() || sbc.SkeletonBoneToMeshLookup.empty()) {
+    if (sbc.meshArray.empty() || sbc.skeletonBoneToMeshLookup.empty()) {
         return nullptr;
     }
 
     aiSkeleton *skeleton = new aiSkeleton;
-    for (auto *mesh : sbc.MeshArray) {
-        auto it = sbc.SkeletonBoneToMeshLookup.find(mesh);
-        if (it == sbc.SkeletonBoneToMeshLookup.end()) {
+    for (auto *mesh : sbc.meshArray) {
+        auto it = sbc.skeletonBoneToMeshLookup.find(mesh);
+        if (it == sbc.skeletonBoneToMeshLookup.end()) {
             continue;
         }
         SkeletonBoneArray *ba = it->second;
@@ -1547,12 +1544,12 @@ static void copyBoneToSkeletonBone(aiMesh *mesh, aiBone *bone, aiSkeletonBone *s
 void FBXConverter::ConvertWeightsToSkeleton(aiMesh *out, const MeshGeometry &geo, const aiMatrix4x4 &absolute_transform, aiNode *parent, unsigned int materialIndex,
         std::vector<unsigned int> *outputVertStartIndices, SkeletonBoneContainer &skeletonContainer) {
 
-    if (skeletonContainer.SkeletonBoneToMeshLookup.find(out) != skeletonContainer.SkeletonBoneToMeshLookup.end()) {
+    if (skeletonContainer.skeletonBoneToMeshLookup.find(out) != skeletonContainer.skeletonBoneToMeshLookup.end()) {
         return;
     }
 
     ConvertWeights(out, geo, absolute_transform, parent, materialIndex, outputVertStartIndices);
-    skeletonContainer.MeshArray.emplace_back(out);
+    skeletonContainer.meshArray.emplace_back(out);
     SkeletonBoneArray *ba = new SkeletonBoneArray;
     for (size_t i = 0; i < out->mNumBones; ++i) {
         aiBone *bone = out->mBones[i];
@@ -1563,7 +1560,7 @@ void FBXConverter::ConvertWeightsToSkeleton(aiMesh *out, const MeshGeometry &geo
         copyBoneToSkeletonBone(out, bone, skeletonBone);
         ba->emplace_back(skeletonBone);
     }
-    skeletonContainer.SkeletonBoneToMeshLookup[out] = ba;
+    skeletonContainer.skeletonBoneToMeshLookup[out] = ba;
 }
 
 void FBXConverter::ConvertWeights(aiMesh *out, const MeshGeometry &geo, const aiMatrix4x4 &absolute_transform,
@@ -1571,8 +1568,6 @@ void FBXConverter::ConvertWeights(aiMesh *out, const MeshGeometry &geo, const ai
         std::vector<unsigned int> *outputVertStartIndices) {
     ai_assert(geo.DeformerSkin());
 
-    std::vector<size_t> out_indices, index_out_indices, count_out_indices;
-
     const Skin &sk = *geo.DeformerSkin();
 
     std::vector<aiBone*> bones;
@@ -1580,6 +1575,10 @@ void FBXConverter::ConvertWeights(aiMesh *out, const MeshGeometry &geo, const ai
     ai_assert(no_mat_check || outputVertStartIndices);
 
     try {
+        std::vector<size_t> count_out_indices;
+        std::vector<size_t> index_out_indices;
+        std::vector<size_t> out_indices;
+
         // iterate over the sub deformers
         for (const Cluster *cluster : sk.Clusters()) {
             ai_assert(cluster);
@@ -1751,10 +1750,10 @@ unsigned int FBXConverter::GetDefaultMaterial() {
         return defaultMaterialIndex - 1;
     }
 
-    aiMaterial *out_mat = new aiMaterial();
+    auto out_mat = new aiMaterial();
     materials.push_back(out_mat);
 
-    const aiColor3D diffuse = aiColor3D(0.8f, 0.8f, 0.8f);
+    const auto diffuse = aiColor3D(0.8f, 0.8f, 0.8f);
     out_mat->AddProperty(&diffuse, 1, AI_MATKEY_COLOR_DIFFUSE);
 
     aiString s;
@@ -1770,7 +1769,7 @@ unsigned int FBXConverter::ConvertMaterial(const Material &material, const MeshG
     const PropertyTable &props = material.Props();
 
     // generate empty output material
-    aiMaterial *out_mat = new aiMaterial();
+    auto out_mat = new aiMaterial();
     materials_converted[&material] = static_cast<unsigned int>(materials.size());
 
     materials.push_back(out_mat);
@@ -1809,7 +1808,7 @@ unsigned int FBXConverter::ConvertMaterial(const Material &material, const MeshG
 
 unsigned int FBXConverter::ConvertVideo(const Video &video) {
     // generate empty output texture
-    aiTexture *out_tex = new aiTexture();
+    auto out_tex = new aiTexture();
     textures.push_back(out_tex);
 
     // assuming the texture is compressed

+ 2 - 2
code/AssetLib/FBX/FBXConverter.h

@@ -80,8 +80,8 @@ using SkeletonBoneArray = std::vector<aiSkeletonBone *>;
 using SkeletonBoneToMesh = std::map<aiMesh*, SkeletonBoneArray*>;
 
 struct SkeletonBoneContainer {
-    std::vector<aiMesh *> MeshArray;
-    SkeletonBoneToMesh SkeletonBoneToMeshLookup;
+    MeshArray meshArray;
+    SkeletonBoneToMesh skeletonBoneToMeshLookup;
 };
 
 class Document;

+ 3 - 3
code/AssetLib/Irr/IRRLoader.cpp

@@ -162,7 +162,7 @@ aiMesh *IRRImporter::BuildSingleQuadMesh(const SkyboxVertex &v1,
 }
 
 // ------------------------------------------------------------------------------------------------
-void IRRImporter::BuildSkybox(std::vector<aiMesh *> &meshes, std::vector<aiMaterial *> materials) {
+void IRRImporter::BuildSkybox(MeshArray &meshes, std::vector<aiMaterial *> materials) {
     // Update the material of the skybox - replace the name and disable shading for skyboxes.
     for (unsigned int i = 0; i < 6; ++i) {
         aiMaterial *out = (aiMaterial *)(*(materials.end() - (6 - i)));
@@ -602,7 +602,7 @@ void SetupMapping(aiMaterial *mat, aiTextureMapping mode, const aiVector3D &axis
 // ------------------------------------------------------------------------------------------------
 void IRRImporter::GenerateGraph(Node *root, aiNode *rootOut, aiScene *scene,
         BatchLoader &batch,
-        std::vector<aiMesh *> &meshes,
+        MeshArray &meshes,
         std::vector<aiNodeAnim *> &anims,
         std::vector<AttachmentInfo> &attach,
         std::vector<aiMaterial *> &materials,
@@ -1283,7 +1283,7 @@ void IRRImporter::InternReadFile(const std::string &pFile, aiScene *pScene, IOSy
     std::vector<aiNodeAnim *> anims;
     std::vector<aiMaterial *> materials;
     std::vector<AttachmentInfo> attach;
-    std::vector<aiMesh *> meshes;
+    MeshArray meshes;
 
     // try to guess how much storage we'll need
     anims.reserve(guessedAnimCnt + (guessedAnimCnt >> 2));

+ 2 - 2
code/AssetLib/Irr/IRRLoader.h

@@ -229,7 +229,7 @@ private:
     /// Fill the scene-graph recursively
     void GenerateGraph(Node *root, aiNode *rootOut, aiScene *scene,
             BatchLoader &batch,
-            std::vector<aiMesh *> &meshes,
+            MeshArray &meshes,
             std::vector<aiNodeAnim *> &anims,
             std::vector<AttachmentInfo> &attach,
             std::vector<aiMaterial *> &materials,
@@ -248,7 +248,7 @@ private:
     /// @param meshes Receives 6 output meshes
     /// @param materials The last 6 materials are assigned to the newly
     ///                  created meshes. The names of the materials are adjusted.
-    void BuildSkybox(std::vector<aiMesh *> &meshes,
+    void BuildSkybox(MeshArray &meshes,
             std::vector<aiMaterial *> materials);
 
     // -------------------------------------------------------------------

+ 1 - 1
code/AssetLib/Irr/IRRMeshLoader.cpp

@@ -121,7 +121,7 @@ void IRRMeshImporter::InternReadFile(const std::string &pFile,
 
     // final data
     std::vector<aiMaterial *> materials;
-    std::vector<aiMesh *> meshes;
+    MeshArray meshes;
     materials.reserve(5);
     meshes.reserve(5);
 

+ 1 - 1
code/AssetLib/LWO/LWOLoader.cpp

@@ -239,7 +239,7 @@ void LWOImporter::InternReadFile(const std::string &pFile,
     ResolveClips();
 
     // now process all layers and build meshes and nodes
-    std::vector<aiMesh *> apcMeshes;
+    MeshArray apcMeshes;
     std::map<uint16_t, aiNode *> apcNodes;
 
     apcMeshes.reserve(mLayers->size() * std::min(((unsigned int)mSurfaces->size() / 2u), 1u));

+ 2 - 2
code/AssetLib/MDL/MDLLoader.cpp

@@ -1404,10 +1404,10 @@ void MDLImporter::InternReadFile_3DGS_MDL7() {
     sharedData.apcOutBones = this->LoadBones_3DGS_MDL7();
 
     // vector to held all created meshes
-    std::vector<aiMesh *> *avOutList;
+    MeshArray *avOutList;
 
     // 3 meshes per group - that should be OK for most models
-    avOutList = new std::vector<aiMesh *>[pcHeader->groups_num];
+    avOutList = new MeshArray[pcHeader->groups_num];
     for (uint32_t i = 0; i < pcHeader->groups_num; ++i)
         avOutList[i].reserve(3);
 

+ 1 - 1
code/AssetLib/Q3BSP/Q3BSPFileImporter.cpp

@@ -270,7 +270,7 @@ void Q3BSPFileImporter::CreateNodes(const Q3BSP::Q3BSPModel *pModel, aiScene *pS
     }
 
     unsigned int matIdx(0);
-    std::vector<aiMesh *> MeshArray;
+    MeshArray MeshArray;
     std::vector<aiNode *> NodeArray;
     for (FaceMapIt it = m_MaterialLookupMap.begin(); it != m_MaterialLookupMap.end(); ++it) {
         std::vector<Q3BSP::sQ3BSPFace *> *pArray = (*it).second;

+ 1 - 1
code/AssetLib/SIB/SIBImporter.cpp

@@ -116,7 +116,7 @@ struct SIBObject {
 
 struct SIB {
     std::vector<aiMaterial *> mtls;
-    std::vector<aiMesh *> meshes;
+    MeshArray meshes;
     std::vector<aiLight *> lights;
     std::vector<SIBObject> objs, insts;
 };

+ 1 - 1
code/AssetLib/STL/STLLoader.cpp

@@ -222,7 +222,7 @@ void STLImporter::InternReadFile(const std::string &pFile, aiScene *pScene, IOSy
 // ------------------------------------------------------------------------------------------------
 // Read an ASCII STL file
 void STLImporter::LoadASCIIFile(aiNode *root) {
-    std::vector<aiMesh *> meshes;
+    MeshArray meshes;
     std::vector<aiNode *> nodes;
     const char *sz = mBuffer;
     const char *bufferEnd = mBuffer + mFileSize;

+ 1 - 1
code/AssetLib/X/XFileImporter.cpp

@@ -219,7 +219,7 @@ void XFileImporter::CreateMeshes(aiScene *pScene, aiNode *pNode, const std::vect
     }
 
     // create a mesh for each mesh-material combination in the source node
-    std::vector<aiMesh *> meshes;
+    MeshArray meshes;
     for (unsigned int a = 0; a < pMeshes.size(); ++a) {
         XFile::Mesh *sourceMesh = pMeshes[a];
         if (nullptr == sourceMesh) {

+ 1 - 1
code/AssetLib/XGL/XGLLoader.cpp

@@ -139,7 +139,7 @@ void XGLImporter::InternReadFile(const std::string &pFile, aiScene *pScene, IOSy
 		ReadWorld(*worldNode, scope);
 	}
 
-	std::vector<aiMesh *> &meshes = scope.meshes_linear;
+	MeshArray &meshes = scope.meshes_linear;
 	std::vector<aiMaterial *> &materials = scope.materials_linear;
 	if (meshes.empty() || materials.empty()) {
 		ThrowException("failed to extract data from XGL file, no meshes loaded");

+ 1 - 1
code/AssetLib/glTF/glTFImporter.cpp

@@ -192,7 +192,7 @@ static bool CheckValidFacesIndices(const aiFace *faces, unsigned nFaces, unsigne
 }
 
 void glTFImporter::ImportMeshes(Asset &r) {
-    std::vector<aiMesh *> meshes;
+    MeshArray meshes;
 
     unsigned int k = 0;
     meshOffsets.clear();

+ 13 - 14
code/Common/SceneCombiner.cpp

@@ -678,8 +678,8 @@ void SceneCombiner::MergeScenes(aiScene **_dest, aiScene *master, std::vector<At
 // ------------------------------------------------------------------------------------------------
 // Build a list of unique bones
 void SceneCombiner::BuildUniqueBoneList(std::list<BoneWithHash> &asBones,
-        std::vector<aiMesh *>::const_iterator it,
-        std::vector<aiMesh *>::const_iterator end) {
+        MeshArray::const_iterator it,
+        MeshArray::const_iterator end) {
     unsigned int iOffset = 0;
     for (; it != end; ++it) {
         for (unsigned int l = 0; l < (*it)->mNumBones; ++l) {
@@ -712,8 +712,7 @@ void SceneCombiner::BuildUniqueBoneList(std::list<BoneWithHash> &asBones,
 
 // ------------------------------------------------------------------------------------------------
 // Merge a list of bones
-void SceneCombiner::MergeBones(aiMesh *out, std::vector<aiMesh *>::const_iterator it,
-        std::vector<aiMesh *>::const_iterator end) {
+void SceneCombiner::MergeBones(aiMesh *out, MeshArray::const_iterator it, MeshArray::const_iterator end) {
     if (nullptr == out || out->mNumBones == 0) {
         return;
     }
@@ -771,8 +770,8 @@ void SceneCombiner::MergeBones(aiMesh *out, std::vector<aiMesh *>::const_iterato
 // ------------------------------------------------------------------------------------------------
 // Merge a list of meshes
 void SceneCombiner::MergeMeshes(aiMesh **_out, unsigned int /*flags*/,
-        std::vector<aiMesh *>::const_iterator begin,
-        std::vector<aiMesh *>::const_iterator end) {
+        MeshArray::const_iterator begin,
+        MeshArray::const_iterator end) {
     if (nullptr == _out) {
         return;
     }
@@ -788,7 +787,7 @@ void SceneCombiner::MergeMeshes(aiMesh **_out, unsigned int /*flags*/,
 
     std::string name;
     // Find out how much output storage we'll need
-    for (std::vector<aiMesh *>::const_iterator it = begin; it != end; ++it) {
+    for (MeshArray::const_iterator it = begin; it != end; ++it) {
         const char *meshName((*it)->mName.C_Str());
         name += std::string(meshName);
         if (it != end - 1) {
@@ -810,7 +809,7 @@ void SceneCombiner::MergeMeshes(aiMesh **_out, unsigned int /*flags*/,
         if ((**begin).HasPositions()) {
 
             pv2 = out->mVertices = new aiVector3D[out->mNumVertices];
-            for (std::vector<aiMesh *>::const_iterator it = begin; it != end; ++it) {
+            for (MeshArray::const_iterator it = begin; it != end; ++it) {
                 if ((*it)->mVertices) {
                     ::memcpy(pv2, (*it)->mVertices, (*it)->mNumVertices * sizeof(aiVector3D));
                 } else
@@ -822,7 +821,7 @@ void SceneCombiner::MergeMeshes(aiMesh **_out, unsigned int /*flags*/,
         if ((**begin).HasNormals()) {
 
             pv2 = out->mNormals = new aiVector3D[out->mNumVertices];
-            for (std::vector<aiMesh *>::const_iterator it = begin; it != end; ++it) {
+            for (MeshArray::const_iterator it = begin; it != end; ++it) {
                 if ((*it)->mNormals) {
                     ::memcpy(pv2, (*it)->mNormals, (*it)->mNumVertices * sizeof(aiVector3D));
                 } else {
@@ -837,7 +836,7 @@ void SceneCombiner::MergeMeshes(aiMesh **_out, unsigned int /*flags*/,
             pv2 = out->mTangents = new aiVector3D[out->mNumVertices];
             aiVector3D *pv2b = out->mBitangents = new aiVector3D[out->mNumVertices];
 
-            for (std::vector<aiMesh *>::const_iterator it = begin; it != end; ++it) {
+            for (MeshArray::const_iterator it = begin; it != end; ++it) {
                 if ((*it)->mTangents) {
                     ::memcpy(pv2, (*it)->mTangents, (*it)->mNumVertices * sizeof(aiVector3D));
                     ::memcpy(pv2b, (*it)->mBitangents, (*it)->mNumVertices * sizeof(aiVector3D));
@@ -854,7 +853,7 @@ void SceneCombiner::MergeMeshes(aiMesh **_out, unsigned int /*flags*/,
             out->mNumUVComponents[n] = (*begin)->mNumUVComponents[n];
 
             pv2 = out->mTextureCoords[n] = new aiVector3D[out->mNumVertices];
-            for (std::vector<aiMesh *>::const_iterator it = begin; it != end; ++it) {
+            for (MeshArray::const_iterator it = begin; it != end; ++it) {
                 if ((*it)->mTextureCoords[n]) {
                     ::memcpy(pv2, (*it)->mTextureCoords[n], (*it)->mNumVertices * sizeof(aiVector3D));
                 } else {
@@ -868,7 +867,7 @@ void SceneCombiner::MergeMeshes(aiMesh **_out, unsigned int /*flags*/,
         n = 0;
         while ((**begin).HasVertexColors(n)) {
             aiColor4D *pVec2 = out->mColors[n] = new aiColor4D[out->mNumVertices];
-            for (std::vector<aiMesh *>::const_iterator it = begin; it != end; ++it) {
+            for (MeshArray::const_iterator it = begin; it != end; ++it) {
                 if ((*it)->mColors[n]) {
                     ::memcpy(pVec2, (*it)->mColors[n], (*it)->mNumVertices * sizeof(aiColor4D));
                 } else {
@@ -887,7 +886,7 @@ void SceneCombiner::MergeMeshes(aiMesh **_out, unsigned int /*flags*/,
         aiFace *pf2 = out->mFaces;
 
         unsigned int ofs = 0;
-        for (std::vector<aiMesh *>::const_iterator it = begin; it != end; ++it) {
+        for (MeshArray::const_iterator it = begin; it != end; ++it) {
             for (unsigned int m = 0; m < (*it)->mNumFaces; ++m, ++pf2) {
                 aiFace &face = (*it)->mFaces[m];
                 pf2->mNumIndices = face.mNumIndices;
@@ -910,7 +909,7 @@ void SceneCombiner::MergeMeshes(aiMesh **_out, unsigned int /*flags*/,
         MergeBones(out, begin, end);
 
     // delete all source meshes
-    for (std::vector<aiMesh *>::const_iterator it = begin; it != end; ++it)
+    for (MeshArray::const_iterator it = begin; it != end; ++it)
         delete *it;
 }
 

+ 3 - 3
code/Common/Subdivision.cpp

@@ -158,8 +158,8 @@ void CatmullClarkSubdivider::Subdivide(
         return;
     }
 
-    std::vector<aiMesh *> inmeshes;
-    std::vector<aiMesh *> outmeshes;
+    MeshArray inmeshes;
+    MeshArray outmeshes;
     std::vector<unsigned int> maptbl;
 
     inmeshes.reserve(nmesh);
@@ -577,7 +577,7 @@ void CatmullClarkSubdivider::InternSubdivide(
     // 7. Apply the next subdivision step.
     // ---------------------------------------------------------------------
     if (num != 1) {
-        std::vector<aiMesh *> tmp(nmesh);
+        MeshArray tmp(nmesh);
         InternSubdivide(out, nmesh, &tmp.front(), num - 1);
         for (size_t i = 0; i < nmesh; ++i) {
             delete out[i];

+ 2 - 2
code/PostProcessing/PretransformVertices.cpp

@@ -332,7 +332,7 @@ void PretransformVertices::ApplyTransform(aiMesh *mesh, const aiMatrix4x4 &mat)
 
 // ------------------------------------------------------------------------------------------------
 // Simple routine to build meshes in worldspace, no further optimization
-void PretransformVertices::BuildWCSMeshes(std::vector<aiMesh *> &out, aiMesh **in,
+void PretransformVertices::BuildWCSMeshes(MeshArray &out, aiMesh **in,
 		unsigned int numIn, aiNode *node) const {
 	// NOTE:
 	//  aiMesh::mNumBones store original source mesh, or UINT_MAX if not a copy
@@ -459,7 +459,7 @@ void PretransformVertices::Execute(aiScene *pScene) {
 	}
 
 	// now build a list of output meshes
-	std::vector<aiMesh *> apcOutMeshes;
+	MeshArray apcOutMeshes;
 
 	// Keep scene hierarchy? It's an easy job in this case ...
 	// we go on and transform all meshes, if one is referenced by nodes

+ 1 - 1
code/PostProcessing/PretransformVertices.h

@@ -139,7 +139,7 @@ private:
 
 	// -------------------------------------------------------------------
 	// Simple routine to build meshes in worldspace, no further optimization
-	void BuildWCSMeshes(std::vector<aiMesh *> &out, aiMesh **in,
+	void BuildWCSMeshes(MeshArray &out, aiMesh **in,
 			unsigned int numIn, aiNode *node) const;
 
 	// -------------------------------------------------------------------

+ 1 - 1
code/PostProcessing/SortByPTypeProcess.cpp

@@ -126,7 +126,7 @@ void SortByPTypeProcess::Execute(aiScene *pScene) {
 
     unsigned int aiNumMeshesPerPType[4] = { 0, 0, 0, 0 };
 
-    std::vector<aiMesh *> outMeshes;
+    MeshArray outMeshes;
     outMeshes.reserve(static_cast<size_t>(pScene->mNumMeshes) << 1u);
 
     bool bAnyChanges = false;

+ 2 - 0
include/assimp/Importer.hpp

@@ -58,6 +58,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include <assimp/types.h>
 
 #include <exception>
+#include <vector>
 
 namespace Assimp {
 // =======================================================================
@@ -67,6 +68,7 @@ class IOStream;
 class IOSystem;
 class ProgressHandler;
 
+
 // =======================================================================
 // Plugin development
 //

+ 6 - 6
include/assimp/SceneCombiner.h

@@ -240,8 +240,8 @@ public:
      *  @param end Points to the mesh after the last mesh to be processed
      */
     static void MergeMeshes(aiMesh **dest, unsigned int flags,
-            std::vector<aiMesh *>::const_iterator begin,
-            std::vector<aiMesh *>::const_iterator end);
+            MeshArray::const_iterator begin,
+            MeshArray::const_iterator end);
 
     // -------------------------------------------------------------------
     /** Merges two or more bones
@@ -251,8 +251,8 @@ public:
      *  @param begin First mesh to be processed
      *  @param end Points to the mesh after the last mesh to be processed
      */
-    static void MergeBones(aiMesh *out, std::vector<aiMesh *>::const_iterator it,
-            std::vector<aiMesh *>::const_iterator end);
+    static void MergeBones(aiMesh *out, MeshArray::const_iterator it,
+            MeshArray::const_iterator end);
 
     // -------------------------------------------------------------------
     /** Merges two or more materials
@@ -277,8 +277,8 @@ public:
      *  @param end     Last mesh to be processed
      */
     static void BuildUniqueBoneList(std::list<BoneWithHash> &asBones,
-            std::vector<aiMesh *>::const_iterator it,
-            std::vector<aiMesh *>::const_iterator end);
+            MeshArray::const_iterator it,
+            MeshArray::const_iterator end);
 
     // -------------------------------------------------------------------
     /** Add a name prefix to all nodes in a scene.

+ 11 - 0
include/assimp/types.h

@@ -77,6 +77,17 @@ typedef uint32_t ai_uint32;
 #include <new>    // for std::nothrow_t
 #include <string> // for aiString::Set(const std::string&)
 
+struct aiNode;
+struct aiMesh;
+struct aiMaterial;
+
+#include <vector>
+
+
+using MeshArray = std::vector<aiMesh *>;
+using NodeArray = std::vector<aiNode *>;
+using MaterialArray = std::vector<aiMaterial*>;
+
 namespace Assimp {
 //! @cond never
 namespace Intern {

+ 5 - 5
packaging/windows-innosetup/script_x64.iss

@@ -2,7 +2,7 @@
 
 [Setup]
 AppName=Open Asset Import Library - SDK
-AppVerName=Open Asset Import Library - SDK (v5.4.3)
+AppVerName=Open Asset Import Library - SDK (v6.0.2)
 DefaultDirName={pf}\Assimp
 DefaultGroupName=Assimp
 UninstallDisplayIcon={app}\bin\x64\assimp.exe
@@ -12,9 +12,9 @@ SetupIconFile=..\..\tools\shared\assimp_tools_icon.ico
 WizardImageFile=..\..\tools\shared\assimp_tools_icon.bmp
 WizardSmallImageFile=..\..\tools\shared\assimp_tools_icon.bmp
 LicenseFile=License.rtf
-OutputBaseFileName=assimp-sdk-5.4.3-setup
-VersionInfoVersion=5.4.3.0
-VersionInfoTextVersion=5.4.3
+OutputBaseFileName=assimp-sdk-6.0.2-setup
+VersionInfoVersion=6.0.2.0
+VersionInfoTextVersion=6.0.2
 VersionInfoCompany=Assimp Development Team
 ArchitecturesInstallIn64BitMode=x64
 
@@ -43,7 +43,7 @@ Source: "vc_redist.x64.exe"; DestDir: "{app}\stub\"; Check: IsWin64
 ; Common stuff
 Source: "..\..\CREDITS"; DestDir: "{app}"
 Source: "..\..\LICENSE"; DestDir: "{app}"
-Source: "..\..\README"; DestDir: "{app}"
+Source: "..\..\README.md"; DestDir: "{app}"
 Source: "WEB"; DestDir: "{app}"
 
 Source: "..\..\scripts\*"; DestDir: "{app}\scripts"; Flags: recursesubdirs

+ 1 - 1
test/unit/utSceneCombiner.cpp

@@ -50,7 +50,7 @@ class utSceneCombiner : public ::testing::Test {
 };
 
 TEST_F(utSceneCombiner, MergeMeshes_ValidNames_Test) {
-    std::vector<aiMesh *> merge_list;
+    MeshArray merge_list;
     aiMesh *mesh1 = new aiMesh;
     mesh1->mName.Set("mesh_1");
     merge_list.push_back(mesh1);