Commit Graph

74 Commits

Author SHA1 Message Date
Kim Kulling
a4b8943533 Refactor condition checks for empty vectors (#6385)
* Refactor based on SonarCube.
2025-11-07 16:07:39 +01:00
Luca Della Vedova
672594c230 Revert "Refactoring: use using types (#6266)" (#6324)
* Revert "Refactoring: use using types (#6266)"
2025-11-04 15:10:45 +01:00
Kim Kulling
f544f9c217 Bugfix/fix sonarcube findings (#6369)
* Fix sonarcube findings.
---------
Co-authored-by: Kim Kulling <kim.kulling@draeger.com>
2025-10-14 00:01:50 +02:00
Kim Kulling
9f4e7c6d8d Refactoring: use using types (#6266)
* Refactoring: use using types

---------

Co-authored-by: Kim Kulling <kim.kulling@draeger.com>
2025-07-28 17:00:45 +02:00
krishty
88959b2be7 Fix Whitespace (#6063)
* Fix Whitespace

No functional changes. This commit removes trailing spaces, undesired line breaks, and formatting screwups.

* Remove more useless line breaks in license (500 out of 630 license copies do NOT use double line breaks here)

---------

Co-authored-by: Krishty <krishty@krishty.com>
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-03-26 00:12:55 +01:00
Kim Kulling
45898eee55 Refactorings: glTF cleanups (#6028) 2025-03-05 21:37:47 +01:00
Steve M
8e44b40df4 [AMF] Fix texture mapping (#5949)
* Fix texture mapping

---------

Co-authored-by: Steve M <praktique-tellypresence@yahoo.com>
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-01-12 23:04:10 +01:00
Kim Kulling
5fa7b8ceb9 Bugfix/cosmetic code cleanup (#5947)
* Refactorings: Code cleanups

* More cosmetic changes

---------

Co-authored-by: Kim Kulling <kim.kulling@draeger.com>
2025-01-07 23:32:50 +01:00
Kim Kulling
9f3a7e95ab Fix: Fix name collision (#5937)
* Fix: Fix name collision

* Fix: Fix possible override

* Fix: Use reentrant providing time function

* Fix: Fix override

* Update AssbinFileWriter.cpp

Revert, not portable.

* Update AssxmlFileWriter.cpp

Revert asctime_r, not portable.
2024-12-23 12:23:42 +01:00
Kim Kulling
41cc2f66a4 Remove strcpy. (#5802)
* Remove strcpy.

* Sonarcube: Add more strcpy replacements

* BlenderLoader: Replace strncpy by memcpy
2024-11-18 16:54:58 +01:00
Kim Kulling
35e4f1bf64 Kimkulling/fix double precision tests (#5660)
* Make color single precision

* Fix the unittests for double precision

* Fix merge issues

* Fix issues with Vertex + Color4

* Fix vertex operator, some tests are still red.
2024-07-12 14:37:49 +02:00
Kim Kulling
bff00b15f1 Replace raw pointers by std::string (#5656)
* Replace raw pointers by std::string
2024-07-06 13:59:02 +02:00
Kim Kulling
01231d0e60 Add 2024 to copyright infos (#5475) 2024-02-23 22:30:05 +01:00
Kim Kulling
8cf2d6e588 Refactoring: Some cleanups 2023-11-12 21:09:33 +01:00
Jackie9527
87c309566f Fix warning related to missing-noreturn.
Signed-off-by: Jackie9527 <80555200+Jackie9527@users.noreply.github.com>
2023-04-01 18:46:12 +08:00
Turo Lamminen
5ddd18d1c7 Add more AMF unit tests 2023-03-22 12:06:30 +02:00
Krishty
36305cf987 Tidy Up Constructors and Destructors
This commit does not add or remove c’tors or d’tors, so it is *not* ABI-breaking.

If a c’tor/d’tor does nothing else than the default behavior, this commit replaces it with “= default”.

If an initializer list entry does nothing else than the default behavior, this commit removes it. First and foremost, remove default c’tor calls of base classes (always called by the compiler if no other base c’tor is explicitly called) and c’tor calls of members with complex types (e.g. “std::vector”).

In a few instances, user-defined copy c’tors / move c’tors / assignment operators / move assignment operators were replaced with “= default”, too. I only did this if I had a clear understanding of what’s going on.
2023-01-16 21:47:11 +01:00
Aaron Gokaslan
ccfb175460 Apply various clang-tidy checks for smartprs and modern C++ types 2022-11-08 11:03:55 -05:00
Kim Kulling
05746acb07 Merge branch 'new-file-detection' of https://github.com/krishty/assimp into krishty-new-file-detection 2022-01-16 20:41:24 +01:00
Kim Kulling
50c7301a38 Update copyrights 2022-01-10 21:13:43 +01:00
IOhannes m zmölnig
3b8126d26a Fix spelling mistake 2021-10-08 08:48:01 +02:00
krishty
8c84afaff0 Merge branch 'master' into const-tokens 2021-09-15 23:31:00 +02:00
Kim Kulling
18531e3677 Next iteration for c++11 features. 2021-09-13 22:38:20 +02:00
Krishty
5895c0c22c more const in format detection
BaseImporter::SearchFileHeaderForToken() expected a pointer to a non-const token list. This was probably an oversight, as nobody would realistically expect the function to change the list. Furthermore, it prevented token lists from being compiled to read-only memory, in some cases even causing the compiler to generate thread-safe initialization.

The list is now const and all callers declare their token lists static const, thus compiling them to read-only memory.
2021-09-11 23:23:05 +02:00
Krishty
758116b083 removed trailing spaces and tabs from source and text
This commit ignores the “contrib” folder in order to prevent merge conflicts in dependencies, should these be updated via git.
2021-07-29 13:28:51 +02:00
Jason C
00b625a2ae [amf] Fix crash when file could not be parsed.
Fix double free of mXmlParser (deleted but not reset in ParseFile, then deleted again in ~AMFImporter).

Should probably use a smart pointer instead, though.

---

This change was previously made in 785cca1bb4, as part of PR #3890, but was lost in a merge.
2021-05-10 19:06:39 -04:00
Kim Kulling
cb7d3ac598 Merge branch 'master' into jc3-spam-killa 2021-05-10 22:21:13 +02:00
Jason C
f87b180147 Merge branch 'master' into jc3-importer-open-error-handling 2021-05-09 17:02:04 -04:00
Kim Kulling
b30cbcf117 Merge branch 'master' into jc3-spam-killa 2021-05-09 21:47:17 +02:00
Jason C
785cca1bb4 [amf] Fix crash when file could not be parsed.
Fix double free of mXmlParser (deleted but not reset in ParseFile, then deleted again in ~AMFImporter).

Should probably use a smart pointer instead, though.

Partially addresses https://github.com/assimp/assimp/issues/3888.
2021-05-05 17:13:10 -04:00
Jason C
a03dc4edaa [amf] Fix minor typo in error message.
Added missing space to detail string on parse failure.
2021-05-04 21:56:49 -04:00
Krishty
b79b84d34e Merge branch 'master' into new-file-detection 2021-05-05 00:09:42 +02:00
Krishty
0f3e6e2941 replaced std::size() with AI_COUNT_OF for pre-C++20 compilers 2021-05-05 00:08:54 +02:00
Jason C
2925592c64 [assimp] Make sure ctype calls use unsigned char.
Cast to unsigned char as required by C++ (see C++ **[cctype.cyn]** -> ISO C99 section 7.4, [see also](https://en.cppreference.com/w/cpp/string/byte/isspace)).

Addresses https://github.com/assimp/assimp/issues/3867 and then some.
2021-05-04 17:31:13 -04:00
kkulling
55fd820ed7 use const chars 2021-05-04 10:57:30 +02:00
Krishty
b00de10eb3 Simplified importer search and fixed a few bugs
The search for a matching importer had a few issues, see #3791. There were two different mechanisms to determine whether an importer accepts a specific file extension:
1. `aiImporterDesc::mFileExtensions`, which was forwarded to the UI via `BaseImporter::GetExtensionList()`.
2. `BaseImporter::CanRead()` when called with `checkSig == false`, which determines whether to actually use that importer.
Both were redundant and got out of sync repeatedly. I removed 2. completely and replaced it with 1., thereby syncing UI/import and shortening all `BaseImporter::CanRead()` implementations.

Further bugfixes:
- fixed glTF2 importer throwing exceptions when checking whether it can load a file
- removed `BaseImporter::SimpleExtensionCheck()` because it is no longer used and had a bug with case sensitivity

Since the `checkSig` parameter in `BaseImporter::CanRead()` is now useless, it can be removed completely. I’m not sure if this would break ABI compatiblity, so I’ll submit it with a later pull request.
2021-04-24 00:17:50 +02:00
Krishty
9dc66b0003 removed dead code
BaseImporter::GetExtensionList() is not a virtual function; overriding it is useless. This probably stemmed from a misunderstanding.
2021-04-23 15:15:21 +02:00
Kim Kulling
80fc8538be Update AMFImporter_Material.cpp 2021-04-03 10:29:16 +02:00
Kim Kulling
d62c89557b Remove dead code 2021-04-03 10:28:19 +02:00
Kim Kulling
46e49d0b83 Update AMFImporter_Geometry.cpp 2021-04-03 10:27:54 +02:00
Kim Kulling
da0543972b Fix parsing for AMF-Files. 2021-04-03 10:25:03 +02:00
Kim Kulling
89a8f87dae AMF: Remove unused macros 2021-04-02 13:10:24 +02:00
Kim Kulling
6c89631581 closes https://github.com/assimp/assimp/issues/3678: ensure lowercase 2021-03-09 21:08:28 +01:00
Kim Kulling
c669c8f1eb Merge branch 'master' into update_copyrights 2021-02-28 12:18:41 +01:00
Kim Kulling
9e8dbd0ca5 Update copyrights to 2021. 2021-02-28 12:17:54 +01:00
Guangmo Lin
ba7f945f99 Eliminate MSVC warning C4819 caused by source files encoded in UTF-8 without BOM 2021-02-14 10:28:14 +08:00
Ville Voutilainen
6ebae5e67c GCC 11 build fixes 2021-01-24 11:04:46 +02:00
ihsinme
070072370d Update AMFImporter_Material.cpp 2021-01-12 15:43:40 +03:00
ihsinme
2e96366d04 Update AMFImporter_Geometry.cpp 2021-01-12 15:40:19 +03:00
Kim Kulling
177426185e Fix invalid cast 2020-09-30 16:38:13 +02:00