diff --git a/Readme.md b/Readme.md
index 9a8ac7c33..a740be772 100644
--- a/Readme.md
+++ b/Readme.md
@@ -6,20 +6,14 @@ Open Asset Import Library is a library to load various 3d file formats into a sh
### Current project status ###
[![Financial Contributors on Open Collective](https://opencollective.com/assimp/all/badge.svg?label=financial+contributors)](https://opencollective.com/assimp)
![C/C++ CI](https://github.com/assimp/assimp/workflows/C/C++%20CI/badge.svg)
-
-
-
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/9973693b7bdd4543b07084d5d9cf4745)](https://www.codacy.com/gh/assimp/assimp/dashboard?utm_source=github.com&utm_medium=referral&utm_content=assimp/assimp&utm_campaign=Badge_Grade)
-
-[![Coverage Status](https://coveralls.io/repos/github/assimp/assimp/badge.svg?branch=master)](https://coveralls.io/github/assimp/assimp?branch=master)
[![Join the chat at https://gitter.im/assimp/assimp](https://badges.gitter.im/assimp/assimp.svg)](https://gitter.im/assimp/assimp?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/assimp/assimp.svg)](http://isitmaintained.com/project/assimp/assimp "Average time to resolve an issue")
[![Percentage of issues still open](http://isitmaintained.com/badge/open/assimp/assimp.svg)](http://isitmaintained.com/project/assimp/assimp "Percentage of issues still open")
APIs are provided for C and C++. There are various bindings to other languages (C#, Java, Python, Delphi, D). Assimp also runs on Android and iOS.
-Additionally, assimp features various __mesh post processing tools__: normals and tangent space generation, triangulation, vertex cache locality optimization, removal of degenerate primitives and duplicate vertices, sorting by primitive type, merging of redundant materials and many more.
+Additionally, assimp features various __mesh post-processing tools__: normals and tangent space generation, triangulation, vertex cache locality optimization, removal of degenerate primitives and duplicate vertices, sorting by primitive type, merging of redundant materials and many more.
### Latest Doc's ###
Please check the latest documents at [Asset-Importer-Lib-Doc](https://assimp-docs.readthedocs.io/en/latest/).
@@ -58,20 +52,21 @@ Take a look into the https://github.com/assimp/assimp/blob/master/Build.md file.
### Other tools ###
[open3mod](https://github.com/acgessler/open3mod) is a powerful 3D model viewer based on Assimp's import and export abilities.
+[Assimp-Viewer(]https://github.com/assimp/assimp_view) is an experimental implementation for an Asset-Viewer based on ImGUI and Assimp (experimental).
#### Repository structure ####
-Open Asset Import Library is implemented in C++. The directory structure looks like:
+Open Asset Import Library is implemented in C++. The directory structure looks like this:
/code Source code
/contrib Third-party libraries
/doc Documentation (doxysource and pre-compiled docs)
- /fuzz Contains the test-code for the Google-Fuzzer project
+ /fuzz Contains the test code for the Google Fuzzer project
/include Public header C and C++ header files
- /scripts Scripts used to generate the loading code for some formats
+ /scripts Scripts are used to generate the loading code for some formats
/port Ports to other languages and scripts to maintain those.
/test Unit- and regression tests, test suite of models
/tools Tools (old assimp viewer, command line `assimp`)
- /samples A small number of samples to illustrate possible use-cases for Assimp
+ /samples A small number of samples to illustrate possible use cases for Assimp
The source code is organized in the following way:
@@ -79,9 +74,9 @@ The source code is organized in the following way:
code/CApi Special implementations which are only used for the C-API
code/Geometry A collection of geometry tools
code/Material The material system
- code/PBR An exporter for physical based models
+ code/PBR An exporter for physical-based models
code/PostProcessing The post-processing steps
- code/AssetLib/ Implementation for import and export for the format
+ code/AssetLib/ Implementation for import and export of the format
### Contributing ###
Contributions to assimp are highly appreciated. The easiest way to get involved is to submit
@@ -118,4 +113,4 @@ and don't sue us if our code doesn't work. Note that, unlike LGPLed code, you ma
For the legal details, see the `LICENSE` file.
### Why this name ###
-Sorry, we're germans :-), no english native speakers ...
+Sorry, we're germans :-), no English native speakers ...
diff --git a/code/AssetLib/3DS/3DSConverter.cpp b/code/AssetLib/3DS/3DSConverter.cpp
index b4f625b76..b99e9f798 100644
--- a/code/AssetLib/3DS/3DSConverter.cpp
+++ b/code/AssetLib/3DS/3DSConverter.cpp
@@ -52,9 +52,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include
#include
-using namespace Assimp;
+namespace Assimp {
-static const unsigned int NotSet = 0xcdcdcdcd;
+static constexpr unsigned int NotSet = 0xcdcdcdcd;
// ------------------------------------------------------------------------------------------------
// Setup final material indices, generae a default material if necessary
@@ -68,7 +68,7 @@ void Discreet3DSImporter::ReplaceDefaultMaterial() {
unsigned int idx(NotSet);
for (unsigned int i = 0; i < mScene->mMaterials.size(); ++i) {
std::string s = mScene->mMaterials[i].mName;
- for (char & it : s) {
+ for (char &it : s) {
it = static_cast(::tolower(static_cast(it)));
}
@@ -262,7 +262,7 @@ void Discreet3DSImporter::ConvertMaterial(D3DS::Material &oldMat,
unsigned int iWire = 1;
mat.AddProperty((int *)&iWire, 1, AI_MATKEY_ENABLE_WIREFRAME);
}
- [[fallthrough]];
+ [[fallthrough]];
case D3DS::Discreet3DS::Gouraud:
eShading = aiShadingMode_Gouraud;
@@ -805,4 +805,6 @@ void Discreet3DSImporter::ConvertScene(aiScene *pcOut) {
}
}
+} // namespace Assimp
+
#endif // !! ASSIMP_BUILD_NO_3DS_IMPORTER
diff --git a/code/AssetLib/3DS/3DSExporter.h b/code/AssetLib/3DS/3DSExporter.h
index 82ec3512f..66e91e10d 100644
--- a/code/AssetLib/3DS/3DSExporter.h
+++ b/code/AssetLib/3DS/3DSExporter.h
@@ -4,7 +4,6 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2022, assimp team
-
All rights reserved.
Redistribution and use of this software in source and binary forms,
@@ -57,8 +56,7 @@ struct aiNode;
struct aiMaterial;
struct aiMesh;
-namespace Assimp
-{
+namespace Assimp {
// ------------------------------------------------------------------------------------------------
/**
@@ -88,7 +86,7 @@ private:
std::map trafos;
- typedef std::multimap MeshesByNodeMap;
+ using MeshesByNodeMap = std::multimap;
MeshesByNodeMap meshes;
};
diff --git a/code/AssetLib/3DS/3DSLoader.cpp b/code/AssetLib/3DS/3DSLoader.cpp
index aa29956df..a2dcc32ac 100644
--- a/code/AssetLib/3DS/3DSLoader.cpp
+++ b/code/AssetLib/3DS/3DSLoader.cpp
@@ -54,9 +54,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include
#include
-using namespace Assimp;
+namespace Assimp {
-static const aiImporterDesc desc = {
+static constexpr aiImporterDesc desc = {
"Discreet 3DS Importer",
"",
"",
@@ -103,10 +103,6 @@ Discreet3DSImporter::Discreet3DSImporter() :
// empty
}
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-Discreet3DSImporter::~Discreet3DSImporter() = default;
-
// ------------------------------------------------------------------------------------------------
// Returns whether the class can handle the format of the given file.
bool Discreet3DSImporter::CanRead(const std::string &pFile, IOSystem *pIOHandler, bool /*checkSig*/) const {
@@ -1339,4 +1335,6 @@ void Discreet3DSImporter::ParseColorChunk(aiColor3D *out, bool acceptPercent) {
(void)bGamma;
}
+} // namespace Assimp
+
#endif // !! ASSIMP_BUILD_NO_3DS_IMPORTER
diff --git a/code/AssetLib/3DS/3DSLoader.h b/code/AssetLib/3DS/3DSLoader.h
index 6bd73f412..c579507e0 100644
--- a/code/AssetLib/3DS/3DSLoader.h
+++ b/code/AssetLib/3DS/3DSLoader.h
@@ -59,7 +59,6 @@ struct aiNode;
namespace Assimp {
-
using namespace D3DS;
// ---------------------------------------------------------------------------------
@@ -68,7 +67,7 @@ using namespace D3DS;
class Discreet3DSImporter : public BaseImporter {
public:
Discreet3DSImporter();
- ~Discreet3DSImporter() override;
+ ~Discreet3DSImporter() override = default;
// -------------------------------------------------------------------
/** Returns whether the class can handle the format of the given file.
diff --git a/code/AssetLib/3MF/D3MFImporter.cpp b/code/AssetLib/3MF/D3MFImporter.cpp
index 5d9644fa5..e8529064c 100644
--- a/code/AssetLib/3MF/D3MFImporter.cpp
+++ b/code/AssetLib/3MF/D3MFImporter.cpp
@@ -68,7 +68,7 @@ namespace Assimp {
using namespace D3MF;
-static const aiImporterDesc desc = {
+static constexpr aiImporterDesc desc = {
"3mf Importer",
"",
"",
@@ -81,10 +81,6 @@ static const aiImporterDesc desc = {
"3mf"
};
-D3MFImporter::D3MFImporter() = default;
-
-D3MFImporter::~D3MFImporter() = default;
-
bool D3MFImporter::CanRead(const std::string &filename, IOSystem *pIOHandler, bool /*checkSig*/) const {
if (!ZipArchiveIOSystem::isZipArchive(pIOHandler, filename)) {
return false;
diff --git a/code/AssetLib/3MF/D3MFImporter.h b/code/AssetLib/3MF/D3MFImporter.h
index a39ae790f..9ae68acb0 100644
--- a/code/AssetLib/3MF/D3MFImporter.h
+++ b/code/AssetLib/3MF/D3MFImporter.h
@@ -56,10 +56,10 @@ namespace Assimp {
class D3MFImporter : public BaseImporter {
public:
/// @brief The default class constructor.
- D3MFImporter();
+ D3MFImporter() = default;
/// @brief The class destructor.
- ~D3MFImporter() override;
+ ~D3MFImporter() override = default;
/// @brief Performs the data format detection.
/// @param pFile The filename to check.
diff --git a/code/AssetLib/3MF/D3MFOpcPackage.cpp b/code/AssetLib/3MF/D3MFOpcPackage.cpp
index d833e7467..e772d8b7e 100644
--- a/code/AssetLib/3MF/D3MFOpcPackage.cpp
+++ b/code/AssetLib/3MF/D3MFOpcPackage.cpp
@@ -68,7 +68,7 @@ using OpcPackageRelationshipPtr = std::shared_ptr;
class OpcPackageRelationshipReader {
public:
OpcPackageRelationshipReader(XmlParser &parser) :
- m_relationShips() {
+ mRelations() {
XmlNode root = parser.getRootNode();
ParseRootNode(root);
}
@@ -108,13 +108,13 @@ public:
relPtr->type = currentNode.attribute(XmlTag::RELS_ATTRIB_TYPE).as_string();
relPtr->target = currentNode.attribute(XmlTag::RELS_ATTRIB_TARGET).as_string();
if (validateRels(relPtr)) {
- m_relationShips.push_back(relPtr);
+ mRelations.push_back(relPtr);
}
}
}
}
- std::vector m_relationShips;
+ std::vector mRelations;
};
static bool IsEmbeddedTexture( const std::string &filename ) {
@@ -214,11 +214,11 @@ std::string D3MFOpcPackage::ReadPackageRootRelationship(IOStream *stream) {
OpcPackageRelationshipReader reader(xmlParser);
- auto itr = std::find_if(reader.m_relationShips.begin(), reader.m_relationShips.end(), [](const OpcPackageRelationshipPtr &rel) {
+ auto itr = std::find_if(reader.mRelations.begin(), reader.mRelations.end(), [](const OpcPackageRelationshipPtr &rel) {
return rel->type == XmlTag::PACKAGE_START_PART_RELATIONSHIP_TYPE;
});
- if (itr == reader.m_relationShips.end()) {
+ if (itr == reader.mRelations.end()) {
throw DeadlyImportError("Cannot find ", XmlTag::PACKAGE_START_PART_RELATIONSHIP_TYPE);
}
diff --git a/code/AssetLib/3MF/XmlSerializer.cpp b/code/AssetLib/3MF/XmlSerializer.cpp
index c77111728..5fcdc0ccc 100644
--- a/code/AssetLib/3MF/XmlSerializer.cpp
+++ b/code/AssetLib/3MF/XmlSerializer.cpp
@@ -49,12 +49,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
namespace Assimp {
namespace D3MF {
-static const int IdNotSet = -1;
+static constexpr int IdNotSet = -1;
namespace {
-static const size_t ColRGBA_Len = 9;
-static const size_t ColRGB_Len = 7;
+static constexpr size_t ColRGBA_Len = 9;
+static constexpr size_t ColRGB_Len = 7;
// format of the color string: #RRGGBBAA or #RRGGBB (3MF Core chapter 5.1.1)
bool validateColorString(const char *color) {
diff --git a/code/AssetLib/AC/ACLoader.cpp b/code/AssetLib/AC/ACLoader.cpp
index e93fba5f0..1bb77c441 100644
--- a/code/AssetLib/AC/ACLoader.cpp
+++ b/code/AssetLib/AC/ACLoader.cpp
@@ -60,9 +60,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include
#include
-using namespace Assimp;
+namespace Assimp {
-static const aiImporterDesc desc = {
+static constexpr aiImporterDesc desc = {
"AC3D Importer",
"",
"",
@@ -862,4 +862,6 @@ void AC3DImporter::InternReadFile(const std::string &pFile,
}
}
+} // namespace Assimp
+
#endif //!defined ASSIMP_BUILD_NO_AC_IMPORTER
diff --git a/code/AssetLib/AMF/AMFImporter.cpp b/code/AssetLib/AMF/AMFImporter.cpp
index ff581b492..eabdb35e1 100644
--- a/code/AssetLib/AMF/AMFImporter.cpp
+++ b/code/AssetLib/AMF/AMFImporter.cpp
@@ -53,7 +53,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
namespace Assimp {
-const aiImporterDesc AMFImporter::Description = {
+static constexpr aiImporterDesc Description = {
"Additive manufacturing file format(AMF) Importer",
"smalcom",
"",
diff --git a/code/AssetLib/AMF/AMFImporter.hpp b/code/AssetLib/AMF/AMFImporter.hpp
index 27f733043..fbaf4fc6d 100644
--- a/code/AssetLib/AMF/AMFImporter.hpp
+++ b/code/AssetLib/AMF/AMFImporter.hpp
@@ -98,8 +98,12 @@ namespace Assimp {
/// old -