From 6db06f117ae362041cb3b6ae484a8bd887484fb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Terziman?= Date: Tue, 23 Aug 2016 11:59:49 +0200 Subject: [PATCH 01/22] In metadata: added method to append new metadata to structure --- include/assimp/metadata.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/include/assimp/metadata.h b/include/assimp/metadata.h index 814d89272..0cc27a802 100644 --- a/include/assimp/metadata.h +++ b/include/assimp/metadata.h @@ -192,7 +192,28 @@ struct aiMetadata } } + template + inline void Add( const std::string& key, const T& value ) + { + aiString* new_keys = new aiString[mNumProperties + 1]; + aiMetadataEntry* new_values = new aiMetadataEntry[mNumProperties + 1]; + for(unsigned int i = 0; i < mNumProperties; ++i) + { + new_keys[i] = mKeys[i]; + new_values[i] = mValues[i]; + } + + delete mKeys; + delete mValues; + + mKeys = new_keys; + mValues = new_values; + + mNumProperties++; + + Set(mNumProperties - 1, key, value); + } template inline void Set( unsigned index, const std::string& key, const T& value ) From 2a6f722a7dbd2894c091fc1a05dc0ef8530dd043 Mon Sep 17 00:00:00 2001 From: Leo Terziman Date: Thu, 12 Jan 2017 10:19:25 +0100 Subject: [PATCH 02/22] Fixed matching ENDIF condition in CMake --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a8f3d2488..8aaaf36de 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -335,7 +335,7 @@ IF ( ASSIMP_BUILD_ASSIMP_TOOLS ) IF ( ASSIMP_BUILD_ASSIMP_VIEW ) ADD_SUBDIRECTORY( tools/assimp_view/ ) ENDIF ( ASSIMP_BUILD_ASSIMP_VIEW ) - ENDIF ( WIN32 ) + ENDIF ( WIN32 AND DirectX_D3DX9_LIBRARY ) ADD_SUBDIRECTORY( tools/assimp_cmd/ ) From ef540f46a3528f2838aafe8d11c34553c5c4ef77 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Wed, 22 Feb 2017 17:20:26 +0100 Subject: [PATCH 03/22] Remove unused headers. --- CHANGES | 410 +++++++++++++++---------------- code/3DSExporter.h | 2 +- code/3DSHelper.h | 8 +- code/3DSLoader.cpp | 1 + code/ACLoader.cpp | 1 + code/AMFImporter.cpp | 1 - code/AMFImporter.hpp | 5 +- code/AMFImporter_Postprocess.cpp | 33 ++- code/ASELoader.cpp | 1 + code/ASELoader.h | 2 +- code/ASEParser.cpp | 1 - code/AssbinLoader.cpp | 1 + code/AssbinLoader.h | 1 - code/AssxmlExporter.cpp | 2 +- code/B3DImporter.cpp | 2 +- code/B3DImporter.h | 1 - code/BVHLoader.cpp | 1 + code/BaseImporter.cpp | 1 + code/BaseImporter.h | 3 +- code/BaseProcess.h | 2 - code/Bitmap.h | 126 ++++------ code/BlenderDNA.cpp | 1 + code/BlenderDNA.h | 3 +- code/BlenderDNA.inl | 3 +- code/BlenderIntermediate.h | 3 +- code/BlenderLoader.cpp | 5 +- code/BlenderScene.cpp | 1 - code/COBLoader.cpp | 2 +- code/COBScene.h | 7 +- code/CSMLoader.cpp | 2 +- code/ColladaExporter.cpp | 4 +- code/ColladaHelper.h | 1 - code/ColladaLoader.cpp | 5 +- code/ColladaParser.h | 1 - code/D3MFImporter.cpp | 9 +- code/D3MFImporter.h | 3 - code/D3MFOpcPackage.cpp | 1 - code/D3MFOpcPackage.h | 1 - code/DXFLoader.cpp | 2 + code/DXFLoader.h | 1 + code/DefaultIOStream.cpp | 1 - code/DefaultIOStream.h | 2 +- code/FBXImporter.cpp | 4 +- code/HMPLoader.cpp | 1 + code/IFCLoader.cpp | 2 +- code/IRRLoader.cpp | 2 +- code/IRRMeshLoader.cpp | 2 +- code/Importer.cpp | 1 + code/LWOLoader.cpp | 3 +- code/LWOLoader.h | 2 + code/LWSLoader.cpp | 2 +- code/MD2Loader.cpp | 2 + code/MD3Loader.cpp | 3 +- code/MD5Loader.cpp | 1 + code/MDCLoader.cpp | 1 + code/MDLLoader.cpp | 2 +- code/MS3DLoader.cpp | 3 +- code/NDOLoader.cpp | 2 + code/NFFLoader.cpp | 1 + code/OFFLoader.cpp | 2 +- code/ObjFileImporter.cpp | 2 +- code/OgreImporter.cpp | 3 +- code/OpenGEXImporter.cpp | 1 + code/OpenGEXImporter.h | 1 + code/PlyLoader.cpp | 2 +- code/Q3BSPFileImporter.cpp | 1 + code/Q3BSPFileImporter.h | 21 +- code/Q3DLoader.cpp | 1 + code/RawLoader.cpp | 2 +- code/SIBImporter.cpp | 3 + code/SMDLoader.cpp | 1 + code/STLLoader.cpp | 1 + code/TerragenLoader.cpp | 2 +- code/UnrealLoader.cpp | 1 + code/XFileImporter.cpp | 4 +- code/XGLLoader.cpp | 1 + code/XGLLoader.h | 1 + code/glTFImporter.cpp | 2 + 78 files changed, 365 insertions(+), 384 deletions(-) diff --git a/CHANGES b/CHANGES index 10acd8424..1d98700f8 100644 --- a/CHANGES +++ b/CHANGES @@ -1,205 +1,205 @@ ----------------------------------------------------------------------- -CHANGELOG ----------------------------------------------------------------------- - -3.3.1 (2016-07-08) - -FIXES/HOUSEKEEPING: - - Setup of default precision for 17 exporters - - Fix xcode project files - - Fix BlenderTesselator: offsetof operator - - Invalid version in cmake file - - Update pstdint.h to latest greatest - - -3.3.0 (2016-07-05) - -FEATURES: - - C++11 support enabled - - New regression-test-UI - - Experimental glTF-importer support - - OpenGEX: add support for cameras and lights - - C4D: update to latest Melange-SDK - - Add a gitter channel - - Coverity check enabled - - Switch to <...> include brackets for public headers - - Enable export by pyAssimp - - CI: check windows build - - Add functionality to perform a singlepost-processing step - - many more, just check the history - -FIXES/HOUSEKEEPING: - - Fix of many resource leaks in unittests and main lib - - Fix iOS-buildfor X64 - - Choosing zlib manually for cmake - - many more, just check the history - - -3.2.1 (2016-010-10) - -FEATURES: - - Updated glTF exporter to meet 1.0 specification. - -FIXES/HOUSEKEEPING: - - Fixed glTF Validator errors for exported glTF format. - -ISSUES: - - Hard coded sampler setting for - - magFilter - - minFilter - - void* in ExportData for accessor max and min. - - -3.2.0 (2015-11-03) - -FEATURES: - - OpenDDL-Parser is part of contrib-source. - - Experimental OpenGEX-support - - CI-check for linux and windows - - Coverity check added - - New regression testsuite. - -FIXES/HOUSEKEEPING: - - Hundreds of bugfixes in all parts of the library - - Unified line endings - - -API COMPATIBILITY: - - Removed precompiled header to increase build speed for linux - - -3.1.1 (2014-06-15) - -FEATURES: - - Support for FBX 2013 and newer, binary and ASCII (this is partly - work from Google Summer of Code 2012) - - Support for OGRE binary mesh and skeleton format - - Updated BLEND support for newer Blender versions - - Support for arbitrary meta data, used to hold FBX and DAE metadata - - OBJ Export now produces smaller files - - Meshes can now have names, this is supported by the major importers - - Improved IFC geometry generation - - M3 support has been removed - -FIXES/HOUSEKEEPING: - - Hundreds of bugfixes in all parts of the library - - CMake is now the primary build system - -API COMPATIBILITY: - - 3.1.1 is not binary compatible to 3.0 due to aiNode::mMetaData - and aiMesh::mName - - Export interface has been cleaned up and unified - - Other than that no relevant changes - - -3.0 (2012-07-07) - -FEATURES: - - new export interface similar to the import API. - - Supported export formats: Collada, OBJ, PLY and STL - - added new import formats: XGL/ZGL, M3 (experimental) - - new postprocessing steps: Debone - - vastly improved IFC (Industry Foundation Classes) support - - introduced API to query importer meta information (such as supported - format versions, full name, maintainer info). - - reworked Ogre XML import - - C-API now supports per-import properties - -FIXES/HOUSEKEEPING: - - - hundreds of bugfixes in all parts of the library - - unified naming and cleanup of public headers - - improved CMake build system - - templatized math library - - reduce dependency on boost.thread, only remaining spot - is synchronization for the C logging API - -API COMPATIBILITY: - - renamed headers, export interface, C API properties and meta data - prevent compatibility with code written for 2.0, but in - most cases these can be easily resolved - - Note: 3.0 is not binary compatible with 2.0 - - - - -2.0 (2010-11-21) - -FEATURES: - - Add support for static Blender (*.blend) scenes - - Add support for Q3BSP scenes - - Add a windows-based OpenGL sample featuring texturing & basic materials - - Add an experimental progress feedback interface. - - Vastly improved performance (up to 500%, depending on mesh size and - spatial structure) in some expensive postprocessing steps - - AssimpView now uses a reworked layout which leaves more space - to the scene hierarchy window - - - Add C# bindings ('Assimp.NET') - - Keep BSD-licensed and otherwise free test files in separate - folders (./test/models and ./test/models-nonbsd). - -FIXES: - - Many Collada bugfixes, improve fault tolerance - - Fix possible crashes in the Obj loader - - Improve the Ogre XML loader - - OpenGL-sample now works with MinGW - - Fix Importer::FindLoader failing on uppercase file extensions - - Fix flawed path handling when locating external files - - Limit the maximum number of vertices, faces, face indices and - weights that Assimp is able to handle. This is to avoid - crashes due to overflowing counters. - - - Updated XCode project files - - Further CMAKE build improvements - - -API CHANGES: - - Add data structures for vertex-based animations (These are not - currently used, however ...) - - Some Assimp::Importer methods are const now. - - - - - -1.1 (2010-04-17) -This is the list of relevant changes from the 1.0 (r412) release to 1.1 (r700). - -FEATURES: - - Vastly improved Collada support - - Add MS3D (Milkshape 3D) support - - Add support for Ogre XML static meshes - - Add experimental COB (TrueSpace) support - - Automatic test suite to quickly locate regressions - - D bindings (`dAssimp`) - - Python 2.n bindings (`PyAssimp`) - - Add basic support for Unicode input files (utf8, utf16 and utf32) - - Add further utilities to the `assimp` tool (xml/binary dumps, quick file stats) - - Switch to a CMAKE-based build system including an install target for unix'es - - Automatic evaluation of subdivision surfaces for some formats. - - Add `Importer::ReadFileFromMemory` and the corresponding C-API `aiReadFileFromMemory` - - Expose further math utilities via the C-API (i.e. `aiMultiplyMatrix4`) - - - Move noboost files away from the public include directory - - Many, many bugfixes and improvements in existing loaders and postprocessing steps - - Documentation improved and clarified in many places. - - Add a sample on using Assimp in conjunction with OpenGL - - - Distribution/packaging: comfortable SDK installer for Windows - - Distribution/packaging: improved release packages for other architectures - -CRITICAL FIXES: - - Resolve problems with clashing heap managers, STL ABIs and runtime libraries (win32) - - Fix automatic detection of file type if no file extension is given - - Improved exception safety and robustness, prevent leaking of exceptions through the C interface - - Fix possible heap corruption due to material properties pulled in incorrectly - - Avoid leaking in certain error scenarios - - Fix 64 bit compatibility problems in some loaders (i.e. MDL) - -BREAKING API CHANGES: - - None - - -MINOR API BEHAVIOUR CHANGES: - - Change quaternion orientation to suit to the more common convention (-w). - - aiString is utf8 now. Not yet consistent, however. +---------------------------------------------------------------------- +CHANGELOG +---------------------------------------------------------------------- + +3.3.1 (2016-07-08) + +FIXES/HOUSEKEEPING: + - Setup of default precision for 17 exporters + - Fix xcode project files + - Fix BlenderTesselator: offsetof operator + - Invalid version in cmake file + - Update pstdint.h to latest greatest + + +3.3.0 (2016-07-05) + +FEATURES: + - C++11 support enabled + - New regression-test-UI + - Experimental glTF-importer support + - OpenGEX: add support for cameras and lights + - C4D: update to latest Melange-SDK + - Add a gitter channel + - Coverity check enabled + - Switch to <...> include brackets for public headers + - Enable export by pyAssimp + - CI: check windows build + - Add functionality to perform a singlepost-processing step + - many more, just check the history + +FIXES/HOUSEKEEPING: + - Fix of many resource leaks in unittests and main lib + - Fix iOS-buildfor X64 + - Choosing zlib manually for cmake + - many more, just check the history + + +3.2.1 (2016-010-10) + +FEATURES: + - Updated glTF exporter to meet 1.0 specification. + +FIXES/HOUSEKEEPING: + - Fixed glTF Validator errors for exported glTF format. + +ISSUES: + - Hard coded sampler setting for + - magFilter + - minFilter + - void* in ExportData for accessor max and min. + + +3.2.0 (2015-11-03) + +FEATURES: + - OpenDDL-Parser is part of contrib-source. + - Experimental OpenGEX-support + - CI-check for linux and windows + - Coverity check added + - New regression testsuite. + +FIXES/HOUSEKEEPING: + - Hundreds of bugfixes in all parts of the library + - Unified line endings + + +API COMPATIBILITY: + - Removed precompiled header to increase build speed for linux + + +3.1.1 (2014-06-15) + +FEATURES: + - Support for FBX 2013 and newer, binary and ASCII (this is partly + work from Google Summer of Code 2012) + - Support for OGRE binary mesh and skeleton format + - Updated BLEND support for newer Blender versions + - Support for arbitrary meta data, used to hold FBX and DAE metadata + - OBJ Export now produces smaller files + - Meshes can now have names, this is supported by the major importers + - Improved IFC geometry generation + - M3 support has been removed + +FIXES/HOUSEKEEPING: + - Hundreds of bugfixes in all parts of the library + - CMake is now the primary build system + +API COMPATIBILITY: + - 3.1.1 is not binary compatible to 3.0 due to aiNode::mMetaData + and aiMesh::mName + - Export interface has been cleaned up and unified + - Other than that no relevant changes + + +3.0 (2012-07-07) + +FEATURES: + - new export interface similar to the import API. + - Supported export formats: Collada, OBJ, PLY and STL + - added new import formats: XGL/ZGL, M3 (experimental) + - new postprocessing steps: Debone + - vastly improved IFC (Industry Foundation Classes) support + - introduced API to query importer meta information (such as supported + format versions, full name, maintainer info). + - reworked Ogre XML import + - C-API now supports per-import properties + +FIXES/HOUSEKEEPING: + + - hundreds of bugfixes in all parts of the library + - unified naming and cleanup of public headers + - improved CMake build system + - templatized math library + - reduce dependency on boost.thread, only remaining spot + is synchronization for the C logging API + +API COMPATIBILITY: + - renamed headers, export interface, C API properties and meta data + prevent compatibility with code written for 2.0, but in + most cases these can be easily resolved + - Note: 3.0 is not binary compatible with 2.0 + + + + +2.0 (2010-11-21) + +FEATURES: + - Add support for static Blender (*.blend) scenes + - Add support for Q3BSP scenes + - Add a windows-based OpenGL sample featuring texturing & basic materials + - Add an experimental progress feedback interface. + - Vastly improved performance (up to 500%, depending on mesh size and + spatial structure) in some expensive postprocessing steps + - AssimpView now uses a reworked layout which leaves more space + to the scene hierarchy window + + - Add C# bindings ('Assimp.NET') + - Keep BSD-licensed and otherwise free test files in separate + folders (./test/models and ./test/models-nonbsd). + +FIXES: + - Many Collada bugfixes, improve fault tolerance + - Fix possible crashes in the Obj loader + - Improve the Ogre XML loader + - OpenGL-sample now works with MinGW + - Fix Importer::FindLoader failing on uppercase file extensions + - Fix flawed path handling when locating external files + - Limit the maximum number of vertices, faces, face indices and + weights that Assimp is able to handle. This is to avoid + crashes due to overflowing counters. + + - Updated XCode project files + - Further CMAKE build improvements + + +API CHANGES: + - Add data structures for vertex-based animations (These are not + currently used, however ...) + - Some Assimp::Importer methods are const now. + + + + + +1.1 (2010-04-17) +This is the list of relevant changes from the 1.0 (r412) release to 1.1 (r700). + +FEATURES: + - Vastly improved Collada support + - Add MS3D (Milkshape 3D) support + - Add support for Ogre XML static meshes + - Add experimental COB (TrueSpace) support + - Automatic test suite to quickly locate regressions + - D bindings (`dAssimp`) + - Python 2.n bindings (`PyAssimp`) + - Add basic support for Unicode input files (utf8, utf16 and utf32) + - Add further utilities to the `assimp` tool (xml/binary dumps, quick file stats) + - Switch to a CMAKE-based build system including an install target for unix'es + - Automatic evaluation of subdivision surfaces for some formats. + - Add `Importer::ReadFileFromMemory` and the corresponding C-API `aiReadFileFromMemory` + - Expose further math utilities via the C-API (i.e. `aiMultiplyMatrix4`) + + - Move noboost files away from the public include directory + - Many, many bugfixes and improvements in existing loaders and postprocessing steps + - Documentation improved and clarified in many places. + - Add a sample on using Assimp in conjunction with OpenGL + + - Distribution/packaging: comfortable SDK installer for Windows + - Distribution/packaging: improved release packages for other architectures + +CRITICAL FIXES: + - Resolve problems with clashing heap managers, STL ABIs and runtime libraries (win32) + - Fix automatic detection of file type if no file extension is given + - Improved exception safety and robustness, prevent leaking of exceptions through the C interface + - Fix possible heap corruption due to material properties pulled in incorrectly + - Avoid leaking in certain error scenarios + - Fix 64 bit compatibility problems in some loaders (i.e. MDL) + +BREAKING API CHANGES: + - None - + +MINOR API BEHAVIOUR CHANGES: + - Change quaternion orientation to suit to the more common convention (-w). + - aiString is utf8 now. Not yet consistent, however. diff --git a/code/3DSExporter.h b/code/3DSExporter.h index 4d9b39d53..8bcce338d 100644 --- a/code/3DSExporter.h +++ b/code/3DSExporter.h @@ -48,7 +48,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include "StreamWriter.h" -#include "./../include/assimp/material.h" +#include struct aiScene; struct aiNode; diff --git a/code/3DSHelper.h b/code/3DSHelper.h index 7a2ad3f8a..699767cee 100644 --- a/code/3DSHelper.h +++ b/code/3DSHelper.h @@ -48,10 +48,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "SmoothingGroups.h" #include "StringUtils.h" #include "qnan.h" -#include "./../include/assimp/material.h" -#include "./../include/assimp/camera.h" -#include "./../include/assimp/light.h" -#include "./../include/assimp/anim.h" +#include +#include +#include +#include #include //sprintf namespace Assimp { diff --git a/code/3DSLoader.cpp b/code/3DSLoader.cpp index b19d37f4c..f0285a899 100644 --- a/code/3DSLoader.cpp +++ b/code/3DSLoader.cpp @@ -54,6 +54,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include +#include #include "StringComparison.h" using namespace Assimp; diff --git a/code/ACLoader.cpp b/code/ACLoader.cpp index c040d6bbd..bca24e948 100644 --- a/code/ACLoader.cpp +++ b/code/ACLoader.cpp @@ -60,6 +60,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include +#include #include using namespace Assimp; diff --git a/code/AMFImporter.cpp b/code/AMFImporter.cpp index 78f21814c..42d8922d4 100644 --- a/code/AMFImporter.cpp +++ b/code/AMFImporter.cpp @@ -55,7 +55,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Header files, stdlib. #include -#include namespace Assimp { diff --git a/code/AMFImporter.hpp b/code/AMFImporter.hpp index 4d92b9ea0..9731f2e41 100644 --- a/code/AMFImporter.hpp +++ b/code/AMFImporter.hpp @@ -52,9 +52,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "AMFImporter_Node.hpp" // Header files, Assimp. -#include "assimp/DefaultLogger.hpp" -#include "assimp/importerdesc.h" -#include "assimp/ProgressHandler.hpp" +#include +#include #include "assimp/types.h" #include "BaseImporter.h" #include "irrXMLWrapper.h" diff --git a/code/AMFImporter_Postprocess.cpp b/code/AMFImporter_Postprocess.cpp index 686040598..6f82d5367 100644 --- a/code/AMFImporter_Postprocess.cpp +++ b/code/AMFImporter_Postprocess.cpp @@ -54,7 +54,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "StringUtils.h" // Header files, stdlib. -#include #include namespace Assimp @@ -62,7 +61,7 @@ namespace Assimp aiColor4D AMFImporter::SPP_Material::GetColor(const float pX, const float pY, const float pZ) const { -aiColor4D tcol; + aiColor4D tcol; // Check if stored data are supported. if(Composition.size() != 0) @@ -93,8 +92,8 @@ aiColor4D tcol; void AMFImporter::PostprocessHelper_CreateMeshDataArray(const CAMFImporter_NodeElement_Mesh& pNodeElement, std::vector& pVertexCoordinateArray, std::vector& pVertexColorArray) const { -CAMFImporter_NodeElement_Vertices* vn = nullptr; -size_t col_idx; + CAMFImporter_NodeElement_Vertices* vn = nullptr; + size_t col_idx; // All data stored in "vertices", search for it. for(CAMFImporter_NodeElement* ne_child: pNodeElement.Child) @@ -142,8 +141,8 @@ size_t col_idx; size_t AMFImporter::PostprocessHelper_GetTextureID_Or_Create(const std::string& pID_R, const std::string& pID_G, const std::string& pID_B, const std::string& pID_A) { -size_t TextureConverted_Index; -std::string TextureConverted_ID; + size_t TextureConverted_Index; + std::string TextureConverted_ID; // check input data if(pID_R.empty() && pID_G.empty() && pID_B.empty() && pID_A.empty()) @@ -302,19 +301,19 @@ std::string TextureConverted_ID; void AMFImporter::PostprocessHelper_SplitFacesByTextureID(std::list& pInputList, std::list >& pOutputList_Separated) { -auto texmap_is_equal = [](const CAMFImporter_NodeElement_TexMap* pTexMap1, const CAMFImporter_NodeElement_TexMap* pTexMap2) -> bool -{ - if((pTexMap1 == nullptr) && (pTexMap2 == nullptr)) return true; - if(pTexMap1 == nullptr) return false; - if(pTexMap2 == nullptr) return false; + auto texmap_is_equal = [](const CAMFImporter_NodeElement_TexMap* pTexMap1, const CAMFImporter_NodeElement_TexMap* pTexMap2) -> bool + { + if((pTexMap1 == nullptr) && (pTexMap2 == nullptr)) return true; + if(pTexMap1 == nullptr) return false; + if(pTexMap2 == nullptr) return false; - if(pTexMap1->TextureID_R != pTexMap2->TextureID_R) return false; - if(pTexMap1->TextureID_G != pTexMap2->TextureID_G) return false; - if(pTexMap1->TextureID_B != pTexMap2->TextureID_B) return false; - if(pTexMap1->TextureID_A != pTexMap2->TextureID_A) return false; + if(pTexMap1->TextureID_R != pTexMap2->TextureID_R) return false; + if(pTexMap1->TextureID_G != pTexMap2->TextureID_G) return false; + if(pTexMap1->TextureID_B != pTexMap2->TextureID_B) return false; + if(pTexMap1->TextureID_A != pTexMap2->TextureID_A) return false; - return true; -}; + return true; + }; pOutputList_Separated.clear(); if(pInputList.size() == 0) return; diff --git a/code/ASELoader.cpp b/code/ASELoader.cpp index ed01c17e1..24f63d2d0 100644 --- a/code/ASELoader.cpp +++ b/code/ASELoader.cpp @@ -54,6 +54,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include +#include #include diff --git a/code/ASELoader.h b/code/ASELoader.h index b775fc6bb..6ef4d28f8 100644 --- a/code/ASELoader.h +++ b/code/ASELoader.h @@ -46,9 +46,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "BaseImporter.h" #include +#include "ASEParser.h" struct aiNode; -#include "ASEParser.h" namespace Assimp { diff --git a/code/ASEParser.cpp b/code/ASEParser.cpp index 1a3354c6d..9fa4ee617 100644 --- a/code/ASEParser.cpp +++ b/code/ASEParser.cpp @@ -49,7 +49,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // internal headers #include "TextureTransform.h" #include "ASELoader.h" -#include "MaterialSystem.h" #include "fast_atof.h" #include diff --git a/code/AssbinLoader.cpp b/code/AssbinLoader.cpp index 7a17d5ad5..408620c3a 100644 --- a/code/AssbinLoader.cpp +++ b/code/AssbinLoader.cpp @@ -54,6 +54,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include +#include #ifdef ASSIMP_BUILD_NO_OWN_ZLIB # include diff --git a/code/AssbinLoader.h b/code/AssbinLoader.h index e8c8dd0cb..75c0f3a16 100644 --- a/code/AssbinLoader.h +++ b/code/AssbinLoader.h @@ -46,7 +46,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define AI_ASSBINIMPORTER_H_INC #include "BaseImporter.h" -#include struct aiMesh; struct aiNode; diff --git a/code/AssxmlExporter.cpp b/code/AssxmlExporter.cpp index c50f1985b..677bea265 100644 --- a/code/AssxmlExporter.cpp +++ b/code/AssxmlExporter.cpp @@ -41,7 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ASSXML exporter main code */ #include -#include "./../include/assimp/version.h" +#include #include "ProcessHelper.h" #include #include diff --git a/code/B3DImporter.cpp b/code/B3DImporter.cpp index d28d41518..e2a685d1a 100644 --- a/code/B3DImporter.cpp +++ b/code/B3DImporter.cpp @@ -56,7 +56,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include - +#include using namespace Assimp; using namespace std; diff --git a/code/B3DImporter.h b/code/B3DImporter.h index 92ddc0272..167078655 100644 --- a/code/B3DImporter.h +++ b/code/B3DImporter.h @@ -48,7 +48,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include "BaseImporter.h" -#include #include struct aiNodeAnim; diff --git a/code/BVHLoader.cpp b/code/BVHLoader.cpp index e5821fdaf..1324dcdca 100644 --- a/code/BVHLoader.cpp +++ b/code/BVHLoader.cpp @@ -51,6 +51,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "TinyFormatter.h" #include #include +#include using namespace Assimp; using namespace Assimp::Formatter; diff --git a/code/BaseImporter.cpp b/code/BaseImporter.cpp index 3d53bc089..e96b35cf2 100644 --- a/code/BaseImporter.cpp +++ b/code/BaseImporter.cpp @@ -50,6 +50,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include +#include #include #include #include diff --git a/code/BaseImporter.h b/code/BaseImporter.h index 7c8932a3f..781318be8 100644 --- a/code/BaseImporter.h +++ b/code/BaseImporter.h @@ -44,14 +44,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "Exceptional.h" -#include -#include #include #include #include #include struct aiScene; +struct aiImporterDesc; namespace Assimp { diff --git a/code/BaseProcess.h b/code/BaseProcess.h index 148f07284..e4838fa7f 100644 --- a/code/BaseProcess.h +++ b/code/BaseProcess.h @@ -43,8 +43,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define INCLUDED_AI_BASEPROCESS_H #include - -#include #include "GenericProperty.h" struct aiScene; diff --git a/code/Bitmap.h b/code/Bitmap.h index ad29783ce..f665605b9 100644 --- a/code/Bitmap.h +++ b/code/Bitmap.h @@ -50,93 +50,71 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include + struct aiTexture; namespace Assimp { class IOStream; + class Bitmap { +protected: - protected: + struct Header { + uint16_t type; + uint32_t size; + uint16_t reserved1; + uint16_t reserved2; + uint32_t offset; - struct Header { + // 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 + }; - uint16_t type; + 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; - uint32_t size; + // 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 + }; - uint16_t reserved1; + static const std::size_t mBytesPerPixel = 4; - 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); +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); }; } diff --git a/code/BlenderDNA.cpp b/code/BlenderDNA.cpp index e8f335bce..5dbc950aa 100644 --- a/code/BlenderDNA.cpp +++ b/code/BlenderDNA.cpp @@ -48,6 +48,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "BlenderDNA.h" #include "StreamReader.h" #include "fast_atof.h" +#include "TinyFormatter.h" using namespace Assimp; using namespace Assimp::Blender; diff --git a/code/BlenderDNA.h b/code/BlenderDNA.h index 135e38d60..dbddad336 100644 --- a/code/BlenderDNA.h +++ b/code/BlenderDNA.h @@ -46,12 +46,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define INCLUDED_AI_BLEND_DNA_H #include "BaseImporter.h" -#include "TinyFormatter.h" #include "StreamReader.h" #include #include #include - +#include // enable verbose log output. really verbose, so be careful. #ifdef ASSIMP_BUILD_DEBUG diff --git a/code/BlenderDNA.inl b/code/BlenderDNA.inl index 7397e291b..25aa81c91 100644 --- a/code/BlenderDNA.inl +++ b/code/BlenderDNA.inl @@ -46,9 +46,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define INCLUDED_AI_BLEND_DNA_INL #include +#include "TinyFormatter.h" namespace Assimp { - namespace Blender { +namespace Blender { //-------------------------------------------------------------------------------- const Field& Structure :: operator [] (const std::string& ss) const diff --git a/code/BlenderIntermediate.h b/code/BlenderIntermediate.h index 0290185de..c79bc08f2 100644 --- a/code/BlenderIntermediate.h +++ b/code/BlenderIntermediate.h @@ -48,9 +48,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "BlenderLoader.h" #include "BlenderDNA.h" #include "BlenderScene.h" -#include "BlenderSceneGen.h" #include -#include "./../include/assimp/material.h" +#include struct aiTexture; diff --git a/code/BlenderLoader.cpp b/code/BlenderLoader.cpp index b19eed00c..438828388 100644 --- a/code/BlenderLoader.cpp +++ b/code/BlenderLoader.cpp @@ -54,12 +54,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "BlenderBMesh.h" #include "StringUtils.h" #include -#include "StringComparison.h" +#include +#include "StringComparison.h" #include "StreamReader.h" #include "MemoryIOWrapper.h" + #include -#include // zlib is needed for compressed blend files diff --git a/code/BlenderScene.cpp b/code/BlenderScene.cpp index 2781cc7c6..b5ed862dc 100644 --- a/code/BlenderScene.cpp +++ b/code/BlenderScene.cpp @@ -46,7 +46,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "BlenderDNA.h" #include "BlenderScene.h" -#include "BlenderSceneGen.h" using namespace Assimp; using namespace Assimp::Blender; diff --git a/code/COBLoader.cpp b/code/COBLoader.cpp index 441dd1c56..e1d238a1c 100644 --- a/code/COBLoader.cpp +++ b/code/COBLoader.cpp @@ -57,7 +57,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include - +#include using namespace Assimp; using namespace Assimp::COB; diff --git a/code/COBScene.h b/code/COBScene.h index 0e27d1461..a73a6df3a 100644 --- a/code/COBScene.h +++ b/code/COBScene.h @@ -46,12 +46,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include +#include #include "BaseImporter.h" -#include "./../include/assimp/material.h" +#include -namespace Assimp { - namespace COB { +namespace Assimp { +namespace COB { // ------------------ /** Represents a single vertex index in a face */ diff --git a/code/CSMLoader.cpp b/code/CSMLoader.cpp index 5f274c51f..1d10f3965 100644 --- a/code/CSMLoader.cpp +++ b/code/CSMLoader.cpp @@ -57,7 +57,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include - +#include using namespace Assimp; diff --git a/code/ColladaExporter.cpp b/code/ColladaExporter.cpp index 7f9540aa1..bfb769771 100644 --- a/code/ColladaExporter.cpp +++ b/code/ColladaExporter.cpp @@ -38,12 +38,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ---------------------------------------------------------------------- */ - - #ifndef ASSIMP_BUILD_NO_EXPORT #ifndef ASSIMP_BUILD_NO_COLLADA_EXPORTER -#include "ColladaExporter.h" +#include "ColladaExporter.h" #include "Bitmap.h" #include "fast_atof.h" #include "SceneCombiner.h" diff --git a/code/ColladaHelper.h b/code/ColladaHelper.h index 0fe3259ee..e805ed0a0 100644 --- a/code/ColladaHelper.h +++ b/code/ColladaHelper.h @@ -43,7 +43,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_COLLADAHELPER_H_INC #define AI_COLLADAHELPER_H_INC -#include #include #include #include diff --git a/code/ColladaLoader.cpp b/code/ColladaLoader.cpp index 7c6aa74bb..f87ea86e9 100644 --- a/code/ColladaLoader.cpp +++ b/code/ColladaLoader.cpp @@ -49,8 +49,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include -#include "ColladaParser.h" +#include +#include "ColladaParser.h" #include "fast_atof.h" #include "ParsingUtils.h" #include "SkeletonMeshBuilder.h" @@ -60,11 +61,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "time.h" #include "math.h" #include -#include #include #include "Defines.h" - using namespace Assimp; using namespace Assimp::Formatter; diff --git a/code/ColladaParser.h b/code/ColladaParser.h index 5aa724063..4f2b6b8ce 100644 --- a/code/ColladaParser.h +++ b/code/ColladaParser.h @@ -49,7 +49,6 @@ #include "ColladaHelper.h" #include #include "TinyFormatter.h" -#include namespace Assimp { diff --git a/code/D3MFImporter.cpp b/code/D3MFImporter.cpp index 347263145..9e4a84642 100644 --- a/code/D3MFImporter.cpp +++ b/code/D3MFImporter.cpp @@ -43,24 +43,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "D3MFImporter.h" #include -#include #include #include +#include #include "StringComparison.h" #include "StringUtils.h" #include -#include #include #include -#include #include -#include #include -#include - #include "D3MFOpcPackage.h" #include #include "irrXMLWrapper.h" @@ -313,8 +308,6 @@ private: private: std::vector meshes; XmlReader* xmlReader; - - }; } //namespace D3MF diff --git a/code/D3MFImporter.h b/code/D3MFImporter.h index 36c6d53e4..372dc59ed 100644 --- a/code/D3MFImporter.h +++ b/code/D3MFImporter.h @@ -41,9 +41,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_D3MFLOADER_H_INCLUDED #define AI_D3MFLOADER_H_INCLUDED -#include -#include - #include "BaseImporter.h" namespace Assimp { diff --git a/code/D3MFOpcPackage.cpp b/code/D3MFOpcPackage.cpp index f6c1fb605..a9633b6a5 100644 --- a/code/D3MFOpcPackage.cpp +++ b/code/D3MFOpcPackage.cpp @@ -53,7 +53,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include -#include #include diff --git a/code/D3MFOpcPackage.h b/code/D3MFOpcPackage.h index dd8a40aab..e63243676 100644 --- a/code/D3MFOpcPackage.h +++ b/code/D3MFOpcPackage.h @@ -41,7 +41,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef D3MFOPCPACKAGE_H #define D3MFOPCPACKAGE_H -#include #include #include diff --git a/code/DXFLoader.cpp b/code/DXFLoader.cpp index ab5ca146c..f1acb65f2 100644 --- a/code/DXFLoader.cpp +++ b/code/DXFLoader.cpp @@ -54,6 +54,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "DXFHelper.h" #include #include +#include + #include using namespace Assimp; diff --git a/code/DXFLoader.h b/code/DXFLoader.h index 13af4cdec..2b61c19a9 100644 --- a/code/DXFLoader.h +++ b/code/DXFLoader.h @@ -45,6 +45,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define AI_DXFLOADER_H_INCLUDED #include "BaseImporter.h" +#include namespace Assimp { namespace DXF { diff --git a/code/DefaultIOStream.cpp b/code/DefaultIOStream.cpp index 1907709e3..8a9336e9b 100644 --- a/code/DefaultIOStream.cpp +++ b/code/DefaultIOStream.cpp @@ -45,7 +45,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include "DefaultIOStream.h" -#include #include using namespace Assimp; diff --git a/code/DefaultIOStream.h b/code/DefaultIOStream.h index 294c5b797..16a33cd80 100644 --- a/code/DefaultIOStream.h +++ b/code/DefaultIOStream.h @@ -44,7 +44,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include -#include +//#include #include "Defines.h" namespace Assimp { diff --git a/code/FBXImporter.cpp b/code/FBXImporter.cpp index d6c80db2f..83b74f8cd 100644 --- a/code/FBXImporter.cpp +++ b/code/FBXImporter.cpp @@ -55,9 +55,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "StreamReader.h" #include "MemoryIOWrapper.h" #include - -#include -#include +#include namespace Assimp { template<> const std::string LogFunctions::log_prefix = "FBX: "; diff --git a/code/HMPLoader.cpp b/code/HMPLoader.cpp index 788286e12..fce0daf4a 100644 --- a/code/HMPLoader.cpp +++ b/code/HMPLoader.cpp @@ -51,6 +51,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include +#include using namespace Assimp; diff --git a/code/IFCLoader.cpp b/code/IFCLoader.cpp index 1ef51be47..ebfd64e97 100644 --- a/code/IFCLoader.cpp +++ b/code/IFCLoader.cpp @@ -58,10 +58,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "IFCUtil.h" -#include "StreamReader.h" #include "MemoryIOWrapper.h" #include #include +#include namespace Assimp { diff --git a/code/IRRLoader.cpp b/code/IRRLoader.cpp index 7145f9b66..e552601b8 100644 --- a/code/IRRLoader.cpp +++ b/code/IRRLoader.cpp @@ -65,7 +65,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include - +#include using namespace Assimp; using namespace irr; diff --git a/code/IRRMeshLoader.cpp b/code/IRRMeshLoader.cpp index 853ead15f..88439459a 100644 --- a/code/IRRMeshLoader.cpp +++ b/code/IRRMeshLoader.cpp @@ -54,9 +54,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include +#include #include "Macros.h" - using namespace Assimp; using namespace irr; using namespace irr::io; diff --git a/code/Importer.cpp b/code/Importer.cpp index d60dfb6b0..d39d081c6 100644 --- a/code/Importer.cpp +++ b/code/Importer.cpp @@ -45,6 +45,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include +#include // ------------------------------------------------------------------------------------------------ /* Uncomment this line to prevent Assimp from catching unknown exceptions. diff --git a/code/LWOLoader.cpp b/code/LWOLoader.cpp index 4a45efb91..5d8b84aab 100644 --- a/code/LWOLoader.cpp +++ b/code/LWOLoader.cpp @@ -54,10 +54,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "ProcessHelper.h" #include "ConvertToLHProcess.h" #include +#include #include #include #include - +#include using namespace Assimp; diff --git a/code/LWOLoader.h b/code/LWOLoader.h index 09d66cf24..9907d691d 100644 --- a/code/LWOLoader.h +++ b/code/LWOLoader.h @@ -49,6 +49,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "LWOFileData.h" #include "BaseImporter.h" +#include + struct aiTexture; struct aiNode; struct aiMaterial; diff --git a/code/LWSLoader.cpp b/code/LWSLoader.cpp index 6ca3cf589..52d0c522c 100644 --- a/code/LWSLoader.cpp +++ b/code/LWSLoader.cpp @@ -58,9 +58,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include +#include #include - using namespace Assimp; static const aiImporterDesc desc = { diff --git a/code/MD2Loader.cpp b/code/MD2Loader.cpp index b4c124774..ffcda3916 100644 --- a/code/MD2Loader.cpp +++ b/code/MD2Loader.cpp @@ -50,6 +50,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include +#include + #include using namespace Assimp; diff --git a/code/MD3Loader.cpp b/code/MD3Loader.cpp index 0736e84b9..f469a4c95 100644 --- a/code/MD3Loader.cpp +++ b/code/MD3Loader.cpp @@ -62,10 +62,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include +#include #include - - using namespace Assimp; static const aiImporterDesc desc = { diff --git a/code/MD5Loader.cpp b/code/MD5Loader.cpp index 0703e92de..d2477a2c5 100644 --- a/code/MD5Loader.cpp +++ b/code/MD5Loader.cpp @@ -56,6 +56,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include +#include #include using namespace Assimp; diff --git a/code/MDCLoader.cpp b/code/MDCLoader.cpp index d97215864..db109bf83 100644 --- a/code/MDCLoader.cpp +++ b/code/MDCLoader.cpp @@ -52,6 +52,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include +#include #include diff --git a/code/MDLLoader.cpp b/code/MDLLoader.cpp index f82e7abfe..4aeff43e5 100644 --- a/code/MDLLoader.cpp +++ b/code/MDLLoader.cpp @@ -58,10 +58,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include +#include #include - using namespace Assimp; static const aiImporterDesc desc = { diff --git a/code/MS3DLoader.cpp b/code/MS3DLoader.cpp index c50ccc46e..07a3d9b17 100644 --- a/code/MS3DLoader.cpp +++ b/code/MS3DLoader.cpp @@ -53,7 +53,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include - +#include +#include using namespace Assimp; diff --git a/code/NDOLoader.cpp b/code/NDOLoader.cpp index cf3d6edf6..2ce3983dc 100644 --- a/code/NDOLoader.cpp +++ b/code/NDOLoader.cpp @@ -49,7 +49,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include +#include #include "StreamReader.h" +#include using namespace Assimp; diff --git a/code/NFFLoader.cpp b/code/NFFLoader.cpp index 8cc1624d5..24ca24cce 100644 --- a/code/NFFLoader.cpp +++ b/code/NFFLoader.cpp @@ -54,6 +54,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include +#include #include diff --git a/code/OFFLoader.cpp b/code/OFFLoader.cpp index cb2226bf6..fee36b03a 100644 --- a/code/OFFLoader.cpp +++ b/code/OFFLoader.cpp @@ -54,7 +54,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include - +#include using namespace Assimp; diff --git a/code/ObjFileImporter.cpp b/code/ObjFileImporter.cpp index 9a5a56c5e..55e7c087e 100644 --- a/code/ObjFileImporter.cpp +++ b/code/ObjFileImporter.cpp @@ -47,10 +47,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "ObjFileData.h" #include "IOStreamBuffer.h" #include -#include #include #include #include +#include static const aiImporterDesc desc = { "Wavefront Object Importer", diff --git a/code/OgreImporter.cpp b/code/OgreImporter.cpp index 504f6a96f..744be0965 100644 --- a/code/OgreImporter.cpp +++ b/code/OgreImporter.cpp @@ -40,12 +40,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef ASSIMP_BUILD_NO_OGRE_IMPORTER - - #include "OgreImporter.h" #include "OgreBinarySerializer.h" #include "OgreXmlSerializer.h" #include +#include #include static const aiImporterDesc desc = { diff --git a/code/OpenGEXImporter.cpp b/code/OpenGEXImporter.cpp index a605e0f41..0061498fc 100644 --- a/code/OpenGEXImporter.cpp +++ b/code/OpenGEXImporter.cpp @@ -48,6 +48,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include +#include #include diff --git a/code/OpenGEXImporter.h b/code/OpenGEXImporter.h index 103b27903..d33b0a804 100644 --- a/code/OpenGEXImporter.h +++ b/code/OpenGEXImporter.h @@ -47,6 +47,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include +#include namespace ODDLParser { class DDLNode; diff --git a/code/PlyLoader.cpp b/code/PlyLoader.cpp index 8b0471326..df1ce3159 100644 --- a/code/PlyLoader.cpp +++ b/code/PlyLoader.cpp @@ -51,7 +51,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include - +#include using namespace Assimp; diff --git a/code/Q3BSPFileImporter.cpp b/code/Q3BSPFileImporter.cpp index 198ecdd73..5b4da5a0d 100644 --- a/code/Q3BSPFileImporter.cpp +++ b/code/Q3BSPFileImporter.cpp @@ -56,6 +56,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include +#include #include #include #include "StringComparison.h" diff --git a/code/Q3BSPFileImporter.h b/code/Q3BSPFileImporter.h index ee8991bea..bac370411 100644 --- a/code/Q3BSPFileImporter.h +++ b/code/Q3BSPFileImporter.h @@ -42,30 +42,27 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "BaseImporter.h" +#include + struct aiMesh; struct aiNode; struct aiFace; struct aiMaterial; struct aiTexture; -namespace Assimp -{ -namespace Q3BSP -{ - -class Q3BSPZipArchive; -struct Q3BSPModel; -struct sQ3BSPFace; - +namespace Assimp { +namespace Q3BSP { + class Q3BSPZipArchive; + struct Q3BSPModel; + struct sQ3BSPFace; } + // ------------------------------------------------------------------------------------------------ /** Loader to import BSP-levels from a PK3 archive or from a unpacked BSP-level. */ // ------------------------------------------------------------------------------------------------ -class Q3BSPFileImporter : public BaseImporter -{ +class Q3BSPFileImporter : public BaseImporter { public: - /// @brief Default constructor. Q3BSPFileImporter(); diff --git a/code/Q3DLoader.cpp b/code/Q3DLoader.cpp index d9dc29672..0debb2d05 100644 --- a/code/Q3DLoader.cpp +++ b/code/Q3DLoader.cpp @@ -53,6 +53,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include +#include using namespace Assimp; diff --git a/code/RawLoader.cpp b/code/RawLoader.cpp index 57e0fc119..ae10ba8b4 100644 --- a/code/RawLoader.cpp +++ b/code/RawLoader.cpp @@ -54,7 +54,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include - +#include using namespace Assimp; diff --git a/code/SIBImporter.cpp b/code/SIBImporter.cpp index aaf4b0b26..f7471e563 100644 --- a/code/SIBImporter.cpp +++ b/code/SIBImporter.cpp @@ -61,6 +61,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include +#include + +#include using namespace Assimp; diff --git a/code/SMDLoader.cpp b/code/SMDLoader.cpp index 408125771..37968d030 100644 --- a/code/SMDLoader.cpp +++ b/code/SMDLoader.cpp @@ -54,6 +54,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include +#include #include using namespace Assimp; diff --git a/code/STLLoader.cpp b/code/STLLoader.cpp index 7d3e3224c..61d8d33b5 100644 --- a/code/STLLoader.cpp +++ b/code/STLLoader.cpp @@ -52,6 +52,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include +#include using namespace Assimp; diff --git a/code/TerragenLoader.cpp b/code/TerragenLoader.cpp index 854959f19..dcb19b9ca 100644 --- a/code/TerragenLoader.cpp +++ b/code/TerragenLoader.cpp @@ -51,7 +51,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include - +#include using namespace Assimp; diff --git a/code/UnrealLoader.cpp b/code/UnrealLoader.cpp index 790002235..59be4bed1 100644 --- a/code/UnrealLoader.cpp +++ b/code/UnrealLoader.cpp @@ -60,6 +60,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include +#include #include diff --git a/code/XFileImporter.cpp b/code/XFileImporter.cpp index 3b149a18a..a4bf86ceb 100644 --- a/code/XFileImporter.cpp +++ b/code/XFileImporter.cpp @@ -53,11 +53,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include +#include + #include #include - - using namespace Assimp; using namespace Assimp::Formatter; diff --git a/code/XGLLoader.cpp b/code/XGLLoader.cpp index d14e9968d..6c9db1f89 100644 --- a/code/XGLLoader.cpp +++ b/code/XGLLoader.cpp @@ -52,6 +52,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "MemoryIOWrapper.h" #include #include +#include #include #include diff --git a/code/XGLLoader.h b/code/XGLLoader.h index c8a68ba31..a7f0d7208 100644 --- a/code/XGLLoader.h +++ b/code/XGLLoader.h @@ -52,6 +52,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include +#include struct aiNode; diff --git a/code/glTFImporter.cpp b/code/glTFImporter.cpp index 65a600f83..02c60ee5e 100644 --- a/code/glTFImporter.cpp +++ b/code/glTFImporter.cpp @@ -48,6 +48,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include +#include + #include #include "MakeVerboseFormat.h" From 5e2c846ca03b77c98257fca01c6414078b1d02df Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Wed, 22 Feb 2017 17:22:23 +0100 Subject: [PATCH 04/22] Remove unused header. --- code/Importer.h | 1 - 1 file changed, 1 deletion(-) diff --git a/code/Importer.h b/code/Importer.h index a0df1a6c1..fcfe1b018 100644 --- a/code/Importer.h +++ b/code/Importer.h @@ -44,7 +44,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define INCLUDED_AI_IMPORTER_H #include -#include #include #include From 5dd1bb9d6c87993a2436d381dfe333159161892d Mon Sep 17 00:00:00 2001 From: Antoine Bolvy Date: Mon, 27 Feb 2017 21:31:56 -0500 Subject: [PATCH 05/22] Export DefaultIOSystem and move it with DefaultIOStream to include/ instead of code/ --- code/AMFImporter.cpp | 2 +- code/CMakeLists.txt | 4 ++-- code/ColladaExporter.cpp | 2 +- code/ColladaLoader.cpp | 3 +-- code/DefaultIOStream.cpp | 2 +- code/DefaultIOSystem.cpp | 4 ++-- code/DefaultLogger.cpp | 3 ++- code/Exceptional.h | 2 +- code/Exporter.cpp | 5 +++-- code/FileLogStream.h | 2 +- code/IFCBoolean.cpp | 2 +- code/IFCUtil.cpp | 2 +- code/Importer.cpp | 5 +++-- code/MDLMaterialLoader.cpp | 2 +- code/ObjFileImporter.cpp | 2 +- code/ObjFileParser.cpp | 6 +++--- code/OpenGEXImporter.cpp | 2 +- code/Q3BSPFileImporter.cpp | 2 +- code/Q3BSPFileParser.cpp | 2 +- code/SceneCombiner.h | 2 +- code/StandardShapes.cpp | 2 +- code/StepExporter.cpp | 2 +- code/StreamReader.h | 4 ++-- code/X3DImporter.cpp | 2 +- code/X3DImporter_Networking.cpp | 2 +- code/XFileExporter.cpp | 2 +- code/XFileHelper.h | 2 +- code/XFileImporter.cpp | 2 +- code/glTFAsset.h | 2 +- code/glTFImporter.h | 2 +- {code => include/assimp}/DefaultIOStream.h | 2 +- {code => include/assimp}/DefaultIOSystem.h | 2 +- {code => include/assimp}/Defines.h | 0 .../assimp/port/AndroidJNI/AndroidJNIIOSystem.h | 2 +- port/AndroidJNI/AndroidJNIIOSystem.cpp | 2 +- test/unit/TestIOStream.h | 2 +- test/unit/utImporter.cpp | 14 +++++++------- 37 files changed, 52 insertions(+), 50 deletions(-) rename {code => include/assimp}/DefaultIOStream.h (99%) rename {code => include/assimp}/DefaultIOSystem.h (98%) rename {code => include/assimp}/Defines.h (100%) diff --git a/code/AMFImporter.cpp b/code/AMFImporter.cpp index 78f21814c..a038560fc 100644 --- a/code/AMFImporter.cpp +++ b/code/AMFImporter.cpp @@ -51,7 +51,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "AMFImporter_Macro.hpp" #include "fast_atof.h" -#include "DefaultIOSystem.h" +#include // Header files, stdlib. #include diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index 92199c234..4d94e93ae 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -93,6 +93,8 @@ SET( PUBLIC_HEADERS ${HEADER_PATH}/NullLogger.hpp ${HEADER_PATH}/cexport.h ${HEADER_PATH}/Exporter.hpp + ${HEADER_PATH}/DefaultIOStream.h + ${HEADER_PATH}/DefaultIOSystem.h ) SET( Core_SRCS @@ -125,9 +127,7 @@ SET( Common_SRCS ByteSwapper.h DefaultProgressHandler.h DefaultIOStream.cpp - DefaultIOStream.h DefaultIOSystem.cpp - DefaultIOSystem.h CInterfaceIOWrapper.cpp CInterfaceIOWrapper.h Hash.h diff --git a/code/ColladaExporter.cpp b/code/ColladaExporter.cpp index 7f9540aa1..fad035358 100644 --- a/code/ColladaExporter.cpp +++ b/code/ColladaExporter.cpp @@ -47,9 +47,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "Bitmap.h" #include "fast_atof.h" #include "SceneCombiner.h" -#include "DefaultIOSystem.h" #include "StringUtils.h" #include "XMLTools.h" +#include #include #include #include diff --git a/code/ColladaLoader.cpp b/code/ColladaLoader.cpp index 7c6aa74bb..c671545ca 100644 --- a/code/ColladaLoader.cpp +++ b/code/ColladaLoader.cpp @@ -54,7 +54,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "fast_atof.h" #include "ParsingUtils.h" #include "SkeletonMeshBuilder.h" -#include "Defines.h" #include "CreateAnimMesh.h" #include "time.h" @@ -62,7 +61,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include -#include "Defines.h" +#include using namespace Assimp; diff --git a/code/DefaultIOStream.cpp b/code/DefaultIOStream.cpp index 1907709e3..57507c12b 100644 --- a/code/DefaultIOStream.cpp +++ b/code/DefaultIOStream.cpp @@ -44,7 +44,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include -#include "DefaultIOStream.h" +#include #include #include diff --git a/code/DefaultIOSystem.cpp b/code/DefaultIOSystem.cpp index 8c44c8bd0..711476806 100644 --- a/code/DefaultIOSystem.cpp +++ b/code/DefaultIOSystem.cpp @@ -40,10 +40,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** @file Default implementation of IOSystem using the standard C file functions */ -#include "DefaultIOSystem.h" -#include "DefaultIOStream.h" #include "StringComparison.h" +#include +#include #include #include #include diff --git a/code/DefaultLogger.cpp b/code/DefaultLogger.cpp index 5364bd8bc..106c51561 100644 --- a/code/DefaultLogger.cpp +++ b/code/DefaultLogger.cpp @@ -43,13 +43,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * @brief Implementation of DefaultLogger (and Logger) */ -#include "DefaultIOSystem.h" // Default log streams #include "Win32DebugLogStream.h" #include "StdOStreamLogStream.h" #include "FileLogStream.h" #include "StringUtils.h" + +#include #include #include #include diff --git a/code/Exceptional.h b/code/Exceptional.h index 3268423ef..5109b8f07 100644 --- a/code/Exceptional.h +++ b/code/Exceptional.h @@ -42,7 +42,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define INCLUDED_EXCEPTIONAL_H #include -#include "DefaultIOStream.h" +#include using std::runtime_error; #ifdef _MSC_VER diff --git a/code/Exporter.cpp b/code/Exporter.cpp index 3f77826e5..81178bbdb 100644 --- a/code/Exporter.cpp +++ b/code/Exporter.cpp @@ -52,7 +52,6 @@ Here we implement only the C++ interface (Assimp::Exporter). #ifndef ASSIMP_BUILD_NO_EXPORT -#include "DefaultIOSystem.h" #include "BlobIOSystem.h" #include "SceneCombiner.h" #include "BaseProcess.h" @@ -64,6 +63,8 @@ Here we implement only the C++ interface (Assimp::Exporter). #include "Exceptional.h" #include "ScenePrivate.h" #include + +#include #include #include #include @@ -235,7 +236,7 @@ bool Exporter::IsDefaultIOHandler() const { } // ------------------------------------------------------------------------------------------------ -const aiExportDataBlob* Exporter::ExportToBlob( const aiScene* pScene, const char* pFormatId, +const aiExportDataBlob* Exporter::ExportToBlob( const aiScene* pScene, const char* pFormatId, unsigned int, const ExportProperties* pProperties ) { if (pimpl->blob) { delete pimpl->blob; diff --git a/code/FileLogStream.h b/code/FileLogStream.h index 574a63ed6..ba08d2c89 100644 --- a/code/FileLogStream.h +++ b/code/FileLogStream.h @@ -3,7 +3,7 @@ #include #include -#include "DefaultIOSystem.h" +#include namespace Assimp { diff --git a/code/IFCBoolean.cpp b/code/IFCBoolean.cpp index d3b77d87c..98b230392 100644 --- a/code/IFCBoolean.cpp +++ b/code/IFCBoolean.cpp @@ -47,7 +47,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "IFCUtil.h" #include "PolyTools.h" #include "ProcessHelper.h" -#include "Defines.h" +#include #include #include diff --git a/code/IFCUtil.cpp b/code/IFCUtil.cpp index 7caebbcd4..d7e4d5d54 100644 --- a/code/IFCUtil.cpp +++ b/code/IFCUtil.cpp @@ -49,7 +49,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "IFCUtil.h" #include "PolyTools.h" #include "ProcessHelper.h" -#include "Defines.h" +#include namespace Assimp { namespace IFC { diff --git a/code/Importer.cpp b/code/Importer.cpp index d60dfb6b0..7d7b84292 100644 --- a/code/Importer.cpp +++ b/code/Importer.cpp @@ -65,8 +65,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "BaseImporter.h" #include "BaseProcess.h" -#include "DefaultIOStream.h" -#include "DefaultIOSystem.h" #include "DefaultProgressHandler.h" #include "GenericProperty.h" #include "ProcessHelper.h" @@ -81,6 +79,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include +#include +#include + #ifndef ASSIMP_BUILD_NO_VALIDATEDS_PROCESS # include "ValidateDataStructure.h" #endif diff --git a/code/MDLMaterialLoader.cpp b/code/MDLMaterialLoader.cpp index 3425d7b09..64cebc7d5 100644 --- a/code/MDLMaterialLoader.cpp +++ b/code/MDLMaterialLoader.cpp @@ -52,8 +52,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include +#include #include "qnan.h" -#include "Defines.h" using namespace Assimp; diff --git a/code/ObjFileImporter.cpp b/code/ObjFileImporter.cpp index 9a5a56c5e..85d0d08af 100644 --- a/code/ObjFileImporter.cpp +++ b/code/ObjFileImporter.cpp @@ -41,12 +41,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef ASSIMP_BUILD_NO_OBJ_IMPORTER -#include "DefaultIOSystem.h" #include "ObjFileImporter.h" #include "ObjFileParser.h" #include "ObjFileData.h" #include "IOStreamBuffer.h" #include +#include #include #include #include diff --git a/code/ObjFileParser.cpp b/code/ObjFileParser.cpp index 6980f0dab..41ae447ba 100644 --- a/code/ObjFileParser.cpp +++ b/code/ObjFileParser.cpp @@ -45,8 +45,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "ObjTools.h" #include "ObjFileData.h" #include "ParsingUtils.h" -#include "DefaultIOSystem.h" #include "BaseImporter.h" +#include #include #include #include @@ -58,7 +58,7 @@ const std::string ObjFileParser::DEFAULT_MATERIAL = AI_DEFAULT_MATERIAL_NAME; // ------------------------------------------------------------------- // Constructor with loaded data and directories. -ObjFileParser::ObjFileParser( IOStreamBuffer &streamBuffer, const std::string &modelName, +ObjFileParser::ObjFileParser( IOStreamBuffer &streamBuffer, const std::string &modelName, IOSystem *io, ProgressHandler* progress, const std::string &originalObjFileName) : m_DataIt(), @@ -115,7 +115,7 @@ void ObjFileParser::parseFile( IOStreamBuffer &streamBuffer ) { m_DataIt = buffer.begin(); m_DataItEnd = buffer.end(); - // Handle progress reporting + // Handle progress reporting const size_t filePos( streamBuffer.getFilePos() ); if ( lastFilePos < filePos ) { processed += static_cast(filePos); diff --git a/code/OpenGEXImporter.cpp b/code/OpenGEXImporter.cpp index a605e0f41..442d19458 100644 --- a/code/OpenGEXImporter.cpp +++ b/code/OpenGEXImporter.cpp @@ -40,7 +40,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef ASSIMP_BUILD_NO_OPENGEX_IMPORTER #include "OpenGEXImporter.h" -#include "DefaultIOSystem.h" +#include #include #include "MakeVerboseFormat.h" #include "StringComparison.h" diff --git a/code/Q3BSPFileImporter.cpp b/code/Q3BSPFileImporter.cpp index 198ecdd73..25ecb0017 100644 --- a/code/Q3BSPFileImporter.cpp +++ b/code/Q3BSPFileImporter.cpp @@ -40,7 +40,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef ASSIMP_BUILD_NO_Q3BSP_IMPORTER -#include "DefaultIOSystem.h" #include "Q3BSPFileImporter.h" #include "Q3BSPZipArchive.h" #include "Q3BSPFileParser.h" @@ -56,6 +55,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include +#include #include #include #include "StringComparison.h" diff --git a/code/Q3BSPFileParser.cpp b/code/Q3BSPFileParser.cpp index 0dabaf87d..b32f15000 100644 --- a/code/Q3BSPFileParser.cpp +++ b/code/Q3BSPFileParser.cpp @@ -42,10 +42,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef ASSIMP_BUILD_NO_Q3BSP_IMPORTER #include "Q3BSPFileParser.h" -#include "DefaultIOSystem.h" #include "Q3BSPFileData.h" #include "Q3BSPZipArchive.h" #include +#include #include namespace Assimp { diff --git a/code/SceneCombiner.h b/code/SceneCombiner.h index a6ba06768..64c1ea48e 100644 --- a/code/SceneCombiner.h +++ b/code/SceneCombiner.h @@ -46,7 +46,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include -#include "Defines.h" +#include #include #include #include diff --git a/code/StandardShapes.cpp b/code/StandardShapes.cpp index eed8ddabc..26c84217a 100644 --- a/code/StandardShapes.cpp +++ b/code/StandardShapes.cpp @@ -47,8 +47,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "StandardShapes.h" #include "StringComparison.h" -#include "Defines.h" #include +#include #include namespace Assimp { diff --git a/code/StepExporter.cpp b/code/StepExporter.cpp index eb84ac594..aa7086cee 100644 --- a/code/StepExporter.cpp +++ b/code/StepExporter.cpp @@ -48,7 +48,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "BaseImporter.h" #include "fast_atof.h" #include "SceneCombiner.h" -#include "DefaultIOSystem.h" #include #include #include @@ -56,6 +55,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include "Exceptional.h" +#include #include #include #include diff --git a/code/StreamReader.h b/code/StreamReader.h index 89367494a..8ee07641c 100644 --- a/code/StreamReader.h +++ b/code/StreamReader.h @@ -50,7 +50,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "Exceptional.h" #include #include -#include "Defines.h" +#include namespace Assimp { @@ -243,7 +243,7 @@ public: * * @param limit Maximum number of bytes to be read from * the beginning of the file. Specifying UINT_MAX - * resets the limit to the original end of the stream. + * resets the limit to the original end of the stream. * Returns the previously set limit. */ unsigned int SetReadLimit(unsigned int _limit) { unsigned int prev = GetReadLimit(); diff --git a/code/X3DImporter.cpp b/code/X3DImporter.cpp index cbeaa4623..2bd9d7544 100644 --- a/code/X3DImporter.cpp +++ b/code/X3DImporter.cpp @@ -49,7 +49,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "StringUtils.h" // Header files, Assimp. -#include "DefaultIOSystem.h" +#include #include "fast_atof.h" // Header files, stdlib. diff --git a/code/X3DImporter_Networking.cpp b/code/X3DImporter_Networking.cpp index 4a75c9e66..d862cd7ef 100644 --- a/code/X3DImporter_Networking.cpp +++ b/code/X3DImporter_Networking.cpp @@ -48,7 +48,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "X3DImporter_Macro.hpp" // Header files, Assimp. -#include "DefaultIOSystem.h" +#include namespace Assimp { diff --git a/code/XFileExporter.cpp b/code/XFileExporter.cpp index eeb5a1de1..30a0a21f8 100644 --- a/code/XFileExporter.cpp +++ b/code/XFileExporter.cpp @@ -48,7 +48,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "BaseImporter.h" #include "fast_atof.h" #include "SceneCombiner.h" -#include "DefaultIOSystem.h" +#include #include #include #include diff --git a/code/XFileHelper.h b/code/XFileHelper.h index 69f2a98f6..49a41d153 100644 --- a/code/XFileHelper.h +++ b/code/XFileHelper.h @@ -51,7 +51,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include -#include "Defines.h" +#include namespace Assimp { diff --git a/code/XFileImporter.cpp b/code/XFileImporter.cpp index 3b149a18a..ca5956d94 100644 --- a/code/XFileImporter.cpp +++ b/code/XFileImporter.cpp @@ -47,9 +47,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "XFileImporter.h" #include "XFileParser.h" -#include "Defines.h" #include "TinyFormatter.h" #include "ConvertToLHProcess.h" +#include #include #include #include diff --git a/code/glTFAsset.h b/code/glTFAsset.h index 2a0de7bf3..10453efa6 100644 --- a/code/glTFAsset.h +++ b/code/glTFAsset.h @@ -62,7 +62,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifdef ASSIMP_API # include -# include "DefaultIOSystem.h" +# include # include "ByteSwapper.h" #else # include diff --git a/code/glTFImporter.h b/code/glTFImporter.h index 5d06730a5..7edcc83f2 100644 --- a/code/glTFImporter.h +++ b/code/glTFImporter.h @@ -41,7 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define AI_GLTFIMPORTER_H_INC #include "BaseImporter.h" -#include "DefaultIOSystem.h" +#include struct aiNode; diff --git a/code/DefaultIOStream.h b/include/assimp/DefaultIOStream.h similarity index 99% rename from code/DefaultIOStream.h rename to include/assimp/DefaultIOStream.h index 294c5b797..f4c9af85d 100644 --- a/code/DefaultIOStream.h +++ b/include/assimp/DefaultIOStream.h @@ -45,7 +45,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include -#include "Defines.h" +#include namespace Assimp { diff --git a/code/DefaultIOSystem.h b/include/assimp/DefaultIOSystem.h similarity index 98% rename from code/DefaultIOSystem.h rename to include/assimp/DefaultIOSystem.h index 49960a847..b4986b330 100644 --- a/code/DefaultIOSystem.h +++ b/include/assimp/DefaultIOSystem.h @@ -48,7 +48,7 @@ namespace Assimp { // --------------------------------------------------------------------------- /** Default implementation of IOSystem using the standard C file functions */ -class DefaultIOSystem : public IOSystem +class ASSIMP_API DefaultIOSystem : public IOSystem { public: /** Constructor. */ diff --git a/code/Defines.h b/include/assimp/Defines.h similarity index 100% rename from code/Defines.h rename to include/assimp/Defines.h diff --git a/include/assimp/port/AndroidJNI/AndroidJNIIOSystem.h b/include/assimp/port/AndroidJNI/AndroidJNIIOSystem.h index 6f806f922..41d800487 100644 --- a/include/assimp/port/AndroidJNI/AndroidJNIIOSystem.h +++ b/include/assimp/port/AndroidJNI/AndroidJNIIOSystem.h @@ -45,7 +45,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_ANDROIDJNIIOSYSTEM_H_INC #define AI_ANDROIDJNIIOSYSTEM_H_INC -#include "../code/DefaultIOSystem.h" +#include #include #include #include diff --git a/port/AndroidJNI/AndroidJNIIOSystem.cpp b/port/AndroidJNI/AndroidJNIIOSystem.cpp index 43bb9213d..2c3d61a00 100644 --- a/port/AndroidJNI/AndroidJNIIOSystem.cpp +++ b/port/AndroidJNI/AndroidJNIIOSystem.cpp @@ -53,7 +53,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include -#include +#include #include using namespace Assimp; diff --git a/test/unit/TestIOStream.h b/test/unit/TestIOStream.h index a979caec8..3dbfc45e3 100644 --- a/test/unit/TestIOStream.h +++ b/test/unit/TestIOStream.h @@ -39,7 +39,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #pragma once -#include "DefaultIOStream.h" +#include using namespace ::Assimp; diff --git a/test/unit/utImporter.cpp b/test/unit/utImporter.cpp index ac1f0194f..a2ba25ac2 100644 --- a/test/unit/utImporter.cpp +++ b/test/unit/utImporter.cpp @@ -45,7 +45,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include "TestIOSystem.h" -#include "DefaultIOSystem.h" +#include using namespace ::std; using namespace ::Assimp; @@ -53,12 +53,12 @@ using namespace ::Assimp; class ImporterTest : public ::testing::Test { public: - virtual void SetUp() { - pImp = new Importer(); + virtual void SetUp() { + pImp = new Importer(); } - - virtual void TearDown() { - delete pImp; + + virtual void TearDown() { + delete pImp; } protected: @@ -275,4 +275,4 @@ TEST_F(ImporterTest, testMultipleReads) TEST_F( ImporterTest, SearchFileHeaderForTokenTest ) { //DefaultIOSystem ioSystem; // BaseImporter::SearchFileHeaderForToken( &ioSystem, assetPath, Token, 2 ) -} \ No newline at end of file +} From f312d8709e7c56944427f6ff9ac7bfe53352ac9a Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Tue, 28 Feb 2017 16:37:07 +0100 Subject: [PATCH 06/22] More cleanup --- code/BlobIOSystem.h | 8 +++---- code/Exporter.cpp | 1 - code/FBXAnimation.cpp | 1 - code/FBXConverter.cpp | 1 - code/FBXDeformer.cpp | 2 -- code/FBXModel.cpp | 2 -- code/FBXNodeAttribute.cpp | 2 -- code/FBXProperties.h | 1 - code/FBXTokenizer.h | 2 -- code/FBXUtil.h | 1 - code/FileLogStream.h | 41 +++++++++++++++++++++++++++++++++++ code/HMPLoader.h | 5 ----- code/HalfLifeFileData.h | 1 - code/IOStreamBuffer.h | 2 -- code/MD2FileData.h | 2 -- code/RemoveComments.h | 2 +- code/SceneCombiner.h | 1 - code/StandardShapes.cpp | 1 - code/StringComparison.h | 1 - code/StringUtils.h | 5 ----- code/Version.cpp | 6 ++--- include/assimp/Importer.hpp | 1 - include/assimp/LogStream.hpp | 3 +++ include/assimp/Logger.hpp | 4 +++- include/assimp/NullLogger.hpp | 4 +++- include/assimp/cexport.h | 1 - include/assimp/cimport.h | 1 - 27 files changed, 58 insertions(+), 44 deletions(-) diff --git a/code/BlobIOSystem.h b/code/BlobIOSystem.h index 6cd014254..bb76ffadb 100644 --- a/code/BlobIOSystem.h +++ b/code/BlobIOSystem.h @@ -45,10 +45,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_BLOBIOSYSTEM_H_INCLUDED #define AI_BLOBIOSYSTEM_H_INCLUDED -#include "./../include/assimp/IOStream.hpp" -#include "./../include/assimp/cexport.h" -#include "./../include/assimp/IOSystem.hpp" -#include "./../include/assimp/DefaultLogger.hpp" +#include +#include +#include +#include #include #include #include diff --git a/code/Exporter.cpp b/code/Exporter.cpp index 3f77826e5..b8e92ec5c 100644 --- a/code/Exporter.cpp +++ b/code/Exporter.cpp @@ -68,7 +68,6 @@ Here we implement only the C++ interface (Assimp::Exporter). #include #include #include -#include namespace Assimp { diff --git a/code/FBXAnimation.cpp b/code/FBXAnimation.cpp index 0758d4db7..09d7c184d 100644 --- a/code/FBXAnimation.cpp +++ b/code/FBXAnimation.cpp @@ -48,7 +48,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "FBXParser.h" #include "FBXDocument.h" #include "FBXImporter.h" -#include "FBXImportSettings.h" #include "FBXDocumentUtil.h" #include "FBXProperties.h" diff --git a/code/FBXConverter.cpp b/code/FBXConverter.cpp index 848da579e..30d332f5b 100644 --- a/code/FBXConverter.cpp +++ b/code/FBXConverter.cpp @@ -58,7 +58,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include -#include #include namespace Assimp { diff --git a/code/FBXDeformer.cpp b/code/FBXDeformer.cpp index 067a5e405..c7cc52e5f 100644 --- a/code/FBXDeformer.cpp +++ b/code/FBXDeformer.cpp @@ -47,9 +47,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "FBXParser.h" #include "FBXDocument.h" #include "FBXImporter.h" -#include "FBXImportSettings.h" #include "FBXDocumentUtil.h" -#include "FBXProperties.h" namespace Assimp { namespace FBX { diff --git a/code/FBXModel.cpp b/code/FBXModel.cpp index bbeb14bfb..27e5429c3 100644 --- a/code/FBXModel.cpp +++ b/code/FBXModel.cpp @@ -48,9 +48,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "FBXMeshGeometry.h" #include "FBXDocument.h" #include "FBXImporter.h" -#include "FBXImportSettings.h" #include "FBXDocumentUtil.h" -#include "FBXProperties.h" namespace Assimp { namespace FBX { diff --git a/code/FBXNodeAttribute.cpp b/code/FBXNodeAttribute.cpp index 405ce7206..1638d6751 100644 --- a/code/FBXNodeAttribute.cpp +++ b/code/FBXNodeAttribute.cpp @@ -47,9 +47,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "FBXParser.h" #include "FBXDocument.h" #include "FBXImporter.h" -#include "FBXImportSettings.h" #include "FBXDocumentUtil.h" -#include "FBXProperties.h" namespace Assimp { namespace FBX { diff --git a/code/FBXProperties.h b/code/FBXProperties.h index 60cdfe2c6..303f296aa 100644 --- a/code/FBXProperties.h +++ b/code/FBXProperties.h @@ -44,7 +44,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef INCLUDED_AI_FBX_PROPERTIES_H #define INCLUDED_AI_FBX_PROPERTIES_H -#include #include "FBXCompileConfig.h" #include diff --git a/code/FBXTokenizer.h b/code/FBXTokenizer.h index 66df3992a..0f020ac86 100644 --- a/code/FBXTokenizer.h +++ b/code/FBXTokenizer.h @@ -44,11 +44,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef INCLUDED_AI_FBX_TOKENIZER_H #define INCLUDED_AI_FBX_TOKENIZER_H -#include #include "FBXCompileConfig.h" #include #include -#include namespace Assimp { namespace FBX { diff --git a/code/FBXUtil.h b/code/FBXUtil.h index bd41834b0..7da51dac8 100644 --- a/code/FBXUtil.h +++ b/code/FBXUtil.h @@ -44,7 +44,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef INCLUDED_AI_FBX_UTIL_H #define INCLUDED_AI_FBX_UTIL_H -#include #include "FBXCompileConfig.h" #include "FBXTokenizer.h" diff --git a/code/FileLogStream.h b/code/FileLogStream.h index 574a63ed6..4650e28c5 100644 --- a/code/FileLogStream.h +++ b/code/FileLogStream.h @@ -1,3 +1,44 @@ +/* +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 FileLofStream.h +*/ #ifndef ASSIMP_FILELOGSTREAM_H_INC #define ASSIMP_FILELOGSTREAM_H_INC diff --git a/code/HMPLoader.h b/code/HMPLoader.h index 4dd0d9840..036b37894 100644 --- a/code/HMPLoader.h +++ b/code/HMPLoader.h @@ -44,11 +44,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_HMPLOADER_H_INCLUDED #define AI_HMPLOADER_H_INCLUDED -// public ASSIMP headers -#include -#include -#include - // internal headers #include "BaseImporter.h" #include "MDLLoader.h" diff --git a/code/HalfLifeFileData.h b/code/HalfLifeFileData.h index 54fe83734..9837a4e29 100644 --- a/code/HalfLifeFileData.h +++ b/code/HalfLifeFileData.h @@ -49,7 +49,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_MDLFILEHELPER2_H_INC #define AI_MDLFILEHELPER2_H_INC -#include "MDLFileData.h" #include "./../include/assimp/Compiler/pushpack1.h" namespace Assimp { diff --git a/code/IOStreamBuffer.h b/code/IOStreamBuffer.h index 8fb58e548..5208d020c 100644 --- a/code/IOStreamBuffer.h +++ b/code/IOStreamBuffer.h @@ -44,8 +44,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include "ParsingUtils.h" -#include - namespace Assimp { // --------------------------------------------------------------------------- diff --git a/code/MD2FileData.h b/code/MD2FileData.h index f7a494335..b56f6c76b 100644 --- a/code/MD2FileData.h +++ b/code/MD2FileData.h @@ -46,8 +46,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define AI_MD2FILEHELPER_H_INC #include -#include -#include #include #include diff --git a/code/RemoveComments.h b/code/RemoveComments.h index 856ed74bf..35f7774a3 100644 --- a/code/RemoveComments.h +++ b/code/RemoveComments.h @@ -44,7 +44,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_REMOVE_COMMENTS_H_INC #define AI_REMOVE_COMMENTS_H_INC -#include + #include namespace Assimp { diff --git a/code/SceneCombiner.h b/code/SceneCombiner.h index a6ba06768..196007700 100644 --- a/code/SceneCombiner.h +++ b/code/SceneCombiner.h @@ -47,7 +47,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include "Defines.h" -#include #include #include #include diff --git a/code/StandardShapes.cpp b/code/StandardShapes.cpp index eed8ddabc..bc728788b 100644 --- a/code/StandardShapes.cpp +++ b/code/StandardShapes.cpp @@ -48,7 +48,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "StandardShapes.h" #include "StringComparison.h" #include "Defines.h" -#include #include namespace Assimp { diff --git a/code/StringComparison.h b/code/StringComparison.h index 0e1dbe4b8..d3130e1cb 100644 --- a/code/StringComparison.h +++ b/code/StringComparison.h @@ -56,7 +56,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include -#include namespace Assimp { diff --git a/code/StringUtils.h b/code/StringUtils.h index 15f7db2e7..b1cfa3d13 100644 --- a/code/StringUtils.h +++ b/code/StringUtils.h @@ -40,12 +40,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef INCLUDED_AI_STRINGUTILS_H #define INCLUDED_AI_STRINGUTILS_H -#include -#include -#include -#include #include -#include /// @fn ai_snprintf /// @brief The portable version of the function snprintf ( C99 standard ), which works on visual studio compilers 2013 and earlier. diff --git a/code/Version.cpp b/code/Version.cpp index 34df01858..fd8ed622c 100644 --- a/code/Version.cpp +++ b/code/Version.cpp @@ -41,8 +41,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Actually just a dummy, used by the compiler to build the precompiled header. -#include "./../include/assimp/version.h" -#include "./../include/assimp/scene.h" +#include +#include #include "ScenePrivate.h" static const unsigned int MajorVersion = 3; @@ -55,7 +55,7 @@ static const char* LEGAL_INFORMATION = "Open Asset Import Library (Assimp).\n" "A free C/C++ library to import various 3D file formats into applications\n\n" -"(c) 2008-2016, assimp team\n" +"(c) 2008-2017, assimp team\n" "License under the terms and conditions of the 3-clause BSD license\n" "http://assimp.sourceforge.net\n" ; diff --git a/include/assimp/Importer.hpp b/include/assimp/Importer.hpp index 86023fe91..6b8c6ac46 100644 --- a/include/assimp/Importer.hpp +++ b/include/assimp/Importer.hpp @@ -52,7 +52,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Public ASSIMP data structures #include -#include namespace Assimp { // ======================================================================= diff --git a/include/assimp/LogStream.hpp b/include/assimp/LogStream.hpp index 477fe5321..03e77dba4 100644 --- a/include/assimp/LogStream.hpp +++ b/include/assimp/LogStream.hpp @@ -43,8 +43,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef INCLUDED_AI_LOGSTREAM_H #define INCLUDED_AI_LOGSTREAM_H + #include "types.h" + namespace Assimp { + class IOSystem; // ------------------------------------------------------------------------------------ diff --git a/include/assimp/Logger.hpp b/include/assimp/Logger.hpp index 7f355b5bf..655957bab 100644 --- a/include/assimp/Logger.hpp +++ b/include/assimp/Logger.hpp @@ -45,7 +45,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define INCLUDED_AI_LOGGER_H #include "types.h" -namespace Assimp { + +namespace Assimp { + class LogStream; // Maximum length of a log message. Longer messages are rejected. diff --git a/include/assimp/NullLogger.hpp b/include/assimp/NullLogger.hpp index 64b59a4a0..357ffc499 100644 --- a/include/assimp/NullLogger.hpp +++ b/include/assimp/NullLogger.hpp @@ -46,7 +46,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define INCLUDED_AI_NULLLOGGER_H #include "Logger.hpp" -namespace Assimp { + +namespace Assimp { + // --------------------------------------------------------------------------- /** @brief CPP-API: Empty logging implementation. * diff --git a/include/assimp/cexport.h b/include/assimp/cexport.h index f77d23c05..44b06fb3c 100644 --- a/include/assimp/cexport.h +++ b/include/assimp/cexport.h @@ -49,7 +49,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef ASSIMP_BUILD_NO_EXPORT // Public ASSIMP data structures -#include #include #ifdef __cplusplus diff --git a/include/assimp/cimport.h b/include/assimp/cimport.h index 6d3fa4aea..8bb47750a 100644 --- a/include/assimp/cimport.h +++ b/include/assimp/cimport.h @@ -46,7 +46,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_ASSIMP_H_INC #define AI_ASSIMP_H_INC -#include #include #include "importerdesc.h" From e6dcad384a16e091799d8e711df9694fc5799316 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sun, 5 Mar 2017 15:05:40 +0100 Subject: [PATCH 07/22] Fix missing includes. --- CREDITS | 320 ++--- LICENSE | 156 +-- Readme.md | 286 ++--- code/BlenderScene.cpp | 3 +- code/FBXCompileConfig.h | 2 + code/FBXDocument.cpp | 2 +- code/FBXParser.cpp | 1 - code/FBXProperties.h | 4 +- code/FBXTokenizer.h | 1 + code/FBXUtil.cpp | 1 + code/res/assimp.rc | 160 +-- contrib/poly2tri/poly2tri/sweep/cdt.cc | 144 +-- contrib/poly2tri/poly2tri/sweep/sweep.cc | 1500 +++++++++++----------- test/models/OBJ/spider.obj | 76 +- 14 files changed, 1331 insertions(+), 1325 deletions(-) diff --git a/CREDITS b/CREDITS index 1cfe4f640..744173cc7 100644 --- a/CREDITS +++ b/CREDITS @@ -1,160 +1,160 @@ -=============================================================== -Open Asset Import Library (Assimp) -Developers and Contributors -=============================================================== - -The following is a non-exhaustive list of all constributors over the years. -If you think your name should be listed here, drop us a line and we'll add you. - -- Alexander Gessler, -3DS-, BLEND-, ASE-, DXF-, HMP-, MDL-, MD2-, MD3-, MD5-, MDC-, NFF-, PLY-, STL-, RAW-, OFF-, MS3D-, Q3D- and LWO-Loader, Assimp-Viewer, assimp-cmd, -noboost, Website (Design). - -- Thomas Schulze, -X-, Collada-, BVH-Loader, Postprocessing framework. Data structure & Interface design, documentation. - -- Kim Kulling, -Obj-, Q3BSD-, OpenGEX-Loader, Logging system, CMake-build-environment, Linux-build, Website ( Admin ), Coverity ( Admin ), Glitter ( Admin ). - -- R.Schmidt, -Linux build, eclipse support. - -- Matthias Gubisch, -Assimp.net -Visual Studio 9 support, bugfixes. - -- Mark Sibly -B3D-Loader, Assimp testing - -- Jonathan Klein -Ogre Loader, VC2010 fixes and CMake fixes. - -- Sebastian Hempel, -PyAssimp (first version) -Compile-Bugfixes for mingw, add environment for static library support in make. - -- Jonathan Pokrass -Supplied a bugfix concerning the scaling in the md3 loader. - -- Andrew Galante, -Submitted patches to make Assimp compile with GCC-4, a makefile and the xcode3 workspace. - -- Andreas Nagel -First Assimp testing & verification under Windows Vista 64 Bit. - -- Marius Schr�der -Allowed us to use many of his models for screenshots and testing. - -- Christian Schubert -Supplied various XFiles for testing purposes. - -- Tizian Wieland -Searched the web for hundreds of test models for internal use - -- John Connors -Supplied patches for linux and SCons. - -- T. R. -The GUY who performed some of the CSM mocaps. - -- Andy Maloney -Contributed fixes for the documentation and the doxygen markup - -- Zhao Lei -Contributed several bugfixes fixing memory leaks and improving float parsing - -- sueastside -Updated PyAssimp to the latest Assimp data structures and provided a script to keep the Python binding up-to-date. - -- Tobias Rittig -Collada testing with Cinema 4D - -- Brad Grantham -Improvements in OpenGL-Sample. - -- Robert Ramirez -Add group loading feature to Obj-Loader. - -- Chris Maiwald -Many bugreports, improving Assimp's portability, regular testing & feedback. - -- Stepan Hrbek -Bugreport and fix for a obj-materialloader crash. - -- David Nadlinger -D bindings, CMake install support. - -- Dario Accornero -Contributed several patches regarding Mac OS/XCode targets, bug reports. - -- Martin Walser (Samhayne) -Contributed the 'SimpleTexturedOpenGl' sample. - -- Matthias Fauconneau -Contributed a fix for the Q3-BSP loader. - -- J�rgen P. Tjern� -Contributed updated and improved xcode workspaces - -- drparallax -Contributed the /samples/SimpleAssimpViewX sample - -- Carsten Fuchs -Contributed a fix for the Normalize method in aiQuaternion. - -- dbburgess -Contributes a Android-specific build issue: log the hardware architecture for ARM. - -- alfiereinre7 -Contributes a obj-fileparser fix: missing tokens in the obj-token list. - -- Roman Kharitonov -Contributes a fix for the configure script environment. - -- Ed Diana -Contributed AssimpDelphi (/port/AssimpDelphi). - -- rdb -Contributes a bundle of fixes and improvements for the bsp-importer. - -- Mick P -For contributing the De-bone postprocessing step and filing various bug reports. - -- Rosen Diankov -Contributed patches to build assimp debian packages using cmake. - -- Mark Page -Contributed a patch to fix the VertexTriangleAdjacency postprocessing step. - -- IOhannes -Contributed the Debian build fixes ( architecture macro ). - -- gellule -Several LWO and LWS fixes (pivoting). - -- Marcel Metz -GCC/Linux fixes for the SimpleOpenGL sample. - -- Brian Miller -Bugfix for a compiler fix for iOS on arm. - -- S�verin Lemaignan -Rewrite of PyAssimp, distutils and Python3 support - -- albert-wang -Bugfixes for the collada parser - -- Ya ping Jin -Bugfixes for uv-tanget calculation. - -- Jonne Nauha -Ogre Binary format support - -- Filip Wasil, Tieto Poland Sp. z o.o. -Android JNI asset extraction support - -- Richard Steffen -Contributed ExportProperties interface -Contributed X File exporter -Contributed Step (stp) exporter - - +=============================================================== +Open Asset Import Library (Assimp) +Developers and Contributors +=============================================================== + +The following is a non-exhaustive list of all constributors over the years. +If you think your name should be listed here, drop us a line and we'll add you. + +- Alexander Gessler, +3DS-, BLEND-, ASE-, DXF-, HMP-, MDL-, MD2-, MD3-, MD5-, MDC-, NFF-, PLY-, STL-, RAW-, OFF-, MS3D-, Q3D- and LWO-Loader, Assimp-Viewer, assimp-cmd, -noboost, Website (Design). + +- Thomas Schulze, +X-, Collada-, BVH-Loader, Postprocessing framework. Data structure & Interface design, documentation. + +- Kim Kulling, +Obj-, Q3BSD-, OpenGEX-Loader, Logging system, CMake-build-environment, Linux-build, Website ( Admin ), Coverity ( Admin ), Glitter ( Admin ). + +- R.Schmidt, +Linux build, eclipse support. + +- Matthias Gubisch, +Assimp.net +Visual Studio 9 support, bugfixes. + +- Mark Sibly +B3D-Loader, Assimp testing + +- Jonathan Klein +Ogre Loader, VC2010 fixes and CMake fixes. + +- Sebastian Hempel, +PyAssimp (first version) +Compile-Bugfixes for mingw, add environment for static library support in make. + +- Jonathan Pokrass +Supplied a bugfix concerning the scaling in the md3 loader. + +- Andrew Galante, +Submitted patches to make Assimp compile with GCC-4, a makefile and the xcode3 workspace. + +- Andreas Nagel +First Assimp testing & verification under Windows Vista 64 Bit. + +- Marius Schr�der +Allowed us to use many of his models for screenshots and testing. + +- Christian Schubert +Supplied various XFiles for testing purposes. + +- Tizian Wieland +Searched the web for hundreds of test models for internal use + +- John Connors +Supplied patches for linux and SCons. + +- T. R. +The GUY who performed some of the CSM mocaps. + +- Andy Maloney +Contributed fixes for the documentation and the doxygen markup + +- Zhao Lei +Contributed several bugfixes fixing memory leaks and improving float parsing + +- sueastside +Updated PyAssimp to the latest Assimp data structures and provided a script to keep the Python binding up-to-date. + +- Tobias Rittig +Collada testing with Cinema 4D + +- Brad Grantham +Improvements in OpenGL-Sample. + +- Robert Ramirez +Add group loading feature to Obj-Loader. + +- Chris Maiwald +Many bugreports, improving Assimp's portability, regular testing & feedback. + +- Stepan Hrbek +Bugreport and fix for a obj-materialloader crash. + +- David Nadlinger +D bindings, CMake install support. + +- Dario Accornero +Contributed several patches regarding Mac OS/XCode targets, bug reports. + +- Martin Walser (Samhayne) +Contributed the 'SimpleTexturedOpenGl' sample. + +- Matthias Fauconneau +Contributed a fix for the Q3-BSP loader. + +- J�rgen P. Tjern� +Contributed updated and improved xcode workspaces + +- drparallax +Contributed the /samples/SimpleAssimpViewX sample + +- Carsten Fuchs +Contributed a fix for the Normalize method in aiQuaternion. + +- dbburgess +Contributes a Android-specific build issue: log the hardware architecture for ARM. + +- alfiereinre7 +Contributes a obj-fileparser fix: missing tokens in the obj-token list. + +- Roman Kharitonov +Contributes a fix for the configure script environment. + +- Ed Diana +Contributed AssimpDelphi (/port/AssimpDelphi). + +- rdb +Contributes a bundle of fixes and improvements for the bsp-importer. + +- Mick P +For contributing the De-bone postprocessing step and filing various bug reports. + +- Rosen Diankov +Contributed patches to build assimp debian packages using cmake. + +- Mark Page +Contributed a patch to fix the VertexTriangleAdjacency postprocessing step. + +- IOhannes +Contributed the Debian build fixes ( architecture macro ). + +- gellule +Several LWO and LWS fixes (pivoting). + +- Marcel Metz +GCC/Linux fixes for the SimpleOpenGL sample. + +- Brian Miller +Bugfix for a compiler fix for iOS on arm. + +- S�verin Lemaignan +Rewrite of PyAssimp, distutils and Python3 support + +- albert-wang +Bugfixes for the collada parser + +- Ya ping Jin +Bugfixes for uv-tanget calculation. + +- Jonne Nauha +Ogre Binary format support + +- Filip Wasil, Tieto Poland Sp. z o.o. +Android JNI asset extraction support + +- Richard Steffen +Contributed ExportProperties interface +Contributed X File exporter +Contributed Step (stp) exporter + + diff --git a/LICENSE b/LICENSE index c8e47b34a..262606aff 100644 --- a/LICENSE +++ b/LICENSE @@ -1,78 +1,78 @@ -Open Asset Import Library (assimp) - -Copyright (c) 2006-2016, 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. - - - -****************************************************************************** - -AN EXCEPTION applies to all files in the ./test/models-nonbsd folder. -These are 3d models for testing purposes, from various free sources -on the internet. They are - unless otherwise stated - copyright of -their respective creators, which may impose additional requirements -on the use of their work. For any of these models, see -.source.txt for more legal information. Contact us if you -are a copyright holder and believe that we credited you inproperly or -if you don't want your files to appear in the repository. - - -****************************************************************************** - -Poly2Tri Copyright (c) 2009-2010, Poly2Tri Contributors -http://code.google.com/p/poly2tri/ - -All rights reserved. -Redistribution and use 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 Poly2Tri nor the names of its contributors may be - used to endorse or promote products derived from this software without specific - prior written permission. - -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. +Open Asset Import Library (assimp) + +Copyright (c) 2006-2016, 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. + + + +****************************************************************************** + +AN EXCEPTION applies to all files in the ./test/models-nonbsd folder. +These are 3d models for testing purposes, from various free sources +on the internet. They are - unless otherwise stated - copyright of +their respective creators, which may impose additional requirements +on the use of their work. For any of these models, see +.source.txt for more legal information. Contact us if you +are a copyright holder and believe that we credited you inproperly or +if you don't want your files to appear in the repository. + + +****************************************************************************** + +Poly2Tri Copyright (c) 2009-2010, Poly2Tri Contributors +http://code.google.com/p/poly2tri/ + +All rights reserved. +Redistribution and use 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 Poly2Tri nor the names of its contributors may be + used to endorse or promote products derived from this software without specific + prior written permission. + +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. diff --git a/Readme.md b/Readme.md index 6b33168f2..af8225bda 100644 --- a/Readme.md +++ b/Readme.md @@ -1,143 +1,143 @@ -Open Asset Import Library (assimp) -================================== - -[![Linux Build Status](https://travis-ci.org/assimp/assimp.svg)](https://travis-ci.org/assimp/assimp) -[![Windows Build Status](https://ci.appveyor.com/api/projects/status/tmo433wax6u6cjp4?svg=true)](https://ci.appveyor.com/project/kimkulling/assimp) - - Coverity Scan Build Status - -[![Coverage Status](https://coveralls.io/repos/github/assimp/assimp/badge.svg?branch=master)](https://coveralls.io/github/assimp/assimp?branch=master) -
- -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. - -This is the development trunk containing the latest features and bugfixes. For productive use though, we recommend one of the stable releases available from [assimp.sf.net](http://assimp.sf.net) or from *nix package repositories. -The current build status is: - -Gitter chat: [![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)
-__[open3mod](https://github.com/acgessler/open3mod) is a powerful 3D model viewer based on Assimp's import and export abilities.__ - -Please check our Wiki as well: https://github.com/assimp/assimp/wiki - -#### Supported file formats #### - -A full list [is here](http://assimp.org/main_features_formats.html). -__Importers__: - -- 3DS -- BLEND (Blender) -- DAE/Collada -- FBX -- IFC-STEP -- ASE -- DXF -- HMP -- MD2 -- MD3 -- MD5 -- MDC -- MDL -- NFF -- PLY -- STL -- X -- OBJ -- OpenGEX -- SMD -- LWO -- LXO -- LWS -- TER -- AC3D -- MS3D -- COB -- Q3BSP -- XGL -- CSM -- BVH -- B3D -- NDO -- Ogre Binary -- Ogre XML -- Q3D -- ASSBIN (Assimp custom format) -- glTF (partial) -- 3MF - -Additionally, some formats are supported by dependency on non-free code or external SDKs (not built by default): - -- C4D (https://github.com/acgessler/assimp-cinema4d) - -__Exporters__: - -- DAE (Collada) -- STL -- OBJ -- PLY -- X -- 3DS -- JSON (for WebGl, via https://github.com/acgessler/assimp2json) -- ASSBIN -- STEP -- glTF (partial) - -### Building ### -Take a look into the `INSTALL` file. Our build system is CMake, if you used CMake before there is a good chance you know what to do. - -### Ports ### -* [Android](port/AndroidJNI/README.md) -* [Python](port/PyAssimp/README.md) -* [.NET](port/AssimpNET/Readme.md) -* [Pascal](port/AssimpPascal/Readme.md) -* [Javascript (Alpha)](https://github.com/makc/assimp2json) - -#### Repository structure #### -Open Asset Import Library is implemented in C++. The directory structure is: - - /code Source code - /contrib Third-party libraries - /doc Documentation (doxysource and pre-compiled docs) - /include Public header C and C++ header files - /scripts Scripts 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 - /workspaces Build environments for vc,xcode,... (deprecated, - CMake has superseeded all legacy build options!) - - -### Where to get help ### -For more information, visit [our website](http://assimp.org/). Or check out the `./doc`- folder, which contains the official documentation in HTML format. -(CHMs for Windows are included in some release packages and should be located right here in the root folder). - -If the docs don't solve your problem, ask on [StackOverflow](http://stackoverflow.com/questions/tagged/assimp?sort=newest). If you think you found a bug, please open an issue on Github. - -For development discussions, there is also a (very low-volume) mailing list, _assimp-discussions_ - [(subscribe here)]( https://lists.sourceforge.net/lists/listinfo/assimp-discussions) - -Open Asset Import Library is a library to load various 3d file formats into a shared, in-memory format. It supports more than __40 file formats__ for import and a growing selection of file formats for export. - -And we also have a Gitter-channel:Gitter [![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)
- -### Contributing ### -Contributions to assimp are highly appreciated. The easiest way to get involved is to submit -a pull request with your changes against the main repository's `master` branch. - -### Donate ### -If you like assimp, consider buying us a beer (or two): -[Donate](http://sourceforge.net/donate/index.php?group_id=226462) - -### License ### -Our license is based on the modified, __3-clause BSD__-License. - -An _informal_ summary is: do whatever you want, but include Assimp's license text with your product - -and don't sue us if our code doesn't work. Note that, unlike LGPLed code, you may link statically to Assimp. -For the legal details, see the `LICENSE` file. - -### Why this name ### -Sorry, we're germans :-), no english native speakers ... +Open Asset Import Library (assimp) +================================== + +[![Linux Build Status](https://travis-ci.org/assimp/assimp.svg)](https://travis-ci.org/assimp/assimp) +[![Windows Build Status](https://ci.appveyor.com/api/projects/status/tmo433wax6u6cjp4?svg=true)](https://ci.appveyor.com/project/kimkulling/assimp) + + Coverity Scan Build Status + +[![Coverage Status](https://coveralls.io/repos/github/assimp/assimp/badge.svg?branch=master)](https://coveralls.io/github/assimp/assimp?branch=master) +
+ +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. + +This is the development trunk containing the latest features and bugfixes. For productive use though, we recommend one of the stable releases available from [assimp.sf.net](http://assimp.sf.net) or from *nix package repositories. +The current build status is: + +Gitter chat: [![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)
+__[open3mod](https://github.com/acgessler/open3mod) is a powerful 3D model viewer based on Assimp's import and export abilities.__ + +Please check our Wiki as well: https://github.com/assimp/assimp/wiki + +#### Supported file formats #### + +A full list [is here](http://assimp.org/main_features_formats.html). +__Importers__: + +- 3DS +- BLEND (Blender) +- DAE/Collada +- FBX +- IFC-STEP +- ASE +- DXF +- HMP +- MD2 +- MD3 +- MD5 +- MDC +- MDL +- NFF +- PLY +- STL +- X +- OBJ +- OpenGEX +- SMD +- LWO +- LXO +- LWS +- TER +- AC3D +- MS3D +- COB +- Q3BSP +- XGL +- CSM +- BVH +- B3D +- NDO +- Ogre Binary +- Ogre XML +- Q3D +- ASSBIN (Assimp custom format) +- glTF (partial) +- 3MF + +Additionally, some formats are supported by dependency on non-free code or external SDKs (not built by default): + +- C4D (https://github.com/acgessler/assimp-cinema4d) + +__Exporters__: + +- DAE (Collada) +- STL +- OBJ +- PLY +- X +- 3DS +- JSON (for WebGl, via https://github.com/acgessler/assimp2json) +- ASSBIN +- STEP +- glTF (partial) + +### Building ### +Take a look into the `INSTALL` file. Our build system is CMake, if you used CMake before there is a good chance you know what to do. + +### Ports ### +* [Android](port/AndroidJNI/README.md) +* [Python](port/PyAssimp/README.md) +* [.NET](port/AssimpNET/Readme.md) +* [Pascal](port/AssimpPascal/Readme.md) +* [Javascript (Alpha)](https://github.com/makc/assimp2json) + +#### Repository structure #### +Open Asset Import Library is implemented in C++. The directory structure is: + + /code Source code + /contrib Third-party libraries + /doc Documentation (doxysource and pre-compiled docs) + /include Public header C and C++ header files + /scripts Scripts 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 + /workspaces Build environments for vc,xcode,... (deprecated, + CMake has superseeded all legacy build options!) + + +### Where to get help ### +For more information, visit [our website](http://assimp.org/). Or check out the `./doc`- folder, which contains the official documentation in HTML format. +(CHMs for Windows are included in some release packages and should be located right here in the root folder). + +If the docs don't solve your problem, ask on [StackOverflow](http://stackoverflow.com/questions/tagged/assimp?sort=newest). If you think you found a bug, please open an issue on Github. + +For development discussions, there is also a (very low-volume) mailing list, _assimp-discussions_ + [(subscribe here)]( https://lists.sourceforge.net/lists/listinfo/assimp-discussions) + +Open Asset Import Library is a library to load various 3d file formats into a shared, in-memory format. It supports more than __40 file formats__ for import and a growing selection of file formats for export. + +And we also have a Gitter-channel:Gitter [![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)
+ +### Contributing ### +Contributions to assimp are highly appreciated. The easiest way to get involved is to submit +a pull request with your changes against the main repository's `master` branch. + +### Donate ### +If you like assimp, consider buying us a beer (or two): +[Donate](http://sourceforge.net/donate/index.php?group_id=226462) + +### License ### +Our license is based on the modified, __3-clause BSD__-License. + +An _informal_ summary is: do whatever you want, but include Assimp's license text with your product - +and don't sue us if our code doesn't work. Note that, unlike LGPLed code, you may link statically to Assimp. +For the legal details, see the `LICENSE` file. + +### Why this name ### +Sorry, we're germans :-), no english native speakers ... diff --git a/code/BlenderScene.cpp b/code/BlenderScene.cpp index b5ed862dc..b9068329b 100644 --- a/code/BlenderScene.cpp +++ b/code/BlenderScene.cpp @@ -44,8 +44,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef ASSIMP_BUILD_NO_BLEND_IMPORTER -#include "BlenderDNA.h" #include "BlenderScene.h" +#include "BlenderSceneGen.h" +#include "BlenderDNA.h" using namespace Assimp; using namespace Assimp::Blender; diff --git a/code/FBXCompileConfig.h b/code/FBXCompileConfig.h index 901f5b330..c3934e0c8 100644 --- a/code/FBXCompileConfig.h +++ b/code/FBXCompileConfig.h @@ -44,6 +44,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef INCLUDED_AI_FBX_COMPILECONFIG_H #define INCLUDED_AI_FBX_COMPILECONFIG_H +#include + // #if _MSC_VER > 1500 || (defined __GNUC___) # define ASSIMP_FBX_USE_UNORDERED_MULTIMAP diff --git a/code/FBXDocument.cpp b/code/FBXDocument.cpp index 49ce0314a..0d5e24f96 100644 --- a/code/FBXDocument.cpp +++ b/code/FBXDocument.cpp @@ -55,7 +55,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include - +#include namespace Assimp { namespace FBX { diff --git a/code/FBXParser.cpp b/code/FBXParser.cpp index 8e9d40beb..6562ef41d 100644 --- a/code/FBXParser.cpp +++ b/code/FBXParser.cpp @@ -51,7 +51,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # include "../contrib/zlib/zlib.h" #endif - #include "FBXTokenizer.h" #include "FBXParser.h" #include "FBXUtil.h" diff --git a/code/FBXProperties.h b/code/FBXProperties.h index 303f296aa..ed7af673d 100644 --- a/code/FBXProperties.h +++ b/code/FBXProperties.h @@ -46,11 +46,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "FBXCompileConfig.h" #include +#include namespace Assimp { namespace FBX { - class Element; +// Forward declarations +class Element; /** Represents a dynamic property. Type info added by deriving classes, diff --git a/code/FBXTokenizer.h b/code/FBXTokenizer.h index 0f020ac86..3b60142e4 100644 --- a/code/FBXTokenizer.h +++ b/code/FBXTokenizer.h @@ -47,6 +47,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "FBXCompileConfig.h" #include #include +#include namespace Assimp { namespace FBX { diff --git a/code/FBXUtil.cpp b/code/FBXUtil.cpp index 601d5e214..280349d20 100644 --- a/code/FBXUtil.cpp +++ b/code/FBXUtil.cpp @@ -46,6 +46,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "FBXTokenizer.h" #include "TinyFormatter.h" +#include #ifndef ASSIMP_BUILD_NO_FBX_IMPORTER diff --git a/code/res/assimp.rc b/code/res/assimp.rc index 78f9d852b..0fe98c05d 100644 --- a/code/res/assimp.rc +++ b/code/res/assimp.rc @@ -1,80 +1,80 @@ -// Microsoft Visual C++ generated resource script. -// -#include "resource.h" -#include "..\..\revision.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#define APSTUDIO_HIDDEN_SYMBOLS -#include "windows.h" -#undef APSTUDIO_HIDDEN_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// Deutsch (Deutschland) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU) -#ifdef _WIN32 -LANGUAGE LANG_GERMAN, SUBLANG_GERMAN -#pragma code_page(1252) -#endif //_WIN32 - - -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,1,SVNRevision, 0 - PRODUCTVERSION 1,1,SVNRevision,0 - FILEFLAGSMASK 0x17L -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x4L - FILETYPE 0x7L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040704b0" - BEGIN - VALUE "Comments", "Licensed under a 3-clause BSD license" - VALUE "CompanyName", "assimp team" - VALUE "FileDescription", "Open Asset Import Library" - VALUE "FileVersion", 1,1,SVNRevision,0 - VALUE "InternalName", "assimp " - VALUE "LegalCopyright", "Copyright (C) 2006-2010" - VALUE "OriginalFilename", "assimpNN.dll" - VALUE "ProductName", "Open Asset Import Library" - VALUE "ProductVersion", 1,1,SVNRevision,0 - ,0 - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x407, 1200 - END -END - -#endif // Deutsch (Deutschland) resources -///////////////////////////////////////////////////////////////////////////// - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" +#include "..\..\revision.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#define APSTUDIO_HIDDEN_SYMBOLS +#include "windows.h" +#undef APSTUDIO_HIDDEN_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// Deutsch (Deutschland) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU) +#ifdef _WIN32 +LANGUAGE LANG_GERMAN, SUBLANG_GERMAN +#pragma code_page(1252) +#endif //_WIN32 + + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,1,SVNRevision, 0 + PRODUCTVERSION 1,1,SVNRevision,0 + FILEFLAGSMASK 0x17L +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x7L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040704b0" + BEGIN + VALUE "Comments", "Licensed under a 3-clause BSD license" + VALUE "CompanyName", "assimp team" + VALUE "FileDescription", "Open Asset Import Library" + VALUE "FileVersion", 1,1,SVNRevision,0 + VALUE "InternalName", "assimp " + VALUE "LegalCopyright", "Copyright (C) 2006-2010" + VALUE "OriginalFilename", "assimpNN.dll" + VALUE "ProductName", "Open Asset Import Library" + VALUE "ProductVersion", 1,1,SVNRevision,0 + ,0 + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x407, 1200 + END +END + +#endif // Deutsch (Deutschland) resources +///////////////////////////////////////////////////////////////////////////// + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/contrib/poly2tri/poly2tri/sweep/cdt.cc b/contrib/poly2tri/poly2tri/sweep/cdt.cc index f013e47e3..d7838257c 100644 --- a/contrib/poly2tri/poly2tri/sweep/cdt.cc +++ b/contrib/poly2tri/poly2tri/sweep/cdt.cc @@ -1,72 +1,72 @@ -/* - * Poly2Tri Copyright (c) 2009-2010, Poly2Tri Contributors - * http://code.google.com/p/poly2tri/ - * - * All rights reserved. - * - * Redistribution and use 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 Poly2Tri nor the names of its contributors may be - * used to endorse or promote products derived from this software without specific - * prior written permission. - * - * 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 "cdt.h" - -namespace p2t { - -CDT::CDT(std::vector polyline) -{ - sweep_context_ = new SweepContext(polyline); - sweep_ = new Sweep; -} - -void CDT::AddHole(std::vector polyline) -{ - sweep_context_->AddHole(polyline); -} - -void CDT::AddPoint(Point* point) { - sweep_context_->AddPoint(point); -} - -void CDT::Triangulate() -{ - sweep_->Triangulate(*sweep_context_); -} - -std::vector CDT::GetTriangles() -{ - return sweep_context_->GetTriangles(); -} - -std::list CDT::GetMap() -{ - return sweep_context_->GetMap(); -} - -CDT::~CDT() -{ - delete sweep_context_; - delete sweep_; -} - -} - +/* + * Poly2Tri Copyright (c) 2009-2010, Poly2Tri Contributors + * http://code.google.com/p/poly2tri/ + * + * All rights reserved. + * + * Redistribution and use 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 Poly2Tri nor the names of its contributors may be + * used to endorse or promote products derived from this software without specific + * prior written permission. + * + * 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 "cdt.h" + +namespace p2t { + +CDT::CDT(std::vector polyline) +{ + sweep_context_ = new SweepContext(polyline); + sweep_ = new Sweep; +} + +void CDT::AddHole(std::vector polyline) +{ + sweep_context_->AddHole(polyline); +} + +void CDT::AddPoint(Point* point) { + sweep_context_->AddPoint(point); +} + +void CDT::Triangulate() +{ + sweep_->Triangulate(*sweep_context_); +} + +std::vector CDT::GetTriangles() +{ + return sweep_context_->GetTriangles(); +} + +std::list CDT::GetMap() +{ + return sweep_context_->GetMap(); +} + +CDT::~CDT() +{ + delete sweep_context_; + delete sweep_; +} + +} + diff --git a/contrib/poly2tri/poly2tri/sweep/sweep.cc b/contrib/poly2tri/poly2tri/sweep/sweep.cc index d3e35aebf..ed7c49ac4 100644 --- a/contrib/poly2tri/poly2tri/sweep/sweep.cc +++ b/contrib/poly2tri/poly2tri/sweep/sweep.cc @@ -1,750 +1,750 @@ -/* - * Poly2Tri Copyright (c) 2009-2010, Poly2Tri Contributors - * http://code.google.com/p/poly2tri/ - * - * All rights reserved. - * - * Redistribution and use 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 Poly2Tri nor the names of its contributors may be - * used to endorse or promote products derived from this software without specific - * prior written permission. - * - * 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 -#include "sweep.h" -#include "sweep_context.h" -#include "advancing_front.h" -#include "../common/utils.h" - -namespace p2t { - -// Triangulate simple polygon with holes -void Sweep::Triangulate(SweepContext& tcx) -{ - tcx.InitTriangulation(); - tcx.CreateAdvancingFront(nodes_); - // Sweep points; build mesh - SweepPoints(tcx); - // Clean up - FinalizationPolygon(tcx); -} - -void Sweep::SweepPoints(SweepContext& tcx) -{ - for (int i = 1; i < tcx.point_count(); i++) { - Point& point = *tcx.GetPoint(i); - Node* node = &PointEvent(tcx, point); - for (unsigned int i = 0; i < point.edge_list.size(); i++) { - EdgeEvent(tcx, point.edge_list[i], node); - } - } -} - -void Sweep::FinalizationPolygon(SweepContext& tcx) -{ - // Get an Internal triangle to start with - Triangle* t = tcx.front()->head()->next->triangle; - Point* p = tcx.front()->head()->next->point; - while (!t->GetConstrainedEdgeCW(*p)) { - t = t->NeighborCCW(*p); - } - - // Collect interior triangles constrained by edges - tcx.MeshClean(*t); -} - -Node& Sweep::PointEvent(SweepContext& tcx, Point& point) -{ - Node& node = tcx.LocateNode(point); - Node& new_node = NewFrontTriangle(tcx, point, node); - - // Only need to check +epsilon since point never have smaller - // x value than node due to how we fetch nodes from the front - if (point.x <= node.point->x + EPSILON) { - Fill(tcx, node); - } - - //tcx.AddNode(new_node); - - FillAdvancingFront(tcx, new_node); - return new_node; -} - -void Sweep::EdgeEvent(SweepContext& tcx, Edge* edge, Node* node) -{ - tcx.edge_event.constrained_edge = edge; - tcx.edge_event.right = (edge->p->x > edge->q->x); - - if (IsEdgeSideOfTriangle(*node->triangle, *edge->p, *edge->q)) { - return; - } - - // For now we will do all needed filling - // TODO: integrate with flip process might give some better performance - // but for now this avoid the issue with cases that needs both flips and fills - FillEdgeEvent(tcx, edge, node); - EdgeEvent(tcx, *edge->p, *edge->q, node->triangle, *edge->q); -} - -void Sweep::EdgeEvent(SweepContext& tcx, Point& ep, Point& eq, Triangle* triangle, Point& point) -{ - if (IsEdgeSideOfTriangle(*triangle, ep, eq)) { - return; - } - - Point* p1 = triangle->PointCCW(point); - Orientation o1 = Orient2d(eq, *p1, ep); - if (o1 == COLLINEAR) { - // ASSIMP_CHANGE (aramis_acg) - throw std::runtime_error("EdgeEvent - collinear points not supported"); - if( triangle->Contains(&eq, p1)) { - triangle->MarkConstrainedEdge(&eq, p1 ); - // We are modifying the constraint maybe it would be better to - // not change the given constraint and just keep a variable for the new constraint - tcx.edge_event.constrained_edge->q = p1; - triangle = &triangle->NeighborAcross(point); - EdgeEvent( tcx, ep, *p1, triangle, *p1 ); - } else { - // ASSIMP_CHANGE (aramis_acg) - std::runtime_error("EdgeEvent - collinear points not supported"); - } - return; - } - - Point* p2 = triangle->PointCW(point); - Orientation o2 = Orient2d(eq, *p2, ep); - if (o2 == COLLINEAR) { - // ASSIMP_CHANGE (aramis_acg) - throw std::runtime_error("EdgeEvent - collinear points not supported"); - - if( triangle->Contains(&eq, p2)) { - triangle->MarkConstrainedEdge(&eq, p2 ); - // We are modifying the constraint maybe it would be better to - // not change the given constraint and just keep a variable for the new constraint - tcx.edge_event.constrained_edge->q = p2; - triangle = &triangle->NeighborAcross(point); - EdgeEvent( tcx, ep, *p2, triangle, *p2 ); - } else { - // ASSIMP_CHANGE (aramis_acg) - throw std::runtime_error("EdgeEvent - collinear points not supported"); - } - return; - } - - if (o1 == o2) { - // Need to decide if we are rotating CW or CCW to get to a triangle - // that will cross edge - if (o1 == CW) { - triangle = triangle->NeighborCCW(point); - } else{ - triangle = triangle->NeighborCW(point); - } - EdgeEvent(tcx, ep, eq, triangle, point); - } else { - // This triangle crosses constraint so lets flippin start! - FlipEdgeEvent(tcx, ep, eq, triangle, point); - } -} - -bool Sweep::IsEdgeSideOfTriangle(Triangle& triangle, Point& ep, Point& eq) -{ - int index = triangle.EdgeIndex(&ep, &eq); - - if (index != -1) { - triangle.MarkConstrainedEdge(index); - Triangle* t = triangle.GetNeighbor(index); - if (t) { - t->MarkConstrainedEdge(&ep, &eq); - } - return true; - } - return false; -} - -Node& Sweep::NewFrontTriangle(SweepContext& tcx, Point& point, Node& node) -{ - Triangle* triangle = new Triangle(point, *node.point, *node.next->point); - - triangle->MarkNeighbor(*node.triangle); - tcx.AddToMap(triangle); - - Node* new_node = new Node(point); - nodes_.push_back(new_node); - - new_node->next = node.next; - new_node->prev = &node; - node.next->prev = new_node; - node.next = new_node; - - if (!Legalize(tcx, *triangle)) { - tcx.MapTriangleToNodes(*triangle); - } - - return *new_node; -} - -void Sweep::Fill(SweepContext& tcx, Node& node) -{ - Triangle* triangle = new Triangle(*node.prev->point, *node.point, *node.next->point); - - // TODO: should copy the constrained_edge value from neighbor triangles - // for now constrained_edge values are copied during the legalize - triangle->MarkNeighbor(*node.prev->triangle); - triangle->MarkNeighbor(*node.triangle); - - tcx.AddToMap(triangle); - - // Update the advancing front - node.prev->next = node.next; - node.next->prev = node.prev; - - // If it was legalized the triangle has already been mapped - if (!Legalize(tcx, *triangle)) { - tcx.MapTriangleToNodes(*triangle); - } - -} - -void Sweep::FillAdvancingFront(SweepContext& tcx, Node& n) -{ - - // Fill right holes - Node* node = n.next; - - while (node->next) { - double angle = HoleAngle(*node); - if (angle > PI_2 || angle < -PI_2) break; - Fill(tcx, *node); - node = node->next; - } - - // Fill left holes - node = n.prev; - - while (node->prev) { - double angle = HoleAngle(*node); - if (angle > PI_2 || angle < -PI_2) break; - Fill(tcx, *node); - node = node->prev; - } - - // Fill right basins - if (n.next && n.next->next) { - double angle = BasinAngle(n); - if (angle < PI_3div4) { - FillBasin(tcx, n); - } - } -} - -double Sweep::BasinAngle(Node& node) -{ - double ax = node.point->x - node.next->next->point->x; - double ay = node.point->y - node.next->next->point->y; - return atan2(ay, ax); -} - -double Sweep::HoleAngle(Node& node) -{ - /* Complex plane - * ab = cosA +i*sinA - * ab = (ax + ay*i)(bx + by*i) = (ax*bx + ay*by) + i(ax*by-ay*bx) - * atan2(y,x) computes the principal value of the argument function - * applied to the complex number x+iy - * Where x = ax*bx + ay*by - * y = ax*by - ay*bx - */ - double ax = node.next->point->x - node.point->x; - double ay = node.next->point->y - node.point->y; - double bx = node.prev->point->x - node.point->x; - double by = node.prev->point->y - node.point->y; - return atan2(ax * by - ay * bx, ax * bx + ay * by); -} - -bool Sweep::Legalize(SweepContext& tcx, Triangle& t) -{ - // To legalize a triangle we start by finding if any of the three edges - // violate the Delaunay condition - for (int i = 0; i < 3; i++) { - if (t.delaunay_edge[i]) - continue; - - Triangle* ot = t.GetNeighbor(i); - - if (ot) { - Point* p = t.GetPoint(i); - Point* op = ot->OppositePoint(t, *p); - int oi = ot->Index(op); - - // If this is a Constrained Edge or a Delaunay Edge(only during recursive legalization) - // then we should not try to legalize - if (ot->constrained_edge[oi] || ot->delaunay_edge[oi]) { - t.constrained_edge[i] = ot->constrained_edge[oi]; - continue; - } - - bool inside = Incircle(*p, *t.PointCCW(*p), *t.PointCW(*p), *op); - - if (inside) { - // Lets mark this shared edge as Delaunay - t.delaunay_edge[i] = true; - ot->delaunay_edge[oi] = true; - - // Lets rotate shared edge one vertex CW to legalize it - RotateTrianglePair(t, *p, *ot, *op); - - // We now got one valid Delaunay Edge shared by two triangles - // This gives us 4 new edges to check for Delaunay - - // Make sure that triangle to node mapping is done only one time for a specific triangle - bool not_legalized = !Legalize(tcx, t); - if (not_legalized) { - tcx.MapTriangleToNodes(t); - } - - not_legalized = !Legalize(tcx, *ot); - if (not_legalized) - tcx.MapTriangleToNodes(*ot); - - // Reset the Delaunay edges, since they only are valid Delaunay edges - // until we add a new triangle or point. - // XXX: need to think about this. Can these edges be tried after we - // return to previous recursive level? - t.delaunay_edge[i] = false; - ot->delaunay_edge[oi] = false; - - // If triangle have been legalized no need to check the other edges since - // the recursive legalization will handles those so we can end here. - return true; - } - } - } - return false; -} - -bool Sweep::Incircle(Point& pa, Point& pb, Point& pc, Point& pd) -{ - double adx = pa.x - pd.x; - double ady = pa.y - pd.y; - double bdx = pb.x - pd.x; - double bdy = pb.y - pd.y; - - double adxbdy = adx * bdy; - double bdxady = bdx * ady; - double oabd = adxbdy - bdxady; - - if (oabd <= 0) - return false; - - double cdx = pc.x - pd.x; - double cdy = pc.y - pd.y; - - double cdxady = cdx * ady; - double adxcdy = adx * cdy; - double ocad = cdxady - adxcdy; - - if (ocad <= 0) - return false; - - double bdxcdy = bdx * cdy; - double cdxbdy = cdx * bdy; - - double alift = adx * adx + ady * ady; - double blift = bdx * bdx + bdy * bdy; - double clift = cdx * cdx + cdy * cdy; - - double det = alift * (bdxcdy - cdxbdy) + blift * ocad + clift * oabd; - - return det > 0; -} - -void Sweep::RotateTrianglePair(Triangle& t, Point& p, Triangle& ot, Point& op) -{ - Triangle* n1, *n2, *n3, *n4; - n1 = t.NeighborCCW(p); - n2 = t.NeighborCW(p); - n3 = ot.NeighborCCW(op); - n4 = ot.NeighborCW(op); - - bool ce1, ce2, ce3, ce4; - ce1 = t.GetConstrainedEdgeCCW(p); - ce2 = t.GetConstrainedEdgeCW(p); - ce3 = ot.GetConstrainedEdgeCCW(op); - ce4 = ot.GetConstrainedEdgeCW(op); - - bool de1, de2, de3, de4; - de1 = t.GetDelunayEdgeCCW(p); - de2 = t.GetDelunayEdgeCW(p); - de3 = ot.GetDelunayEdgeCCW(op); - de4 = ot.GetDelunayEdgeCW(op); - - t.Legalize(p, op); - ot.Legalize(op, p); - - // Remap delaunay_edge - ot.SetDelunayEdgeCCW(p, de1); - t.SetDelunayEdgeCW(p, de2); - t.SetDelunayEdgeCCW(op, de3); - ot.SetDelunayEdgeCW(op, de4); - - // Remap constrained_edge - ot.SetConstrainedEdgeCCW(p, ce1); - t.SetConstrainedEdgeCW(p, ce2); - t.SetConstrainedEdgeCCW(op, ce3); - ot.SetConstrainedEdgeCW(op, ce4); - - // Remap neighbors - // XXX: might optimize the markNeighbor by keeping track of - // what side should be assigned to what neighbor after the - // rotation. Now mark neighbor does lots of testing to find - // the right side. - t.ClearNeighbors(); - ot.ClearNeighbors(); - if (n1) ot.MarkNeighbor(*n1); - if (n2) t.MarkNeighbor(*n2); - if (n3) t.MarkNeighbor(*n3); - if (n4) ot.MarkNeighbor(*n4); - t.MarkNeighbor(ot); -} - -void Sweep::FillBasin(SweepContext& tcx, Node& node) -{ - if (Orient2d(*node.point, *node.next->point, *node.next->next->point) == CCW) { - tcx.basin.left_node = node.next->next; - } else { - tcx.basin.left_node = node.next; - } - - // Find the bottom and right node - tcx.basin.bottom_node = tcx.basin.left_node; - while (tcx.basin.bottom_node->next - && tcx.basin.bottom_node->point->y >= tcx.basin.bottom_node->next->point->y) { - tcx.basin.bottom_node = tcx.basin.bottom_node->next; - } - if (tcx.basin.bottom_node == tcx.basin.left_node) { - // No valid basin - return; - } - - tcx.basin.right_node = tcx.basin.bottom_node; - while (tcx.basin.right_node->next - && tcx.basin.right_node->point->y < tcx.basin.right_node->next->point->y) { - tcx.basin.right_node = tcx.basin.right_node->next; - } - if (tcx.basin.right_node == tcx.basin.bottom_node) { - // No valid basins - return; - } - - tcx.basin.width = tcx.basin.right_node->point->x - tcx.basin.left_node->point->x; - tcx.basin.left_highest = tcx.basin.left_node->point->y > tcx.basin.right_node->point->y; - - FillBasinReq(tcx, tcx.basin.bottom_node); -} - -void Sweep::FillBasinReq(SweepContext& tcx, Node* node) -{ - // if shallow stop filling - if (IsShallow(tcx, *node)) { - return; - } - - Fill(tcx, *node); - - if (node->prev == tcx.basin.left_node && node->next == tcx.basin.right_node) { - return; - } else if (node->prev == tcx.basin.left_node) { - Orientation o = Orient2d(*node->point, *node->next->point, *node->next->next->point); - if (o == CW) { - return; - } - node = node->next; - } else if (node->next == tcx.basin.right_node) { - Orientation o = Orient2d(*node->point, *node->prev->point, *node->prev->prev->point); - if (o == CCW) { - return; - } - node = node->prev; - } else { - // Continue with the neighbor node with lowest Y value - if (node->prev->point->y < node->next->point->y) { - node = node->prev; - } else { - node = node->next; - } - } - - FillBasinReq(tcx, node); -} - -bool Sweep::IsShallow(SweepContext& tcx, Node& node) -{ - double height; - - if (tcx.basin.left_highest) { - height = tcx.basin.left_node->point->y - node.point->y; - } else { - height = tcx.basin.right_node->point->y - node.point->y; - } - - // if shallow stop filling - if (tcx.basin.width > height) { - return true; - } - return false; -} - -void Sweep::FillEdgeEvent(SweepContext& tcx, Edge* edge, Node* node) -{ - if (tcx.edge_event.right) { - FillRightAboveEdgeEvent(tcx, edge, node); - } else { - FillLeftAboveEdgeEvent(tcx, edge, node); - } -} - -void Sweep::FillRightAboveEdgeEvent(SweepContext& tcx, Edge* edge, Node* node) -{ - while (node->next->point->x < edge->p->x) { - // Check if next node is below the edge - if (Orient2d(*edge->q, *node->next->point, *edge->p) == CCW) { - FillRightBelowEdgeEvent(tcx, edge, *node); - } else { - node = node->next; - } - } -} - -void Sweep::FillRightBelowEdgeEvent(SweepContext& tcx, Edge* edge, Node& node) -{ - if (node.point->x < edge->p->x) { - if (Orient2d(*node.point, *node.next->point, *node.next->next->point) == CCW) { - // Concave - FillRightConcaveEdgeEvent(tcx, edge, node); - } else{ - // Convex - FillRightConvexEdgeEvent(tcx, edge, node); - // Retry this one - FillRightBelowEdgeEvent(tcx, edge, node); - } - } -} - -void Sweep::FillRightConcaveEdgeEvent(SweepContext& tcx, Edge* edge, Node& node) -{ - Fill(tcx, *node.next); - if (node.next->point != edge->p) { - // Next above or below edge? - if (Orient2d(*edge->q, *node.next->point, *edge->p) == CCW) { - // Below - if (Orient2d(*node.point, *node.next->point, *node.next->next->point) == CCW) { - // Next is concave - FillRightConcaveEdgeEvent(tcx, edge, node); - } else { - // Next is convex - } - } - } - -} - -void Sweep::FillRightConvexEdgeEvent(SweepContext& tcx, Edge* edge, Node& node) -{ - // Next concave or convex? - if (Orient2d(*node.next->point, *node.next->next->point, *node.next->next->next->point) == CCW) { - // Concave - FillRightConcaveEdgeEvent(tcx, edge, *node.next); - } else{ - // Convex - // Next above or below edge? - if (Orient2d(*edge->q, *node.next->next->point, *edge->p) == CCW) { - // Below - FillRightConvexEdgeEvent(tcx, edge, *node.next); - } else{ - // Above - } - } -} - -void Sweep::FillLeftAboveEdgeEvent(SweepContext& tcx, Edge* edge, Node* node) -{ - while (node->prev->point->x > edge->p->x) { - // Check if next node is below the edge - if (Orient2d(*edge->q, *node->prev->point, *edge->p) == CW) { - FillLeftBelowEdgeEvent(tcx, edge, *node); - } else { - node = node->prev; - } - } -} - -void Sweep::FillLeftBelowEdgeEvent(SweepContext& tcx, Edge* edge, Node& node) -{ - if (node.point->x > edge->p->x) { - if (Orient2d(*node.point, *node.prev->point, *node.prev->prev->point) == CW) { - // Concave - FillLeftConcaveEdgeEvent(tcx, edge, node); - } else { - // Convex - FillLeftConvexEdgeEvent(tcx, edge, node); - // Retry this one - FillLeftBelowEdgeEvent(tcx, edge, node); - } - } -} - -void Sweep::FillLeftConvexEdgeEvent(SweepContext& tcx, Edge* edge, Node& node) -{ - // Next concave or convex? - if (Orient2d(*node.prev->point, *node.prev->prev->point, *node.prev->prev->prev->point) == CW) { - // Concave - FillLeftConcaveEdgeEvent(tcx, edge, *node.prev); - } else{ - // Convex - // Next above or below edge? - if (Orient2d(*edge->q, *node.prev->prev->point, *edge->p) == CW) { - // Below - FillLeftConvexEdgeEvent(tcx, edge, *node.prev); - } else{ - // Above - } - } -} - -void Sweep::FillLeftConcaveEdgeEvent(SweepContext& tcx, Edge* edge, Node& node) -{ - Fill(tcx, *node.prev); - if (node.prev->point != edge->p) { - // Next above or below edge? - if (Orient2d(*edge->q, *node.prev->point, *edge->p) == CW) { - // Below - if (Orient2d(*node.point, *node.prev->point, *node.prev->prev->point) == CW) { - // Next is concave - FillLeftConcaveEdgeEvent(tcx, edge, node); - } else{ - // Next is convex - } - } - } - -} - -void Sweep::FlipEdgeEvent(SweepContext& tcx, Point& ep, Point& eq, Triangle* t, Point& p) -{ - Triangle& ot = t->NeighborAcross(p); - Point& op = *ot.OppositePoint(*t, p); - - if (InScanArea(p, *t->PointCCW(p), *t->PointCW(p), op)) { - // Lets rotate shared edge one vertex CW - RotateTrianglePair(*t, p, ot, op); - tcx.MapTriangleToNodes(*t); - tcx.MapTriangleToNodes(ot); - - if (p == eq && op == ep) { - if (eq == *tcx.edge_event.constrained_edge->q && ep == *tcx.edge_event.constrained_edge->p) { - t->MarkConstrainedEdge(&ep, &eq); - ot.MarkConstrainedEdge(&ep, &eq); - Legalize(tcx, *t); - Legalize(tcx, ot); - } else { - // XXX: I think one of the triangles should be legalized here? - } - } else { - Orientation o = Orient2d(eq, op, ep); - t = &NextFlipTriangle(tcx, (int)o, *t, ot, p, op); - FlipEdgeEvent(tcx, ep, eq, t, p); - } - } else { - Point& newP = NextFlipPoint(ep, eq, ot, op); - FlipScanEdgeEvent(tcx, ep, eq, *t, ot, newP); - EdgeEvent(tcx, ep, eq, t, p); - } -} - -Triangle& Sweep::NextFlipTriangle(SweepContext& tcx, int o, Triangle& t, Triangle& ot, Point& p, Point& op) -{ - if (o == CCW) { - // ot is not crossing edge after flip - int edge_index = ot.EdgeIndex(&p, &op); - ot.delaunay_edge[edge_index] = true; - Legalize(tcx, ot); - ot.ClearDelunayEdges(); - return t; - } - - // t is not crossing edge after flip - int edge_index = t.EdgeIndex(&p, &op); - - t.delaunay_edge[edge_index] = true; - Legalize(tcx, t); - t.ClearDelunayEdges(); - return ot; -} - -Point& Sweep::NextFlipPoint(Point& ep, Point& eq, Triangle& ot, Point& op) -{ - Orientation o2d = Orient2d(eq, op, ep); - if (o2d == CW) { - // Right - return *ot.PointCCW(op); - } else if (o2d == CCW) { - // Left - return *ot.PointCW(op); - } else{ - //throw new RuntimeException("[Unsupported] Opposing point on constrained edge"); - // ASSIMP_CHANGE (aramis_acg) - throw std::runtime_error("[Unsupported] Opposing point on constrained edge"); - } -} - -void Sweep::FlipScanEdgeEvent(SweepContext& tcx, Point& ep, Point& eq, Triangle& flip_triangle, - Triangle& t, Point& p) -{ - Triangle& ot = t.NeighborAcross(p); - Point& op = *ot.OppositePoint(t, p); - - if (InScanArea(eq, *flip_triangle.PointCCW(eq), *flip_triangle.PointCW(eq), op)) { - // flip with new edge op->eq - FlipEdgeEvent(tcx, eq, op, &ot, op); - // TODO: Actually I just figured out that it should be possible to - // improve this by getting the next ot and op before the the above - // flip and continue the flipScanEdgeEvent here - // set new ot and op here and loop back to inScanArea test - // also need to set a new flip_triangle first - // Turns out at first glance that this is somewhat complicated - // so it will have to wait. - } else{ - Point& newP = NextFlipPoint(ep, eq, ot, op); - FlipScanEdgeEvent(tcx, ep, eq, flip_triangle, ot, newP); - } -} - -Sweep::~Sweep() { - - // Clean up memory - for(unsigned int i = 0; i < nodes_.size(); i++) { - delete nodes_[i]; - } - -} - -} - +/* + * Poly2Tri Copyright (c) 2009-2010, Poly2Tri Contributors + * http://code.google.com/p/poly2tri/ + * + * All rights reserved. + * + * Redistribution and use 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 Poly2Tri nor the names of its contributors may be + * used to endorse or promote products derived from this software without specific + * prior written permission. + * + * 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 +#include "sweep.h" +#include "sweep_context.h" +#include "advancing_front.h" +#include "../common/utils.h" + +namespace p2t { + +// Triangulate simple polygon with holes +void Sweep::Triangulate(SweepContext& tcx) +{ + tcx.InitTriangulation(); + tcx.CreateAdvancingFront(nodes_); + // Sweep points; build mesh + SweepPoints(tcx); + // Clean up + FinalizationPolygon(tcx); +} + +void Sweep::SweepPoints(SweepContext& tcx) +{ + for (int i = 1; i < tcx.point_count(); i++) { + Point& point = *tcx.GetPoint(i); + Node* node = &PointEvent(tcx, point); + for (unsigned int i = 0; i < point.edge_list.size(); i++) { + EdgeEvent(tcx, point.edge_list[i], node); + } + } +} + +void Sweep::FinalizationPolygon(SweepContext& tcx) +{ + // Get an Internal triangle to start with + Triangle* t = tcx.front()->head()->next->triangle; + Point* p = tcx.front()->head()->next->point; + while (!t->GetConstrainedEdgeCW(*p)) { + t = t->NeighborCCW(*p); + } + + // Collect interior triangles constrained by edges + tcx.MeshClean(*t); +} + +Node& Sweep::PointEvent(SweepContext& tcx, Point& point) +{ + Node& node = tcx.LocateNode(point); + Node& new_node = NewFrontTriangle(tcx, point, node); + + // Only need to check +epsilon since point never have smaller + // x value than node due to how we fetch nodes from the front + if (point.x <= node.point->x + EPSILON) { + Fill(tcx, node); + } + + //tcx.AddNode(new_node); + + FillAdvancingFront(tcx, new_node); + return new_node; +} + +void Sweep::EdgeEvent(SweepContext& tcx, Edge* edge, Node* node) +{ + tcx.edge_event.constrained_edge = edge; + tcx.edge_event.right = (edge->p->x > edge->q->x); + + if (IsEdgeSideOfTriangle(*node->triangle, *edge->p, *edge->q)) { + return; + } + + // For now we will do all needed filling + // TODO: integrate with flip process might give some better performance + // but for now this avoid the issue with cases that needs both flips and fills + FillEdgeEvent(tcx, edge, node); + EdgeEvent(tcx, *edge->p, *edge->q, node->triangle, *edge->q); +} + +void Sweep::EdgeEvent(SweepContext& tcx, Point& ep, Point& eq, Triangle* triangle, Point& point) +{ + if (IsEdgeSideOfTriangle(*triangle, ep, eq)) { + return; + } + + Point* p1 = triangle->PointCCW(point); + Orientation o1 = Orient2d(eq, *p1, ep); + if (o1 == COLLINEAR) { + // ASSIMP_CHANGE (aramis_acg) + throw std::runtime_error("EdgeEvent - collinear points not supported"); + if( triangle->Contains(&eq, p1)) { + triangle->MarkConstrainedEdge(&eq, p1 ); + // We are modifying the constraint maybe it would be better to + // not change the given constraint and just keep a variable for the new constraint + tcx.edge_event.constrained_edge->q = p1; + triangle = &triangle->NeighborAcross(point); + EdgeEvent( tcx, ep, *p1, triangle, *p1 ); + } else { + // ASSIMP_CHANGE (aramis_acg) + std::runtime_error("EdgeEvent - collinear points not supported"); + } + return; + } + + Point* p2 = triangle->PointCW(point); + Orientation o2 = Orient2d(eq, *p2, ep); + if (o2 == COLLINEAR) { + // ASSIMP_CHANGE (aramis_acg) + throw std::runtime_error("EdgeEvent - collinear points not supported"); + + if( triangle->Contains(&eq, p2)) { + triangle->MarkConstrainedEdge(&eq, p2 ); + // We are modifying the constraint maybe it would be better to + // not change the given constraint and just keep a variable for the new constraint + tcx.edge_event.constrained_edge->q = p2; + triangle = &triangle->NeighborAcross(point); + EdgeEvent( tcx, ep, *p2, triangle, *p2 ); + } else { + // ASSIMP_CHANGE (aramis_acg) + throw std::runtime_error("EdgeEvent - collinear points not supported"); + } + return; + } + + if (o1 == o2) { + // Need to decide if we are rotating CW or CCW to get to a triangle + // that will cross edge + if (o1 == CW) { + triangle = triangle->NeighborCCW(point); + } else{ + triangle = triangle->NeighborCW(point); + } + EdgeEvent(tcx, ep, eq, triangle, point); + } else { + // This triangle crosses constraint so lets flippin start! + FlipEdgeEvent(tcx, ep, eq, triangle, point); + } +} + +bool Sweep::IsEdgeSideOfTriangle(Triangle& triangle, Point& ep, Point& eq) +{ + int index = triangle.EdgeIndex(&ep, &eq); + + if (index != -1) { + triangle.MarkConstrainedEdge(index); + Triangle* t = triangle.GetNeighbor(index); + if (t) { + t->MarkConstrainedEdge(&ep, &eq); + } + return true; + } + return false; +} + +Node& Sweep::NewFrontTriangle(SweepContext& tcx, Point& point, Node& node) +{ + Triangle* triangle = new Triangle(point, *node.point, *node.next->point); + + triangle->MarkNeighbor(*node.triangle); + tcx.AddToMap(triangle); + + Node* new_node = new Node(point); + nodes_.push_back(new_node); + + new_node->next = node.next; + new_node->prev = &node; + node.next->prev = new_node; + node.next = new_node; + + if (!Legalize(tcx, *triangle)) { + tcx.MapTriangleToNodes(*triangle); + } + + return *new_node; +} + +void Sweep::Fill(SweepContext& tcx, Node& node) +{ + Triangle* triangle = new Triangle(*node.prev->point, *node.point, *node.next->point); + + // TODO: should copy the constrained_edge value from neighbor triangles + // for now constrained_edge values are copied during the legalize + triangle->MarkNeighbor(*node.prev->triangle); + triangle->MarkNeighbor(*node.triangle); + + tcx.AddToMap(triangle); + + // Update the advancing front + node.prev->next = node.next; + node.next->prev = node.prev; + + // If it was legalized the triangle has already been mapped + if (!Legalize(tcx, *triangle)) { + tcx.MapTriangleToNodes(*triangle); + } + +} + +void Sweep::FillAdvancingFront(SweepContext& tcx, Node& n) +{ + + // Fill right holes + Node* node = n.next; + + while (node->next) { + double angle = HoleAngle(*node); + if (angle > PI_2 || angle < -PI_2) break; + Fill(tcx, *node); + node = node->next; + } + + // Fill left holes + node = n.prev; + + while (node->prev) { + double angle = HoleAngle(*node); + if (angle > PI_2 || angle < -PI_2) break; + Fill(tcx, *node); + node = node->prev; + } + + // Fill right basins + if (n.next && n.next->next) { + double angle = BasinAngle(n); + if (angle < PI_3div4) { + FillBasin(tcx, n); + } + } +} + +double Sweep::BasinAngle(Node& node) +{ + double ax = node.point->x - node.next->next->point->x; + double ay = node.point->y - node.next->next->point->y; + return atan2(ay, ax); +} + +double Sweep::HoleAngle(Node& node) +{ + /* Complex plane + * ab = cosA +i*sinA + * ab = (ax + ay*i)(bx + by*i) = (ax*bx + ay*by) + i(ax*by-ay*bx) + * atan2(y,x) computes the principal value of the argument function + * applied to the complex number x+iy + * Where x = ax*bx + ay*by + * y = ax*by - ay*bx + */ + double ax = node.next->point->x - node.point->x; + double ay = node.next->point->y - node.point->y; + double bx = node.prev->point->x - node.point->x; + double by = node.prev->point->y - node.point->y; + return atan2(ax * by - ay * bx, ax * bx + ay * by); +} + +bool Sweep::Legalize(SweepContext& tcx, Triangle& t) +{ + // To legalize a triangle we start by finding if any of the three edges + // violate the Delaunay condition + for (int i = 0; i < 3; i++) { + if (t.delaunay_edge[i]) + continue; + + Triangle* ot = t.GetNeighbor(i); + + if (ot) { + Point* p = t.GetPoint(i); + Point* op = ot->OppositePoint(t, *p); + int oi = ot->Index(op); + + // If this is a Constrained Edge or a Delaunay Edge(only during recursive legalization) + // then we should not try to legalize + if (ot->constrained_edge[oi] || ot->delaunay_edge[oi]) { + t.constrained_edge[i] = ot->constrained_edge[oi]; + continue; + } + + bool inside = Incircle(*p, *t.PointCCW(*p), *t.PointCW(*p), *op); + + if (inside) { + // Lets mark this shared edge as Delaunay + t.delaunay_edge[i] = true; + ot->delaunay_edge[oi] = true; + + // Lets rotate shared edge one vertex CW to legalize it + RotateTrianglePair(t, *p, *ot, *op); + + // We now got one valid Delaunay Edge shared by two triangles + // This gives us 4 new edges to check for Delaunay + + // Make sure that triangle to node mapping is done only one time for a specific triangle + bool not_legalized = !Legalize(tcx, t); + if (not_legalized) { + tcx.MapTriangleToNodes(t); + } + + not_legalized = !Legalize(tcx, *ot); + if (not_legalized) + tcx.MapTriangleToNodes(*ot); + + // Reset the Delaunay edges, since they only are valid Delaunay edges + // until we add a new triangle or point. + // XXX: need to think about this. Can these edges be tried after we + // return to previous recursive level? + t.delaunay_edge[i] = false; + ot->delaunay_edge[oi] = false; + + // If triangle have been legalized no need to check the other edges since + // the recursive legalization will handles those so we can end here. + return true; + } + } + } + return false; +} + +bool Sweep::Incircle(Point& pa, Point& pb, Point& pc, Point& pd) +{ + double adx = pa.x - pd.x; + double ady = pa.y - pd.y; + double bdx = pb.x - pd.x; + double bdy = pb.y - pd.y; + + double adxbdy = adx * bdy; + double bdxady = bdx * ady; + double oabd = adxbdy - bdxady; + + if (oabd <= 0) + return false; + + double cdx = pc.x - pd.x; + double cdy = pc.y - pd.y; + + double cdxady = cdx * ady; + double adxcdy = adx * cdy; + double ocad = cdxady - adxcdy; + + if (ocad <= 0) + return false; + + double bdxcdy = bdx * cdy; + double cdxbdy = cdx * bdy; + + double alift = adx * adx + ady * ady; + double blift = bdx * bdx + bdy * bdy; + double clift = cdx * cdx + cdy * cdy; + + double det = alift * (bdxcdy - cdxbdy) + blift * ocad + clift * oabd; + + return det > 0; +} + +void Sweep::RotateTrianglePair(Triangle& t, Point& p, Triangle& ot, Point& op) +{ + Triangle* n1, *n2, *n3, *n4; + n1 = t.NeighborCCW(p); + n2 = t.NeighborCW(p); + n3 = ot.NeighborCCW(op); + n4 = ot.NeighborCW(op); + + bool ce1, ce2, ce3, ce4; + ce1 = t.GetConstrainedEdgeCCW(p); + ce2 = t.GetConstrainedEdgeCW(p); + ce3 = ot.GetConstrainedEdgeCCW(op); + ce4 = ot.GetConstrainedEdgeCW(op); + + bool de1, de2, de3, de4; + de1 = t.GetDelunayEdgeCCW(p); + de2 = t.GetDelunayEdgeCW(p); + de3 = ot.GetDelunayEdgeCCW(op); + de4 = ot.GetDelunayEdgeCW(op); + + t.Legalize(p, op); + ot.Legalize(op, p); + + // Remap delaunay_edge + ot.SetDelunayEdgeCCW(p, de1); + t.SetDelunayEdgeCW(p, de2); + t.SetDelunayEdgeCCW(op, de3); + ot.SetDelunayEdgeCW(op, de4); + + // Remap constrained_edge + ot.SetConstrainedEdgeCCW(p, ce1); + t.SetConstrainedEdgeCW(p, ce2); + t.SetConstrainedEdgeCCW(op, ce3); + ot.SetConstrainedEdgeCW(op, ce4); + + // Remap neighbors + // XXX: might optimize the markNeighbor by keeping track of + // what side should be assigned to what neighbor after the + // rotation. Now mark neighbor does lots of testing to find + // the right side. + t.ClearNeighbors(); + ot.ClearNeighbors(); + if (n1) ot.MarkNeighbor(*n1); + if (n2) t.MarkNeighbor(*n2); + if (n3) t.MarkNeighbor(*n3); + if (n4) ot.MarkNeighbor(*n4); + t.MarkNeighbor(ot); +} + +void Sweep::FillBasin(SweepContext& tcx, Node& node) +{ + if (Orient2d(*node.point, *node.next->point, *node.next->next->point) == CCW) { + tcx.basin.left_node = node.next->next; + } else { + tcx.basin.left_node = node.next; + } + + // Find the bottom and right node + tcx.basin.bottom_node = tcx.basin.left_node; + while (tcx.basin.bottom_node->next + && tcx.basin.bottom_node->point->y >= tcx.basin.bottom_node->next->point->y) { + tcx.basin.bottom_node = tcx.basin.bottom_node->next; + } + if (tcx.basin.bottom_node == tcx.basin.left_node) { + // No valid basin + return; + } + + tcx.basin.right_node = tcx.basin.bottom_node; + while (tcx.basin.right_node->next + && tcx.basin.right_node->point->y < tcx.basin.right_node->next->point->y) { + tcx.basin.right_node = tcx.basin.right_node->next; + } + if (tcx.basin.right_node == tcx.basin.bottom_node) { + // No valid basins + return; + } + + tcx.basin.width = tcx.basin.right_node->point->x - tcx.basin.left_node->point->x; + tcx.basin.left_highest = tcx.basin.left_node->point->y > tcx.basin.right_node->point->y; + + FillBasinReq(tcx, tcx.basin.bottom_node); +} + +void Sweep::FillBasinReq(SweepContext& tcx, Node* node) +{ + // if shallow stop filling + if (IsShallow(tcx, *node)) { + return; + } + + Fill(tcx, *node); + + if (node->prev == tcx.basin.left_node && node->next == tcx.basin.right_node) { + return; + } else if (node->prev == tcx.basin.left_node) { + Orientation o = Orient2d(*node->point, *node->next->point, *node->next->next->point); + if (o == CW) { + return; + } + node = node->next; + } else if (node->next == tcx.basin.right_node) { + Orientation o = Orient2d(*node->point, *node->prev->point, *node->prev->prev->point); + if (o == CCW) { + return; + } + node = node->prev; + } else { + // Continue with the neighbor node with lowest Y value + if (node->prev->point->y < node->next->point->y) { + node = node->prev; + } else { + node = node->next; + } + } + + FillBasinReq(tcx, node); +} + +bool Sweep::IsShallow(SweepContext& tcx, Node& node) +{ + double height; + + if (tcx.basin.left_highest) { + height = tcx.basin.left_node->point->y - node.point->y; + } else { + height = tcx.basin.right_node->point->y - node.point->y; + } + + // if shallow stop filling + if (tcx.basin.width > height) { + return true; + } + return false; +} + +void Sweep::FillEdgeEvent(SweepContext& tcx, Edge* edge, Node* node) +{ + if (tcx.edge_event.right) { + FillRightAboveEdgeEvent(tcx, edge, node); + } else { + FillLeftAboveEdgeEvent(tcx, edge, node); + } +} + +void Sweep::FillRightAboveEdgeEvent(SweepContext& tcx, Edge* edge, Node* node) +{ + while (node->next->point->x < edge->p->x) { + // Check if next node is below the edge + if (Orient2d(*edge->q, *node->next->point, *edge->p) == CCW) { + FillRightBelowEdgeEvent(tcx, edge, *node); + } else { + node = node->next; + } + } +} + +void Sweep::FillRightBelowEdgeEvent(SweepContext& tcx, Edge* edge, Node& node) +{ + if (node.point->x < edge->p->x) { + if (Orient2d(*node.point, *node.next->point, *node.next->next->point) == CCW) { + // Concave + FillRightConcaveEdgeEvent(tcx, edge, node); + } else{ + // Convex + FillRightConvexEdgeEvent(tcx, edge, node); + // Retry this one + FillRightBelowEdgeEvent(tcx, edge, node); + } + } +} + +void Sweep::FillRightConcaveEdgeEvent(SweepContext& tcx, Edge* edge, Node& node) +{ + Fill(tcx, *node.next); + if (node.next->point != edge->p) { + // Next above or below edge? + if (Orient2d(*edge->q, *node.next->point, *edge->p) == CCW) { + // Below + if (Orient2d(*node.point, *node.next->point, *node.next->next->point) == CCW) { + // Next is concave + FillRightConcaveEdgeEvent(tcx, edge, node); + } else { + // Next is convex + } + } + } + +} + +void Sweep::FillRightConvexEdgeEvent(SweepContext& tcx, Edge* edge, Node& node) +{ + // Next concave or convex? + if (Orient2d(*node.next->point, *node.next->next->point, *node.next->next->next->point) == CCW) { + // Concave + FillRightConcaveEdgeEvent(tcx, edge, *node.next); + } else{ + // Convex + // Next above or below edge? + if (Orient2d(*edge->q, *node.next->next->point, *edge->p) == CCW) { + // Below + FillRightConvexEdgeEvent(tcx, edge, *node.next); + } else{ + // Above + } + } +} + +void Sweep::FillLeftAboveEdgeEvent(SweepContext& tcx, Edge* edge, Node* node) +{ + while (node->prev->point->x > edge->p->x) { + // Check if next node is below the edge + if (Orient2d(*edge->q, *node->prev->point, *edge->p) == CW) { + FillLeftBelowEdgeEvent(tcx, edge, *node); + } else { + node = node->prev; + } + } +} + +void Sweep::FillLeftBelowEdgeEvent(SweepContext& tcx, Edge* edge, Node& node) +{ + if (node.point->x > edge->p->x) { + if (Orient2d(*node.point, *node.prev->point, *node.prev->prev->point) == CW) { + // Concave + FillLeftConcaveEdgeEvent(tcx, edge, node); + } else { + // Convex + FillLeftConvexEdgeEvent(tcx, edge, node); + // Retry this one + FillLeftBelowEdgeEvent(tcx, edge, node); + } + } +} + +void Sweep::FillLeftConvexEdgeEvent(SweepContext& tcx, Edge* edge, Node& node) +{ + // Next concave or convex? + if (Orient2d(*node.prev->point, *node.prev->prev->point, *node.prev->prev->prev->point) == CW) { + // Concave + FillLeftConcaveEdgeEvent(tcx, edge, *node.prev); + } else{ + // Convex + // Next above or below edge? + if (Orient2d(*edge->q, *node.prev->prev->point, *edge->p) == CW) { + // Below + FillLeftConvexEdgeEvent(tcx, edge, *node.prev); + } else{ + // Above + } + } +} + +void Sweep::FillLeftConcaveEdgeEvent(SweepContext& tcx, Edge* edge, Node& node) +{ + Fill(tcx, *node.prev); + if (node.prev->point != edge->p) { + // Next above or below edge? + if (Orient2d(*edge->q, *node.prev->point, *edge->p) == CW) { + // Below + if (Orient2d(*node.point, *node.prev->point, *node.prev->prev->point) == CW) { + // Next is concave + FillLeftConcaveEdgeEvent(tcx, edge, node); + } else{ + // Next is convex + } + } + } + +} + +void Sweep::FlipEdgeEvent(SweepContext& tcx, Point& ep, Point& eq, Triangle* t, Point& p) +{ + Triangle& ot = t->NeighborAcross(p); + Point& op = *ot.OppositePoint(*t, p); + + if (InScanArea(p, *t->PointCCW(p), *t->PointCW(p), op)) { + // Lets rotate shared edge one vertex CW + RotateTrianglePair(*t, p, ot, op); + tcx.MapTriangleToNodes(*t); + tcx.MapTriangleToNodes(ot); + + if (p == eq && op == ep) { + if (eq == *tcx.edge_event.constrained_edge->q && ep == *tcx.edge_event.constrained_edge->p) { + t->MarkConstrainedEdge(&ep, &eq); + ot.MarkConstrainedEdge(&ep, &eq); + Legalize(tcx, *t); + Legalize(tcx, ot); + } else { + // XXX: I think one of the triangles should be legalized here? + } + } else { + Orientation o = Orient2d(eq, op, ep); + t = &NextFlipTriangle(tcx, (int)o, *t, ot, p, op); + FlipEdgeEvent(tcx, ep, eq, t, p); + } + } else { + Point& newP = NextFlipPoint(ep, eq, ot, op); + FlipScanEdgeEvent(tcx, ep, eq, *t, ot, newP); + EdgeEvent(tcx, ep, eq, t, p); + } +} + +Triangle& Sweep::NextFlipTriangle(SweepContext& tcx, int o, Triangle& t, Triangle& ot, Point& p, Point& op) +{ + if (o == CCW) { + // ot is not crossing edge after flip + int edge_index = ot.EdgeIndex(&p, &op); + ot.delaunay_edge[edge_index] = true; + Legalize(tcx, ot); + ot.ClearDelunayEdges(); + return t; + } + + // t is not crossing edge after flip + int edge_index = t.EdgeIndex(&p, &op); + + t.delaunay_edge[edge_index] = true; + Legalize(tcx, t); + t.ClearDelunayEdges(); + return ot; +} + +Point& Sweep::NextFlipPoint(Point& ep, Point& eq, Triangle& ot, Point& op) +{ + Orientation o2d = Orient2d(eq, op, ep); + if (o2d == CW) { + // Right + return *ot.PointCCW(op); + } else if (o2d == CCW) { + // Left + return *ot.PointCW(op); + } else{ + //throw new RuntimeException("[Unsupported] Opposing point on constrained edge"); + // ASSIMP_CHANGE (aramis_acg) + throw std::runtime_error("[Unsupported] Opposing point on constrained edge"); + } +} + +void Sweep::FlipScanEdgeEvent(SweepContext& tcx, Point& ep, Point& eq, Triangle& flip_triangle, + Triangle& t, Point& p) +{ + Triangle& ot = t.NeighborAcross(p); + Point& op = *ot.OppositePoint(t, p); + + if (InScanArea(eq, *flip_triangle.PointCCW(eq), *flip_triangle.PointCW(eq), op)) { + // flip with new edge op->eq + FlipEdgeEvent(tcx, eq, op, &ot, op); + // TODO: Actually I just figured out that it should be possible to + // improve this by getting the next ot and op before the the above + // flip and continue the flipScanEdgeEvent here + // set new ot and op here and loop back to inScanArea test + // also need to set a new flip_triangle first + // Turns out at first glance that this is somewhat complicated + // so it will have to wait. + } else{ + Point& newP = NextFlipPoint(ep, eq, ot, op); + FlipScanEdgeEvent(tcx, ep, eq, flip_triangle, ot, newP); + } +} + +Sweep::~Sweep() { + + // Clean up memory + for(unsigned int i = 0; i < nodes_.size(); i++) { + delete nodes_[i]; + } + +} + +} + diff --git a/test/models/OBJ/spider.obj b/test/models/OBJ/spider.obj index 58c4f28d9..f45d94599 100644 --- a/test/models/OBJ/spider.obj +++ b/test/models/OBJ/spider.obj @@ -1780,8 +1780,8 @@ vn -0.7573840022087097 0.2233279943466187 -0.6135900020599365 vn -0.902417004108429 0.4006629884243011 -0.1584679931402206 vn -0.902417004108429 -0.2050659954547882 -0.3789339959621429 -# Mesh 'HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01' with 80 faces -g HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01 +# Mesh 'HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01' with 80 faces +g HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01 usemtl HLeibTex f 1/1/1 2/2/2 3/3/3 f 4/4/4 3/3/3 5/5/5 @@ -1864,8 +1864,8 @@ f 25/25/25 27/27/27 42/42/42 f 35/35/35 42/42/42 34/34/34 f 27/27/27 34/34/34 42/42/42 -# Mesh 'OK_OK_OK_OK_OK_OK_OK_OK' with 60 faces -g OK_OK_OK_OK_OK_OK_OK_OK +# Mesh 'OK_OK_OK_OK_OK_OK_OK_OK_OK_OK_OK_OK_OK_OK_OK_OK' with 60 faces +g OK_OK_OK_OK_OK_OK_OK_OK_OK_OK_OK_OK_OK_OK_OK_OK usemtl Skin f 43/43/43 44/44/44 45/45/45 f 46/46/46 45/45/45 47/47/47 @@ -1928,8 +1928,8 @@ f 53/53/53 66/63/66 52/52/52 f 78/67/78 52/52/52 66/63/66 f 67/64/67 69/63/69 79/67/79 -# Mesh 'Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li' with 98 faces -g Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li +# Mesh 'Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li' with 98 faces +g Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li usemtl BeinTex f 80/68/80 81/68/80 82/68/80 f 83/68/81 84/68/81 85/68/81 @@ -2030,8 +2030,8 @@ f 129/114/128 94/122/92 92/121/90 f 130/115/129 125/116/130 94/122/92 f 125/116/130 83/123/94 94/122/92 -# Mesh 'Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re' with 98 faces -g Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re +# Mesh 'Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re' with 98 faces +g Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re usemtl BeinTex f 131/68/131 132/68/131 133/68/131 f 134/68/132 135/68/132 136/68/132 @@ -2132,8 +2132,8 @@ f 143/121/141 146/122/144 180/114/179 f 146/122/144 176/116/181 181/115/180 f 146/122/144 136/123/145 176/116/181 -# Mesh 'Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li' with 98 faces -g Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li +# Mesh 'Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li' with 98 faces +g Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li usemtl BeinTex f 182/68/182 183/68/182 184/68/182 f 185/68/183 186/68/183 187/68/183 @@ -2234,8 +2234,8 @@ f 231/114/230 196/122/194 194/121/192 f 232/115/231 227/116/232 196/122/194 f 227/116/232 185/123/196 196/122/194 -# Mesh 'Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re' with 98 faces -g Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re +# Mesh 'Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re' with 98 faces +g Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re usemtl BeinTex f 233/68/233 234/68/233 235/68/233 f 236/68/234 237/68/234 238/68/234 @@ -2336,8 +2336,8 @@ f 245/121/243 248/122/246 282/114/281 f 248/122/246 278/116/283 283/115/282 f 248/122/246 238/123/247 278/116/283 -# Mesh 'Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re' with 98 faces -g Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re +# Mesh 'Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re' with 98 faces +g Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re usemtl BeinTex f 284/68/284 285/68/284 286/68/284 f 287/68/285 288/68/285 289/68/285 @@ -2438,8 +2438,8 @@ f 296/121/294 299/122/297 333/114/332 f 299/122/297 329/116/334 334/115/333 f 299/122/297 289/123/298 329/116/334 -# Mesh 'Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li' with 98 faces -g Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li +# Mesh 'Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li' with 98 faces +g Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li usemtl BeinTex f 335/68/335 336/68/335 337/68/335 f 338/68/336 339/68/336 340/68/336 @@ -2540,8 +2540,8 @@ f 384/114/383 349/122/347 347/121/345 f 385/115/384 380/116/385 349/122/347 f 380/116/385 338/123/349 349/122/347 -# Mesh 'Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re' with 98 faces -g Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re +# Mesh 'Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re' with 98 faces +g Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re usemtl BeinTex f 386/68/386 387/68/386 388/68/386 f 389/68/387 390/68/387 391/68/387 @@ -2642,8 +2642,8 @@ f 398/121/396 401/122/399 435/114/434 f 401/122/399 431/116/436 436/115/435 f 401/122/399 391/123/400 431/116/436 -# Mesh 'Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li' with 98 faces -g Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li +# Mesh 'Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li' with 98 faces +g Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li usemtl BeinTex f 437/68/437 438/68/437 439/68/437 f 440/68/438 441/68/438 442/68/438 @@ -2744,8 +2744,8 @@ f 486/114/485 451/122/449 449/121/447 f 487/115/486 482/116/487 451/122/449 f 482/116/487 440/123/451 451/122/449 -# Mesh 'Zahn_Zahn_Zahn_Zahn_Zahn_Zahn_Zahn_Zahn' with 42 faces -g Zahn_Zahn_Zahn_Zahn_Zahn_Zahn_Zahn_Zahn +# Mesh 'Zahn_Zahn_Zahn_Zahn_Zahn_Zahn_Zahn_Zahn_Zahn_Zahn_Zahn_Zahn_Zahn_Zahn_Zahn_Zahn' with 42 faces +g Zahn_Zahn_Zahn_Zahn_Zahn_Zahn_Zahn_Zahn_Zahn_Zahn_Zahn_Zahn_Zahn_Zahn_Zahn_Zahn usemtl BeinTex f 488/124/488 488/124/488 488/124/488 f 489/125/489 490/126/489 491/127/489 @@ -2790,8 +2790,8 @@ f 488/124/505 492/128/491 488/124/490 f 503/139/506 502/138/507 492/128/491 f 502/138/507 489/125/493 492/128/491 -# Mesh 'klZahn_klZahn_klZahn_klZahn_klZahn_klZahn_klZahn_klZahn' with 42 faces -g klZahn_klZahn_klZahn_klZahn_klZahn_klZahn_klZahn_klZahn +# Mesh 'klZahn_klZahn_klZahn_klZahn_klZahn_klZahn_klZahn_klZahn_klZahn_klZahn_klZahn_klZahn_klZahn_klZahn_klZahn_klZahn' with 42 faces +g klZahn_klZahn_klZahn_klZahn_klZahn_klZahn_klZahn_klZahn_klZahn_klZahn_klZahn_klZahn_klZahn_klZahn_klZahn_klZahn usemtl BeinTex f 504/140/488 504/140/488 504/140/488 f 505/141/508 506/142/508 507/143/508 @@ -2836,8 +2836,8 @@ f 504/140/524 508/144/510 504/140/509 f 519/155/525 518/154/526 508/144/510 f 518/154/526 505/141/512 508/144/510 -# Mesh 'Kopf_Kopf_Kopf_Kopf_Kopf_Kopf_Kopf_Kopf' with 90 faces -g Kopf_Kopf_Kopf_Kopf_Kopf_Kopf_Kopf_Kopf +# Mesh 'Kopf_Kopf_Kopf_Kopf_Kopf_Kopf_Kopf_Kopf_Kopf_Kopf_Kopf_Kopf_Kopf_Kopf_Kopf_Kopf' with 90 faces +g Kopf_Kopf_Kopf_Kopf_Kopf_Kopf_Kopf_Kopf_Kopf_Kopf_Kopf_Kopf_Kopf_Kopf_Kopf_Kopf usemtl Skin f 520/68/527 521/156/528 522/157/529 f 520/68/527 523/158/530 521/156/528 @@ -2930,8 +2930,8 @@ f 564/197/571 562/195/569 545/178/552 f 545/178/552 552/185/559 566/199/573 f 564/197/571 566/199/573 545/178/552 -# Mesh 'Brust_Brust_Brust_Brust_Brust_Brust_Brust_Brust' with 20 faces -g Brust_Brust_Brust_Brust_Brust_Brust_Brust_Brust +# Mesh 'Brust_Brust_Brust_Brust_Brust_Brust_Brust_Brust_Brust_Brust_Brust_Brust_Brust_Brust_Brust_Brust' with 20 faces +g Brust_Brust_Brust_Brust_Brust_Brust_Brust_Brust_Brust_Brust_Brust_Brust_Brust_Brust_Brust_Brust usemtl Skin f 70/210/584 71/211/585 577/212/586 f 60/120/587 577/212/586 64/213/588 @@ -2954,8 +2954,8 @@ f 70/210/584 580/217/592 69/223/599 f 77/75/593 79/224/600 580/217/592 f 69/223/599 580/217/592 79/224/600 -# Mesh 'Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2' with 90 faces -g Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2 +# Mesh 'Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2' with 90 faces +g Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2 usemtl Skin f 582/225/601 583/226/602 584/123/603 f 583/226/602 585/227/604 584/123/603 @@ -3048,8 +3048,8 @@ f 607/245/626 624/262/643 625/263/644 f 627/265/646 614/252/633 607/245/626 f 607/245/626 627/265/646 625/263/644 -# Mesh 'Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2' with 42 faces -g Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2 +# Mesh 'Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2' with 42 faces +g Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2 usemtl BeinTex f 639/124/488 639/124/488 639/124/488 f 640/127/658 641/126/658 642/125/658 @@ -3094,8 +3094,8 @@ f 639/124/661 644/128/660 639/124/674 f 644/128/660 653/138/676 654/139/675 f 644/128/660 642/125/662 653/138/676 -# Mesh 'klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2' with 42 faces -g klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2 +# Mesh 'klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2' with 42 faces +g klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2 usemtl BeinTex f 655/140/488 655/140/488 655/140/488 f 656/143/677 657/142/677 658/141/677 @@ -3140,8 +3140,8 @@ f 655/140/680 660/144/679 655/140/693 f 660/144/679 669/154/695 670/155/694 f 660/144/679 658/141/681 669/154/695 -# Mesh 'Auge_Auge_Auge_Auge_Auge_Auge_Auge_Auge' with 38 faces -g Auge_Auge_Auge_Auge_Auge_Auge_Auge_Auge +# Mesh 'Auge_Auge_Auge_Auge_Auge_Auge_Auge_Auge_Auge_Auge_Auge_Auge_Auge_Auge_Auge_Auge' with 38 faces +g Auge_Auge_Auge_Auge_Auge_Auge_Auge_Auge_Auge_Auge_Auge_Auge_Auge_Auge_Auge_Auge usemtl Augentex f 671/277/696 672/278/697 673/279/698 f 671/277/696 673/279/698 674/280/699 @@ -3182,8 +3182,8 @@ f 681/287/706 684/290/709 696/302/721 f 689/295/714 696/302/721 688/294/713 f 684/290/709 688/294/713 696/302/721 -# Mesh 'Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05' with 38 faces -g Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05 +# Mesh 'Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05' with 38 faces +g Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05 usemtl Augentex f 697/279/722 698/278/723 699/277/724 f 700/280/725 697/279/722 699/277/724 From 3bd9efa82c8dc20ce3ee54fb64f69bbf06d0d339 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Wed, 8 Mar 2017 09:55:44 +0100 Subject: [PATCH 08/22] Cleanup_includes: fix linux build. --- code/Importer.h | 1 + include/assimp/types.h | 9 +- test/models/OBJ/spider.obj | 206 ++++++++++++++++---------------- test/unit/utObjImportExport.cpp | 1 + 4 files changed, 108 insertions(+), 109 deletions(-) diff --git a/code/Importer.h b/code/Importer.h index fcfe1b018..6beca45ba 100644 --- a/code/Importer.h +++ b/code/Importer.h @@ -45,6 +45,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include +#include #include struct aiScene; diff --git a/include/assimp/types.h b/include/assimp/types.h index 7904413b0..8f303f3af 100644 --- a/include/assimp/types.h +++ b/include/assimp/types.h @@ -115,8 +115,6 @@ const size_t MAXLEN = 1024; # define MAXLEN 1024 #endif -#include "./Compiler/pushpack1.h" - // ---------------------------------------------------------------------------------- /** Represents a plane in a three-dimensional, euclidean space */ @@ -133,7 +131,7 @@ struct aiPlane //! Plane equation ai_real a,b,c,d; -} PACK_STRUCT; // !struct aiPlane +}; // !struct aiPlane // ---------------------------------------------------------------------------------- /** Represents a ray @@ -151,7 +149,7 @@ struct aiRay //! Position and direction of the ray C_STRUCT aiVector3D pos, dir; -} PACK_STRUCT; // !struct aiRay +}; // !struct aiRay // ---------------------------------------------------------------------------------- /** Represents a color in Red-Green-Blue space. @@ -227,8 +225,7 @@ struct aiColor3D //! Red, green and blue color values ai_real r, g, b; -} /*PACK_STRUCT*/; // !struct aiColor3D -#include "./Compiler/poppack1.h" +}; // !struct aiColor3D // ---------------------------------------------------------------------------------- /** Represents an UTF-8 string, zero byte terminated. diff --git a/test/models/OBJ/spider.obj b/test/models/OBJ/spider.obj index 58c4f28d9..e4d53b0a8 100644 --- a/test/models/OBJ/spider.obj +++ b/test/models/OBJ/spider.obj @@ -1,5 +1,5 @@ # File produced by Open Asset Import Library (http://www.assimp.sf.net) -# (assimp v3.3.102088114) +# (assimp v3.3.721346005) mtllib spider.obj.mtl @@ -14,7 +14,7 @@ v -6.442715167999268 10.77740478515625 -0.5375289916992188 v -8.120363235473633 15.6844596862793 -10.5 v -0.8867700099945068 23.4237174987793 -4.342854022979736 v -0.8867700099945068 23.4237174987793 -16.65714454650879 -v 14.40229797363281 32.89186859130859 -26.41482543945312 +v 14.40229797363281 32.89186859130859 -26.41482543945313 v 12.95316505432129 36.87333679199219 -11.5 v 30.52731704711914 37.50395202636719 -2.733282089233398 v 30.52731704711914 37.50395202636719 -20.26671600341797 @@ -23,15 +23,15 @@ v 45.09496688842773 27.71094512939453 2.684845924377441 v 57.93621826171875 30.27653312683105 -11.5 v 54.50359344482422 5.934020042419434 -11.5 v 51.09176254272461 11.23489952087402 2.684845924377441 -v 45.09496688842773 27.71094512939453 -25.68484497070312 +v 45.09496688842773 27.71094512939453 -25.68484497070313 v 39.18625640869141 16.23099708557129 -35.63270568847656 -v 51.09176254272461 11.23489952087402 -25.68484497070312 +v 51.09176254272461 11.23489952087402 -25.68484497070313 v 27.52080917358398 27.08032608032227 -34.45156478881836 v 4.568314075469971 16.85711288452148 -26.6196174621582 v 1.160378932952881 4.512683868408203 -27.44916915893555 v 22.65617179870605 10.21453857421875 -39.86968994140625 v 7.838881015777588 -6.414187908172607 -26.6196174621582 -v 30.91004180908203 -12.4627857208252 -26.41482543945312 +v 30.91004180908203 -12.4627857208252 -26.41482543945313 v 37.22381591796875 0.4215309917926788 -34.45156478881836 v 46.22711181640625 -5.630886077880859 -20.26671600341797 v 32.35918426513672 -16.44425201416016 -11.5 @@ -72,11 +72,11 @@ v -18.8264045715332 5.435883045196533 -20.58309173583984 v -32.62586212158203 10.86018753051758 -28.47975921630859 v -41.85661315917969 -0.7548459768295288 -29.43077087402344 v -27.9502124786377 1.303017020225525 -23.0814208984375 -v -39.19473266601562 -9.356718063354492 -28.47975921630859 +v -39.19473266601563 -9.356718063354492 -28.47975921630859 v -31.49889755249023 -9.618716239929199 -16.87730979919434 v -22.99813652038574 -7.403382778167725 -20.58309173583984 v -49.71383666992188 -2.983590126037598 1.421121001243591 -v -39.19473266601562 -9.356718063354492 8.47976016998291 +v -39.19473266601563 -9.356718063354492 8.47976016998291 v -22.99813652038574 -7.403382778167725 0.5830910205841064 v -31.49889755249023 -9.618716239929199 -3.122689962387085 v -50.63702392578125 8.975393295288086 -10 @@ -95,15 +95,15 @@ v -55.4437255859375 28.01696014404297 -51.02064895629883 v -55.80507659912109 29.50034332275391 -50.36057662963867 v -56.41304779052734 27.51875305175781 -54.60213470458984 v -57.93299102783203 29.20790100097656 -55.03944778442383 -v -67.98501586914062 13.43557167053223 -79.02035522460938 +v -67.98501586914063 13.43557167053223 -79.02035522460938 v -69.89360046386719 14.10584259033203 -80.14413452148438 -v -81.67832183837891 -31.37918090820312 -101.2915573120117 +v -81.67832183837891 -31.37918090820313 -101.2915573120117 v -82.77850341796875 -29.84352111816406 -101.2665863037109 v -45.27461242675781 -1.921316027641296 -17.56256103515625 v -88.2349853515625 -39.3502311706543 -103.8660430908203 v -48.86238861083984 8.964324951171875 -36.15071487426758 v -56.92498016357422 29.82746124267578 -49.55580902099609 -v -60.01216888427734 29.56021118164062 -54.08668899536133 +v -60.01216888427734 29.56021118164063 -54.08668899536133 v -72.06874084472656 14.20652008056641 -79.36090087890625 v -83.47474670410156 -29.51860809326172 -100.4707794189453 v -48.11187744140625 -2.742969989776611 -19.29600143432617 @@ -112,12 +112,12 @@ v -50.95351028442383 7.973351955413818 -36.14510726928711 v -57.96013641357422 28.75201416015625 -49.21238708496094 v -61.08487701416016 28.31040191650391 -52.46125793457031 v -72.87251281738281 13.66179847717285 -77.26039123535156 -v -83.24275207519531 -30.64902877807617 -99.50344848632812 +v -83.24275207519531 -30.64902877807617 -99.50344848632813 v -48.33858871459961 -4.09240198135376 -22.38015365600586 v -87.97438049316406 -40.34838485717773 -103.3615341186523 v -51.84541320800781 6.477696895599365 -37.66901397705078 v -58.13103866577148 27.08382415771484 -49.58887100219727 -v -60.34334564208984 26.39956665039062 -51.38712310791016 +v -60.34334564208984 26.39956665039063 -51.38712310791016 v -71.69966125488281 12.8818302154541 -75.42439270019531 v -82.25722503662109 -32.38360595703125 -99.09293365478516 v -45.78402709960938 -4.953472137451172 -24.49265670776367 @@ -127,7 +127,7 @@ v -57.30899810791016 26.07907104492188 -50.40177917480469 v -58.34596252441406 25.26664733886719 -51.67315673828125 v -69.433349609375 12.45395088195801 -75.23539733886719 v -81.26026153564453 -33.41617965698242 -99.54843139648438 -v -42.37185668945312 -4.677759170532227 -24.04270935058594 +v -42.37185668945313 -4.677759170532227 -24.04270935058594 v -87.46121978759766 -40.53748321533203 -104.0717544555664 v -48.75384521484375 6.009276866912842 -40.42763137817383 v -56.11302947998047 26.49437713623047 -51.03896713256836 @@ -139,27 +139,27 @@ v -42.83802795410156 -1.822747945785522 -1.17337703704834 v -41.96012115478516 -3.15467095375061 1.817621946334839 v -92.29042816162109 -39.21158981323242 57.38248825073242 v -92.26210784912109 -39.83740234375 57.07994079589844 -v -91.95950317382812 -39.73274230957031 57.5407600402832 +v -91.95950317382813 -39.73274230957031 57.5407600402832 v -49.36812591552734 8.476757049560547 19.08589744567871 -v -49.19630432128906 7.804555892944336 21.29348754882812 +v -49.19630432128906 7.804555892944336 21.29348754882813 v -54.25469207763672 27.27288055419922 30.44888496398926 v -54.92575836181641 28.34239959716797 29.36605453491211 v -57.45500946044922 28.70623016357422 33.83551406860352 v -55.48647308349609 27.49809265136719 33.97690582275391 v -67.46834564208984 9.109057426452637 43.49641799926758 -v -69.61196136474609 9.454971313476562 44.29645156860352 +v -69.61196136474609 9.454971313476563 44.29645156860352 v -87.01417541503906 -30.51413726806641 52.42203521728516 v -85.97149658203125 -32.07468414306641 52.63847351074219 -v -45.98867797851562 -1.450130939483643 -2.535742998123169 -v -92.60006713867188 -39.16170501708984 56.99636840820312 +v -45.98867797851563 -1.450130939483643 -2.535742998123169 +v -92.60006713867188 -39.16170501708984 56.99636840820313 v -50.88497161865234 7.785149097442627 17.48099899291992 v -55.98342132568359 28.08773803710938 28.45757293701172 v -59.41564178466797 28.14698791503906 32.74097061157227 v -71.61580657958984 8.682785987854004 43.43437957763672 v -87.75607299804688 -30.29622077941895 51.63100051879883 -v -49.03958129882812 -2.317409992218018 -1.243530988693237 +v -49.03958129882813 -2.317409992218018 -1.243530988693237 v -92.65523529052734 -39.6205940246582 56.67316055297852 -v -52.60464477539062 6.250553131103516 17.68733215332031 +v -52.60464477539063 6.250553131103516 17.68733215332031 v -56.63124847412109 26.70069122314453 28.40756416320801 v -59.89194488525391 26.24149322509766 31.51743125915527 v -71.97093963623047 7.37397575378418 41.55935287475586 @@ -184,11 +184,11 @@ v -50.4989013671875 6.274747848510742 22.44142532348633 v -54.47554779052734 25.68461608886719 30.89064788818359 v -54.99231719970703 25.43232727050781 33.05861282348633 v -66.79914093017578 7.905498027801514 41.6367301940918 -v -85.4132080078125 -33.80271530151367 52.11734008789062 +v -85.4132080078125 -33.80271530151367 52.11734008789063 v -32.53578186035156 -3.15467095375061 -19.16253662109375 v -34.38373184204102 -1.822747945785522 -16.65216445922852 v -36.48015213012695 -3.096683979034424 -19.71685028076172 -v -43.38578033447266 -41.58316040039062 -95.21874237060547 +v -43.38578033447266 -41.58316040039063 -95.21874237060547 v -43.91326141357422 -41.58873748779297 -95.02735137939453 v -43.69423675537109 -41.06890106201172 -95.43450164794922 v -35.0989875793457 7.804555892944336 -38.97930526733398 @@ -201,7 +201,7 @@ v -39.32158660888672 4.109056949615479 -79.20964813232422 v -40.77798843383789 4.454970836639404 -80.97431182861328 v -40.8770866394043 -32.42660522460938 -89.88973236083984 v -41.6864128112793 -30.95858383178711 -90.76108551025391 -v -37.81033325195312 -1.450130939483643 -16.44955062866211 +v -37.81033325195313 -1.450130939483643 -16.44955062866211 v -44.16765594482422 -40.94609069824219 -95.34366607666016 v -38.46767044067383 7.785149097442627 -36.52191925048828 v -40.04683303833008 28.08773803710938 -50.77265167236328 @@ -211,7 +211,7 @@ v -42.73056793212891 -30.60493469238281 -90.66996002197266 v -40.23527908325195 -2.317409992218018 -18.70730972290039 v -44.44951629638672 -41.30718231201172 -95.01465606689453 v -39.85378265380859 6.250553131103516 -37.56044387817383 -v -40.63287734985352 26.70069122314453 -51.05325317382812 +v -40.63287734985352 26.70069122314453 -51.05325317382813 v -41.90177536010742 26.24149322509766 -55.37683486938477 v -44.18946838378906 2.373975992202759 -79.78339385986328 v -43.2232666015625 -31.63191223144531 -89.68506622314453 @@ -231,7 +231,7 @@ v -41.56508255004883 1.750601053237915 -76.60358428955078 v -41.76493453979492 -34.27718353271484 -88.11498260498047 v -33.65802383422852 -4.442947864532471 -22.09029006958008 v -43.47456359863281 -42.10161590576172 -94.85892486572266 -v -35.65310668945312 6.274747848510742 -40.62473678588867 +v -35.65310668945313 6.274747848510742 -40.62473678588867 v -37.52444076538086 25.68461608886719 -52.12581634521484 v -36.88800048828125 25.43232727050781 -54.26172637939453 v -39.6718864440918 2.905498027801514 -77.26450347900391 @@ -251,7 +251,7 @@ v -38.03726577758789 27.49446105957031 33.66647720336914 v -34.5403938293457 17.31492233276367 46.75900650024414 v -35.8452262878418 17.43609428405762 48.66624069213867 v -28.96659469604492 -31.87043952941895 66.61157989501953 -v -28.00870513916016 -33.48403930664062 66.39229583740234 +v -28.00870513916016 -33.48403930664063 66.39229583740234 v -37.94406127929688 -1.883904933929443 -4.875525951385498 v -29.19070816040039 -38.59844589233398 75.64435577392578 v -38.12530136108398 7.461886882781982 15.15559387207031 @@ -285,8 +285,8 @@ v -28.36112785339355 -39.7656364440918 75.63690948486328 v -34.68405532836914 6.534968852996826 18.94173622131348 v -38.70342254638672 25.53554534912109 30.5754222869873 v -37.81640243530273 25.43576812744141 32.63310623168945 -v -34.87471389770508 16.03384399414062 44.86114120483398 -v -27.90771293640137 -35.34060668945312 66.05712127685547 +v -34.87471389770508 16.03384399414063 44.86114120483398 +v -27.90771293640137 -35.34060668945313 66.05712127685547 v -26.45577621459961 -3.443838119506836 -2.149142980575562 v -26.46640014648438 -2.246160984039307 -5.887526988983154 v -23.49448394775391 -3.47288703918457 -4.813465118408203 @@ -302,26 +302,26 @@ v -10.52369499206543 27.51875305175781 29.59563827514648 v -0.9972569942474365 13.43557167053223 54.88214111328125 v -1.514698028564453 14.10584259033203 57.03571319580078 v 3.385565996170044 -29.84352111816406 80.76795196533203 -v 3.675970077514648 -31.37918090820312 79.70648956298828 +v 3.675970077514648 -31.37918090820313 79.70648956298828 v -29.43033599853516 -1.921316027641296 -4.146553039550781 v 4.587766170501709 -39.3502311706543 86.69120025634766 v -18.55141067504883 8.964324951171875 11.34670639038086 v -14.50934600830078 29.82746124267578 26.45841026306152 -v -13.3946418762207 29.56021118164062 31.82656478881836 +v -13.3946418762207 29.56021118164063 31.82656478881836 v -3.589093923568726 14.20652008056641 58.0562744140625 v 2.445001125335693 -29.51860809326172 81.25101470947266 -v -30.15432739257812 -2.742969989776611 -0.9014430046081543 +v -30.15432739257813 -2.742969989776611 -0.9014430046081543 v 4.197091102600098 -39.74774169921875 86.60486602783203 v -20.00806045532227 7.973351955413818 12.8470344543457 v -15.4754638671875 28.75201416015625 26.9644775390625 v -15.30904579162598 28.31040191650391 31.46907806396484 -v -5.658416748046875 13.66179847717285 57.17532348632812 +v -5.658416748046875 13.66179847717285 57.17532348632813 v 1.562493085861206 -30.64902877807617 80.79186248779297 v -28.0932731628418 -4.09240198135376 1.404078960418701 v 4.161306858062744 -40.34838485717773 86.31630706787109 v -19.53142166137695 6.477696895599365 14.54720878601074 v -15.32335662841797 27.08382415771484 27.34894752502441 -v -15.56659698486328 26.39956665039062 30.18951416015625 +v -15.56659698486328 26.39956665039063 30.18951416015625 v -6.164387226104736 12.8818302154541 55.05625915527344 v 1.402615070343018 -32.38360595703125 79.73628997802734 v -24.79911041259766 -4.953472137451172 1.033954977989197 @@ -340,7 +340,7 @@ v -2.426440954208374 12.70041084289551 53.21726226806641 v 3.097472906112671 -32.96916198730469 78.86588287353516 v -23.49448394775391 -3.47288703918457 -15.18653869628906 v -26.46640014648438 -2.246160984039307 -14.11247634887695 -v -26.45577621459961 -3.443838119506836 -17.85086059570312 +v -26.45577621459961 -3.443838119506836 -17.85086059570313 v 5.211228847503662 -39.9835319519043 -106.1982498168945 v 4.668338775634766 -40.01747512817383 -106.3362197875977 v 5.039107799530029 -39.45514678955078 -106.5102310180664 @@ -352,27 +352,27 @@ v -10.52369499206543 27.51875305175781 -49.59563446044922 v -11.26496505737305 29.20790100097656 -50.99276733398438 v -0.9972569942474365 13.43557167053223 -74.88213348388672 v -1.514698028564453 14.10584259033203 -77.03571319580078 -v 3.675970077514648 -31.37918090820312 -99.70648956298828 +v 3.675970077514648 -31.37918090820313 -99.70648956298828 v 3.38556694984436 -29.84352111816406 -100.767951965332 v -29.43033599853516 -1.921316027641296 -15.85345077514648 v 4.587764739990234 -39.3502311706543 -106.6912002563477 -v -18.55141067504883 8.964324951171875 -31.34671020507812 +v -18.55141067504883 8.964324951171875 -31.34671020507813 v -14.50934600830078 29.82746124267578 -46.45841217041016 -v -13.3946418762207 29.56021118164062 -51.82656097412109 +v -13.3946418762207 29.56021118164063 -51.82656097412109 v -3.589093923568726 14.20652008056641 -78.05626678466797 v 2.445001125335693 -29.51860809326172 -101.2510147094727 -v -30.15432739257812 -2.742969989776611 -19.09856033325195 +v -30.15432739257813 -2.742969989776611 -19.09856033325195 v 4.197090148925781 -39.74774169921875 -106.604866027832 v -20.00806045532227 7.973351955413818 -32.8470344543457 v -15.4754638671875 28.75201416015625 -46.9644775390625 v -15.30904579162598 28.31040191650391 -51.46907806396484 v -5.658416748046875 13.66179847717285 -77.17531585693359 v 1.562493085861206 -30.64902877807617 -100.791862487793 -v -28.0932731628418 -4.09240198135376 -21.40408325195312 +v -28.0932731628418 -4.09240198135376 -21.40408325195313 v 4.161307811737061 -40.34838485717773 -106.3163070678711 v -19.53142166137695 6.477696895599365 -34.54721069335938 v -15.32335662841797 27.08382415771484 -47.34894561767578 -v -15.56659698486328 26.39956665039062 -50.18951416015625 +v -15.56659698486328 26.39956665039063 -50.18951416015625 v -6.164387226104736 12.8818302154541 -75.05625152587891 v 1.402615070343018 -32.38360595703125 -99.73628997802734 v -24.79911041259766 -4.953472137451172 -21.03395843505859 @@ -393,14 +393,14 @@ v -14.25648880004883 -6.954940795898438 -3.301691055297852 v -14.10265731811523 -6.075778961181641 -7.124460220336914 v -11.2052116394043 -7.280231952667236 -5.841878890991211 v 19.74986457824707 -37.60753631591797 68.32992553710938 -v 19.34836387634277 -38.14849472045898 68.15628051757812 +v 19.34836387634277 -38.14849472045898 68.15628051757813 v 19.89711761474609 -38.15519714355469 68.03912353515625 v -4.907510757446289 6.093640804290771 10.12681770324707 v -2.877649068832397 5.517601013183594 11.07694053649902 v 1.745674014091492 26.13694000244141 21.00781440734863 v 0.4745520055294037 27.20939636230469 20.97971534729004 v 3.233434915542603 28.02400207519531 25.24942970275879 -v 4.282450199127197 26.64773559570312 23.71314430236816 +v 4.282450199127197 26.64773559570313 23.71314430236816 v 14.8602180480957 5.642467975616455 47.61897277832031 v 14.56025314331055 6.223588943481445 49.83868408203125 v 18.9760627746582 -28.07810020446777 62.27335357666016 @@ -434,28 +434,28 @@ v 1.932853937149048 23.20393180847168 23.79626274108887 v 11.57662582397461 3.190187931060791 46.84990692138672 v 17.50724792480469 -31.60873603820801 60.42989349365234 v -10.6054573059082 -8.239757537841797 -2.646497964859009 -v 19.63114547729492 -38.69778442382812 67.83663940429688 +v 19.63114547729492 -38.69778442382813 67.83663940429688 v -2.475620031356812 4.172726154327393 12.91663932800293 v 2.032040119171143 24.59943771362305 21.57402229309082 v 3.703634023666382 24.50261497497559 23.06640815734863 -v 13.53237915039062 4.292479038238525 46.28885650634766 +v 13.53237915039063 4.292479038238525 46.28885650634766 v 18.54694938659668 -31.23143768310547 60.44495391845703 v -12.53854370117188 -7.280231952667236 -13.491455078125 v -15.43598937988281 -6.075778961181641 -12.2088737487793 v -15.58982086181641 -6.954940795898438 -16.03164291381836 -v 18.56378555297852 -38.15519714355469 -87.37246704101562 +v 18.56378555297852 -38.15519714355469 -87.37246704101563 v 18.0150318145752 -38.14849472045898 -87.4896240234375 v 18.41653251647949 -37.60753631591797 -87.66326904296875 v -4.210980892181396 5.517601013183594 -30.41027450561523 v -6.240842819213867 6.093640804290771 -29.46015167236328 v 0.4123420119285583 26.13694000244141 -40.34114837646484 v -0.8587800264358521 27.20939636230469 -40.31304931640625 -v 2.949118137359619 26.64773559570312 -43.04647827148438 +v 2.949118137359619 26.64773559570313 -43.04647827148438 v 1.900102972984314 28.02400207519531 -44.582763671875 -v 13.52688598632812 5.642467975616455 -66.95231628417969 -v 13.22692108154297 6.223588943481445 -69.17202758789062 +v 13.52688598632813 5.642467975616455 -66.95231628417969 +v 13.22692108154297 6.223588943481445 -69.17202758789063 v 17.86732864379883 -29.66015243530273 -80.59872436523438 -v 17.64273071289062 -28.07810020446777 -81.60670471191406 +v 17.64273071289063 -28.07810020446777 -81.60670471191406 v -18.44928359985352 -5.533359050750732 -13.80491638183594 v 17.96691513061523 -37.46723175048828 -87.82330322265625 v -8.370006561279297 5.467060089111328 -30.11508178710938 @@ -471,7 +471,7 @@ v -1.290704965591431 25.68392181396484 -45.89799499511719 v 9.702729225158691 4.237391948699951 -70.18302917480469 v 15.76919937133789 -28.75799560546875 -81.57952880859375 v -17.36852645874023 -7.262344837188721 -19.56281280517578 -v 17.48766136169434 -38.44494247436523 -87.45840454101562 +v 17.48766136169434 -38.44494247436523 -87.45840454101563 v -7.645581245422363 3.043694019317627 -33.43013000488281 v -1.641402959823608 24.23861885070801 -41.86458587646484 v -1.029770016670227 23.72967147827148 -44.68647766113281 @@ -485,7 +485,7 @@ v 0.5995219945907593 23.20393180847168 -43.12960052490234 v 10.24329376220703 3.190187931060791 -66.18324279785156 v 16.17391586303711 -31.60873603820801 -79.76324462890625 v -11.93878936767578 -8.239757537841797 -16.68683624267578 -v 18.29781341552734 -38.69778442382812 -87.16998291015625 +v 18.29781341552734 -38.69778442382813 -87.16998291015625 v -3.808951854705811 4.172726154327393 -32.24997329711914 v 0.6987079977989197 24.59943771362305 -40.90735626220703 v 2.370301961898804 24.50261497497559 -42.39974212646484 @@ -519,7 +519,7 @@ v -51.75783920288086 11.98240089416504 0.8355600237846375 v -56.05172729492188 7.156466007232666 5.002277851104736 v -53.53396987915039 14.21004676818848 1.72101902961731 v -57.36484146118164 8.803488731384277 5.656900882720947 -v -56.62808227539062 15.23869514465332 0.7346760034561157 +v -56.62808227539063 15.23869514465332 0.7346760034561157 v -59.24757766723633 9.889246940612793 4.827473163604736 v -58.71025466918945 14.29374885559082 -1.380638957023621 v -60.28214263916016 9.596194267272949 3.138458967208862 @@ -556,7 +556,7 @@ v -40.64442825317383 21.88604164123535 -0.7607129812240601 v -44.44827651977539 21.88604164123535 2.546009063720703 v -53.9999885559082 20.33333778381348 0.4478580057621002 v -60.29326629638672 19.47619819641113 -2.199142932891846 -v -63.06387329101562 19.47619819641113 -6.810235023498535 +v -63.06387329101563 19.47619819641113 -6.810235023498535 v -64.39229583740234 20.33333778381348 -9.944446563720703 v -63.32090759277344 15.14286994934082 -6.139256000518799 v -62.36603164672852 15.39914894104004 -5.604844093322754 @@ -618,7 +618,7 @@ v -38.80768203735352 21.88604164123535 -9.988886833190918 v -44.44827651977539 21.88604164123535 -22.47934150695801 v -53.9999885559082 20.33333778381348 -20.38118934631348 v -60.29326629638672 19.47619819641113 -17.73418998718262 -v -63.06387329101562 19.47619819641113 -13.12309837341309 +v -63.06387329101563 19.47619819641113 -13.12309837341309 v -64.39229583740234 20.33333778381348 -9.988886833190918 v -62.33220672607422 15.06181526184082 -14.44650936126709 v -62.36603164672852 15.39914894104004 -14.32849025726318 @@ -650,7 +650,7 @@ v -64.66415405273438 4.277801990509033 -18.2394905090332 v -63.78934860229492 3.570785999298096 -16.48468399047852 v -62.37599182128906 11.21470260620117 -16.82923698425293 v -66.95527648925781 4.531181812286377 -18.78395462036133 -v -63.80926132202148 13.24985885620117 -14.86489868164062 +v -63.80926132202148 13.24985885620117 -14.86489868164063 v -68.93736267089844 4.140174865722656 -17.70805549621582 v -64.48637390136719 12.67211532592773 -12.25428771972656 v -69.1180419921875 3.399224042892456 -15.82198143005371 @@ -670,7 +670,7 @@ v -51.75783920288086 12.03694534301758 -19.50222587585449 v -56.05172729492188 7.211010932922363 -23.66894340515137 v -53.53396987915039 14.26459121704102 -20.38768196105957 v -57.36484146118164 8.858034133911133 -24.32356452941895 -v -56.62808227539062 15.29323959350586 -19.40134239196777 +v -56.62808227539063 15.29323959350586 -19.40134239196777 v -59.24757766723633 9.943792343139648 -23.49413871765137 v -58.71025466918945 14.34829330444336 -17.28602600097656 v -60.28214263916016 9.650739669799805 -21.80512428283691 @@ -679,13 +679,13 @@ v -58.74361419677734 17.51846694946289 -2.271703958511353 v -59.46704864501953 18.40674209594727 -2.53897500038147 v -60.63759613037109 18.10347366333008 -2.337920904159546 v -61.55588531494141 18.15423965454102 -3.37207293510437 -v -60.57522583007812 18.69086074829102 -3.431842088699341 +v -60.57522583007813 18.69086074829102 -3.431842088699341 v -61.64485168457031 18.26233291625977 -4.609260082244873 v -61.38417816162109 17.94110488891602 -5.717274188995361 v -61.48154449462891 16.98392105102539 -6.448155879974365 v -62.26735687255859 17.28479385375977 -5.621510982513428 v -62.61495971679688 16.49116897583008 -5.094202995300293 -v -62.20498657226562 16.13167190551758 -6.081917762756348 +v -62.20498657226563 16.13167190551758 -6.081917762756348 v -61.27806091308594 15.97928333282471 -6.500585079193115 v -62.26735687255859 15.54427146911621 -4.988009929656982 v -61.38417816162109 14.97993564605713 -4.639497756958008 @@ -693,7 +693,7 @@ v -61.48154449462891 15.24338626861572 -5.814656257629395 v -60.47430419921875 15.08453464508057 -3.54331111907959 v -61.64485168457031 15.44609451293945 -3.584233999252319 v -61.55588531494141 16.32414627075195 -2.705970048904419 -v -60.57522583007812 15.87463855743408 -2.406815052032471 +v -60.57522583007813 15.87463855743408 -2.406815052032471 v -59.56442260742188 15.70901966094971 -2.636348009109497 v -60.63759613037109 17.02777481079102 -1.946398019790649 v -59.46704864501953 16.66621780395508 -1.905473947525024 @@ -704,13 +704,13 @@ v -59.46704864501953 18.14007568359375 -17.19435882568359 v -58.74361419677734 17.25180053710938 -17.46162986755371 v -59.67054748535156 17.40419006347656 -17.88029861450195 v -60.63759613037109 17.83680725097656 -17.39541244506836 -v -60.57522583007812 18.4241943359375 -16.30149078369141 +v -60.57522583007813 18.4241943359375 -16.30149078369141 v -61.55588531494141 17.8875732421875 -16.36125946044922 v -61.64485168457031 17.99566650390625 -15.12407302856445 v -62.26735687255859 17.01812744140625 -14.1118221282959 v -61.48154449462891 16.71725463867188 -13.28517723083496 v -61.38417816162109 17.6744384765625 -14.01605987548828 -v -62.20498657226562 15.86500549316406 -13.65141487121582 +v -62.20498657226563 15.86500549316406 -13.65141487121582 v -62.61495971679688 16.22450256347656 -14.63912963867188 v -61.27806091308594 15.71261596679688 -13.23274803161621 v -62.26735687255859 15.27760314941406 -14.74532318115234 @@ -718,7 +718,7 @@ v -61.48154449462891 14.97671890258789 -13.91867828369141 v -61.38417816162109 14.7132682800293 -15.09383583068848 v -61.64485168457031 15.17942810058594 -16.14909934997559 v -60.47430419921875 14.81786727905273 -16.19002342224121 -v -60.57522583007812 15.60797119140625 -17.32651901245117 +v -60.57522583007813 15.60797119140625 -17.32651901245117 v -61.55588531494141 16.05747985839844 -17.02736282348633 v -59.56442260742188 15.44235229492188 -17.09698486328125 v -60.63759613037109 16.7611083984375 -17.78693389892578 @@ -1249,7 +1249,7 @@ vn -0.7882999777793884 -0.6091880202293396 -0.08644299954175949 vn -0.6353080272674561 -0.5868319869041443 0.5020080208778381 vn -0.7489200234413147 -0.3426479995250702 0.5671960115432739 vn -0.8290749788284302 -0.1998199969530106 0.5222129821777344 -vn -0.8114089965820312 -0.2435930073261261 0.5312989950180054 +vn -0.8114089965820313 -0.2435930073261261 0.5312989950180054 vn -0.02972600050270557 -0.7129759788513184 -0.7005580067634583 vn -0.1212550029158592 -0.8703849911689758 -0.4772070050239563 vn 0.1511760056018829 -0.9298509955406189 -0.3354449868202209 @@ -1538,7 +1538,7 @@ vn -0.3590719997882843 -0.2934069931507111 -0.8859909772872925 vn -0.5312150120735168 -0.1616500020027161 -0.8316730260848999 vn 0.5217099785804749 -0.3334519863128662 -0.7852569818496704 vn 0.4982230067253113 -0.5182129740715027 -0.6951469779014587 -vn 0.3192520141601562 -0.6669300198554993 -0.6732630133628845 +vn 0.3192520141601563 -0.6669300198554993 -0.6732630133628845 vn 0.4172089993953705 0.6029300093650818 -0.6800090074539185 vn -0.3909519910812378 -0.5063930153846741 -0.7685850262641907 vn -0.785847008228302 -0.2199160009622574 -0.5779989957809448 @@ -1595,7 +1595,7 @@ vn -0.8313949704170227 0.3698750138282776 0.414698988199234 vn -0.7773889899253845 0.439754992723465 0.4497570097446442 vn -0.7120980024337769 0.07437500357627869 0.6981300115585327 vn -0.5221620202064514 -0.5821250081062317 0.6232789754867554 -vn -0.5362930297851562 0.8426250219345093 0.04870999976992607 +vn -0.5362930297851563 0.8426250219345093 0.04870999976992607 vn -0.6278550028800964 0.7403159737586975 0.2402739971876144 vn -0.817995011806488 0.4767960011959076 0.3217920064926147 vn -0.7291709780693054 0.6557949781417847 0.1955550014972687 @@ -1780,8 +1780,8 @@ vn -0.7573840022087097 0.2233279943466187 -0.6135900020599365 vn -0.902417004108429 0.4006629884243011 -0.1584679931402206 vn -0.902417004108429 -0.2050659954547882 -0.3789339959621429 -# Mesh 'HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01' with 80 faces -g HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01 +# Mesh 'HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01' with 80 faces +g HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01_HLeib01 usemtl HLeibTex f 1/1/1 2/2/2 3/3/3 f 4/4/4 3/3/3 5/5/5 @@ -1864,8 +1864,8 @@ f 25/25/25 27/27/27 42/42/42 f 35/35/35 42/42/42 34/34/34 f 27/27/27 34/34/34 42/42/42 -# Mesh 'OK_OK_OK_OK_OK_OK_OK_OK' with 60 faces -g OK_OK_OK_OK_OK_OK_OK_OK +# Mesh 'OK_OK_OK_OK_OK_OK_OK_OK_OK_OK_OK_OK_OK_OK_OK_OK' with 60 faces +g OK_OK_OK_OK_OK_OK_OK_OK_OK_OK_OK_OK_OK_OK_OK_OK usemtl Skin f 43/43/43 44/44/44 45/45/45 f 46/46/46 45/45/45 47/47/47 @@ -1928,8 +1928,8 @@ f 53/53/53 66/63/66 52/52/52 f 78/67/78 52/52/52 66/63/66 f 67/64/67 69/63/69 79/67/79 -# Mesh 'Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li' with 98 faces -g Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li +# Mesh 'Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li' with 98 faces +g Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li_Bein1Li usemtl BeinTex f 80/68/80 81/68/80 82/68/80 f 83/68/81 84/68/81 85/68/81 @@ -2030,8 +2030,8 @@ f 129/114/128 94/122/92 92/121/90 f 130/115/129 125/116/130 94/122/92 f 125/116/130 83/123/94 94/122/92 -# Mesh 'Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re' with 98 faces -g Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re +# Mesh 'Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re' with 98 faces +g Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re_Bein1Re usemtl BeinTex f 131/68/131 132/68/131 133/68/131 f 134/68/132 135/68/132 136/68/132 @@ -2132,8 +2132,8 @@ f 143/121/141 146/122/144 180/114/179 f 146/122/144 176/116/181 181/115/180 f 146/122/144 136/123/145 176/116/181 -# Mesh 'Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li' with 98 faces -g Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li +# Mesh 'Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li' with 98 faces +g Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li_Bein2Li usemtl BeinTex f 182/68/182 183/68/182 184/68/182 f 185/68/183 186/68/183 187/68/183 @@ -2234,8 +2234,8 @@ f 231/114/230 196/122/194 194/121/192 f 232/115/231 227/116/232 196/122/194 f 227/116/232 185/123/196 196/122/194 -# Mesh 'Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re' with 98 faces -g Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re +# Mesh 'Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re' with 98 faces +g Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re_Bein2Re usemtl BeinTex f 233/68/233 234/68/233 235/68/233 f 236/68/234 237/68/234 238/68/234 @@ -2336,8 +2336,8 @@ f 245/121/243 248/122/246 282/114/281 f 248/122/246 278/116/283 283/115/282 f 248/122/246 238/123/247 278/116/283 -# Mesh 'Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re' with 98 faces -g Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re +# Mesh 'Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re' with 98 faces +g Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re_Bein3Re usemtl BeinTex f 284/68/284 285/68/284 286/68/284 f 287/68/285 288/68/285 289/68/285 @@ -2438,8 +2438,8 @@ f 296/121/294 299/122/297 333/114/332 f 299/122/297 329/116/334 334/115/333 f 299/122/297 289/123/298 329/116/334 -# Mesh 'Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li' with 98 faces -g Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li +# Mesh 'Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li' with 98 faces +g Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li_Bein3Li usemtl BeinTex f 335/68/335 336/68/335 337/68/335 f 338/68/336 339/68/336 340/68/336 @@ -2540,8 +2540,8 @@ f 384/114/383 349/122/347 347/121/345 f 385/115/384 380/116/385 349/122/347 f 380/116/385 338/123/349 349/122/347 -# Mesh 'Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re' with 98 faces -g Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re +# Mesh 'Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re' with 98 faces +g Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re_Bein4Re usemtl BeinTex f 386/68/386 387/68/386 388/68/386 f 389/68/387 390/68/387 391/68/387 @@ -2642,8 +2642,8 @@ f 398/121/396 401/122/399 435/114/434 f 401/122/399 431/116/436 436/115/435 f 401/122/399 391/123/400 431/116/436 -# Mesh 'Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li' with 98 faces -g Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li +# Mesh 'Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li' with 98 faces +g Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li_Bein4Li usemtl BeinTex f 437/68/437 438/68/437 439/68/437 f 440/68/438 441/68/438 442/68/438 @@ -2744,8 +2744,8 @@ f 486/114/485 451/122/449 449/121/447 f 487/115/486 482/116/487 451/122/449 f 482/116/487 440/123/451 451/122/449 -# Mesh 'Zahn_Zahn_Zahn_Zahn_Zahn_Zahn_Zahn_Zahn' with 42 faces -g Zahn_Zahn_Zahn_Zahn_Zahn_Zahn_Zahn_Zahn +# Mesh 'Zahn_Zahn_Zahn_Zahn_Zahn_Zahn_Zahn_Zahn_Zahn_Zahn_Zahn_Zahn_Zahn_Zahn_Zahn_Zahn' with 42 faces +g Zahn_Zahn_Zahn_Zahn_Zahn_Zahn_Zahn_Zahn_Zahn_Zahn_Zahn_Zahn_Zahn_Zahn_Zahn_Zahn usemtl BeinTex f 488/124/488 488/124/488 488/124/488 f 489/125/489 490/126/489 491/127/489 @@ -2790,8 +2790,8 @@ f 488/124/505 492/128/491 488/124/490 f 503/139/506 502/138/507 492/128/491 f 502/138/507 489/125/493 492/128/491 -# Mesh 'klZahn_klZahn_klZahn_klZahn_klZahn_klZahn_klZahn_klZahn' with 42 faces -g klZahn_klZahn_klZahn_klZahn_klZahn_klZahn_klZahn_klZahn +# Mesh 'klZahn_klZahn_klZahn_klZahn_klZahn_klZahn_klZahn_klZahn_klZahn_klZahn_klZahn_klZahn_klZahn_klZahn_klZahn_klZahn' with 42 faces +g klZahn_klZahn_klZahn_klZahn_klZahn_klZahn_klZahn_klZahn_klZahn_klZahn_klZahn_klZahn_klZahn_klZahn_klZahn_klZahn usemtl BeinTex f 504/140/488 504/140/488 504/140/488 f 505/141/508 506/142/508 507/143/508 @@ -2836,8 +2836,8 @@ f 504/140/524 508/144/510 504/140/509 f 519/155/525 518/154/526 508/144/510 f 518/154/526 505/141/512 508/144/510 -# Mesh 'Kopf_Kopf_Kopf_Kopf_Kopf_Kopf_Kopf_Kopf' with 90 faces -g Kopf_Kopf_Kopf_Kopf_Kopf_Kopf_Kopf_Kopf +# Mesh 'Kopf_Kopf_Kopf_Kopf_Kopf_Kopf_Kopf_Kopf_Kopf_Kopf_Kopf_Kopf_Kopf_Kopf_Kopf_Kopf' with 90 faces +g Kopf_Kopf_Kopf_Kopf_Kopf_Kopf_Kopf_Kopf_Kopf_Kopf_Kopf_Kopf_Kopf_Kopf_Kopf_Kopf usemtl Skin f 520/68/527 521/156/528 522/157/529 f 520/68/527 523/158/530 521/156/528 @@ -2930,8 +2930,8 @@ f 564/197/571 562/195/569 545/178/552 f 545/178/552 552/185/559 566/199/573 f 564/197/571 566/199/573 545/178/552 -# Mesh 'Brust_Brust_Brust_Brust_Brust_Brust_Brust_Brust' with 20 faces -g Brust_Brust_Brust_Brust_Brust_Brust_Brust_Brust +# Mesh 'Brust_Brust_Brust_Brust_Brust_Brust_Brust_Brust_Brust_Brust_Brust_Brust_Brust_Brust_Brust_Brust' with 20 faces +g Brust_Brust_Brust_Brust_Brust_Brust_Brust_Brust_Brust_Brust_Brust_Brust_Brust_Brust_Brust_Brust usemtl Skin f 70/210/584 71/211/585 577/212/586 f 60/120/587 577/212/586 64/213/588 @@ -2954,8 +2954,8 @@ f 70/210/584 580/217/592 69/223/599 f 77/75/593 79/224/600 580/217/592 f 69/223/599 580/217/592 79/224/600 -# Mesh 'Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2' with 90 faces -g Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2 +# Mesh 'Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2' with 90 faces +g Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2_Kopf2 usemtl Skin f 582/225/601 583/226/602 584/123/603 f 583/226/602 585/227/604 584/123/603 @@ -3048,8 +3048,8 @@ f 607/245/626 624/262/643 625/263/644 f 627/265/646 614/252/633 607/245/626 f 607/245/626 627/265/646 625/263/644 -# Mesh 'Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2' with 42 faces -g Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2 +# Mesh 'Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2' with 42 faces +g Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2_Zahn2 usemtl BeinTex f 639/124/488 639/124/488 639/124/488 f 640/127/658 641/126/658 642/125/658 @@ -3094,8 +3094,8 @@ f 639/124/661 644/128/660 639/124/674 f 644/128/660 653/138/676 654/139/675 f 644/128/660 642/125/662 653/138/676 -# Mesh 'klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2' with 42 faces -g klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2 +# Mesh 'klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2' with 42 faces +g klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2_klZahn2 usemtl BeinTex f 655/140/488 655/140/488 655/140/488 f 656/143/677 657/142/677 658/141/677 @@ -3140,8 +3140,8 @@ f 655/140/680 660/144/679 655/140/693 f 660/144/679 669/154/695 670/155/694 f 660/144/679 658/141/681 669/154/695 -# Mesh 'Auge_Auge_Auge_Auge_Auge_Auge_Auge_Auge' with 38 faces -g Auge_Auge_Auge_Auge_Auge_Auge_Auge_Auge +# Mesh 'Auge_Auge_Auge_Auge_Auge_Auge_Auge_Auge_Auge_Auge_Auge_Auge_Auge_Auge_Auge_Auge' with 38 faces +g Auge_Auge_Auge_Auge_Auge_Auge_Auge_Auge_Auge_Auge_Auge_Auge_Auge_Auge_Auge_Auge usemtl Augentex f 671/277/696 672/278/697 673/279/698 f 671/277/696 673/279/698 674/280/699 @@ -3182,8 +3182,8 @@ f 681/287/706 684/290/709 696/302/721 f 689/295/714 696/302/721 688/294/713 f 684/290/709 688/294/713 696/302/721 -# Mesh 'Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05' with 38 faces -g Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05 +# Mesh 'Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05' with 38 faces +g Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05_Duplicate05 usemtl Augentex f 697/279/722 698/278/723 699/277/724 f 700/280/725 697/279/722 699/277/724 diff --git a/test/unit/utObjImportExport.cpp b/test/unit/utObjImportExport.cpp index 73cc057b9..37b89ba48 100644 --- a/test/unit/utObjImportExport.cpp +++ b/test/unit/utObjImportExport.cpp @@ -91,6 +91,7 @@ static const std::string ObjModel = "\n" "# Point / Line / Face list\n" "\n" + "g Box01\n" "usemtl Default\n" "f 4 3 2 1\n" "f 2 6 5 1\n" From 143f91d54132fca5d81c11eea75e984da4c9b1aa Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Wed, 8 Mar 2017 10:54:12 +0100 Subject: [PATCH 09/22] Unittests: fix version test. --- test/models/OBJ/spider.obj | 79 +++++++++++++++++++------------------- test/unit/utVersion.cpp | 2 +- 2 files changed, 41 insertions(+), 40 deletions(-) diff --git a/test/models/OBJ/spider.obj b/test/models/OBJ/spider.obj index eab71e3bf..ae8cb9250 100644 --- a/test/models/OBJ/spider.obj +++ b/test/models/OBJ/spider.obj @@ -1,5 +1,5 @@ # File produced by Open Asset Import Library (http://www.assimp.sf.net) -# (assimp v3.3.128220959) +# (assimp v3.3.3072710619) mtllib spider.obj.mtl @@ -1780,8 +1780,8 @@ vn -0.7573840022087097 0.2233279943466187 -0.6135900020599365 vn -0.902417004108429 0.4006629884243011 -0.1584679931402206 vn -0.902417004108429 -0.2050659954547882 -0.3789339959621429 -# Mesh 'HLeib01' with 80 faces -g HLeib01 +# Mesh 'HLeib01_HLeib01' with 80 faces +g HLeib01_HLeib01 usemtl HLeibTex f 1/1/1 2/2/2 3/3/3 f 4/4/4 3/3/3 5/5/5 @@ -1864,8 +1864,8 @@ f 25/25/25 27/27/27 42/42/42 f 35/35/35 42/42/42 34/34/34 f 27/27/27 34/34/34 42/42/42 -# Mesh 'OK' with 60 faces -g OK +# Mesh 'OK_OK' with 60 faces +g OK_OK usemtl Skin f 43/43/43 44/44/44 45/45/45 f 46/46/46 45/45/45 47/47/47 @@ -1928,8 +1928,8 @@ f 53/53/53 66/63/66 52/52/52 f 78/67/78 52/52/52 66/63/66 f 67/64/67 69/63/69 79/67/79 -# Mesh 'Bein1Li' with 98 faces -g Bein1Li +# Mesh 'Bein1Li_Bein1Li' with 98 faces +g Bein1Li_Bein1Li usemtl BeinTex f 80/68/80 81/68/80 82/68/80 f 83/68/81 84/68/81 85/68/81 @@ -2030,8 +2030,8 @@ f 129/114/128 94/122/92 92/121/90 f 130/115/129 125/116/130 94/122/92 f 125/116/130 83/123/94 94/122/92 -# Mesh 'Bein1Re' with 98 faces -g Bein1Re +# Mesh 'Bein1Re_Bein1Re' with 98 faces +g Bein1Re_Bein1Re usemtl BeinTex f 131/68/131 132/68/131 133/68/131 f 134/68/132 135/68/132 136/68/132 @@ -2132,8 +2132,8 @@ f 143/121/141 146/122/144 180/114/179 f 146/122/144 176/116/181 181/115/180 f 146/122/144 136/123/145 176/116/181 -# Mesh 'Bein2Li' with 98 faces -g Bein2Li +# Mesh 'Bein2Li_Bein2Li' with 98 faces +g Bein2Li_Bein2Li usemtl BeinTex f 182/68/182 183/68/182 184/68/182 f 185/68/183 186/68/183 187/68/183 @@ -2234,8 +2234,8 @@ f 231/114/230 196/122/194 194/121/192 f 232/115/231 227/116/232 196/122/194 f 227/116/232 185/123/196 196/122/194 -# Mesh 'Bein2Re' with 98 faces -g Bein2Re +# Mesh 'Bein2Re_Bein2Re' with 98 faces +g Bein2Re_Bein2Re usemtl BeinTex f 233/68/233 234/68/233 235/68/233 f 236/68/234 237/68/234 238/68/234 @@ -2336,8 +2336,8 @@ f 245/121/243 248/122/246 282/114/281 f 248/122/246 278/116/283 283/115/282 f 248/122/246 238/123/247 278/116/283 -# Mesh 'Bein3Re' with 98 faces -g Bein3Re +# Mesh 'Bein3Re_Bein3Re' with 98 faces +g Bein3Re_Bein3Re usemtl BeinTex f 284/68/284 285/68/284 286/68/284 f 287/68/285 288/68/285 289/68/285 @@ -2438,8 +2438,8 @@ f 296/121/294 299/122/297 333/114/332 f 299/122/297 329/116/334 334/115/333 f 299/122/297 289/123/298 329/116/334 -# Mesh 'Bein3Li' with 98 faces -g Bein3Li +# Mesh 'Bein3Li_Bein3Li' with 98 faces +g Bein3Li_Bein3Li usemtl BeinTex f 335/68/335 336/68/335 337/68/335 f 338/68/336 339/68/336 340/68/336 @@ -2540,8 +2540,8 @@ f 384/114/383 349/122/347 347/121/345 f 385/115/384 380/116/385 349/122/347 f 380/116/385 338/123/349 349/122/347 -# Mesh 'Bein4Re' with 98 faces -g Bein4Re +# Mesh 'Bein4Re_Bein4Re' with 98 faces +g Bein4Re_Bein4Re usemtl BeinTex f 386/68/386 387/68/386 388/68/386 f 389/68/387 390/68/387 391/68/387 @@ -2642,8 +2642,8 @@ f 398/121/396 401/122/399 435/114/434 f 401/122/399 431/116/436 436/115/435 f 401/122/399 391/123/400 431/116/436 -# Mesh 'Bein4Li' with 98 faces -g Bein4Li +# Mesh 'Bein4Li_Bein4Li' with 98 faces +g Bein4Li_Bein4Li usemtl BeinTex f 437/68/437 438/68/437 439/68/437 f 440/68/438 441/68/438 442/68/438 @@ -2744,8 +2744,8 @@ f 486/114/485 451/122/449 449/121/447 f 487/115/486 482/116/487 451/122/449 f 482/116/487 440/123/451 451/122/449 -# Mesh 'Zahn' with 42 faces -g Zahn +# Mesh 'Zahn_Zahn' with 42 faces +g Zahn_Zahn usemtl BeinTex f 488/124/488 488/124/488 488/124/488 f 489/125/489 490/126/489 491/127/489 @@ -2790,8 +2790,8 @@ f 488/124/505 492/128/491 488/124/490 f 503/139/506 502/138/507 492/128/491 f 502/138/507 489/125/493 492/128/491 -# Mesh 'klZahn' with 42 faces -g klZahn +# Mesh 'klZahn_klZahn' with 42 faces +g klZahn_klZahn usemtl BeinTex f 504/140/488 504/140/488 504/140/488 f 505/141/508 506/142/508 507/143/508 @@ -2836,8 +2836,8 @@ f 504/140/524 508/144/510 504/140/509 f 519/155/525 518/154/526 508/144/510 f 518/154/526 505/141/512 508/144/510 -# Mesh 'Kopf' with 90 faces -g Kopf +# Mesh 'Kopf_Kopf' with 90 faces +g Kopf_Kopf usemtl Skin f 520/68/527 521/156/528 522/157/529 f 520/68/527 523/158/530 521/156/528 @@ -2930,8 +2930,8 @@ f 564/197/571 562/195/569 545/178/552 f 545/178/552 552/185/559 566/199/573 f 564/197/571 566/199/573 545/178/552 -# Mesh 'Brust' with 20 faces -g Brust +# Mesh 'Brust_Brust' with 20 faces +g Brust_Brust usemtl Skin f 70/210/584 71/211/585 577/212/586 f 60/120/587 577/212/586 64/213/588 @@ -2954,8 +2954,8 @@ f 70/210/584 580/217/592 69/223/599 f 77/75/593 79/224/600 580/217/592 f 69/223/599 580/217/592 79/224/600 -# Mesh 'Kopf2' with 90 faces -g Kopf2 +# Mesh 'Kopf2_Kopf2' with 90 faces +g Kopf2_Kopf2 usemtl Skin f 582/225/601 583/226/602 584/123/603 f 583/226/602 585/227/604 584/123/603 @@ -3048,8 +3048,8 @@ f 607/245/626 624/262/643 625/263/644 f 627/265/646 614/252/633 607/245/626 f 607/245/626 627/265/646 625/263/644 -# Mesh 'Zahn2' with 42 faces -g Zahn2 +# Mesh 'Zahn2_Zahn2' with 42 faces +g Zahn2_Zahn2 usemtl BeinTex f 639/124/488 639/124/488 639/124/488 f 640/127/658 641/126/658 642/125/658 @@ -3094,8 +3094,8 @@ f 639/124/661 644/128/660 639/124/674 f 644/128/660 653/138/676 654/139/675 f 644/128/660 642/125/662 653/138/676 -# Mesh 'klZahn2' with 42 faces -g klZahn2 +# Mesh 'klZahn2_klZahn2' with 42 faces +g klZahn2_klZahn2 usemtl BeinTex f 655/140/488 655/140/488 655/140/488 f 656/143/677 657/142/677 658/141/677 @@ -3140,8 +3140,8 @@ f 655/140/680 660/144/679 655/140/693 f 660/144/679 669/154/695 670/155/694 f 660/144/679 658/141/681 669/154/695 -# Mesh 'Auge' with 38 faces -g Auge +# Mesh 'Auge_Auge' with 38 faces +g Auge_Auge usemtl Augentex f 671/277/696 672/278/697 673/279/698 f 671/277/696 673/279/698 674/280/699 @@ -3182,8 +3182,8 @@ f 681/287/706 684/290/709 696/302/721 f 689/295/714 696/302/721 688/294/713 f 684/290/709 688/294/713 696/302/721 -# Mesh 'Duplicate05' with 38 faces -g Duplicate05 +# Mesh 'Duplicate05_Duplicate05' with 38 faces +g Duplicate05_Duplicate05 usemtl Augentex f 697/279/722 698/278/723 699/277/724 f 700/280/725 697/279/722 699/277/724 @@ -3223,3 +3223,4 @@ f 710/290/735 713/294/738 712/291/737 f 722/302/747 710/290/735 708/287/733 f 713/294/738 722/302/747 716/295/741 f 722/302/747 713/294/738 710/290/735 + diff --git a/test/unit/utVersion.cpp b/test/unit/utVersion.cpp index 498a451e4..84177dbce 100644 --- a/test/unit/utVersion.cpp +++ b/test/unit/utVersion.cpp @@ -48,7 +48,7 @@ TEST_F( utVersion, aiGetLegalStringTest ) { EXPECT_NE( lv, nullptr ); std::string text( lv ); - size_t pos( text.find( std::string( "2016" ) ) ); + size_t pos( text.find( std::string( "2017" ) ) ); EXPECT_NE( pos, std::string::npos ); } From 8bc183182c971a3989f14f9a4340c634ed3505a7 Mon Sep 17 00:00:00 2001 From: Leo Terziman Date: Fri, 10 Mar 2017 14:42:17 +0100 Subject: [PATCH 10/22] Added new option to IFC importer to control tessellation angle + removed unused IFC option --- code/IFCLoader.cpp | 4 +--- code/IFCLoader.h | 2 -- include/assimp/config.h.in | 35 +++++++++++++++++++---------------- 3 files changed, 20 insertions(+), 21 deletions(-) diff --git a/code/IFCLoader.cpp b/code/IFCLoader.cpp index 1cc18fc3f..ff4eb4b1f 100644 --- a/code/IFCLoader.cpp +++ b/code/IFCLoader.cpp @@ -153,10 +153,8 @@ const aiImporterDesc* IFCImporter::GetInfo () const void IFCImporter::SetupProperties(const Importer* pImp) { settings.skipSpaceRepresentations = pImp->GetPropertyBool(AI_CONFIG_IMPORT_IFC_SKIP_SPACE_REPRESENTATIONS,true); - settings.skipCurveRepresentations = pImp->GetPropertyBool(AI_CONFIG_IMPORT_IFC_SKIP_CURVE_REPRESENTATIONS,true); settings.useCustomTriangulation = pImp->GetPropertyBool(AI_CONFIG_IMPORT_IFC_CUSTOM_TRIANGULATION,true); - - settings.conicSamplingAngle = 10.f; + settings.conicSamplingAngle = pImp->GetPropertyFloat(AI_CONFIG_IMPORT_IFC_CONIC_SAMPLING_ANGLE, AI_IMPORT_IFC_DEFAULT_CONIC_SAMPLING_ANGLE); settings.skipAnnotations = true; } diff --git a/code/IFCLoader.h b/code/IFCLoader.h index e301a329d..70a7b1685 100644 --- a/code/IFCLoader.h +++ b/code/IFCLoader.h @@ -107,7 +107,6 @@ public: { Settings() : skipSpaceRepresentations() - , skipCurveRepresentations() , useCustomTriangulation() , skipAnnotations() , conicSamplingAngle(10.f) @@ -115,7 +114,6 @@ public: bool skipSpaceRepresentations; - bool skipCurveRepresentations; bool useCustomTriangulation; bool skipAnnotations; float conicSamplingAngle; diff --git a/include/assimp/config.h.in b/include/assimp/config.h.in index 148a68868..e1af72bbb 100644 --- a/include/assimp/config.h.in +++ b/include/assimp/config.h.in @@ -844,14 +844,6 @@ enum aiComponent #define AI_CONFIG_IMPORT_OGRE_TEXTURETYPE_FROM_FILENAME \ "IMPORT_OGRE_TEXTURETYPE_FROM_FILENAME" -/** @brief Specifies whether the IFC loader skips over IfcSpace elements. - * - * IfcSpace elements (and their geometric representations) are used to - * represent, well, free space in a building storey.
- * Property type: Bool. Default value: true. - */ -#define AI_CONFIG_IMPORT_IFC_SKIP_SPACE_REPRESENTATIONS "IMPORT_IFC_SKIP_SPACE_REPRESENTATIONS" - /** @brief Specifies whether the Android JNI asset extraction is supported. * * Turn on this option if you want to manage assets in native @@ -860,17 +852,13 @@ enum aiComponent */ #define AI_CONFIG_ANDROID_JNI_ASSIMP_MANAGER_SUPPORT "AI_CONFIG_ANDROID_JNI_ASSIMP_MANAGER_SUPPORT" - -// --------------------------------------------------------------------------- -/** @brief Specifies whether the IFC loader skips over - * shape representations of type 'Curve2D'. +/** @brief Specifies whether the IFC loader skips over IfcSpace elements. * - * A lot of files contain both a faceted mesh representation and a outline - * with a presentation type of 'Curve2D'. Currently Assimp doesn't convert those, - * so turning this option off just clutters the log with errors.
+ * IfcSpace elements (and their geometric representations) are used to + * represent, well, free space in a building storey.
* Property type: Bool. Default value: true. */ -#define AI_CONFIG_IMPORT_IFC_SKIP_CURVE_REPRESENTATIONS "IMPORT_IFC_SKIP_CURVE_REPRESENTATIONS" +#define AI_CONFIG_IMPORT_IFC_SKIP_SPACE_REPRESENTATIONS "IMPORT_IFC_SKIP_SPACE_REPRESENTATIONS" // --------------------------------------------------------------------------- /** @brief Specifies whether the IFC loader will use its own, custom triangulation @@ -887,6 +875,21 @@ enum aiComponent */ #define AI_CONFIG_IMPORT_IFC_CUSTOM_TRIANGULATION "IMPORT_IFC_CUSTOM_TRIANGULATION" +// --------------------------------------------------------------------------- + /** @brief Set the tessellation conic angle for IFC curves. + * + * This is used by the IFC importer to determine the tessellation parameter + * for curves. + * @note The default value is AI_IMPORT_IFC_DEFAULT_CONIC_SAMPLING_ANGLE + * Property type: float. + */ +#define AI_CONFIG_IMPORT_IFC_CONIC_SAMPLING_ANGLE "IMPORT_IFC_CONIC_SAMPLING_ANGLE" + +// default value for AI_CONFIG_IMPORT_IFC_CONIC_SAMPLING_ANGLE +#if (!defined AI_IMPORT_IFC_DEFAULT_CONIC_SAMPLING_ANGLE) +# define AI_IMPORT_IFC_DEFAULT_CONIC_SAMPLING_ANGLE 10.0f +#endif + // --------------------------------------------------------------------------- /** @brief Specifies whether the Collada loader will ignore the provided up direction. * From bd33bcaa0d2d96673bd6aae71aa653e968ba8ebb Mon Sep 17 00:00:00 2001 From: Leo Terziman Date: Fri, 10 Mar 2017 14:46:28 +0100 Subject: [PATCH 11/22] Fixed some formatting --- include/assimp/config.h.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/assimp/config.h.in b/include/assimp/config.h.in index e1af72bbb..b8962520e 100644 --- a/include/assimp/config.h.in +++ b/include/assimp/config.h.in @@ -852,6 +852,7 @@ enum aiComponent */ #define AI_CONFIG_ANDROID_JNI_ASSIMP_MANAGER_SUPPORT "AI_CONFIG_ANDROID_JNI_ASSIMP_MANAGER_SUPPORT" +// --------------------------------------------------------------------------- /** @brief Specifies whether the IFC loader skips over IfcSpace elements. * * IfcSpace elements (and their geometric representations) are used to @@ -876,7 +877,7 @@ enum aiComponent #define AI_CONFIG_IMPORT_IFC_CUSTOM_TRIANGULATION "IMPORT_IFC_CUSTOM_TRIANGULATION" // --------------------------------------------------------------------------- - /** @brief Set the tessellation conic angle for IFC curves. +/** @brief Set the tessellation conic angle for IFC curves. * * This is used by the IFC importer to determine the tessellation parameter * for curves. From 6179e22749a6a007bb5c9f607d4e768b6d75acd3 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sat, 11 Mar 2017 11:34:23 +0100 Subject: [PATCH 12/22] StringUtils: add missing include for VS2012 & 2013 --- code/StringUtils.h | 1 + 1 file changed, 1 insertion(+) diff --git a/code/StringUtils.h b/code/StringUtils.h index b1cfa3d13..18041459d 100644 --- a/code/StringUtils.h +++ b/code/StringUtils.h @@ -41,6 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define INCLUDED_AI_STRINGUTILS_H #include +#include /// @fn ai_snprintf /// @brief The portable version of the function snprintf ( C99 standard ), which works on visual studio compilers 2013 and earlier. From b47bfeb0d7a56a2ecb8e67fe60dd802c1d17e23b Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sat, 11 Mar 2017 17:25:34 +0100 Subject: [PATCH 13/22] StringUtils: add the right missing header. --- code/StringUtils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/StringUtils.h b/code/StringUtils.h index 18041459d..434ab4520 100644 --- a/code/StringUtils.h +++ b/code/StringUtils.h @@ -41,7 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define INCLUDED_AI_STRINGUTILS_H #include -#include +#include /// @fn ai_snprintf /// @brief The portable version of the function snprintf ( C99 standard ), which works on visual studio compilers 2013 and earlier. From 2cd6c3d7558d845fc87002168dd56b4dd68c277c Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Tue, 14 Mar 2017 19:01:41 +0100 Subject: [PATCH 14/22] Closes https://github.com/assimp/assimp/issues/1128: do not use non verbose format flag for import. --- code/D3MFImporter.cpp | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/code/D3MFImporter.cpp b/code/D3MFImporter.cpp index 9b4f6d2f9..500b27528 100644 --- a/code/D3MFImporter.cpp +++ b/code/D3MFImporter.cpp @@ -97,31 +97,21 @@ public: } - void ImportXml(aiScene* scene) - { - - scene->mFlags |= AI_SCENE_FLAGS_NON_VERBOSE_FORMAT; - + void ImportXml(aiScene* scene) { scene->mRootNode = new aiNode(); std::vector children; - while(ReadToEndElement(D3MF::XmlTag::model)) - { - - if(xmlReader->getNodeName() == D3MF::XmlTag::object) - { + while(ReadToEndElement(D3MF::XmlTag::model)) { + if(xmlReader->getNodeName() == D3MF::XmlTag::object) { children.push_back(ReadObject(scene)); - } - else if(xmlReader->getNodeName() == D3MF::XmlTag::build) - { - + } else if(xmlReader->getNodeName() == D3MF::XmlTag::build) { + // ??? } } if(scene->mRootNode->mName.length == 0) scene->mRootNode->mName.Set("3MF"); - scene->mNumMeshes = static_cast(meshes.size()); scene->mMeshes = new aiMesh*[scene->mNumMeshes](); From baafa63621a25280261d958e2dcf0baeec620cfe Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Tue, 14 Mar 2017 19:24:20 +0100 Subject: [PATCH 15/22] Unittests: add 3mf load test. --- test/CMakeLists.txt | 1 + test/unit/utD3MFImportExport.cpp | 57 ++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 test/unit/utD3MFImportExport.cpp diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index c7f4ccdad..84c45451f 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -122,6 +122,7 @@ SET( TEST_SRCS unit/utVersion.cpp unit/utVector3.cpp unit/utXImporterExporter.cpp + unit/utD3MFImportExport.cpp ) SOURCE_GROUP( tests FILES ${TEST_SRCS} ) diff --git a/test/unit/utD3MFImportExport.cpp b/test/unit/utD3MFImportExport.cpp new file mode 100644 index 000000000..62de9d156 --- /dev/null +++ b/test/unit/utD3MFImportExport.cpp @@ -0,0 +1,57 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library (assimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2016, 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 "UnitTestPCH.h" +#include "AbstractImportExportBase.h" + +#include + +class utD3MFImporterExporter : public AbstractImportExportBase { +public: + virtual bool importerTest() { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/3MF/box.3mf", 0); + return nullptr != scene; + } +}; + +TEST_F(utD3MFImporterExporter, import3MFFromFileTest) { + EXPECT_TRUE(importerTest()); +} From 78a58ef5f0b2463d6b6e9cd29cf08df510da97f6 Mon Sep 17 00:00:00 2001 From: girinon Date: Thu, 16 Mar 2017 12:03:04 +0100 Subject: [PATCH 16/22] operators to add and multiply by floats --- include/assimp/matrix4x4.h | 2 ++ include/assimp/matrix4x4.inl | 48 ++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/include/assimp/matrix4x4.h b/include/assimp/matrix4x4.h index 17b2d3106..9f87efca7 100644 --- a/include/assimp/matrix4x4.h +++ b/include/assimp/matrix4x4.h @@ -112,6 +112,8 @@ public: // matrix multiplication. aiMatrix4x4t& operator *= (const aiMatrix4x4t& m); aiMatrix4x4t operator * (const aiMatrix4x4t& m) const; + aiMatrix4x4t operator * (const TReal& aFloat) const; + aiMatrix4x4t operator + (const aiMatrix4x4t& aMatrix) const; template operator aiMatrix4x4t () const; diff --git a/include/assimp/matrix4x4.inl b/include/assimp/matrix4x4.inl index 32012654c..c36c893ce 100644 --- a/include/assimp/matrix4x4.inl +++ b/include/assimp/matrix4x4.inl @@ -155,6 +155,54 @@ inline aiMatrix4x4t& aiMatrix4x4t::operator *= (const aiMatrix4x4t return *this; } +// ---------------------------------------------------------------------------------------- +template +inline aiMatrix4x4t aiMatrix4x4t::operator* (const TReal& aFloat) const +{ + aiMatrix4x4t temp( + a1 * aFloat, + a2 * aFloat, + a3 * aFloat, + a4 * aFloat, + b1 * aFloat, + b2 * aFloat, + b3 * aFloat, + b4 * aFloat, + c1 * aFloat, + c2 * aFloat, + c3 * aFloat, + c4 * aFloat, + d1 * aFloat, + d2 * aFloat, + d3 * aFloat, + d4 * aFloat); + return temp; +} + +// ---------------------------------------------------------------------------------------- +template +inline aiMatrix4x4t aiMatrix4x4t::operator+ (const aiMatrix4x4t& m) const +{ + aiMatrix4x4t temp( + m.a1 + a1, + m.a2 + a2, + m.a3 + a3, + m.a4 + a4, + m.b1 + b1, + m.b2 + b2, + m.b3 + b3, + m.b4 + b4, + m.c1 + c1, + m.c2 + c2, + m.c3 + c3, + m.c4 + c4, + m.d1 + d1, + m.d2 + d2, + m.d3 + d3, + m.d4 + d4); + return temp; +} + // ---------------------------------------------------------------------------------------- template inline aiMatrix4x4t aiMatrix4x4t::operator* (const aiMatrix4x4t& m) const From fff0e886a13a94cc84bec6b081c1692a5690ab2a Mon Sep 17 00:00:00 2001 From: Leo Terziman Date: Fri, 17 Mar 2017 11:53:36 +0100 Subject: [PATCH 17/22] Fixed bug in IFC openings when curmesh.vertcnt is empty --- code/IFCOpenings.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/code/IFCOpenings.cpp b/code/IFCOpenings.cpp index c2a7439ee..f40b49fe4 100644 --- a/code/IFCOpenings.cpp +++ b/code/IFCOpenings.cpp @@ -901,13 +901,21 @@ size_t CloseWindows(ContourVector& contours, curmesh.verts.reserve(curmesh.verts.size() + (*it).contour.size() * 4); curmesh.vertcnt.reserve(curmesh.vertcnt.size() + (*it).contour.size()); + bool reverseCountourFaces = false; + // compare base poly normal and contour normal to detect if we need to reverse the face winding - IfcVector3 basePolyNormal = TempMesh::ComputePolygonNormal( curmesh.verts.data(), curmesh.vertcnt.front()); - std::vector worldSpaceContourVtx( it->contour.size()); - for( size_t a = 0; a < it->contour.size(); ++a ) - worldSpaceContourVtx[a] = minv * IfcVector3( it->contour[a].x, it->contour[a].y, 0.0); - IfcVector3 contourNormal = TempMesh::ComputePolygonNormal( worldSpaceContourVtx.data(), worldSpaceContourVtx.size()); - bool reverseCountourFaces = (contourNormal * basePolyNormal) > 0.0; + if(curmesh.vertcnt.size() > 0) { + IfcVector3 basePolyNormal = TempMesh::ComputePolygonNormal(curmesh.verts.data(), curmesh.vertcnt.front()); + + std::vector worldSpaceContourVtx(it->contour.size()); + + for(size_t a = 0; a < it->contour.size(); ++a) + worldSpaceContourVtx[a] = minv * IfcVector3(it->contour[a].x, it->contour[a].y, 0.0); + + IfcVector3 contourNormal = TempMesh::ComputePolygonNormal(worldSpaceContourVtx.data(), worldSpaceContourVtx.size()); + + reverseCountourFaces = (contourNormal * basePolyNormal) > 0.0; + } // XXX this algorithm is really a bit inefficient - both in terms // of constant factor and of asymptotic runtime. From 9ef234b8424f0ca33f2252a56cfd9c5f2e06b4ac Mon Sep 17 00:00:00 2001 From: Leo Terziman Date: Fri, 17 Mar 2017 11:58:50 +0100 Subject: [PATCH 18/22] Added parameter to control cylindrical shapes tessellation + renamed smoothing angle parameter for better user understanding --- code/IFCLoader.cpp | 5 +++-- code/IFCLoader.h | 2 ++ code/IFCProfile.cpp | 4 ++-- include/assimp/config.h.in | 33 +++++++++++++++++++++++++-------- 4 files changed, 32 insertions(+), 12 deletions(-) diff --git a/code/IFCLoader.cpp b/code/IFCLoader.cpp index ff4eb4b1f..dc31f4c59 100644 --- a/code/IFCLoader.cpp +++ b/code/IFCLoader.cpp @@ -154,8 +154,9 @@ void IFCImporter::SetupProperties(const Importer* pImp) { settings.skipSpaceRepresentations = pImp->GetPropertyBool(AI_CONFIG_IMPORT_IFC_SKIP_SPACE_REPRESENTATIONS,true); settings.useCustomTriangulation = pImp->GetPropertyBool(AI_CONFIG_IMPORT_IFC_CUSTOM_TRIANGULATION,true); - settings.conicSamplingAngle = pImp->GetPropertyFloat(AI_CONFIG_IMPORT_IFC_CONIC_SAMPLING_ANGLE, AI_IMPORT_IFC_DEFAULT_CONIC_SAMPLING_ANGLE); - settings.skipAnnotations = true; + settings.conicSamplingAngle = std::min(std::max(pImp->GetPropertyFloat(AI_CONFIG_IMPORT_IFC_SMOOTHING_ANGLE, AI_IMPORT_IFC_DEFAULT_SMOOTHING_ANGLE), 5.0f), 120.0f); + settings.cylindricalTessellation = std::min(std::max(pImp->GetPropertyInteger(AI_CONFIG_IMPORT_IFC_CYLINDRICAL_TESSELLATION, AI_IMPORT_IFC_DEFAULT_CYLINDRICAL_TESSELLATION), 3), 180); + settings.skipAnnotations = true; } diff --git a/code/IFCLoader.h b/code/IFCLoader.h index 70a7b1685..9fa6cba38 100644 --- a/code/IFCLoader.h +++ b/code/IFCLoader.h @@ -110,6 +110,7 @@ public: , useCustomTriangulation() , skipAnnotations() , conicSamplingAngle(10.f) + , cylindricalTessellation(32) {} @@ -117,6 +118,7 @@ public: bool useCustomTriangulation; bool skipAnnotations; float conicSamplingAngle; + int cylindricalTessellation; }; diff --git a/code/IFCProfile.cpp b/code/IFCProfile.cpp index a84f98f58..866b874c9 100644 --- a/code/IFCProfile.cpp +++ b/code/IFCProfile.cpp @@ -101,7 +101,7 @@ void ProcessOpenProfile(const IfcArbitraryOpenProfileDef& def, TempMesh& meshout } // ------------------------------------------------------------------------------------------------ -void ProcessParametrizedProfile(const IfcParameterizedProfileDef& def, TempMesh& meshout, ConversionData& /*conv*/) +void ProcessParametrizedProfile(const IfcParameterizedProfileDef& def, TempMesh& meshout, ConversionData& conv) { if(const IfcRectangleProfileDef* const cprofile = def.ToPtr()) { const IfcFloat x = cprofile->XDim*0.5f, y = cprofile->YDim*0.5f; @@ -117,7 +117,7 @@ void ProcessParametrizedProfile(const IfcParameterizedProfileDef& def, TempMesh& if(def.ToPtr()) { // TODO } - const size_t segments = 32; + const size_t segments = conv.settings.cylindricalTessellation; const IfcFloat delta = AI_MATH_TWO_PI_F/segments, radius = circle->Radius; meshout.verts.reserve(segments); diff --git a/include/assimp/config.h.in b/include/assimp/config.h.in index b8962520e..9f0e70704 100644 --- a/include/assimp/config.h.in +++ b/include/assimp/config.h.in @@ -877,18 +877,35 @@ enum aiComponent #define AI_CONFIG_IMPORT_IFC_CUSTOM_TRIANGULATION "IMPORT_IFC_CUSTOM_TRIANGULATION" // --------------------------------------------------------------------------- -/** @brief Set the tessellation conic angle for IFC curves. +/** @brief Set the tessellation conic angle for IFC smoothing curves. * * This is used by the IFC importer to determine the tessellation parameter - * for curves. - * @note The default value is AI_IMPORT_IFC_DEFAULT_CONIC_SAMPLING_ANGLE - * Property type: float. + * for smoothing curves. + * @note The default value is AI_IMPORT_IFC_DEFAULT_SMOOTHING_ANGLE and the + * accepted values are in range [5.0, 120.0]. + * Property type: Float. */ -#define AI_CONFIG_IMPORT_IFC_CONIC_SAMPLING_ANGLE "IMPORT_IFC_CONIC_SAMPLING_ANGLE" +#define AI_CONFIG_IMPORT_IFC_SMOOTHING_ANGLE "IMPORT_IFC_SMOOTHING_ANGLE" -// default value for AI_CONFIG_IMPORT_IFC_CONIC_SAMPLING_ANGLE -#if (!defined AI_IMPORT_IFC_DEFAULT_CONIC_SAMPLING_ANGLE) -# define AI_IMPORT_IFC_DEFAULT_CONIC_SAMPLING_ANGLE 10.0f +// default value for AI_CONFIG_IMPORT_IFC_SMOOTHING_ANGLE +#if (!defined AI_IMPORT_IFC_DEFAULT_SMOOTHING_ANGLE) +# define AI_IMPORT_IFC_DEFAULT_SMOOTHING_ANGLE 10.0f +#endif + +// --------------------------------------------------------------------------- +/** @brief Set the tessellation for IFC cylindrical shapes. + * + * This is used by the IFC importer to determine the tessellation parameter + * for cylindrical shapes, i.e. the number of segments used to aproximate a circle. + * @note The default value is AI_IMPORT_IFC_DEFAULT_CYLINDRICAL_TESSELLATION and the + * accepted values are in range [3, 180]. + * Property type: Integer. + */ +#define AI_CONFIG_IMPORT_IFC_CYLINDRICAL_TESSELLATION "IMPORT_IFC_CYLINDRICAL_TESSELLATION" + +// default value for AI_CONFIG_IMPORT_IFC_CYLINDRICAL_TESSELLATION +#if (!defined AI_IMPORT_IFC_DEFAULT_CYLINDRICAL_TESSELLATION) +# define AI_IMPORT_IFC_DEFAULT_CYLINDRICAL_TESSELLATION 32 #endif // --------------------------------------------------------------------------- From bf2e2f75374db266e322db38a484ffe5a9675196 Mon Sep 17 00:00:00 2001 From: Leo Terziman Date: Fri, 17 Mar 2017 14:55:18 +0100 Subject: [PATCH 19/22] Extended support for tessellation parameter to more IFC shapes --- code/IFCGeometry.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/IFCGeometry.cpp b/code/IFCGeometry.cpp index f80fadff9..908f5e065 100644 --- a/code/IFCGeometry.cpp +++ b/code/IFCGeometry.cpp @@ -258,7 +258,7 @@ void ProcessRevolvedAreaSolid(const IfcRevolvedAreaSolid& solid, TempMesh& resul return; } - const unsigned int cnt_segments = std::max(2u,static_cast(16 * std::fabs(max_angle)/AI_MATH_HALF_PI_F)); + const unsigned int cnt_segments = std::max(2u,static_cast(conv.settings.cylindricalTessellation * std::fabs(max_angle)/AI_MATH_HALF_PI_F)); const IfcFloat delta = max_angle/cnt_segments; has_area = has_area && std::fabs(max_angle) < AI_MATH_TWO_PI_F*0.99; @@ -327,7 +327,7 @@ void ProcessSweptDiskSolid(const IfcSweptDiskSolid solid, TempMesh& result, Conv return; } - const unsigned int cnt_segments = 16; + const unsigned int cnt_segments = conv.settings.cylindricalTessellation; const IfcFloat deltaAngle = AI_MATH_TWO_PI/cnt_segments; const size_t samples = curve->EstimateSampleCount(solid.StartParam,solid.EndParam); From 209e97276296bc99bbc05f09160ffafa84196e8f Mon Sep 17 00:00:00 2001 From: rmitton Date: Sat, 18 Mar 2017 14:52:48 -0700 Subject: [PATCH 20/22] Fixed faceted normals in SIB importer. --- code/SIBImporter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/SIBImporter.cpp b/code/SIBImporter.cpp index f7471e563..2da683bed 100644 --- a/code/SIBImporter.cpp +++ b/code/SIBImporter.cpp @@ -437,9 +437,9 @@ static aiVector3D CalculateVertexNormal(SIBMesh* mesh, uint32_t faceIdx, uint32_ // Move to whichever side we didn't just come from. if (!edge.creased) { - if (edge.faceA != prevFaceIdx && edge.faceA != faceIdx) + if (edge.faceA != prevFaceIdx && edge.faceA != faceIdx && edge.faceA != 0xffffffff) nextFaceIdx = edge.faceA; - else if (edge.faceB != prevFaceIdx && edge.faceB != faceIdx) + else if (edge.faceB != prevFaceIdx && edge.faceB != faceIdx && edge.faceB != 0xffffffff) nextFaceIdx = edge.faceB; } } From d1c7d905e83e3e0ff929cb53459921803c922980 Mon Sep 17 00:00:00 2001 From: rmitton Date: Sun, 19 Mar 2017 13:46:23 -0700 Subject: [PATCH 21/22] Fixed infinite loop on non-manifold geometry Geometry that had strange non-manifold faces could cause the normal calculation to enter an infinite loop. Instead we now correctly detect which faces to scan over. --- code/SIBImporter.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/code/SIBImporter.cpp b/code/SIBImporter.cpp index 2da683bed..0a4df61a3 100644 --- a/code/SIBImporter.cpp +++ b/code/SIBImporter.cpp @@ -391,7 +391,7 @@ static void ConnectFaces(SIBMesh* mesh) // with non-2-manifold surfaces, but then so does Silo to begin with. if (edge.faceA == 0xffffffff) edge.faceA = static_cast(faceIdx); - else + else if (edge.faceB == 0xffffffff) edge.faceB = static_cast(faceIdx); prev = next; @@ -435,12 +435,17 @@ static aiVector3D CalculateVertexNormal(SIBMesh* mesh, uint32_t faceIdx, uint32_ { SIBEdge& edge = GetEdge(mesh, posA, posB); - // Move to whichever side we didn't just come from. - if (!edge.creased) { - if (edge.faceA != prevFaceIdx && edge.faceA != faceIdx && edge.faceA != 0xffffffff) - nextFaceIdx = edge.faceA; - else if (edge.faceB != prevFaceIdx && edge.faceB != faceIdx && edge.faceB != 0xffffffff) - nextFaceIdx = edge.faceB; + // Non-manifold meshes can produce faces which share + // positions but have no edge entry, so check it. + if (edge.faceA == faceIdx || edge.faceB == faceIdx) + { + // Move to whichever side we didn't just come from. + if (!edge.creased) { + if (edge.faceA != prevFaceIdx && edge.faceA != faceIdx && edge.faceA != 0xffffffff) + nextFaceIdx = edge.faceA; + else if (edge.faceB != prevFaceIdx && edge.faceB != faceIdx && edge.faceB != 0xffffffff) + nextFaceIdx = edge.faceB; + } } } From 1ca54c0b2f85e82731e1f301c2e5a80a1c9ba893 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Thu, 23 Mar 2017 17:11:52 +0100 Subject: [PATCH 22/22] closes https://github.com/assimp/assimp/issues/1211: defensice handling of utf-8 decode issues. --- port/PyAssimp/pyassimp/core.py | 72 ++++++++++++++++++---------------- 1 file changed, 38 insertions(+), 34 deletions(-) diff --git a/port/PyAssimp/pyassimp/core.py b/port/PyAssimp/pyassimp/core.py index 27ec44c97..ac3df9290 100644 --- a/port/PyAssimp/pyassimp/core.py +++ b/port/PyAssimp/pyassimp/core.py @@ -70,7 +70,7 @@ def make_tuple(ai_obj, type = None): def _init_face(aiFace): aiFace.indices = [aiFace.mIndices[i] for i in range(aiFace.mNumIndices)] assimp_struct_inits = { structs.Face : _init_face } - + def call_init(obj, caller = None): if helper.hasattr_silent(obj,'contents'): #pointer _init(obj.contents, obj, caller) @@ -85,12 +85,12 @@ def _is_init_type(obj): # so it breaks the 'is iterable' check. # Basically: # FIXME! - elif not bool(obj): + elif not bool(obj): return False tname = obj.__class__.__name__ return not (tname[:2] == 'c_' or tname == 'Structure' \ or tname == 'POINTER') and not isinstance(obj,int) - + def _init(self, target = None, parent = None): """ Custom initialize() for C structs, adds safely accessible member functionality. @@ -100,8 +100,8 @@ def _init(self, target = None, parent = None): """ if not target: target = self - - dirself = dir(self) + + dirself = dir(self) for m in dirself: if m.startswith("_"): @@ -119,11 +119,12 @@ def _init(self, target = None, parent = None): if m == 'mName': obj = self.mName - target.name = str(obj.data.decode("utf-8")) + uni = unicode(obj.data, errors='ignore') + target.name = str( uni ) target.__class__.__repr__ = lambda x: str(x.__class__) + "(" + x.name + ")" target.__class__.__str__ = lambda x: x.name continue - + name = m[1:].lower() obj = getattr(self, m) @@ -144,7 +145,7 @@ def _init(self, target = None, parent = None): if helper.hasattr_silent(self, 'mNum' + m[1:]): length = getattr(self, 'mNum' + m[1:]) - + # -> special case: properties are # stored as a dict. if m == 'mProperties': @@ -156,7 +157,7 @@ def _init(self, target = None, parent = None): setattr(target, name, []) logger.debug(str(self) + ": " + name + " is an empty list.") continue - + try: if obj._type_ in structs.assimp_structs_as_tuple: @@ -166,7 +167,7 @@ def _init(self, target = None, parent = None): logger.debug(str(self) + ": Added an array of numpy arrays (type "+ str(type(obj)) + ") as self." + name) else: setattr(target, name, [make_tuple(obj[i]) for i in range(length)]) - + logger.debug(str(self) + ": Added a list of lists (type "+ str(type(obj)) + ") as self." + name) else: @@ -191,7 +192,7 @@ def _init(self, target = None, parent = None): sys.exit(1) except ValueError as e: - + logger.error("In " + str(self) + "->" + name + ": " + str(e) + ". Quitting now.") if "setting an array element with a sequence" in str(e): logger.error("Note that pyassimp does not currently " @@ -200,13 +201,13 @@ def _init(self, target = None, parent = None): " a post-processing to triangulate your" " faces.") raise e - + else: # starts with 'm' but not iterable setattr(target, name, obj) logger.debug("Added " + name + " as self." + name + " (type: " + str(type(obj)) + ")") - + if _is_init_type(obj): call_init(obj, target) @@ -265,34 +266,34 @@ def recur_pythonize(node, scene): for c in node.children: recur_pythonize(c, scene) -def load(filename, +def load(filename, file_type = None, processing = postprocess.aiProcess_Triangulate): ''' Load a model into a scene. On failure throws AssimpError. - + Arguments --------- filename: Either a filename or a file object to load model from. If a file object is passed, file_type MUST be specified Otherwise Assimp has no idea which importer to use. - This is named 'filename' so as to not break legacy code. + This is named 'filename' so as to not break legacy code. processing: assimp postprocessing parameters. Verbose keywords are imported from postprocessing, and the parameters can be combined bitwise to generate the final processing value. Note that the default value will triangulate quad faces. Example of generating other possible values: - processing = (pyassimp.postprocess.aiProcess_Triangulate | + processing = (pyassimp.postprocess.aiProcess_Triangulate | pyassimp.postprocess.aiProcess_OptimizeMeshes) file_type: string of file extension, such as 'stl' - + Returns --------- Scene object with model data ''' - + if hasattr(filename, 'read'): ''' - This is the case where a file object has been passed to load. + This is the case where a file object has been passed to load. It is calling the following function: const aiScene* aiImportFileFromMemory(const char* pBuffer, unsigned int pLength, @@ -302,14 +303,14 @@ def load(filename, if file_type == None: raise AssimpError('File type must be specified when passing file objects!') data = filename.read() - model = _assimp_lib.load_mem(data, - len(data), - processing, + model = _assimp_lib.load_mem(data, + len(data), + processing, file_type) else: # a filename string has been passed model = _assimp_lib.load(filename.encode("ascii"), processing) - + if not model: raise AssimpError('Could not import file!') scene = _init(model.contents) @@ -317,22 +318,22 @@ def load(filename, return scene def export(scene, - filename, + filename, file_type = None, processing = postprocess.aiProcess_Triangulate): ''' Export a scene. On failure throws AssimpError. - + Arguments --------- scene: scene to export. - filename: Filename that the scene should be exported to. + filename: Filename that the scene should be exported to. file_type: string of file exporter to use. For example "collada". processing: assimp postprocessing parameters. Verbose keywords are imported from postprocessing, and the parameters can be combined bitwise to generate the final processing value. Note that the default value will triangulate quad faces. Example of generating other possible values: - processing = (pyassimp.postprocess.aiProcess_Triangulate | + processing = (pyassimp.postprocess.aiProcess_Triangulate | pyassimp.postprocess.aiProcess_OptimizeMeshes) ''' @@ -400,7 +401,7 @@ def _finalize_mesh(mesh, target): fillarray("mColors") fillarray("mTextureCoords") - + # prepare faces if numpy: faces = numpy.array([f.indices for f in target.faces], dtype=numpy.int32) @@ -429,7 +430,7 @@ class PropertyGetter(dict): yield k[0], v -def _get_properties(properties, length): +def _get_properties(properties, length): """ Convenience Function to get the material properties as a dict and values in a python format. @@ -439,7 +440,8 @@ def _get_properties(properties, length): for p in [properties[i] for i in range(length)]: #the name p = p.contents - key = (str(p.mKey.data.decode("utf-8")).split('.')[1], p.mSemantic) + uni = unicode(p.mKey.data, errors='ignore') + key = (str(uni).split('.')[1], p.mSemantic) #the data from ctypes import POINTER, cast, c_int, c_float, sizeof @@ -447,7 +449,9 @@ def _get_properties(properties, length): arr = cast(p.mData, POINTER(c_float * int(p.mDataLength/sizeof(c_float)) )).contents value = [x for x in arr] elif p.mType == 3: #string can't be an array - value = cast(p.mData, POINTER(structs.MaterialPropertyString)).contents.data.decode("utf-8") + uni = unicode(cast(p.mData, POINTER(structs.MaterialPropertyString)).contents.data, errors='ignore') + value = uni + elif p.mType == 4: arr = cast(p.mData, POINTER(c_int * int(p.mDataLength/sizeof(c_int)) )).contents value = [x for x in arr] @@ -464,11 +468,11 @@ def _get_properties(properties, length): def decompose_matrix(matrix): if not isinstance(matrix, structs.Matrix4x4): raise AssimpError("pyassimp.decompose_matrix failed: Not a Matrix4x4!") - + scaling = structs.Vector3D() rotation = structs.Quaternion() position = structs.Vector3D() - + from ctypes import byref, pointer _assimp_lib.dll.aiDecomposeMatrix(pointer(matrix), byref(scaling), byref(rotation), byref(position)) return scaling._init(), rotation._init(), position._init()