From 1529f9518fcf826c22f2840d584f6c4f39b6b2eb Mon Sep 17 00:00:00 2001 From: Aaron Franke Date: Sat, 21 Mar 2020 02:34:12 -0400 Subject: [PATCH 001/115] Make file formatting comply with POSIX and Unix standards UTF-8, LF, no BOM, and newlines at the end of files --- INSTALL | 100 +++++++++--------- code/AMF/AMFImporter_Geometry.cpp | 2 +- code/AMF/AMFImporter_Macro.hpp | 2 +- code/AMF/AMFImporter_Material.cpp | 2 +- code/AMF/AMFImporter_Node.hpp | 2 +- code/AMF/AMFImporter_Postprocess.cpp | 2 +- code/Common/ImporterRegistry.cpp | 2 +- code/MMD/MMDImporter.h | 2 +- code/PostProcessing/ArmaturePopulate.h | 2 +- code/PostProcessing/ScaleProcess.h | 2 +- code/PostProcessing/ValidateDataStructure.cpp | 2 +- code/glTF/glTFAsset.h | 2 +- code/glTF/glTFExporter.cpp | 2 +- code/glTF/glTFImporter.cpp | 2 +- code/glTF2/glTF2Asset.h | 2 +- code/glTF2/glTF2Exporter.cpp | 2 +- contrib/Open3DGC/o3dgcSC3DMCDecoder.h | 2 +- contrib/android-cmake/README.md | 2 +- contrib/gtest/docs/Documentation.md | 2 +- contrib/gtest/docs/V1_5_Documentation.md | 2 +- contrib/gtest/docs/V1_5_PumpManual.md | 2 +- contrib/gtest/docs/V1_5_XcodeGuide.md | 2 +- contrib/gtest/docs/V1_6_Documentation.md | 2 +- contrib/gtest/docs/V1_6_XcodeGuide.md | 2 +- contrib/gtest/docs/V1_7_Documentation.md | 2 +- contrib/gtest/docs/V1_7_XcodeGuide.md | 2 +- contrib/gtest/docs/XcodeGuide.md | 2 +- contrib/poly2tri/README | 4 +- contrib/poly2tri/poly2tri/common/shapes.cc | 2 +- contrib/poly2tri/poly2tri/common/shapes.h | 2 +- contrib/poly2tri/poly2tri/poly2tri.h | 2 +- .../poly2tri/sweep/advancing_front.cc | 2 +- .../poly2tri/poly2tri/sweep/advancing_front.h | 2 +- contrib/poly2tri/poly2tri/sweep/cdt.cc | 2 +- contrib/poly2tri/poly2tri/sweep/cdt.h | 2 +- contrib/poly2tri/poly2tri/sweep/sweep.h | 2 +- contrib/stb_image/stb_image.h | 2 +- contrib/zip/.travis.sh | 2 +- contrib/zip/.travis.yml | 2 +- contrib/zlib/contrib/blast/test.txt | 2 +- contrib/zlib/contrib/dotzlib/LICENSE_1_0.txt | 2 +- contrib/zlib/contrib/testzlib/testzlib.txt | 2 +- contrib/zlib_note.txt | 2 +- .../Assimp_Arch_Import.class.violet.html | 2 +- .../Assimp_Arch_export.class.violet.html | 2 +- doc/architecture/assimp.object.violet.html | 2 +- .../assimp_usecase.ucase.violet.html | 2 +- doc/architecture/process.class.violet.html | 2 +- include/assimp/scene.h | 2 +- packaging/windows-innosetup/WEB | 14 ++- .../readme_installer_vieweronly.txt | 2 +- packaging/windows-mkzip/bin_readme.txt | 2 +- port/PyAssimp/pyassimp/errors.py | 22 ++-- .../jassimp/src/jassimp/AiAnimation.java | 2 +- .../jassimp/src/jassimp/AiBlendMode.java | 2 +- .../jassimp/jassimp/src/jassimp/AiCamera.java | 2 +- .../src/jassimp/AiProgressHandler.java | 2 +- .../jassimp/src/jassimp/AiQuaternion.java | 2 +- .../jassimp/src/jassimp/AiTextureType.java | 2 +- port/swig/DONOTUSEYET | 2 +- samples/SimpleAssimpViewX/README | 2 +- .../SimpleTexturedDirectx11/main.cpp | 2 +- .../include/boost_includes.h | 2 +- test/models-nonbsd/3DS/jeep1.3ds.readme.txt | 2 +- test/models-nonbsd/3DS/pyramob.3ds.readme.txt | 2 +- test/models-nonbsd/ASE/Rifle.source.txt | 2 +- test/models-nonbsd/ASE/Rifle2.source.txt | 2 +- test/models-nonbsd/B3D/turtle.source.txt | 2 +- test/models-nonbsd/DXF/rifle.source.txt | 2 +- .../FBX/2013_ASCII/jeep1.fbx.readme.txt | 2 +- .../FBX/2013_ASCII/pyramob.fbx.readme.txt | 2 +- .../FBX/2013_BINARY/jeep1.fbx.readme.txt | 2 +- .../FBX/2013_BINARY/pyramob.fbx.readme.txt | 2 +- test/models-nonbsd/IFC/linklist.txt | 2 +- .../LWO2/LWSReferences/QuickDraw.source.txt | 2 +- test/models-nonbsd/LWO/LWO2/rifle.source.txt | 2 +- .../LWS/QuickDraw v2.2.source.txt | 2 +- .../kt_kubalwagon/readme_kubalwagon.txt | 2 +- test/models-nonbsd/MD3/readme_water.txt | 2 +- test/models-nonbsd/MMD/readme.txt | 2 +- test/models-nonbsd/NFF/NFFSense8/credits.txt | 2 +- test/models-nonbsd/OBJ/rifle.source.txt | 2 +- test/models-nonbsd/OBJ/segment.source.txt | 2 +- test/models-nonbsd/Ogre/OgreSDK/LICENSE | 2 +- test/models-nonbsd/Ogre/OgreSDK/README.md | 2 +- test/models-nonbsd/README.txt | 2 +- test/models/3DS/UVTransformTest/note.txt | 2 +- test/models/3DS/textures.txt | 2 +- test/models/ASE/MotionCaptureROM.source.txt | 2 +- test/models/BLEND/HUMAN.source.txt | 2 +- test/models/BVH/01_nn.bvh.source.txt | 2 +- test/models/CSM/ThomasFechten.source.txt | 2 +- test/models/IRRMesh/credits.txt | 2 +- .../LWO/LWO2/MappingModes/earthCylindric.txt | 2 +- .../MappingModes/earthSpherical.source.txt | 2 +- test/models/LWO/LWO2/concrete.source.txt | 2 +- test/models/LWO/LWO2/uvtest-source.txt | 2 +- test/models/MD2/faerie-source.txt | 2 +- test/models/MD2/sidney-source.txt | 2 +- test/models/MD5/SimpleCube.source.txt | 2 +- .../MDL/MDL3 (3DGS A4)/minigun_readme.txt | 2 +- .../MDL5 (3DGS A5)/minigun_mdl5_readme.txt | 2 +- test/models/MS3D/jeep1.readme.txt | 2 +- test/models/Q3D/E-AT-AT.source.txt | 2 +- test/models/Q3D/earth.source.txt | 2 +- test/models/X/BCN_Epileptic.txt | 2 +- test/models/X/anim_test.txt | 2 +- test/models/X/test.txt | 2 +- test/regression/result_checker.py | 2 +- test/unit/utImproveCacheLocality.cpp | 2 +- tools/assimp_view/Background.cpp | 2 +- tools/assimp_view/Camera.h | 2 +- tools/assimp_view/Display.h | 2 +- tools/assimp_view/Input.cpp | 2 +- tools/assimp_view/LogWindow.h | 2 +- tools/assimp_view/MeshRenderer.cpp | 2 +- tools/assimp_view/MeshRenderer.h | 2 +- tools/assimp_view/NOTE@help.rtf.txt | 2 +- tools/assimp_view/RenderOptions.h | 2 +- tools/assimp_view/SceneAnimator.h | 2 +- tools/assimp_view/Shaders.cpp | 2 +- tools/assimp_view/assimp_view.h | 2 +- 122 files changed, 187 insertions(+), 189 deletions(-) diff --git a/INSTALL b/INSTALL index 350a5f109..ecec2585b 100644 --- a/INSTALL +++ b/INSTALL @@ -1,50 +1,50 @@ - -======================================================================== -Open Asset Import Library (assimp) INSTALL -======================================================================== - ------------------------------- -Getting the documentation ------------------------------- - -A regularly-updated copy is available at -http://assimp.sourceforge.net/lib_html/index.html - -A CHM file is included in the SVN repos: ./doc/AssimpDoc_Html/AssimpDoc.chm. -To build the doxygen documentation on your own, follow these steps: - -a) download & install latest doxygen -b) make sure doxygen is in the executable search path -c) navigate to ./doc -d) and run 'doxygen' - -Open the generated HTML (AssimpDoc_Html/index.html) in the browser of your choice. -Windows only: To generate the CHM doc, install 'Microsoft HTML Workshop' -and configure the path to it in the DOXYFILE first. - ------------------------------- -Building Assimp ------------------------------- - -More detailed build instructions can be found in the documentation, -this section is just for the inpatient among you. - -CMake is the preferred build system for Assimp. The minimum required version -is 2.6. If you don't have it yet, downloads for CMake can be found on -http://www.cmake.org/. - -For Unix: - -1. mkdir build && cd build -2. cmake .. -G 'Unix Makefiles' -3. make -j4 - -For Windows: -1. Open a command prompt -2. mkdir build -3. cd build -4. cmake .. -5. cmake --build . - -For iOS: -Just check the following project, which deploys a compiler toolchain for different iOS-versions: https://github.com/assimp/assimp/tree/master/port/iOS + +======================================================================== +Open Asset Import Library (assimp) INSTALL +======================================================================== + +------------------------------ +Getting the documentation +------------------------------ + +A regularly-updated copy is available at +http://assimp.sourceforge.net/lib_html/index.html + +A CHM file is included in the SVN repos: ./doc/AssimpDoc_Html/AssimpDoc.chm. +To build the doxygen documentation on your own, follow these steps: + +a) download & install latest doxygen +b) make sure doxygen is in the executable search path +c) navigate to ./doc +d) and run 'doxygen' + +Open the generated HTML (AssimpDoc_Html/index.html) in the browser of your choice. +Windows only: To generate the CHM doc, install 'Microsoft HTML Workshop' +and configure the path to it in the DOXYFILE first. + +------------------------------ +Building Assimp +------------------------------ + +More detailed build instructions can be found in the documentation, +this section is just for the inpatient among you. + +CMake is the preferred build system for Assimp. The minimum required version +is 2.6. If you don't have it yet, downloads for CMake can be found on +http://www.cmake.org/. + +For Unix: + +1. mkdir build && cd build +2. cmake .. -G 'Unix Makefiles' +3. make -j4 + +For Windows: +1. Open a command prompt +2. mkdir build +3. cd build +4. cmake .. +5. cmake --build . + +For iOS: +Just check the following project, which deploys a compiler toolchain for different iOS-versions: https://github.com/assimp/assimp/tree/master/port/iOS diff --git a/code/AMF/AMFImporter_Geometry.cpp b/code/AMF/AMFImporter_Geometry.cpp index e9a50b656..45be05df1 100644 --- a/code/AMF/AMFImporter_Geometry.cpp +++ b/code/AMF/AMFImporter_Geometry.cpp @@ -1,4 +1,4 @@ -/* +/* --------------------------------------------------------------------------- Open Asset Import Library (assimp) --------------------------------------------------------------------------- diff --git a/code/AMF/AMFImporter_Macro.hpp b/code/AMF/AMFImporter_Macro.hpp index ec06cb999..5877a62d2 100644 --- a/code/AMF/AMFImporter_Macro.hpp +++ b/code/AMF/AMFImporter_Macro.hpp @@ -1,4 +1,4 @@ -/* +/* --------------------------------------------------------------------------- Open Asset Import Library (assimp) --------------------------------------------------------------------------- diff --git a/code/AMF/AMFImporter_Material.cpp b/code/AMF/AMFImporter_Material.cpp index 64da12dda..7ab5710da 100644 --- a/code/AMF/AMFImporter_Material.cpp +++ b/code/AMF/AMFImporter_Material.cpp @@ -1,4 +1,4 @@ -/* +/* --------------------------------------------------------------------------- Open Asset Import Library (assimp) --------------------------------------------------------------------------- diff --git a/code/AMF/AMFImporter_Node.hpp b/code/AMF/AMFImporter_Node.hpp index b7b7836f3..ea65e106b 100644 --- a/code/AMF/AMFImporter_Node.hpp +++ b/code/AMF/AMFImporter_Node.hpp @@ -1,4 +1,4 @@ -/* +/* --------------------------------------------------------------------------- Open Asset Import Library (assimp) --------------------------------------------------------------------------- diff --git a/code/AMF/AMFImporter_Postprocess.cpp b/code/AMF/AMFImporter_Postprocess.cpp index 8496d8ded..bdf13ac60 100644 --- a/code/AMF/AMFImporter_Postprocess.cpp +++ b/code/AMF/AMFImporter_Postprocess.cpp @@ -1,4 +1,4 @@ -/* +/* --------------------------------------------------------------------------- Open Asset Import Library (assimp) --------------------------------------------------------------------------- diff --git a/code/Common/ImporterRegistry.cpp b/code/Common/ImporterRegistry.cpp index 41aa21979..4b9416663 100644 --- a/code/Common/ImporterRegistry.cpp +++ b/code/Common/ImporterRegistry.cpp @@ -1,4 +1,4 @@ -/* +/* --------------------------------------------------------------------------- Open Asset Import Library (assimp) --------------------------------------------------------------------------- diff --git a/code/MMD/MMDImporter.h b/code/MMD/MMDImporter.h index 1cc91c782..b1fdb9f6a 100644 --- a/code/MMD/MMDImporter.h +++ b/code/MMD/MMDImporter.h @@ -93,4 +93,4 @@ private: } // Namespace Assimp -#endif \ No newline at end of file +#endif diff --git a/code/PostProcessing/ArmaturePopulate.h b/code/PostProcessing/ArmaturePopulate.h index 8985e1d1d..877d8b0d1 100644 --- a/code/PostProcessing/ArmaturePopulate.h +++ b/code/PostProcessing/ArmaturePopulate.h @@ -109,4 +109,4 @@ public: } // Namespace Assimp -#endif // SCALE_PROCESS_H_ \ No newline at end of file +#endif // SCALE_PROCESS_H_ diff --git a/code/PostProcessing/ScaleProcess.h b/code/PostProcessing/ScaleProcess.h index 9cc664c6a..5799dd22c 100644 --- a/code/PostProcessing/ScaleProcess.h +++ b/code/PostProcessing/ScaleProcess.h @@ -94,4 +94,4 @@ private: } // Namespace Assimp -#endif // SCALE_PROCESS_H_ \ No newline at end of file +#endif // SCALE_PROCESS_H_ diff --git a/code/PostProcessing/ValidateDataStructure.cpp b/code/PostProcessing/ValidateDataStructure.cpp index 6212bfb69..93f10598a 100644 --- a/code/PostProcessing/ValidateDataStructure.cpp +++ b/code/PostProcessing/ValidateDataStructure.cpp @@ -1,4 +1,4 @@ -/* +/* --------------------------------------------------------------------------- Open Asset Import Library (assimp) --------------------------------------------------------------------------- diff --git a/code/glTF/glTFAsset.h b/code/glTF/glTFAsset.h index b918d456b..fdda6a615 100644 --- a/code/glTF/glTFAsset.h +++ b/code/glTF/glTFAsset.h @@ -1,4 +1,4 @@ -/* +/* Open Asset Import Library (assimp) ---------------------------------------------------------------------- diff --git a/code/glTF/glTFExporter.cpp b/code/glTF/glTFExporter.cpp index 7c21b738b..e863b3f24 100644 --- a/code/glTF/glTFExporter.cpp +++ b/code/glTF/glTFExporter.cpp @@ -1,4 +1,4 @@ -/* +/* Open Asset Import Library (assimp) ---------------------------------------------------------------------- diff --git a/code/glTF/glTFImporter.cpp b/code/glTF/glTFImporter.cpp index b410e1002..1f18850d2 100644 --- a/code/glTF/glTFImporter.cpp +++ b/code/glTF/glTFImporter.cpp @@ -1,4 +1,4 @@ -/* +/* Open Asset Import Library (assimp) ---------------------------------------------------------------------- diff --git a/code/glTF2/glTF2Asset.h b/code/glTF2/glTF2Asset.h index d3c1654d0..2514a6fae 100644 --- a/code/glTF2/glTF2Asset.h +++ b/code/glTF2/glTF2Asset.h @@ -1,4 +1,4 @@ -/* +/* Open Asset Import Library (assimp) ---------------------------------------------------------------------- diff --git a/code/glTF2/glTF2Exporter.cpp b/code/glTF2/glTF2Exporter.cpp index 7894f8adb..c4decdb49 100644 --- a/code/glTF2/glTF2Exporter.cpp +++ b/code/glTF2/glTF2Exporter.cpp @@ -1,4 +1,4 @@ -/* +/* Open Asset Import Library (assimp) ---------------------------------------------------------------------- diff --git a/contrib/Open3DGC/o3dgcSC3DMCDecoder.h b/contrib/Open3DGC/o3dgcSC3DMCDecoder.h index f3f1617c4..e6f803b94 100644 --- a/contrib/Open3DGC/o3dgcSC3DMCDecoder.h +++ b/contrib/Open3DGC/o3dgcSC3DMCDecoder.h @@ -1,4 +1,4 @@ -/* +/* Copyright (c) 2013 Khaled Mammou - Advanced Micro Devices, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/contrib/android-cmake/README.md b/contrib/android-cmake/README.md index ee6302128..395131daf 100644 --- a/contrib/android-cmake/README.md +++ b/contrib/android-cmake/README.md @@ -237,4 +237,4 @@ The _android-cmake_ should correctly handle projects with assembler sources (`*. ## Copying -_android-cmake_ is distributed under the terms of [BSD 3-Clause License](http://opensource.org/licenses/BSD-3-Clause) \ No newline at end of file +_android-cmake_ is distributed under the terms of [BSD 3-Clause License](http://opensource.org/licenses/BSD-3-Clause) diff --git a/contrib/gtest/docs/Documentation.md b/contrib/gtest/docs/Documentation.md index 8ca1aac75..e5d041f3a 100644 --- a/contrib/gtest/docs/Documentation.md +++ b/contrib/gtest/docs/Documentation.md @@ -11,4 +11,4 @@ documentation for that specific version instead.** To contribute code to Google Test, read: * [DevGuide](DevGuide.md) -- read this _before_ writing your first patch. - * [PumpManual](PumpManual.md) -- how we generate some of Google Test's source files. \ No newline at end of file + * [PumpManual](PumpManual.md) -- how we generate some of Google Test's source files. diff --git a/contrib/gtest/docs/V1_5_Documentation.md b/contrib/gtest/docs/V1_5_Documentation.md index 46bba2ec8..6febc65c9 100644 --- a/contrib/gtest/docs/V1_5_Documentation.md +++ b/contrib/gtest/docs/V1_5_Documentation.md @@ -9,4 +9,4 @@ This page lists all official documentation wiki pages for Google Test **1.5.0** To contribute code to Google Test, read: * DevGuide -- read this _before_ writing your first patch. - * [PumpManual](V1_5_PumpManual.md) -- how we generate some of Google Test's source files. \ No newline at end of file + * [PumpManual](V1_5_PumpManual.md) -- how we generate some of Google Test's source files. diff --git a/contrib/gtest/docs/V1_5_PumpManual.md b/contrib/gtest/docs/V1_5_PumpManual.md index 15710789d..e6485a01d 100644 --- a/contrib/gtest/docs/V1_5_PumpManual.md +++ b/contrib/gtest/docs/V1_5_PumpManual.md @@ -174,4 +174,4 @@ You can find real-world applications of Pump in [Google Test](http://www.google. ## Tips ## * If a meta variable is followed by a letter or digit, you can separate them using `[[]]`, which inserts an empty string. For example `Foo$j[[]]Helper` generate `Foo1Helper` when `j` is 1. - * To avoid extra-long Pump source lines, you can break a line anywhere you want by inserting `[[]]` followed by a new line. Since any new-line character next to `[[` or `]]` is ignored, the generated code won't contain this new line. \ No newline at end of file + * To avoid extra-long Pump source lines, you can break a line anywhere you want by inserting `[[]]` followed by a new line. Since any new-line character next to `[[` or `]]` is ignored, the generated code won't contain this new line. diff --git a/contrib/gtest/docs/V1_5_XcodeGuide.md b/contrib/gtest/docs/V1_5_XcodeGuide.md index bf24bf51b..21d7f5c05 100644 --- a/contrib/gtest/docs/V1_5_XcodeGuide.md +++ b/contrib/gtest/docs/V1_5_XcodeGuide.md @@ -90,4 +90,4 @@ The Debugger has exited with status 0. # Summary # -Unit testing is a valuable way to ensure your data model stays valid even during rapid development or refactoring. The Google Testing Framework is a great unit testing framework for C and C++ which integrates well with an Xcode development environment. \ No newline at end of file +Unit testing is a valuable way to ensure your data model stays valid even during rapid development or refactoring. The Google Testing Framework is a great unit testing framework for C and C++ which integrates well with an Xcode development environment. diff --git a/contrib/gtest/docs/V1_6_Documentation.md b/contrib/gtest/docs/V1_6_Documentation.md index ca924660a..1085673d1 100644 --- a/contrib/gtest/docs/V1_6_Documentation.md +++ b/contrib/gtest/docs/V1_6_Documentation.md @@ -11,4 +11,4 @@ documentation for that specific version instead.** To contribute code to Google Test, read: * [DevGuide](DevGuide.md) -- read this _before_ writing your first patch. - * [PumpManual](V1_6_PumpManual.md) -- how we generate some of Google Test's source files. \ No newline at end of file + * [PumpManual](V1_6_PumpManual.md) -- how we generate some of Google Test's source files. diff --git a/contrib/gtest/docs/V1_6_XcodeGuide.md b/contrib/gtest/docs/V1_6_XcodeGuide.md index bf24bf51b..21d7f5c05 100644 --- a/contrib/gtest/docs/V1_6_XcodeGuide.md +++ b/contrib/gtest/docs/V1_6_XcodeGuide.md @@ -90,4 +90,4 @@ The Debugger has exited with status 0. # Summary # -Unit testing is a valuable way to ensure your data model stays valid even during rapid development or refactoring. The Google Testing Framework is a great unit testing framework for C and C++ which integrates well with an Xcode development environment. \ No newline at end of file +Unit testing is a valuable way to ensure your data model stays valid even during rapid development or refactoring. The Google Testing Framework is a great unit testing framework for C and C++ which integrates well with an Xcode development environment. diff --git a/contrib/gtest/docs/V1_7_Documentation.md b/contrib/gtest/docs/V1_7_Documentation.md index 282697a50..6dc7d05b4 100644 --- a/contrib/gtest/docs/V1_7_Documentation.md +++ b/contrib/gtest/docs/V1_7_Documentation.md @@ -11,4 +11,4 @@ documentation for that specific version instead.** To contribute code to Google Test, read: * [DevGuide](DevGuide.md) -- read this _before_ writing your first patch. - * [PumpManual](V1_7_PumpManual.md) -- how we generate some of Google Test's source files. \ No newline at end of file + * [PumpManual](V1_7_PumpManual.md) -- how we generate some of Google Test's source files. diff --git a/contrib/gtest/docs/V1_7_XcodeGuide.md b/contrib/gtest/docs/V1_7_XcodeGuide.md index bf24bf51b..21d7f5c05 100644 --- a/contrib/gtest/docs/V1_7_XcodeGuide.md +++ b/contrib/gtest/docs/V1_7_XcodeGuide.md @@ -90,4 +90,4 @@ The Debugger has exited with status 0. # Summary # -Unit testing is a valuable way to ensure your data model stays valid even during rapid development or refactoring. The Google Testing Framework is a great unit testing framework for C and C++ which integrates well with an Xcode development environment. \ No newline at end of file +Unit testing is a valuable way to ensure your data model stays valid even during rapid development or refactoring. The Google Testing Framework is a great unit testing framework for C and C++ which integrates well with an Xcode development environment. diff --git a/contrib/gtest/docs/XcodeGuide.md b/contrib/gtest/docs/XcodeGuide.md index bf24bf51b..21d7f5c05 100644 --- a/contrib/gtest/docs/XcodeGuide.md +++ b/contrib/gtest/docs/XcodeGuide.md @@ -90,4 +90,4 @@ The Debugger has exited with status 0. # Summary # -Unit testing is a valuable way to ensure your data model stays valid even during rapid development or refactoring. The Google Testing Framework is a great unit testing framework for C and C++ which integrates well with an Xcode development environment. \ No newline at end of file +Unit testing is a valuable way to ensure your data model stays valid even during rapid development or refactoring. The Google Testing Framework is a great unit testing framework for C and C++ which integrates well with an Xcode development environment. diff --git a/contrib/poly2tri/README b/contrib/poly2tri/README index 2857e2983..883e9a581 100644 --- a/contrib/poly2tri/README +++ b/contrib/poly2tri/README @@ -1,4 +1,4 @@ -================== +================== INSTALLATION GUIDE ================== @@ -48,4 +48,4 @@ Examples: ./p2t nazca_monkey.dat 0 0 9 ./p2t random 10 100 5.0 - ./p2t random 1000 20000 0.025 \ No newline at end of file + ./p2t random 1000 20000 0.025 diff --git a/contrib/poly2tri/poly2tri/common/shapes.cc b/contrib/poly2tri/poly2tri/common/shapes.cc index d0de13e64..c94e11c03 100644 --- a/contrib/poly2tri/poly2tri/common/shapes.cc +++ b/contrib/poly2tri/poly2tri/common/shapes.cc @@ -362,4 +362,4 @@ void Triangle::DebugPrint() cout << points_[2]->x << "," << points_[2]->y << endl; } -} \ No newline at end of file +} diff --git a/contrib/poly2tri/poly2tri/common/shapes.h b/contrib/poly2tri/poly2tri/common/shapes.h index ac7389a2d..d3660f716 100644 --- a/contrib/poly2tri/poly2tri/common/shapes.h +++ b/contrib/poly2tri/poly2tri/common/shapes.h @@ -324,4 +324,4 @@ inline void Triangle::IsInterior(bool b) } -#endif \ No newline at end of file +#endif diff --git a/contrib/poly2tri/poly2tri/poly2tri.h b/contrib/poly2tri/poly2tri/poly2tri.h index 29a08d052..ba5cc159e 100644 --- a/contrib/poly2tri/poly2tri/poly2tri.h +++ b/contrib/poly2tri/poly2tri/poly2tri.h @@ -35,4 +35,4 @@ #include "common/shapes.h" #include "sweep/cdt.h" -#endif \ No newline at end of file +#endif diff --git a/contrib/poly2tri/poly2tri/sweep/advancing_front.cc b/contrib/poly2tri/poly2tri/sweep/advancing_front.cc index 38723beef..9739babce 100644 --- a/contrib/poly2tri/poly2tri/sweep/advancing_front.cc +++ b/contrib/poly2tri/poly2tri/sweep/advancing_front.cc @@ -105,4 +105,4 @@ AdvancingFront::~AdvancingFront() { } -} \ No newline at end of file +} diff --git a/contrib/poly2tri/poly2tri/sweep/advancing_front.h b/contrib/poly2tri/poly2tri/sweep/advancing_front.h index 645dcec97..3bfec5368 100644 --- a/contrib/poly2tri/poly2tri/sweep/advancing_front.h +++ b/contrib/poly2tri/poly2tri/sweep/advancing_front.h @@ -115,4 +115,4 @@ inline void AdvancingFront::set_search(Node* node) } -#endif \ No newline at end of file +#endif diff --git a/contrib/poly2tri/poly2tri/sweep/cdt.cc b/contrib/poly2tri/poly2tri/sweep/cdt.cc index 09d088ae3..b79f5a8de 100644 --- a/contrib/poly2tri/poly2tri/sweep/cdt.cc +++ b/contrib/poly2tri/poly2tri/sweep/cdt.cc @@ -68,4 +68,4 @@ CDT::~CDT() delete sweep_; } -} \ No newline at end of file +} diff --git a/contrib/poly2tri/poly2tri/sweep/cdt.h b/contrib/poly2tri/poly2tri/sweep/cdt.h index ea3286d9a..4a9a292d3 100644 --- a/contrib/poly2tri/poly2tri/sweep/cdt.h +++ b/contrib/poly2tri/poly2tri/sweep/cdt.h @@ -102,4 +102,4 @@ public: } -#endif \ No newline at end of file +#endif diff --git a/contrib/poly2tri/poly2tri/sweep/sweep.h b/contrib/poly2tri/poly2tri/sweep/sweep.h index 33e34a714..ad429fd96 100644 --- a/contrib/poly2tri/poly2tri/sweep/sweep.h +++ b/contrib/poly2tri/poly2tri/sweep/sweep.h @@ -282,4 +282,4 @@ private: } -#endif \ No newline at end of file +#endif diff --git a/contrib/stb_image/stb_image.h b/contrib/stb_image/stb_image.h index 571b0dcea..d9c21bc81 100644 --- a/contrib/stb_image/stb_image.h +++ b/contrib/stb_image/stb_image.h @@ -7459,4 +7459,4 @@ AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ------------------------------------------------------------------------------ -*/ \ No newline at end of file +*/ diff --git a/contrib/zip/.travis.sh b/contrib/zip/.travis.sh index 22974b1ff..9cb03ee87 100755 --- a/contrib/zip/.travis.sh +++ b/contrib/zip/.travis.sh @@ -15,4 +15,4 @@ else make -j 8 make install ASAN_OPTIONS=detect_leaks=0 LSAN_OPTIONS=verbosity=1:log_threads=1 ctest -V -fi \ No newline at end of file +fi diff --git a/contrib/zip/.travis.yml b/contrib/zip/.travis.yml index 86bac1cca..42f84dd25 100644 --- a/contrib/zip/.travis.yml +++ b/contrib/zip/.travis.yml @@ -19,4 +19,4 @@ after_success: - make - make test # Uploading report to CodeCov - - bash <(curl -s https://codecov.io/bash) \ No newline at end of file + - bash <(curl -s https://codecov.io/bash) diff --git a/contrib/zlib/contrib/blast/test.txt b/contrib/zlib/contrib/blast/test.txt index bfdf1c5dc..159002de5 100644 --- a/contrib/zlib/contrib/blast/test.txt +++ b/contrib/zlib/contrib/blast/test.txt @@ -1 +1 @@ -AIAIAIAIAIAIA \ No newline at end of file +AIAIAIAIAIAIA diff --git a/contrib/zlib/contrib/dotzlib/LICENSE_1_0.txt b/contrib/zlib/contrib/dotzlib/LICENSE_1_0.txt index 127a5bc39..36b7cd93c 100644 --- a/contrib/zlib/contrib/dotzlib/LICENSE_1_0.txt +++ b/contrib/zlib/contrib/dotzlib/LICENSE_1_0.txt @@ -20,4 +20,4 @@ FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. \ No newline at end of file +DEALINGS IN THE SOFTWARE. diff --git a/contrib/zlib/contrib/testzlib/testzlib.txt b/contrib/zlib/contrib/testzlib/testzlib.txt index e508bb22f..ba1bb3db6 100644 --- a/contrib/zlib/contrib/testzlib/testzlib.txt +++ b/contrib/zlib/contrib/testzlib/testzlib.txt @@ -7,4 +7,4 @@ copy to a directory file from : - contrib/masmx64 - contrib/vstudio/vc7 -and open testzlib8.sln \ No newline at end of file +and open testzlib8.sln diff --git a/contrib/zlib_note.txt b/contrib/zlib_note.txt index cc274f0bf..a7ca98634 100644 --- a/contrib/zlib_note.txt +++ b/contrib/zlib_note.txt @@ -8,4 +8,4 @@ This is a heavily modified and shrinked version of zlib 1.2.3 Assimp itself does not use the compression part yet, so it needn't be compiled (trees.c, deflate.c, compress.c). -Currently these units are just used by assimp_cmd. \ No newline at end of file +Currently these units are just used by assimp_cmd. diff --git a/doc/architecture/Assimp_Arch_Import.class.violet.html b/doc/architecture/Assimp_Arch_Import.class.violet.html index 264468f98..b4e3a9a6e 100644 --- a/doc/architecture/Assimp_Arch_Import.class.violet.html +++ b/doc/architecture/Assimp_Arch_Import.class.violet.html @@ -351,4 +351,4 @@ BI8AxOURXedNEuG6jMiRPHKQsuuS4BGAuDzS0NCQlZV18JFlRI7qkRRdlwSPAHzCIynKaa5LgkcA ETwCgEfwCAAewSMAeASP4BEAPIJHAPAIHgFItrEBsYNHAD7BK4gZPAKAR/AIAB7BIwCQBvwfU/j0 jy2hMWgAAAAASUVORK5C" /> - \ No newline at end of file + diff --git a/doc/architecture/Assimp_Arch_export.class.violet.html b/doc/architecture/Assimp_Arch_export.class.violet.html index 85f68d68d..ee567caaa 100644 --- a/doc/architecture/Assimp_Arch_export.class.violet.html +++ b/doc/architecture/Assimp_Arch_export.class.violet.html @@ -645,4 +645,4 @@ tQ2gtkFtg9oGQG2jtkFtA6C2UduA2gZQ26C2QW0DoLZR26C2AVDbqG1AbQMoKg8CahvUNgBqG7UN ahsAtY3aBtQ2AGobtQ1qGwC1jdoGtQ2A2kZtA2obALWN2ga1DUA1igr2o7ZBbQPw0/wD+/DsALUN gNpGbYPaBkBto7ZBbQMAAD/R/wDNluGGIxSgmAAAAABJRU5ErkJg" /> - \ No newline at end of file + diff --git a/doc/architecture/assimp.object.violet.html b/doc/architecture/assimp.object.violet.html index 1d82fa05f..dee9d2208 100644 --- a/doc/architecture/assimp.object.violet.html +++ b/doc/architecture/assimp.object.violet.html @@ -104,4 +104,4 @@ tfMWuhaZfgHUw0Q32sDAwIcPH4I/C1fbaJVKRX0GBwft4RA5hXdkNepJqndpKD2R7TlrjeqmxkKh oLOf5O8VrfC7XlrtOvYCO77PYocddthhhx122GGHHXbYYYcddthhhx122GGHHXbYYYdd29q1c83s I9m5B21Yuxg77FJtRzQV/wEjVLA5JUDyfgAAAABJRU5ErkJg" /> - \ No newline at end of file + diff --git a/doc/architecture/assimp_usecase.ucase.violet.html b/doc/architecture/assimp_usecase.ucase.violet.html index 3045add42..c4df02533 100644 --- a/doc/architecture/assimp_usecase.ucase.violet.html +++ b/doc/architecture/assimp_usecase.ucase.violet.html @@ -872,4 +872,4 @@ DYMQQgghNAxCCCGEEBoGIYQQQmgYhBBCCKFhEEIIIYTQMAghhBBCwyCEEEIIDYMQQgghNAxCCCGE EBoGIYQQQmgYhBBCCKFhEEIIIYTQMAghhBBCwyCEEEJI/PP/A0zci3P89Qf2AAAAAElFTkSuQmCC " /> - \ No newline at end of file + diff --git a/doc/architecture/process.class.violet.html b/doc/architecture/process.class.violet.html index d4f77d909..662daf4a8 100644 --- a/doc/architecture/process.class.violet.html +++ b/doc/architecture/process.class.violet.html @@ -334,4 +334,4 @@ CQCsyZpgTQCsyZpgTQCsyZpgTQCsyZpgTQCsCdZkTQBgTdZkTQBgTdZkTQBgTdYEawJgTdYEawJg TdYEawJgTbAmawIAa7ImawIAa7ImawIAa7ImWBMAa7ImWBMAa7ImWBPAvDIByoc1WRMA/uU3lI1q YU0ArAnWZE0AYE3WZE0AABY4/wVVY1WTrOVxIAAAAABJRU5ErkJg" /> - \ No newline at end of file + diff --git a/include/assimp/scene.h b/include/assimp/scene.h index 93d04eee6..a189f5700 100644 --- a/include/assimp/scene.h +++ b/include/assimp/scene.h @@ -1,4 +1,4 @@ -/* +/* --------------------------------------------------------------------------- Open Asset Import Library (assimp) --------------------------------------------------------------------------- diff --git a/packaging/windows-innosetup/WEB b/packaging/windows-innosetup/WEB index 8840d232d..d14d6ed9a 100644 --- a/packaging/windows-innosetup/WEB +++ b/packaging/windows-innosetup/WEB @@ -1,8 +1,6 @@ - -Project home page: -http://assimp.sourceforge.net - -Sourceforge.net project page: -http://www.sourceforge.net/projects/assimp - - + +Project home page: +http://assimp.sourceforge.net + +Sourceforge.net project page: +http://www.sourceforge.net/projects/assimp diff --git a/packaging/windows-innosetup/readme_installer_vieweronly.txt b/packaging/windows-innosetup/readme_installer_vieweronly.txt index bfa4f8c9e..1e84c577d 100644 --- a/packaging/windows-innosetup/readme_installer_vieweronly.txt +++ b/packaging/windows-innosetup/readme_installer_vieweronly.txt @@ -29,4 +29,4 @@ Reinstall Microsoft Visual C++ 2005 SP1 Redistributable (x86 or x64, depending o Add it to PATH. That's not a bug, the installer does not alter the PATH. 4. Crashes immediately -You CPU lacks SSE2 support. Build Assimp from scratch to suit your CPU, sorry. \ No newline at end of file +You CPU lacks SSE2 support. Build Assimp from scratch to suit your CPU, sorry. diff --git a/packaging/windows-mkzip/bin_readme.txt b/packaging/windows-mkzip/bin_readme.txt index 10839a3d9..5cff1f30e 100644 --- a/packaging/windows-mkzip/bin_readme.txt +++ b/packaging/windows-mkzip/bin_readme.txt @@ -26,4 +26,4 @@ Install the latest DirectX runtime or grab the file from somewhere (that's evil (Re)install Microsoft Visual C++ 2005 SP1 Redistributable (x86 or x64, depending on your system) 3. Crashes immediately -You CPU lacks SSE2 support. Build Assimp from scratch to suit your CPU, sorry. \ No newline at end of file +You CPU lacks SSE2 support. Build Assimp from scratch to suit your CPU, sorry. diff --git a/port/PyAssimp/pyassimp/errors.py b/port/PyAssimp/pyassimp/errors.py index 9d776860f..e017b5145 100644 --- a/port/PyAssimp/pyassimp/errors.py +++ b/port/PyAssimp/pyassimp/errors.py @@ -1,11 +1,11 @@ -#-*- coding: UTF-8 -*- - -""" -All possible errors. -""" - -class AssimpError(BaseException): - """ - If an internal error occurs. - """ - pass \ No newline at end of file +#-*- coding: UTF-8 -*- + +""" +All possible errors. +""" + +class AssimpError(BaseException): + """ + If an internal error occurs. + """ + pass diff --git a/port/jassimp/jassimp/src/jassimp/AiAnimation.java b/port/jassimp/jassimp/src/jassimp/AiAnimation.java index 239820aaf..856b918dd 100644 --- a/port/jassimp/jassimp/src/jassimp/AiAnimation.java +++ b/port/jassimp/jassimp/src/jassimp/AiAnimation.java @@ -172,4 +172,4 @@ public final class AiAnimation { public List getMeshChannels() { throw new UnsupportedOperationException("not implemented yet"); } -} \ No newline at end of file +} diff --git a/port/jassimp/jassimp/src/jassimp/AiBlendMode.java b/port/jassimp/jassimp/src/jassimp/AiBlendMode.java index 78cc5a5ed..d3a0e0e96 100644 --- a/port/jassimp/jassimp/src/jassimp/AiBlendMode.java +++ b/port/jassimp/jassimp/src/jassimp/AiBlendMode.java @@ -114,4 +114,4 @@ public enum AiBlendMode { * The mapped c/c++ integer enum value. */ private final int m_rawValue; -} \ No newline at end of file +} diff --git a/port/jassimp/jassimp/src/jassimp/AiCamera.java b/port/jassimp/jassimp/src/jassimp/AiCamera.java index 4445c34fc..b0f692eda 100644 --- a/port/jassimp/jassimp/src/jassimp/AiCamera.java +++ b/port/jassimp/jassimp/src/jassimp/AiCamera.java @@ -300,4 +300,4 @@ public final class AiCamera { * Aspect ratio. */ private final float m_aspect; -} \ No newline at end of file +} diff --git a/port/jassimp/jassimp/src/jassimp/AiProgressHandler.java b/port/jassimp/jassimp/src/jassimp/AiProgressHandler.java index 7998d1bcc..2987e5976 100644 --- a/port/jassimp/jassimp/src/jassimp/AiProgressHandler.java +++ b/port/jassimp/jassimp/src/jassimp/AiProgressHandler.java @@ -43,4 +43,4 @@ package jassimp; public interface AiProgressHandler { boolean update(float percentage); -} \ No newline at end of file +} diff --git a/port/jassimp/jassimp/src/jassimp/AiQuaternion.java b/port/jassimp/jassimp/src/jassimp/AiQuaternion.java index af10e6f91..a9ca7be79 100644 --- a/port/jassimp/jassimp/src/jassimp/AiQuaternion.java +++ b/port/jassimp/jassimp/src/jassimp/AiQuaternion.java @@ -162,4 +162,4 @@ public final class AiQuaternion { return "[" + getX() + ", " + getY() + ", " + getZ() + ", " + getW() + "]"; } -} \ No newline at end of file +} diff --git a/port/jassimp/jassimp/src/jassimp/AiTextureType.java b/port/jassimp/jassimp/src/jassimp/AiTextureType.java index 85b559c30..6b3e642e0 100644 --- a/port/jassimp/jassimp/src/jassimp/AiTextureType.java +++ b/port/jassimp/jassimp/src/jassimp/AiTextureType.java @@ -209,4 +209,4 @@ public enum AiTextureType { * The mapped c/c++ integer enum value. */ private final int m_rawValue; -} \ No newline at end of file +} diff --git a/port/swig/DONOTUSEYET b/port/swig/DONOTUSEYET index be9103007..87c6e0699 100644 --- a/port/swig/DONOTUSEYET +++ b/port/swig/DONOTUSEYET @@ -1 +1 @@ -The interface files are by no means complete yet and only work with the not-yet-released D SWIG backend, although adding support for other languages should not be too much of problem via #ifdefs. +The interface files are by no means complete yet and only work with the not-yet-released D SWIG backend, although adding support for other languages should not be too much of problem via #ifdefs. diff --git a/samples/SimpleAssimpViewX/README b/samples/SimpleAssimpViewX/README index 701a7cdce..dc513d7aa 100644 --- a/samples/SimpleAssimpViewX/README +++ b/samples/SimpleAssimpViewX/README @@ -19,4 +19,4 @@ Troubleshooting: - OSX workspaces are not updated too frequently, so same files may be missing. If you have any problems which you can't solve on your own, -please report them on the thread above. \ No newline at end of file +please report them on the thread above. diff --git a/samples/SimpleTexturedDirectx11/SimpleTexturedDirectx11/main.cpp b/samples/SimpleTexturedDirectx11/SimpleTexturedDirectx11/main.cpp index 781fe89e5..3aad81838 100644 --- a/samples/SimpleTexturedDirectx11/SimpleTexturedDirectx11/main.cpp +++ b/samples/SimpleTexturedDirectx11/SimpleTexturedDirectx11/main.cpp @@ -1,4 +1,4 @@ -// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- // Simple Assimp Directx11 Sample // This is a very basic sample and only reads diffuse texture // but this can load both embedded textures in fbx and non-embedded textures diff --git a/samples/SimpleTexturedOpenGL/SimpleTexturedOpenGL/include/boost_includes.h b/samples/SimpleTexturedOpenGL/SimpleTexturedOpenGL/include/boost_includes.h index 7b9c0860e..2ff6aff04 100644 --- a/samples/SimpleTexturedOpenGL/SimpleTexturedOpenGL/include/boost_includes.h +++ b/samples/SimpleTexturedOpenGL/SimpleTexturedOpenGL/include/boost_includes.h @@ -1 +1 @@ -#include \ No newline at end of file +#include diff --git a/test/models-nonbsd/3DS/jeep1.3ds.readme.txt b/test/models-nonbsd/3DS/jeep1.3ds.readme.txt index d17d5e0e9..f52ada0cc 100644 --- a/test/models-nonbsd/3DS/jeep1.3ds.readme.txt +++ b/test/models-nonbsd/3DS/jeep1.3ds.readme.txt @@ -12,4 +12,4 @@ http://xu1productions.com/3dstudio/index.html - 3D Game Resources http://www.psionicdesign.com - My Main 2D/3D Digital Art site -Psionic 2002 \ No newline at end of file +Psionic 2002 diff --git a/test/models-nonbsd/3DS/pyramob.3ds.readme.txt b/test/models-nonbsd/3DS/pyramob.3ds.readme.txt index bf1858410..2bf93aa64 100644 --- a/test/models-nonbsd/3DS/pyramob.3ds.readme.txt +++ b/test/models-nonbsd/3DS/pyramob.3ds.readme.txt @@ -9,4 +9,4 @@ http://www.elektrobar.com/lux/ or mail to: lux@elektrobar.com -have fun.....VIRLUX \ No newline at end of file +have fun.....VIRLUX diff --git a/test/models-nonbsd/ASE/Rifle.source.txt b/test/models-nonbsd/ASE/Rifle.source.txt index 04d40a85d..1b96f8564 100644 --- a/test/models-nonbsd/ASE/Rifle.source.txt +++ b/test/models-nonbsd/ASE/Rifle.source.txt @@ -22,4 +22,4 @@ tutorials. INFO ==== -CONVERTED FROM 3DS TO ASE WITH AC3D \ No newline at end of file +CONVERTED FROM 3DS TO ASE WITH AC3D diff --git a/test/models-nonbsd/ASE/Rifle2.source.txt b/test/models-nonbsd/ASE/Rifle2.source.txt index 2072ddf13..3fa628db4 100644 --- a/test/models-nonbsd/ASE/Rifle2.source.txt +++ b/test/models-nonbsd/ASE/Rifle2.source.txt @@ -21,4 +21,4 @@ tutorials. INFO ==== -CONVERTED FROM 3DS TO ASE WITH AC3D \ No newline at end of file +CONVERTED FROM 3DS TO ASE WITH AC3D diff --git a/test/models-nonbsd/B3D/turtle.source.txt b/test/models-nonbsd/B3D/turtle.source.txt index fab387bdc..cd93aa3d6 100644 --- a/test/models-nonbsd/B3D/turtle.source.txt +++ b/test/models-nonbsd/B3D/turtle.source.txt @@ -8,4 +8,4 @@ RESTRICTIONS: This model pack is available for use in freeware, shareware, commercial games/software with the following restrictions:- **You may not sell/re-sell this model pack or claim it as your own. -***You may not redistribute this pack in some other model pack through a website or on a compilation CD of any kind, without my written consent. \ No newline at end of file +***You may not redistribute this pack in some other model pack through a website or on a compilation CD of any kind, without my written consent. diff --git a/test/models-nonbsd/DXF/rifle.source.txt b/test/models-nonbsd/DXF/rifle.source.txt index 3e88f009f..a2585afad 100644 --- a/test/models-nonbsd/DXF/rifle.source.txt +++ b/test/models-nonbsd/DXF/rifle.source.txt @@ -20,4 +20,4 @@ tutorials. INFO ==== -COnverted from 3ds to DXF with Ac3D \ No newline at end of file +COnverted from 3ds to DXF with Ac3D diff --git a/test/models-nonbsd/FBX/2013_ASCII/jeep1.fbx.readme.txt b/test/models-nonbsd/FBX/2013_ASCII/jeep1.fbx.readme.txt index d17d5e0e9..f52ada0cc 100644 --- a/test/models-nonbsd/FBX/2013_ASCII/jeep1.fbx.readme.txt +++ b/test/models-nonbsd/FBX/2013_ASCII/jeep1.fbx.readme.txt @@ -12,4 +12,4 @@ http://xu1productions.com/3dstudio/index.html - 3D Game Resources http://www.psionicdesign.com - My Main 2D/3D Digital Art site -Psionic 2002 \ No newline at end of file +Psionic 2002 diff --git a/test/models-nonbsd/FBX/2013_ASCII/pyramob.fbx.readme.txt b/test/models-nonbsd/FBX/2013_ASCII/pyramob.fbx.readme.txt index bf1858410..2bf93aa64 100644 --- a/test/models-nonbsd/FBX/2013_ASCII/pyramob.fbx.readme.txt +++ b/test/models-nonbsd/FBX/2013_ASCII/pyramob.fbx.readme.txt @@ -9,4 +9,4 @@ http://www.elektrobar.com/lux/ or mail to: lux@elektrobar.com -have fun.....VIRLUX \ No newline at end of file +have fun.....VIRLUX diff --git a/test/models-nonbsd/FBX/2013_BINARY/jeep1.fbx.readme.txt b/test/models-nonbsd/FBX/2013_BINARY/jeep1.fbx.readme.txt index d17d5e0e9..f52ada0cc 100644 --- a/test/models-nonbsd/FBX/2013_BINARY/jeep1.fbx.readme.txt +++ b/test/models-nonbsd/FBX/2013_BINARY/jeep1.fbx.readme.txt @@ -12,4 +12,4 @@ http://xu1productions.com/3dstudio/index.html - 3D Game Resources http://www.psionicdesign.com - My Main 2D/3D Digital Art site -Psionic 2002 \ No newline at end of file +Psionic 2002 diff --git a/test/models-nonbsd/FBX/2013_BINARY/pyramob.fbx.readme.txt b/test/models-nonbsd/FBX/2013_BINARY/pyramob.fbx.readme.txt index bf1858410..2bf93aa64 100644 --- a/test/models-nonbsd/FBX/2013_BINARY/pyramob.fbx.readme.txt +++ b/test/models-nonbsd/FBX/2013_BINARY/pyramob.fbx.readme.txt @@ -9,4 +9,4 @@ http://www.elektrobar.com/lux/ or mail to: lux@elektrobar.com -have fun.....VIRLUX \ No newline at end of file +have fun.....VIRLUX diff --git a/test/models-nonbsd/IFC/linklist.txt b/test/models-nonbsd/IFC/linklist.txt index 06ad3844b..6971b7a45 100644 --- a/test/models-nonbsd/IFC/linklist.txt +++ b/test/models-nonbsd/IFC/linklist.txt @@ -1,4 +1,4 @@ Good IFC test cases =================== -http://www.iai.fzk.de/www-extern/index.php?id=1135 \ No newline at end of file +http://www.iai.fzk.de/www-extern/index.php?id=1135 diff --git a/test/models-nonbsd/LWO/LWO2/LWSReferences/QuickDraw.source.txt b/test/models-nonbsd/LWO/LWO2/LWSReferences/QuickDraw.source.txt index bb07f8e24..aaa244217 100644 --- a/test/models-nonbsd/LWO/LWO2/LWSReferences/QuickDraw.source.txt +++ b/test/models-nonbsd/LWO/LWO2/LWSReferences/QuickDraw.source.txt @@ -28,4 +28,4 @@ INFO These files belong to the QuickDraw model in the LWS folder - they are referenced -and loaded into the LWS scene. \ No newline at end of file +and loaded into the LWS scene. diff --git a/test/models-nonbsd/LWO/LWO2/rifle.source.txt b/test/models-nonbsd/LWO/LWO2/rifle.source.txt index 34576f0ca..5523bbc0c 100644 --- a/test/models-nonbsd/LWO/LWO2/rifle.source.txt +++ b/test/models-nonbsd/LWO/LWO2/rifle.source.txt @@ -21,4 +21,4 @@ tutorials. INFO ==== -CONVERTED FROM 3DS TO LWO2 WITH AC3D \ No newline at end of file +CONVERTED FROM 3DS TO LWO2 WITH AC3D diff --git a/test/models-nonbsd/LWS/QuickDraw v2.2.source.txt b/test/models-nonbsd/LWS/QuickDraw v2.2.source.txt index e0c7d0f7c..92ac5d882 100644 --- a/test/models-nonbsd/LWS/QuickDraw v2.2.source.txt +++ b/test/models-nonbsd/LWS/QuickDraw v2.2.source.txt @@ -12,4 +12,4 @@ In the future more 3d formats will be added and some other sections such as wall CHANGES: -Paths have been modified \ No newline at end of file +Paths have been modified diff --git a/test/models-nonbsd/MD3/q3root/models/mapobjects/kt_kubalwagon/readme_kubalwagon.txt b/test/models-nonbsd/MD3/q3root/models/mapobjects/kt_kubalwagon/readme_kubalwagon.txt index e0a978ee0..54fbcbd7f 100644 --- a/test/models-nonbsd/MD3/q3root/models/mapobjects/kt_kubalwagon/readme_kubalwagon.txt +++ b/test/models-nonbsd/MD3/q3root/models/mapobjects/kt_kubalwagon/readme_kubalwagon.txt @@ -23,4 +23,4 @@ ID software, eskimo roll, EMSIPE, QkenneyQ DISTRIBUTION as long as this readme is included...! --------------------------------------------------------------------------- \ No newline at end of file +-------------------------------------------------------------------------- diff --git a/test/models-nonbsd/MD3/readme_water.txt b/test/models-nonbsd/MD3/readme_water.txt index cdc318ff8..c5346261d 100644 --- a/test/models-nonbsd/MD3/readme_water.txt +++ b/test/models-nonbsd/MD3/readme_water.txt @@ -23,4 +23,4 @@ ID software, eskimo roll, EMSIPE, QkenneyQ DISTRIBUTION as long as this readme is included...! --------------------------------------------------------------------------- \ No newline at end of file +-------------------------------------------------------------------------- diff --git a/test/models-nonbsd/MMD/readme.txt b/test/models-nonbsd/MMD/readme.txt index d8c882420..909beee00 100644 --- a/test/models-nonbsd/MMD/readme.txt +++ b/test/models-nonbsd/MMD/readme.txt @@ -46,4 +46,4 @@ version 4 ◯ クレジット 企画: 株式会社ドワンゴ キャラクターデザイン: 黒星紅白 -モデリング: 雨刻 \ No newline at end of file +モデリング: 雨刻 diff --git a/test/models-nonbsd/NFF/NFFSense8/credits.txt b/test/models-nonbsd/NFF/NFFSense8/credits.txt index ff169151d..f3cef4d09 100644 --- a/test/models-nonbsd/NFF/NFFSense8/credits.txt +++ b/test/models-nonbsd/NFF/NFFSense8/credits.txt @@ -1,4 +1,4 @@ teapot.nff, home4.nff - http://www.martinreddy.net/ukvrsig/wtk.html cokecan.nff -www.vrupl.evl.uic.edu/Eng591_Pages/cokecan.nff -TODO: License status to be confirmed \ No newline at end of file +TODO: License status to be confirmed diff --git a/test/models-nonbsd/OBJ/rifle.source.txt b/test/models-nonbsd/OBJ/rifle.source.txt index b09dcda8c..1d2cec5cf 100644 --- a/test/models-nonbsd/OBJ/rifle.source.txt +++ b/test/models-nonbsd/OBJ/rifle.source.txt @@ -24,4 +24,4 @@ tutorials. INFO ==== -Converted from 3DS to OBJ with AC3D \ No newline at end of file +Converted from 3DS to OBJ with AC3D diff --git a/test/models-nonbsd/OBJ/segment.source.txt b/test/models-nonbsd/OBJ/segment.source.txt index 978d72d26..204bc140e 100644 --- a/test/models-nonbsd/OBJ/segment.source.txt +++ b/test/models-nonbsd/OBJ/segment.source.txt @@ -1,4 +1,4 @@ Obj exported from Blender http://toychest.in.tum.de/wiki/projects:kuka_lwr -License: Creative-Commons-by-Attribution-3.0 \ No newline at end of file +License: Creative-Commons-by-Attribution-3.0 diff --git a/test/models-nonbsd/Ogre/OgreSDK/LICENSE b/test/models-nonbsd/Ogre/OgreSDK/LICENSE index e7e8f4280..ccdfb00fa 100644 --- a/test/models-nonbsd/Ogre/OgreSDK/LICENSE +++ b/test/models-nonbsd/Ogre/OgreSDK/LICENSE @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file +THE SOFTWARE. diff --git a/test/models-nonbsd/Ogre/OgreSDK/README.md b/test/models-nonbsd/Ogre/OgreSDK/README.md index e7a838cb0..864536558 100644 --- a/test/models-nonbsd/Ogre/OgreSDK/README.md +++ b/test/models-nonbsd/Ogre/OgreSDK/README.md @@ -7,4 +7,4 @@ This asset set is used to test the full functionality of both binary and XML Ass * Material file was created by copying the relevant material parts from the sample sources. See the file for further information. * Some textures were converted from .png to .jpg to reduce the file size. -See the LICENSE file in this folder for further copyright information about these assets. \ No newline at end of file +See the LICENSE file in this folder for further copyright information about these assets. diff --git a/test/models-nonbsd/README.txt b/test/models-nonbsd/README.txt index 8b244d2aa..aac170708 100644 --- a/test/models-nonbsd/README.txt +++ b/test/models-nonbsd/README.txt @@ -1,3 +1,3 @@ These models are not generally redistributable under the terms of Assimp's BSD license. Usually, an additional requirement on the use of the data is imposed (i.e. no commercial use, need credits, some creative commons variants, ...). -So, if you re-package Assimp for use in a 'clean' OSS package, consider removing this directory. \ No newline at end of file +So, if you re-package Assimp for use in a 'clean' OSS package, consider removing this directory. diff --git a/test/models/3DS/UVTransformTest/note.txt b/test/models/3DS/UVTransformTest/note.txt index dc4bd0789..4c8bfedd2 100644 --- a/test/models/3DS/UVTransformTest/note.txt +++ b/test/models/3DS/UVTransformTest/note.txt @@ -8,4 +8,4 @@ In other words: TO DO, but only if someone REALLY needs it. To see how it should look like - test/ReferenceImages Note that the viewer has no 'decal' texture mapping mode, so -the usual clamping is used. \ No newline at end of file +the usual clamping is used. diff --git a/test/models/3DS/textures.txt b/test/models/3DS/textures.txt index 18bbd8f90..136322bea 100644 --- a/test/models/3DS/textures.txt +++ b/test/models/3DS/textures.txt @@ -1 +1 @@ -All textures are from cgtextures.com and are free for commercial use \ No newline at end of file +All textures are from cgtextures.com and are free for commercial use diff --git a/test/models/ASE/MotionCaptureROM.source.txt b/test/models/ASE/MotionCaptureROM.source.txt index 222a3afbb..2b961906a 100644 --- a/test/models/ASE/MotionCaptureROM.source.txt +++ b/test/models/ASE/MotionCaptureROM.source.txt @@ -1,3 +1,3 @@ "MotionCaptureROM.ase" - Free for any purpose. -NOTE: The errors in the middle of the animation are caused by problems during recording, it's not an importer issue. \ No newline at end of file +NOTE: The errors in the middle of the animation are caused by problems during recording, it's not an importer issue. diff --git a/test/models/BLEND/HUMAN.source.txt b/test/models/BLEND/HUMAN.source.txt index 9409b46d3..a19c52468 100644 --- a/test/models/BLEND/HUMAN.source.txt +++ b/test/models/BLEND/HUMAN.source.txt @@ -1,3 +1,3 @@ HUMAN.blend (c) 2010, Tobias Rittig -Redistribution and reuse allowed for any purpose, credits appreciated. \ No newline at end of file +Redistribution and reuse allowed for any purpose, credits appreciated. diff --git a/test/models/BVH/01_nn.bvh.source.txt b/test/models/BVH/01_nn.bvh.source.txt index e538020a2..fc450d15d 100644 --- a/test/models/BVH/01_nn.bvh.source.txt +++ b/test/models/BVH/01_nn.bvh.source.txt @@ -47,4 +47,4 @@ Here's the relevant paragraph from mocap.cs.cmu.edu: obtained from mocap.cs.cmu.edu. The database was created with funding from NSF EIA-0196217." -[...] \ No newline at end of file +[...] diff --git a/test/models/CSM/ThomasFechten.source.txt b/test/models/CSM/ThomasFechten.source.txt index 529560ced..cf60674d8 100644 --- a/test/models/CSM/ThomasFechten.source.txt +++ b/test/models/CSM/ThomasFechten.source.txt @@ -1 +1 @@ -Recorded with vicon IQ, july 2008. Free for any purpose. \ No newline at end of file +Recorded with vicon IQ, july 2008. Free for any purpose. diff --git a/test/models/IRRMesh/credits.txt b/test/models/IRRMesh/credits.txt index a12163233..504746814 100644 --- a/test/models/IRRMesh/credits.txt +++ b/test/models/IRRMesh/credits.txt @@ -1,2 +1,2 @@ cellar.irrmesh - From irrlight/irrEdit. Irrlicht/irredit license (which?) -Textures resized to 400*400, improved JPEG compression to make them smaller \ No newline at end of file +Textures resized to 400*400, improved JPEG compression to make them smaller diff --git a/test/models/LWO/LWO2/MappingModes/earthCylindric.txt b/test/models/LWO/LWO2/MappingModes/earthCylindric.txt index 46660a486..18ea94ea2 100644 --- a/test/models/LWO/LWO2/MappingModes/earthCylindric.txt +++ b/test/models/LWO/LWO2/MappingModes/earthCylindric.txt @@ -2,4 +2,4 @@ Wikipedia Commons, downloaded November 25th 08 -http://upload.wikimedia.org/wikipedia/commons/0/01/Lambert-cylindrical-equal-area-projection.jpg \ No newline at end of file +http://upload.wikimedia.org/wikipedia/commons/0/01/Lambert-cylindrical-equal-area-projection.jpg diff --git a/test/models/LWO/LWO2/MappingModes/earthSpherical.source.txt b/test/models/LWO/LWO2/MappingModes/earthSpherical.source.txt index 218b339e1..db055ea0f 100644 --- a/test/models/LWO/LWO2/MappingModes/earthSpherical.source.txt +++ b/test/models/LWO/LWO2/MappingModes/earthSpherical.source.txt @@ -6,4 +6,4 @@ http://earthobservatory.nasa.gov/Features/BlueMarble/BlueMarble_monthlies.php Downloaded November 24, 08. -Rescaled to 2048 * 1024 with GIMP \ No newline at end of file +Rescaled to 2048 * 1024 with GIMP diff --git a/test/models/LWO/LWO2/concrete.source.txt b/test/models/LWO/LWO2/concrete.source.txt index 2904ae998..90fc73e2d 100644 --- a/test/models/LWO/LWO2/concrete.source.txt +++ b/test/models/LWO/LWO2/concrete.source.txt @@ -1,2 +1,2 @@ cgtextures.com - free, even for commercial use. See the licensing conditions and the FAQ the site for more details. -Great source for free textures, btw! \ No newline at end of file +Great source for free textures, btw! diff --git a/test/models/LWO/LWO2/uvtest-source.txt b/test/models/LWO/LWO2/uvtest-source.txt index 75e4878a7..654d62180 100644 --- a/test/models/LWO/LWO2/uvtest-source.txt +++ b/test/models/LWO/LWO2/uvtest-source.txt @@ -1,2 +1,2 @@ Regression file. -by Tom Speed, see http://groups.google.com/group/bmx3d/browse_thread/thread/36db3b191f81be36 \ No newline at end of file +by Tom Speed, see http://groups.google.com/group/bmx3d/browse_thread/thread/36db3b191f81be36 diff --git a/test/models/MD2/faerie-source.txt b/test/models/MD2/faerie-source.txt index ef0e4f196..4906ff4d1 100644 --- a/test/models/MD2/faerie-source.txt +++ b/test/models/MD2/faerie-source.txt @@ -21,4 +21,4 @@ The Irrlicht Engine License appreciated but is not required. 2. Altered source versions must be clearly marked as such, and must not be misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. \ No newline at end of file + 3. This notice may not be removed or altered from any source distribution. diff --git a/test/models/MD2/sidney-source.txt b/test/models/MD2/sidney-source.txt index ef0e4f196..4906ff4d1 100644 --- a/test/models/MD2/sidney-source.txt +++ b/test/models/MD2/sidney-source.txt @@ -21,4 +21,4 @@ The Irrlicht Engine License appreciated but is not required. 2. Altered source versions must be clearly marked as such, and must not be misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. \ No newline at end of file + 3. This notice may not be removed or altered from any source distribution. diff --git a/test/models/MD5/SimpleCube.source.txt b/test/models/MD5/SimpleCube.source.txt index 6f51bc1cf..77d151ed7 100644 --- a/test/models/MD5/SimpleCube.source.txt +++ b/test/models/MD5/SimpleCube.source.txt @@ -1 +1 @@ -From http://www.doom3world.org/phpbb2/viewtopic.php?f=3&t=16842 (thanks, Rayne, whoever you are) \ No newline at end of file +From http://www.doom3world.org/phpbb2/viewtopic.php?f=3&t=16842 (thanks, Rayne, whoever you are) diff --git a/test/models/MDL/MDL3 (3DGS A4)/minigun_readme.txt b/test/models/MDL/MDL3 (3DGS A4)/minigun_readme.txt index c2ca7c696..4d36f8cbb 100644 --- a/test/models/MDL/MDL3 (3DGS A4)/minigun_readme.txt +++ b/test/models/MDL/MDL3 (3DGS A4)/minigun_readme.txt @@ -3,4 +3,4 @@ Hi everybody!!! This is my first published model so it isn't very good,but i'm still learning!.. This model is free for everybody,but credit will be nice! You may reach me at rojkov91@mail.ru -P.S: Excuse my bad english \ No newline at end of file +P.S: Excuse my bad english diff --git a/test/models/MDL/MDL5 (3DGS A5)/minigun_mdl5_readme.txt b/test/models/MDL/MDL5 (3DGS A5)/minigun_mdl5_readme.txt index c2ca7c696..4d36f8cbb 100644 --- a/test/models/MDL/MDL5 (3DGS A5)/minigun_mdl5_readme.txt +++ b/test/models/MDL/MDL5 (3DGS A5)/minigun_mdl5_readme.txt @@ -3,4 +3,4 @@ Hi everybody!!! This is my first published model so it isn't very good,but i'm still learning!.. This model is free for everybody,but credit will be nice! You may reach me at rojkov91@mail.ru -P.S: Excuse my bad english \ No newline at end of file +P.S: Excuse my bad english diff --git a/test/models/MS3D/jeep1.readme.txt b/test/models/MS3D/jeep1.readme.txt index d17d5e0e9..f52ada0cc 100644 --- a/test/models/MS3D/jeep1.readme.txt +++ b/test/models/MS3D/jeep1.readme.txt @@ -12,4 +12,4 @@ http://xu1productions.com/3dstudio/index.html - 3D Game Resources http://www.psionicdesign.com - My Main 2D/3D Digital Art site -Psionic 2002 \ No newline at end of file +Psionic 2002 diff --git a/test/models/Q3D/E-AT-AT.source.txt b/test/models/Q3D/E-AT-AT.source.txt index 56a96f7d5..2df8826f1 100644 --- a/test/models/Q3D/E-AT-AT.source.txt +++ b/test/models/Q3D/E-AT-AT.source.txt @@ -5,4 +5,4 @@ Downloaded 4th November 08 (Obama ftw!) Copyright notice found on the page: Where do the models in the archive come from? -All 3D files available from the3darchive.com are from the public domain. \ No newline at end of file +All 3D files available from the3darchive.com are from the public domain. diff --git a/test/models/Q3D/earth.source.txt b/test/models/Q3D/earth.source.txt index 56a96f7d5..2df8826f1 100644 --- a/test/models/Q3D/earth.source.txt +++ b/test/models/Q3D/earth.source.txt @@ -5,4 +5,4 @@ Downloaded 4th November 08 (Obama ftw!) Copyright notice found on the page: Where do the models in the archive come from? -All 3D files available from the3darchive.com are from the public domain. \ No newline at end of file +All 3D files available from the3darchive.com are from the public domain. diff --git a/test/models/X/BCN_Epileptic.txt b/test/models/X/BCN_Epileptic.txt index 1538e59fb..398d21b86 100644 --- a/test/models/X/BCN_Epileptic.txt +++ b/test/models/X/BCN_Epileptic.txt @@ -1 +1 @@ -A human body separated into three meshes: lower body, upper body, head. A common bone hierarchy for all three meshes, plus an test animation that makes the body sort of jump. No material information exported. \ No newline at end of file +A human body separated into three meshes: lower body, upper body, head. A common bone hierarchy for all three meshes, plus an test animation that makes the body sort of jump. No material information exported. diff --git a/test/models/X/anim_test.txt b/test/models/X/anim_test.txt index 637ea0581..3d270dc7d 100644 --- a/test/models/X/anim_test.txt +++ b/test/models/X/anim_test.txt @@ -6,4 +6,4 @@ Frame 18 - 24: Zylinder-Spitze bewegt sich zu Position in Richtung x+ Remarks: The exporter failed here for some reasons... although the mesh referres to four bones, only two of them are stored in the corresponding node hierarchy. So you have a mesh with 4 bones, a hirarchy with 2 nodes and a animation that affects only those two nodes. -There is no timing given for the animation. You have to scale the animation manually. For this file, the timing seems to be 24 ticks per second. \ No newline at end of file +There is no timing given for the animation. You have to scale the animation manually. For this file, the timing seems to be 24 ticks per second. diff --git a/test/models/X/test.txt b/test/models/X/test.txt index 7a5e8e74b..eaf9d9c3c 100644 --- a/test/models/X/test.txt +++ b/test/models/X/test.txt @@ -1,3 +1,3 @@ Simple textured test cube exported from Maya. Has a texture that does label each cube side uniquely, but the sides do not match DirectX coordinate space. -Is not readable using D3DXLoadFrameHierarchy, needs custom text parsing. \ No newline at end of file +Is not readable using D3DXLoadFrameHierarchy, needs custom text parsing. diff --git a/test/regression/result_checker.py b/test/regression/result_checker.py index 19772f8af..1b01c52e6 100644 --- a/test/regression/result_checker.py +++ b/test/regression/result_checker.py @@ -110,4 +110,4 @@ def run(): if __name__ == "__main__": sys.exit(run()) -# vim: ai ts=4 sts=4 et sw=4 \ No newline at end of file +# vim: ai ts=4 sts=4 et sw=4 diff --git a/test/unit/utImproveCacheLocality.cpp b/test/unit/utImproveCacheLocality.cpp index 66ce0d6d8..803562dd2 100644 --- a/test/unit/utImproveCacheLocality.cpp +++ b/test/unit/utImproveCacheLocality.cpp @@ -41,4 +41,4 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------- */ -#include "UnitTestPCH.h" \ No newline at end of file +#include "UnitTestPCH.h" diff --git a/tools/assimp_view/Background.cpp b/tools/assimp_view/Background.cpp index e5f4e2b96..33bb81f2e 100644 --- a/tools/assimp_view/Background.cpp +++ b/tools/assimp_view/Background.cpp @@ -468,4 +468,4 @@ void CBackgroundPainter::RecreateNativeResource() piSkyBoxEffect->SetTechnique("RenderImage2D"); } } -}; \ No newline at end of file +}; diff --git a/tools/assimp_view/Camera.h b/tools/assimp_view/Camera.h index dd82af029..9c3103827 100644 --- a/tools/assimp_view/Camera.h +++ b/tools/assimp_view/Camera.h @@ -82,4 +82,4 @@ class Camera } ; -#endif // !!IG \ No newline at end of file +#endif // !!IG diff --git a/tools/assimp_view/Display.h b/tools/assimp_view/Display.h index f52e65e42..1ca29f498 100644 --- a/tools/assimp_view/Display.h +++ b/tools/assimp_view/Display.h @@ -539,4 +539,4 @@ namespace AssimpView }; } -#endif // AV_DISPLAY_H_INCLUDE \ No newline at end of file +#endif // AV_DISPLAY_H_INCLUDE diff --git a/tools/assimp_view/Input.cpp b/tools/assimp_view/Input.cpp index 505433404..f9f463412 100644 --- a/tools/assimp_view/Input.cpp +++ b/tools/assimp_view/Input.cpp @@ -369,4 +369,4 @@ void HandleKeyboardInputTextureView( void ) if( keys[VK_RIGHT] & 0x80 ) CDisplay::Instance().SetTextureViewOffsetX ( -g_fElpasedTime * 150.0f ); } -}; \ No newline at end of file +}; diff --git a/tools/assimp_view/LogWindow.h b/tools/assimp_view/LogWindow.h index 671d8be8f..5b2a3d2d3 100644 --- a/tools/assimp_view/LogWindow.h +++ b/tools/assimp_view/LogWindow.h @@ -130,4 +130,4 @@ namespace AssimpView } -#endif // AV_LOG_DISPLA \ No newline at end of file +#endif // AV_LOG_DISPLA diff --git a/tools/assimp_view/MeshRenderer.cpp b/tools/assimp_view/MeshRenderer.cpp index 27bc6704f..d93bb4aea 100644 --- a/tools/assimp_view/MeshRenderer.cpp +++ b/tools/assimp_view/MeshRenderer.cpp @@ -161,4 +161,4 @@ int CMeshRenderer::DrawSorted(unsigned int iIndex,const aiMatrix4x4& mWorld) { return 1; } -}; \ No newline at end of file +}; diff --git a/tools/assimp_view/MeshRenderer.h b/tools/assimp_view/MeshRenderer.h index 38cfa6326..d756a9984 100644 --- a/tools/assimp_view/MeshRenderer.h +++ b/tools/assimp_view/MeshRenderer.h @@ -96,4 +96,4 @@ namespace AssimpView { }; } -#endif //!! include guard \ No newline at end of file +#endif //!! include guard diff --git a/tools/assimp_view/NOTE@help.rtf.txt b/tools/assimp_view/NOTE@help.rtf.txt index f00962db6..dd20078e9 100644 --- a/tools/assimp_view/NOTE@help.rtf.txt +++ b/tools/assimp_view/NOTE@help.rtf.txt @@ -1,2 +1,2 @@ text1.bin is the corresponding bin file to be included with the executable file. -When updating the rich formatted text inside Visual Studio, a terminating 0 character must be appended \ No newline at end of file +When updating the rich formatted text inside Visual Studio, a terminating 0 character must be appended diff --git a/tools/assimp_view/RenderOptions.h b/tools/assimp_view/RenderOptions.h index bd9e8a871..69297419e 100644 --- a/tools/assimp_view/RenderOptions.h +++ b/tools/assimp_view/RenderOptions.h @@ -110,4 +110,4 @@ class RenderOptions bool bCulling,bSkeleton; }; -#endif // !! IG \ No newline at end of file +#endif // !! IG diff --git a/tools/assimp_view/SceneAnimator.h b/tools/assimp_view/SceneAnimator.h index 956edb3e3..82f3616c5 100644 --- a/tools/assimp_view/SceneAnimator.h +++ b/tools/assimp_view/SceneAnimator.h @@ -246,4 +246,4 @@ protected: } // end of namespace AssimpView -#endif // AV_SCENEANIMATOR_H_INCLUDED \ No newline at end of file +#endif // AV_SCENEANIMATOR_H_INCLUDED diff --git a/tools/assimp_view/Shaders.cpp b/tools/assimp_view/Shaders.cpp index f129b7cc6..9d80ac227 100644 --- a/tools/assimp_view/Shaders.cpp +++ b/tools/assimp_view/Shaders.cpp @@ -1407,4 +1407,4 @@ std::string g_szCheckerBackgroundShader = std::string( "}\n" "};\n" ); - }; \ No newline at end of file + }; diff --git a/tools/assimp_view/assimp_view.h b/tools/assimp_view/assimp_view.h index 3c519bb92..6b00f7f8c 100644 --- a/tools/assimp_view/assimp_view.h +++ b/tools/assimp_view/assimp_view.h @@ -279,4 +279,4 @@ enum EClickPos extern bool nopointslines; } -#endif // !! AV_MAIN_H_INCLUDED \ No newline at end of file +#endif // !! AV_MAIN_H_INCLUDED From 5e93b9ea8b7750e024d05d3991730ef04104a68d Mon Sep 17 00:00:00 2001 From: Alexey Medvedev Date: Mon, 30 Mar 2020 12:42:32 -0700 Subject: [PATCH 002/115] Fixed bone splitting with excessive amount of bones with 0 weight --- .../SplitByBoneCountProcess.cpp | 48 ++++++------------- 1 file changed, 15 insertions(+), 33 deletions(-) diff --git a/code/PostProcessing/SplitByBoneCountProcess.cpp b/code/PostProcessing/SplitByBoneCountProcess.cpp index ab7a1fe00..3ac0fe557 100644 --- a/code/PostProcessing/SplitByBoneCountProcess.cpp +++ b/code/PostProcessing/SplitByBoneCountProcess.cpp @@ -52,6 +52,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include +#include using namespace Assimp; using namespace Assimp::Formatter; @@ -188,9 +189,6 @@ void SplitByBoneCountProcess::SplitMesh( const aiMesh* pMesh, std::vectormNumFaces); // accumulated vertex count of all the faces in this submesh unsigned int numSubMeshVertices = 0; - // a small local array of new bones for the current face. State of all used bones for that face - // can only be updated AFTER the face is completely analysed. Thanks to imre for the fix. - std::vector newBonesAtCurrentFace; // add faces to the new submesh as long as all bones affecting the faces' vertices fit in the limit for( unsigned int a = 0; a < pMesh->mNumFaces; ++a) @@ -200,33 +198,21 @@ void SplitByBoneCountProcess::SplitMesh( const aiMesh* pMesh, std::vector newBonesAtCurrentFace; + const aiFace& face = pMesh->mFaces[a]; // check every vertex if its bones would still fit into the current submesh for( unsigned int b = 0; b < face.mNumIndices; ++b ) { - const std::vector& vb = vertexBones[face.mIndices[b]]; - for( unsigned int c = 0; c < vb.size(); ++c) - { - unsigned int boneIndex = vb[c].first; - // if the bone is already used in this submesh, it's ok - if( isBoneUsed[boneIndex] ) - { - continue; - } - - // if it's not used, yet, we would need to add it. Store its bone index - if( std::find( newBonesAtCurrentFace.begin(), newBonesAtCurrentFace.end(), boneIndex) == newBonesAtCurrentFace.end() ) - { - newBonesAtCurrentFace.push_back( boneIndex); - } - } + const std::vector& vb = vertexBones[face.mIndices[b]]; + for( unsigned int c = 0; c < vb.size(); ++c) + { + newBonesAtCurrentFace.insert(vb[c].first); + } } - if (newBonesAtCurrentFace.size() > mMaxBoneCount) - { - throw DeadlyImportError("SplitByBoneCountProcess: Single face requires more bones than specified max bone count!"); - } // leave out the face if the new bones required for this face don't fit the bone count limit anymore if( numBones + newBonesAtCurrentFace.size() > mMaxBoneCount ) { @@ -234,17 +220,13 @@ void SplitByBoneCountProcess::SplitMesh( const aiMesh* pMesh, std::vector::iterator it = newBonesAtCurrentFace.begin(); it != newBonesAtCurrentFace.end(); ++it) { - unsigned int newIndex = newBonesAtCurrentFace.back(); - newBonesAtCurrentFace.pop_back(); // this also avoids the deallocation which comes with a clear() - if( isBoneUsed[newIndex] ) - { - continue; - } - - isBoneUsed[newIndex] = true; + if (!isBoneUsed[*it]) + { + isBoneUsed[*it] = true; numBones++; + } } // store the face index and the vertex count From 3ef46b0eddbfdcd914da75c06b299e494a093317 Mon Sep 17 00:00:00 2001 From: Alexey Medvedev Date: Mon, 30 Mar 2020 16:56:33 -0700 Subject: [PATCH 003/115] Weights and bones count checks --- code/PostProcessing/SplitByBoneCountProcess.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/code/PostProcessing/SplitByBoneCountProcess.cpp b/code/PostProcessing/SplitByBoneCountProcess.cpp index 3ac0fe557..015ba9bf6 100644 --- a/code/PostProcessing/SplitByBoneCountProcess.cpp +++ b/code/PostProcessing/SplitByBoneCountProcess.cpp @@ -173,7 +173,15 @@ void SplitByBoneCountProcess::SplitMesh( const aiMesh* pMesh, std::vectormBones[a]; for( unsigned int b = 0; b < bone->mNumWeights; ++b) { - vertexBones[ bone->mWeights[b].mVertexId ].push_back( BoneWeight( a, bone->mWeights[b].mWeight)); + if (bone->mWeights[b].mWeight > 0.0f) + { + int vertexId = bone->mWeights[b].mVertexId; + vertexBones[vertexId].push_back( BoneWeight( a, bone->mWeights[b].mWeight)); + if (vertexBones[vertexId].size() > mMaxBoneCount) + { + throw DeadlyImportError("SplitByBoneCountProcess: Single face requires more bones than specified max bone count!"); + } + } } } From 87e2d3a54de9379675d0cf8899ebd1e2db750902 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gy=C3=B6rgy=20Straub?= <> Date: Mon, 30 Mar 2020 14:30:33 +0100 Subject: [PATCH 004/115] Added support for glTF2 sparse accessors. Refactored Accessors, pulling out reusable bits between those and sparse accessors' indices / values. --- code/glTF2/glTF2Asset.h | 88 +++++++++++++++++++++++++++++--- code/glTF2/glTF2Asset.inl | 102 +++++++++++++++++++++++++++----------- 2 files changed, 154 insertions(+), 36 deletions(-) diff --git a/code/glTF2/glTF2Asset.h b/code/glTF2/glTF2Asset.h index c27522df3..1df87ace3 100644 --- a/code/glTF2/glTF2Asset.h +++ b/code/glTF2/glTF2Asset.h @@ -357,24 +357,46 @@ struct Object { // Classes for each glTF top-level object type // +//! Base class for types that access binary data from a BufferView, such as accessors +//! or sparse accessors' indices. +//! N.B. not a virtual class. All owned pointers to BufferViewClient instances should +//! be to their most derived types (which may of course be just BufferViewClient). +struct BufferViewClient : public Object { + Ref bufferView; //!< The ID of the bufferView. (required) + size_t byteOffset; //!< The offset relative to the start of the bufferView in bytes. (required) + + inline uint8_t *GetPointer(); + + void Read(Value &obj, Asset &r); +}; + +//! BufferViewClient with component type information. +//! N.B. not a virtual class. All owned pointers to ComponentTypedBufferViewClient +//! instances should be to their most derived types (which may of course be just +//! ComponentTypedBufferViewClient). +struct ComponentTypedBufferViewClient : public BufferViewClient { + ComponentType componentType; //!< The datatype of components in the attribute. (required) + + unsigned int GetBytesPerComponent(); + + void Read(Value &obj, Asset &r); +}; + //! A typed view into a BufferView. A BufferView contains raw binary data. //! An accessor provides a typed view into a BufferView or a subset of a BufferView //! similar to how WebGL's vertexAttribPointer() defines an attribute in a buffer. -struct Accessor : public Object { - Ref bufferView; //!< The ID of the bufferView. (required) - size_t byteOffset; //!< The offset relative to the start of the bufferView in bytes. (required) - ComponentType componentType; //!< The datatype of components in the attribute. (required) +struct Accessor : public ComponentTypedBufferViewClient { + struct Sparse; + size_t count; //!< The number of attributes referenced by this accessor. (required) AttribType::Value type; //!< Specifies if the attribute is a scalar, vector, or matrix. (required) std::vector max; //!< Maximum value of each component in this attribute. std::vector min; //!< Minimum value of each component in this attribute. + std::unique_ptr sparse; //!< Sparse accessor information unsigned int GetNumComponents(); - unsigned int GetBytesPerComponent(); unsigned int GetElementSize(); - inline uint8_t *GetPointer(); - template bool ExtractData(T *&outData); @@ -405,11 +427,63 @@ struct Accessor : public Object { } }; + //! Sparse accessor information + struct Sparse { + size_t count; + ComponentTypedBufferViewClient indices; + BufferViewClient values; + + std::vector data; //!< Actual data, which may be defaulted to an array of zeros or the original data, with the sparse buffer view applied on top of it. + + inline void PopulateData(size_t numBytes, uint8_t *bytes) { + if (bytes) { + data.assign(bytes, bytes + numBytes); + } else { + data.resize(numBytes, 0x00); + } + } + + inline void PatchData(unsigned int elementSize) + { + uint8_t *pIndices = indices.GetPointer(); + const unsigned int indexSize = indices.GetBytesPerComponent(); + uint8_t *indicesEnd = pIndices + count * indexSize; + + uint8_t *pValues = values.GetPointer(); + while (pIndices != indicesEnd) { + size_t offset; + switch (indices.componentType) { + case ComponentType_UNSIGNED_BYTE: + offset = *pIndices; + break; + case ComponentType_UNSIGNED_SHORT: + offset = *reinterpret_cast(pIndices); + break; + case ComponentType_UNSIGNED_INT: + offset = *reinterpret_cast(pIndices); + break; + default: + // have fun with float and negative values from signed types as indices. + throw DeadlyImportError("Unsupported component type in index."); + } + + offset *= elementSize; + std::memcpy(data.data() + offset, pValues, elementSize); + + pValues += elementSize; + pIndices += indexSize; + } + } + }; + inline Indexer GetIndexer() { return Indexer(*this); } Accessor() {} + + inline uint8_t *GetPointer(); + void Read(Value &obj, Asset &r); }; diff --git a/code/glTF2/glTF2Asset.inl b/code/glTF2/glTF2Asset.inl index f9c3aa805..79725bace 100644 --- a/code/glTF2/glTF2Asset.inl +++ b/code/glTF2/glTF2Asset.inl @@ -540,36 +540,10 @@ inline void BufferView::Read(Value &obj, Asset &r) { } // -// struct Accessor +// struct BufferViewClient // -inline void Accessor::Read(Value &obj, Asset &r) { - - if (Value *bufferViewVal = FindUInt(obj, "bufferView")) { - bufferView = r.bufferViews.Retrieve(bufferViewVal->GetUint()); - } - - byteOffset = MemberOrDefault(obj, "byteOffset", size_t(0)); - componentType = MemberOrDefault(obj, "componentType", ComponentType_BYTE); - count = MemberOrDefault(obj, "count", size_t(0)); - - const char *typestr; - type = ReadMember(obj, "type", typestr) ? AttribType::FromString(typestr) : AttribType::SCALAR; -} - -inline unsigned int Accessor::GetNumComponents() { - return AttribType::GetNumComponents(type); -} - -inline unsigned int Accessor::GetBytesPerComponent() { - return int(ComponentTypeSize(componentType)); -} - -inline unsigned int Accessor::GetElementSize() { - return GetNumComponents() * GetBytesPerComponent(); -} - -inline uint8_t *Accessor::GetPointer() { +inline uint8_t *BufferViewClient::GetPointer() { if (!bufferView || !bufferView->buffer) return 0; uint8_t *basePtr = bufferView->buffer->GetPointer(); if (!basePtr) return 0; @@ -588,6 +562,76 @@ inline uint8_t *Accessor::GetPointer() { return basePtr + offset; } +inline void BufferViewClient::Read(Value &obj, Asset &r) { + + if (Value *bufferViewVal = FindUInt(obj, "bufferView")) { + bufferView = r.bufferViews.Retrieve(bufferViewVal->GetUint()); + } + + byteOffset = MemberOrDefault(obj, "byteOffset", size_t(0)); +} + +// +// struct ComponentTypedBufferViewClient +// + +inline unsigned int ComponentTypedBufferViewClient::GetBytesPerComponent() { + return int(ComponentTypeSize(componentType)); +} + +inline void ComponentTypedBufferViewClient::Read(Value &obj, Asset &r) { + + BufferViewClient::Read(obj, r); + + componentType = MemberOrDefault(obj, "componentType", ComponentType_BYTE); +} + +// +// struct Accessor +// + +inline uint8_t *Accessor::GetPointer() { + if (!sparse) return BufferViewClient::GetPointer(); + + return sparse->data.data(); +} + +inline void Accessor::Read(Value &obj, Asset &r) { + + ComponentTypedBufferViewClient::Read(obj, r); + + count = MemberOrDefault(obj, "count", size_t(0)); + + const char *typestr; + type = ReadMember(obj, "type", typestr) ? AttribType::FromString(typestr) : AttribType::SCALAR; + + if (Value *sparseValue = FindObject(obj, "sparse")) { + sparse.reset(new Sparse); + ReadMember(*sparseValue, "count", sparse->count); + + if (Value *indicesValue = FindObject(*sparseValue, "indices")) { + sparse->indices.Read(*indicesValue, r); + } + + if (Value *valuesValue = FindObject(*sparseValue, "values")) { + sparse->values.Read(*valuesValue, r); + } + + const unsigned int elementSize = GetElementSize(); + const size_t dataSize = count * elementSize; + sparse->PopulateData(dataSize, BufferViewClient::GetPointer()); + sparse->PatchData(elementSize); + } +} + +inline unsigned int Accessor::GetNumComponents() { + return AttribType::GetNumComponents(type); +} + +inline unsigned int Accessor::GetElementSize() { + return GetNumComponents() * GetBytesPerComponent(); +} + namespace { inline void CopyData(size_t count, const uint8_t *src, size_t src_stride, @@ -621,7 +665,7 @@ bool Accessor::ExtractData(T *&outData) { const size_t targetElemSize = sizeof(T); ai_assert(elemSize <= targetElemSize); - ai_assert(count * stride <= bufferView->byteLength); + ai_assert(count * stride <= (bufferView ? bufferView->byteLength : sparse->data.size())); outData = new T[count]; if (stride == elemSize && targetElemSize == elemSize) { From 53990ffa4243014692b3d325cbe7c18efa911459 Mon Sep 17 00:00:00 2001 From: Alexey Medvedev Date: Tue, 31 Mar 2020 14:18:51 -0700 Subject: [PATCH 005/115] Check for existed bone --- code/PostProcessing/SplitByBoneCountProcess.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/code/PostProcessing/SplitByBoneCountProcess.cpp b/code/PostProcessing/SplitByBoneCountProcess.cpp index 015ba9bf6..1fd26c757 100644 --- a/code/PostProcessing/SplitByBoneCountProcess.cpp +++ b/code/PostProcessing/SplitByBoneCountProcess.cpp @@ -217,7 +217,11 @@ void SplitByBoneCountProcess::SplitMesh( const aiMesh* pMesh, std::vector& vb = vertexBones[face.mIndices[b]]; for( unsigned int c = 0; c < vb.size(); ++c) { - newBonesAtCurrentFace.insert(vb[c].first); + unsigned int boneIndex = vb[c].first; + if( !isBoneUsed[boneIndex] ) + { + newBonesAtCurrentFace.insert(boneIndex); + } } } From 74c8d09bd8b9da85862173c10b51fdc6ab77d29c Mon Sep 17 00:00:00 2001 From: Peter Seiderer Date: Sun, 12 Apr 2020 18:19:13 +0200 Subject: [PATCH 006/115] contrib/zlib: disable dynamic library building Fixes compile failure for static only toolchains (and assimp links against the static one). --- contrib/zlib/CMakeLists.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/contrib/zlib/CMakeLists.txt b/contrib/zlib/CMakeLists.txt index c90996c0b..664c83a71 100644 --- a/contrib/zlib/CMakeLists.txt +++ b/contrib/zlib/CMakeLists.txt @@ -196,10 +196,7 @@ if(MINGW) set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj) endif(MINGW) -add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) -set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL) -set_target_properties(zlib PROPERTIES SOVERSION 1) INSTALL( TARGETS zlibstatic LIBRARY DESTINATION ${ASSIMP_LIB_INSTALL_DIR} From 45e33ce1bf8ed719531aa0a71c2f63bf26d16a13 Mon Sep 17 00:00:00 2001 From: David Golembiowski Date: Fri, 24 Apr 2020 16:36:44 -0400 Subject: [PATCH 007/115] first commit --- port/AssimpRs/Cargo.toml | 9 +++++++++ port/AssimpRs/src/lib.rs | 7 +++++++ 2 files changed, 16 insertions(+) create mode 100644 port/AssimpRs/Cargo.toml create mode 100644 port/AssimpRs/src/lib.rs diff --git a/port/AssimpRs/Cargo.toml b/port/AssimpRs/Cargo.toml new file mode 100644 index 000000000..705699b23 --- /dev/null +++ b/port/AssimpRs/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "AssimpRs" +version = "0.1.0" +authors = ["David Golembiowski "] +edition = "2018" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/port/AssimpRs/src/lib.rs b/port/AssimpRs/src/lib.rs new file mode 100644 index 000000000..31e1bb209 --- /dev/null +++ b/port/AssimpRs/src/lib.rs @@ -0,0 +1,7 @@ +#[cfg(test)] +mod tests { + #[test] + fn it_works() { + assert_eq!(2 + 2, 4); + } +} From df57ee6cb618a45872210f2a9019cc0b866ca6ca Mon Sep 17 00:00:00 2001 From: David Golembiowski Date: Fri, 24 Apr 2020 16:49:38 -0400 Subject: [PATCH 008/115] laying out the submodules --- port/AssimpRs/src/camera/mod.rs | 0 port/AssimpRs/src/core/mod.rs | 0 port/AssimpRs/src/errors/mod.rs | 0 port/AssimpRs/src/formats/mod.rs | 0 port/AssimpRs/src/material/mod.rs | 0 port/AssimpRs/src/postprocess/mod.rs | 0 port/AssimpRs/src/shims/mod.rs | 0 port/AssimpRs/src/socket/mod.rs | 0 port/AssimpRs/src/structs/mod.rs | 0 9 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 port/AssimpRs/src/camera/mod.rs create mode 100644 port/AssimpRs/src/core/mod.rs create mode 100644 port/AssimpRs/src/errors/mod.rs create mode 100644 port/AssimpRs/src/formats/mod.rs create mode 100644 port/AssimpRs/src/material/mod.rs create mode 100644 port/AssimpRs/src/postprocess/mod.rs create mode 100644 port/AssimpRs/src/shims/mod.rs create mode 100644 port/AssimpRs/src/socket/mod.rs create mode 100644 port/AssimpRs/src/structs/mod.rs diff --git a/port/AssimpRs/src/camera/mod.rs b/port/AssimpRs/src/camera/mod.rs new file mode 100644 index 000000000..e69de29bb diff --git a/port/AssimpRs/src/core/mod.rs b/port/AssimpRs/src/core/mod.rs new file mode 100644 index 000000000..e69de29bb diff --git a/port/AssimpRs/src/errors/mod.rs b/port/AssimpRs/src/errors/mod.rs new file mode 100644 index 000000000..e69de29bb diff --git a/port/AssimpRs/src/formats/mod.rs b/port/AssimpRs/src/formats/mod.rs new file mode 100644 index 000000000..e69de29bb diff --git a/port/AssimpRs/src/material/mod.rs b/port/AssimpRs/src/material/mod.rs new file mode 100644 index 000000000..e69de29bb diff --git a/port/AssimpRs/src/postprocess/mod.rs b/port/AssimpRs/src/postprocess/mod.rs new file mode 100644 index 000000000..e69de29bb diff --git a/port/AssimpRs/src/shims/mod.rs b/port/AssimpRs/src/shims/mod.rs new file mode 100644 index 000000000..e69de29bb diff --git a/port/AssimpRs/src/socket/mod.rs b/port/AssimpRs/src/socket/mod.rs new file mode 100644 index 000000000..e69de29bb diff --git a/port/AssimpRs/src/structs/mod.rs b/port/AssimpRs/src/structs/mod.rs new file mode 100644 index 000000000..e69de29bb From 5d05c536e7a6421b347142450f5149058c1f48d2 Mon Sep 17 00:00:00 2001 From: David Golembiowski Date: Fri, 24 Apr 2020 17:02:36 -0400 Subject: [PATCH 009/115] updated gitignore and made port library name compliant with cargo --- port/AssimpRs/Cargo.toml | 9 --------- port/AssimpRs/src/camera/mod.rs | 0 port/AssimpRs/src/core/mod.rs | 0 port/AssimpRs/src/errors/mod.rs | 0 port/AssimpRs/src/formats/mod.rs | 0 port/AssimpRs/src/lib.rs | 7 ------- port/AssimpRs/src/material/mod.rs | 0 port/AssimpRs/src/postprocess/mod.rs | 0 port/AssimpRs/src/shims/mod.rs | 0 port/AssimpRs/src/socket/mod.rs | 0 port/AssimpRs/src/structs/mod.rs | 0 11 files changed, 16 deletions(-) delete mode 100644 port/AssimpRs/Cargo.toml delete mode 100644 port/AssimpRs/src/camera/mod.rs delete mode 100644 port/AssimpRs/src/core/mod.rs delete mode 100644 port/AssimpRs/src/errors/mod.rs delete mode 100644 port/AssimpRs/src/formats/mod.rs delete mode 100644 port/AssimpRs/src/lib.rs delete mode 100644 port/AssimpRs/src/material/mod.rs delete mode 100644 port/AssimpRs/src/postprocess/mod.rs delete mode 100644 port/AssimpRs/src/shims/mod.rs delete mode 100644 port/AssimpRs/src/socket/mod.rs delete mode 100644 port/AssimpRs/src/structs/mod.rs diff --git a/port/AssimpRs/Cargo.toml b/port/AssimpRs/Cargo.toml deleted file mode 100644 index 705699b23..000000000 --- a/port/AssimpRs/Cargo.toml +++ /dev/null @@ -1,9 +0,0 @@ -[package] -name = "AssimpRs" -version = "0.1.0" -authors = ["David Golembiowski "] -edition = "2018" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] diff --git a/port/AssimpRs/src/camera/mod.rs b/port/AssimpRs/src/camera/mod.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/port/AssimpRs/src/core/mod.rs b/port/AssimpRs/src/core/mod.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/port/AssimpRs/src/errors/mod.rs b/port/AssimpRs/src/errors/mod.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/port/AssimpRs/src/formats/mod.rs b/port/AssimpRs/src/formats/mod.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/port/AssimpRs/src/lib.rs b/port/AssimpRs/src/lib.rs deleted file mode 100644 index 31e1bb209..000000000 --- a/port/AssimpRs/src/lib.rs +++ /dev/null @@ -1,7 +0,0 @@ -#[cfg(test)] -mod tests { - #[test] - fn it_works() { - assert_eq!(2 + 2, 4); - } -} diff --git a/port/AssimpRs/src/material/mod.rs b/port/AssimpRs/src/material/mod.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/port/AssimpRs/src/postprocess/mod.rs b/port/AssimpRs/src/postprocess/mod.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/port/AssimpRs/src/shims/mod.rs b/port/AssimpRs/src/shims/mod.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/port/AssimpRs/src/socket/mod.rs b/port/AssimpRs/src/socket/mod.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/port/AssimpRs/src/structs/mod.rs b/port/AssimpRs/src/structs/mod.rs deleted file mode 100644 index e69de29bb..000000000 From 6363bf34c0f80ac41acd4fbd0a8b1b11f2533654 Mon Sep 17 00:00:00 2001 From: David Golembiowski Date: Fri, 24 Apr 2020 17:03:41 -0400 Subject: [PATCH 010/115] see git commit message rust-port 5d05c536 --- .gitignore | 6 ++++++ port/assimp_rs/Cargo.lock | 6 ++++++ port/assimp_rs/Cargo.toml | 9 +++++++++ port/assimp_rs/src/camera/mod.rs | 0 port/assimp_rs/src/core/mod.rs | 0 port/assimp_rs/src/errors/mod.rs | 0 port/assimp_rs/src/formats/mod.rs | 0 port/assimp_rs/src/lib.rs | 17 +++++++++++++++++ port/assimp_rs/src/material/mod.rs | 0 port/assimp_rs/src/postprocess/mod.rs | 0 port/assimp_rs/src/shims/mod.rs | 0 port/assimp_rs/src/socket/mod.rs | 0 port/assimp_rs/src/structs/mod.rs | 0 13 files changed, 38 insertions(+) create mode 100644 port/assimp_rs/Cargo.lock create mode 100644 port/assimp_rs/Cargo.toml create mode 100644 port/assimp_rs/src/camera/mod.rs create mode 100644 port/assimp_rs/src/core/mod.rs create mode 100644 port/assimp_rs/src/errors/mod.rs create mode 100644 port/assimp_rs/src/formats/mod.rs create mode 100644 port/assimp_rs/src/lib.rs create mode 100644 port/assimp_rs/src/material/mod.rs create mode 100644 port/assimp_rs/src/postprocess/mod.rs create mode 100644 port/assimp_rs/src/shims/mod.rs create mode 100644 port/assimp_rs/src/socket/mod.rs create mode 100644 port/assimp_rs/src/structs/mod.rs diff --git a/.gitignore b/.gitignore index e975976bf..fe59f9a70 100644 --- a/.gitignore +++ b/.gitignore @@ -79,6 +79,12 @@ test/gtest/src/gtest-stamp/Debug/ tools/assimp_view/assimp_viewer.vcxproj.user *.pyc +### Rust ### +# Generated by Cargo; will have compiled files and executables +port/assimp_rs/target/ +# Backup files generated by rustfmt +port/assimp_rs/**/*.rs.bk + # Unix editor backups *~ test/gtest/src/gtest-stamp/gtest-gitinfo.txt diff --git a/port/assimp_rs/Cargo.lock b/port/assimp_rs/Cargo.lock new file mode 100644 index 000000000..4f571f362 --- /dev/null +++ b/port/assimp_rs/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "assimp_rs" +version = "0.1.0" + diff --git a/port/assimp_rs/Cargo.toml b/port/assimp_rs/Cargo.toml new file mode 100644 index 000000000..073a2b283 --- /dev/null +++ b/port/assimp_rs/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "assimp_rs" +version = "0.1.0" +authors = ["David Golembiowski "] +edition = "2018" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/port/assimp_rs/src/camera/mod.rs b/port/assimp_rs/src/camera/mod.rs new file mode 100644 index 000000000..e69de29bb diff --git a/port/assimp_rs/src/core/mod.rs b/port/assimp_rs/src/core/mod.rs new file mode 100644 index 000000000..e69de29bb diff --git a/port/assimp_rs/src/errors/mod.rs b/port/assimp_rs/src/errors/mod.rs new file mode 100644 index 000000000..e69de29bb diff --git a/port/assimp_rs/src/formats/mod.rs b/port/assimp_rs/src/formats/mod.rs new file mode 100644 index 000000000..e69de29bb diff --git a/port/assimp_rs/src/lib.rs b/port/assimp_rs/src/lib.rs new file mode 100644 index 000000000..dbb648876 --- /dev/null +++ b/port/assimp_rs/src/lib.rs @@ -0,0 +1,17 @@ +pub mod camera; +pub mod core; +pub mod errors; +pub mod formats; +pub mod material; +pub mod postprocess; +pub mod shims; +pub mod socket; +pub mod structs; + +#[cfg(test)] +mod tests { + #[test] + fn it_works() { + assert_eq!(true, true); + } +} diff --git a/port/assimp_rs/src/material/mod.rs b/port/assimp_rs/src/material/mod.rs new file mode 100644 index 000000000..e69de29bb diff --git a/port/assimp_rs/src/postprocess/mod.rs b/port/assimp_rs/src/postprocess/mod.rs new file mode 100644 index 000000000..e69de29bb diff --git a/port/assimp_rs/src/shims/mod.rs b/port/assimp_rs/src/shims/mod.rs new file mode 100644 index 000000000..e69de29bb diff --git a/port/assimp_rs/src/socket/mod.rs b/port/assimp_rs/src/socket/mod.rs new file mode 100644 index 000000000..e69de29bb diff --git a/port/assimp_rs/src/structs/mod.rs b/port/assimp_rs/src/structs/mod.rs new file mode 100644 index 000000000..e69de29bb From 2108e08c900a624ae9a0a858860e7932635ee9a9 Mon Sep 17 00:00:00 2001 From: David Golembiowski Date: Fri, 24 Apr 2020 18:15:51 -0400 Subject: [PATCH 011/115] adding structs --- port/assimp_rs/src/structs/mod.rs | 61 +++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/port/assimp_rs/src/structs/mod.rs b/port/assimp_rs/src/structs/mod.rs index e69de29bb..fd9087648 100644 --- a/port/assimp_rs/src/structs/mod.rs +++ b/port/assimp_rs/src/structs/mod.rs @@ -0,0 +1,61 @@ +mod anim; +/* Animation + * NodeAnim + * MeshAnim + * MeshMorphAnim + */ +mod blob; +/* ExportDataBlob + */ +mod vec; +/* Vector2d + * Vector3d + * */ +mod matrix; +/* Matrix3by3 + * Matrix4by4 + */ +mod camera; +/* Camera */ +mod color; +/* Color3d + * Color4d + */ +mod key; +/* MeshKey + * MeshMorphKey + * QuatKey + * VectorKey + */ +mod texel; +mod plane; +mod string; +/* String + */ +mod material; +/* Material + * MaterialPropery + * MaterialPropertyString + */ +mod mem; +mod quaternion; +mod face; +mod vertex_weight; +mod mesh; +/* Mesh + */ +mod meta; +/* Metadata + * MetadataEntry + */ +mod node; +/* Node + * */ +mod light; +mod texture; +mod ray; +mod transform; +/* UVTransform */ +mod bone; +mod scene; +/* Scene */ From 060c45fcf3b4019446560c079adafb8a5b894f40 Mon Sep 17 00:00:00 2001 From: David Golembiowski Date: Fri, 24 Apr 2020 22:15:32 -0400 Subject: [PATCH 012/115] initial layout for anim.rs --- port/assimp_rs/src/structs/anim.rs | 44 ++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 port/assimp_rs/src/structs/anim.rs diff --git a/port/assimp_rs/src/structs/anim.rs b/port/assimp_rs/src/structs/anim.rs new file mode 100644 index 000000000..5374151eb --- /dev/null +++ b/port/assimp_rs/src/structs/anim.rs @@ -0,0 +1,44 @@ +pub struct Animation<'mA, 'mMA, 'nA> { + /* The name of the animation. If the modeling package this data was + * exported from does support only a single animation channel, this + * name is usually empty (length is zero). + */ + m_name: Option, + // Duration of the animation in ticks + m_duration: f64, + // Ticks per second. Zero (0.000... ticks/second) if not + // specified in the imported file + m_ticks_per_second: Option, + /* Number of bone animation channels. + Each channel affects a single node. + */ + m_num_channels: u64, + /* Node animation channels. Each channel + affects a single node. + ?? -> The array is m_num_channels in size. + (maybe refine to a derivative type of usize?) + */ + m_channels: &'nA NodeAnim, + /* Number of mesh animation channels. Each + channel affects a single mesh and defines + vertex-based animation. + */ + m_num_mesh_channels: u64, + /* The mesh animation channels. Each channel + affects a single mesh. + The array is m_num_mesh_channels in size + (maybe refine to a derivative of usize?) + */ + m_mesh_channels: &'mA MeshAnim, + /* The number of mesh animation channels. Each channel + affects a single mesh and defines some morphing animation. + */ + m_num_morph_mesh_channels: u64, + /* The morph mesh animation channels. Each channel affects a single mesh. + The array is mNumMorphMeshChannels in size. + */ + m_morph_mesh_channels: &'mMA MeshMorphAnim +} +pub struct NodeAnim {} +pub struct MeshAnim {} +pub struct MeshMorphAnim {} From e438310d8cc3718fdc32d62462b8217569f9c766 Mon Sep 17 00:00:00 2001 From: David Golembiowski Date: Sat, 25 Apr 2020 00:12:58 -0400 Subject: [PATCH 013/115] should have added these earlier --- port/assimp_rs/src/structs/blob.rs | 0 port/assimp_rs/src/structs/bone.rs | 0 port/assimp_rs/src/structs/camera.rs | 0 port/assimp_rs/src/structs/color.rs | 0 port/assimp_rs/src/structs/face.rs | 0 port/assimp_rs/src/structs/key.rs | 0 port/assimp_rs/src/structs/light.rs | 0 port/assimp_rs/src/structs/material.rs | 0 port/assimp_rs/src/structs/matrix.rs | 0 port/assimp_rs/src/structs/mem.rs | 0 port/assimp_rs/src/structs/mesh.rs | 0 port/assimp_rs/src/structs/meta.rs | 0 port/assimp_rs/src/structs/node.rs | 0 port/assimp_rs/src/structs/plane.rs | 0 port/assimp_rs/src/structs/quaternion.rs | 0 port/assimp_rs/src/structs/ray.rs | 0 port/assimp_rs/src/structs/scene.rs | 0 port/assimp_rs/src/structs/string.rs | 0 port/assimp_rs/src/structs/texel.rs | 0 port/assimp_rs/src/structs/texture.rs | 0 port/assimp_rs/src/structs/transform.rs | 0 port/assimp_rs/src/structs/vec.rs | 0 port/assimp_rs/src/structs/vertex_weight.rs | 0 23 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 port/assimp_rs/src/structs/blob.rs create mode 100644 port/assimp_rs/src/structs/bone.rs create mode 100644 port/assimp_rs/src/structs/camera.rs create mode 100644 port/assimp_rs/src/structs/color.rs create mode 100644 port/assimp_rs/src/structs/face.rs create mode 100644 port/assimp_rs/src/structs/key.rs create mode 100644 port/assimp_rs/src/structs/light.rs create mode 100644 port/assimp_rs/src/structs/material.rs create mode 100644 port/assimp_rs/src/structs/matrix.rs create mode 100644 port/assimp_rs/src/structs/mem.rs create mode 100644 port/assimp_rs/src/structs/mesh.rs create mode 100644 port/assimp_rs/src/structs/meta.rs create mode 100644 port/assimp_rs/src/structs/node.rs create mode 100644 port/assimp_rs/src/structs/plane.rs create mode 100644 port/assimp_rs/src/structs/quaternion.rs create mode 100644 port/assimp_rs/src/structs/ray.rs create mode 100644 port/assimp_rs/src/structs/scene.rs create mode 100644 port/assimp_rs/src/structs/string.rs create mode 100644 port/assimp_rs/src/structs/texel.rs create mode 100644 port/assimp_rs/src/structs/texture.rs create mode 100644 port/assimp_rs/src/structs/transform.rs create mode 100644 port/assimp_rs/src/structs/vec.rs create mode 100644 port/assimp_rs/src/structs/vertex_weight.rs diff --git a/port/assimp_rs/src/structs/blob.rs b/port/assimp_rs/src/structs/blob.rs new file mode 100644 index 000000000..e69de29bb diff --git a/port/assimp_rs/src/structs/bone.rs b/port/assimp_rs/src/structs/bone.rs new file mode 100644 index 000000000..e69de29bb diff --git a/port/assimp_rs/src/structs/camera.rs b/port/assimp_rs/src/structs/camera.rs new file mode 100644 index 000000000..e69de29bb diff --git a/port/assimp_rs/src/structs/color.rs b/port/assimp_rs/src/structs/color.rs new file mode 100644 index 000000000..e69de29bb diff --git a/port/assimp_rs/src/structs/face.rs b/port/assimp_rs/src/structs/face.rs new file mode 100644 index 000000000..e69de29bb diff --git a/port/assimp_rs/src/structs/key.rs b/port/assimp_rs/src/structs/key.rs new file mode 100644 index 000000000..e69de29bb diff --git a/port/assimp_rs/src/structs/light.rs b/port/assimp_rs/src/structs/light.rs new file mode 100644 index 000000000..e69de29bb diff --git a/port/assimp_rs/src/structs/material.rs b/port/assimp_rs/src/structs/material.rs new file mode 100644 index 000000000..e69de29bb diff --git a/port/assimp_rs/src/structs/matrix.rs b/port/assimp_rs/src/structs/matrix.rs new file mode 100644 index 000000000..e69de29bb diff --git a/port/assimp_rs/src/structs/mem.rs b/port/assimp_rs/src/structs/mem.rs new file mode 100644 index 000000000..e69de29bb diff --git a/port/assimp_rs/src/structs/mesh.rs b/port/assimp_rs/src/structs/mesh.rs new file mode 100644 index 000000000..e69de29bb diff --git a/port/assimp_rs/src/structs/meta.rs b/port/assimp_rs/src/structs/meta.rs new file mode 100644 index 000000000..e69de29bb diff --git a/port/assimp_rs/src/structs/node.rs b/port/assimp_rs/src/structs/node.rs new file mode 100644 index 000000000..e69de29bb diff --git a/port/assimp_rs/src/structs/plane.rs b/port/assimp_rs/src/structs/plane.rs new file mode 100644 index 000000000..e69de29bb diff --git a/port/assimp_rs/src/structs/quaternion.rs b/port/assimp_rs/src/structs/quaternion.rs new file mode 100644 index 000000000..e69de29bb diff --git a/port/assimp_rs/src/structs/ray.rs b/port/assimp_rs/src/structs/ray.rs new file mode 100644 index 000000000..e69de29bb diff --git a/port/assimp_rs/src/structs/scene.rs b/port/assimp_rs/src/structs/scene.rs new file mode 100644 index 000000000..e69de29bb diff --git a/port/assimp_rs/src/structs/string.rs b/port/assimp_rs/src/structs/string.rs new file mode 100644 index 000000000..e69de29bb diff --git a/port/assimp_rs/src/structs/texel.rs b/port/assimp_rs/src/structs/texel.rs new file mode 100644 index 000000000..e69de29bb diff --git a/port/assimp_rs/src/structs/texture.rs b/port/assimp_rs/src/structs/texture.rs new file mode 100644 index 000000000..e69de29bb diff --git a/port/assimp_rs/src/structs/transform.rs b/port/assimp_rs/src/structs/transform.rs new file mode 100644 index 000000000..e69de29bb diff --git a/port/assimp_rs/src/structs/vec.rs b/port/assimp_rs/src/structs/vec.rs new file mode 100644 index 000000000..e69de29bb diff --git a/port/assimp_rs/src/structs/vertex_weight.rs b/port/assimp_rs/src/structs/vertex_weight.rs new file mode 100644 index 000000000..e69de29bb From 629320a3a0b8ae742b8c1760f49f63cd698c4fa9 Mon Sep 17 00:00:00 2001 From: Inho Lee Date: Mon, 27 Apr 2020 11:52:04 +0200 Subject: [PATCH 014/115] Add timescale for collada --- code/Collada/ColladaExporter.cpp | 4 +++- code/Collada/ColladaLoader.cpp | 10 ++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/code/Collada/ColladaExporter.cpp b/code/Collada/ColladaExporter.cpp index e27e7aa90..cb5d8323b 100644 --- a/code/Collada/ColladaExporter.cpp +++ b/code/Collada/ColladaExporter.cpp @@ -1314,6 +1314,8 @@ void ColladaExporter::WriteSceneLibrary() // ------------------------------------------------------------------------------------------------ void ColladaExporter::WriteAnimationLibrary(size_t pIndex) { + static const float kSecondsFromMilliseconds = .001f; + const aiAnimation * anim = mScene->mAnimations[pIndex]; if ( anim->mNumChannels == 0 && anim->mNumMeshChannels == 0 && anim->mNumMorphMeshChannels ==0 ) @@ -1351,7 +1353,7 @@ void ColladaExporter::WriteAnimationLibrary(size_t pIndex) std::vector frames; for( size_t i = 0; i < nodeAnim->mNumPositionKeys; ++i) { - frames.push_back(static_cast(nodeAnim->mPositionKeys[i].mTime)); + frames.push_back(static_cast(nodeAnim->mPositionKeys[i].mTime) * kSecondsFromMilliseconds); } WriteFloatArray(cur_node_idstr, FloatType_Time, (const ai_real *)frames.data(), frames.size()); diff --git a/code/Collada/ColladaLoader.cpp b/code/Collada/ColladaLoader.cpp index b78fc0e3b..e93550116 100644 --- a/code/Collada/ColladaLoader.cpp +++ b/code/Collada/ColladaLoader.cpp @@ -107,6 +107,8 @@ ColladaLoader::~ColladaLoader() { // empty } +static const float kMillisecondsFromSeconds = 1000.f; + // ------------------------------------------------------------------------------------------------ // Returns whether the class can handle the format of the given file. bool ColladaLoader::CanRead(const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const { @@ -1420,9 +1422,9 @@ void ColladaLoader::CreateAnimation(aiScene* pScene, const ColladaParser& pParse double time = double(mat.d4); // remember? time is stored in mat.d4 mat.d4 = 1.0f; - dstAnim->mPositionKeys[a].mTime = time; - dstAnim->mRotationKeys[a].mTime = time; - dstAnim->mScalingKeys[a].mTime = time; + dstAnim->mPositionKeys[a].mTime = time * kMillisecondsFromSeconds ; + dstAnim->mRotationKeys[a].mTime = time * kMillisecondsFromSeconds ; + dstAnim->mScalingKeys[a].mTime = time * kMillisecondsFromSeconds ; mat.Decompose(dstAnim->mScalingKeys[a].mValue, dstAnim->mRotationKeys[a].mValue, dstAnim->mPositionKeys[a].mValue); } @@ -1484,7 +1486,7 @@ void ColladaLoader::CreateAnimation(aiScene* pScene, const ColladaParser& pParse morphAnim->mKeys[key].mValues = new unsigned int[morphChannels.size()]; morphAnim->mKeys[key].mWeights = new double[morphChannels.size()]; - morphAnim->mKeys[key].mTime = morphTimeValues[key].mTime; + morphAnim->mKeys[key].mTime = morphTimeValues[key].mTime * kMillisecondsFromSeconds ; for (unsigned int valueIndex = 0; valueIndex < morphChannels.size(); valueIndex++) { morphAnim->mKeys[key].mValues[valueIndex] = valueIndex; From b0c97118946c2d138985df1908638614350c1863 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Mon, 27 Apr 2020 15:16:57 +0200 Subject: [PATCH 015/115] Small format finding --- code/Collada/ColladaExporter.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/Collada/ColladaExporter.cpp b/code/Collada/ColladaExporter.cpp index cb5d8323b..6faa229c8 100644 --- a/code/Collada/ColladaExporter.cpp +++ b/code/Collada/ColladaExporter.cpp @@ -4,7 +4,6 @@ Open Asset Import Library (assimp) Copyright (c) 2006-2020, assimp team - All rights reserved. Redistribution and use of this software in source and binary forms, @@ -1316,10 +1315,11 @@ void ColladaExporter::WriteAnimationLibrary(size_t pIndex) { static const float kSecondsFromMilliseconds = .001f; - const aiAnimation * anim = mScene->mAnimations[pIndex]; + const aiAnimation * anim = mScene->mAnimations[pIndex]; - if ( anim->mNumChannels == 0 && anim->mNumMeshChannels == 0 && anim->mNumMorphMeshChannels ==0 ) - return; + if ( anim->mNumChannels == 0 && anim->mNumMeshChannels == 0 && anim->mNumMorphMeshChannels ==0 ) { + return; + } const std::string animation_name_escaped = XMLEscape( anim->mName.C_Str() ); std::string idstr = anim->mName.C_Str(); From 81abd90ee1c25bff7b2f70db29a83216be00d11c Mon Sep 17 00:00:00 2001 From: Paul Arden Date: Tue, 28 Apr 2020 10:07:56 +1000 Subject: [PATCH 016/115] Fix reading of orthographic camera data. Fixes #3028. --- code/glTF2/glTF2Asset.inl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/glTF2/glTF2Asset.inl b/code/glTF2/glTF2Asset.inl index ed23b388a..ea0b17dcd 100644 --- a/code/glTF2/glTF2Asset.inl +++ b/code/glTF2/glTF2Asset.inl @@ -1068,10 +1068,10 @@ inline void Camera::Read(Value &obj, Asset & /*r*/) { cameraProperties.perspective.zfar = MemberOrDefault(*it, "zfar", 100.f); cameraProperties.perspective.znear = MemberOrDefault(*it, "znear", 0.01f); } else { - cameraProperties.ortographic.xmag = MemberOrDefault(obj, "xmag", 1.f); - cameraProperties.ortographic.ymag = MemberOrDefault(obj, "ymag", 1.f); - cameraProperties.ortographic.zfar = MemberOrDefault(obj, "zfar", 100.f); - cameraProperties.ortographic.znear = MemberOrDefault(obj, "znear", 0.01f); + cameraProperties.ortographic.xmag = MemberOrDefault(*it, "xmag", 1.f); + cameraProperties.ortographic.ymag = MemberOrDefault(*it, "ymag", 1.f); + cameraProperties.ortographic.zfar = MemberOrDefault(*it, "zfar", 100.f); + cameraProperties.ortographic.znear = MemberOrDefault(*it, "znear", 0.01f); } } From 4dfdbbf171674756f281dbad07e335bb5e4d989d Mon Sep 17 00:00:00 2001 From: qarmin Date: Tue, 28 Apr 2020 20:31:59 +0200 Subject: [PATCH 017/115] Check index before using --- code/glTF/glTFCommon.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/glTF/glTFCommon.cpp b/code/glTF/glTFCommon.cpp index 1c662a16a..17da49fb8 100644 --- a/code/glTF/glTFCommon.cpp +++ b/code/glTF/glTFCommon.cpp @@ -145,13 +145,13 @@ bool ParseDataURI(const char *const_uri, size_t uriLen, DataURI &out) { size_t i = 5, j; if (uri[i] != ';' && uri[i] != ',') { // has media type? uri[1] = char(i); - for (; uri[i] != ';' && uri[i] != ',' && i < uriLen; ++i) { + for (;i < uriLen && uri[i] != ';' && uri[i] != ','; ++i) { // nothing to do! } } - while (uri[i] == ';' && i < uriLen) { + while (i < uriLen && uri[i] == ';') { uri[i++] = '\0'; - for (j = i; uri[i] != ';' && uri[i] != ',' && i < uriLen; ++i) { + for (j = i; i < uriLen && uri[i] != ';' && uri[i] != ','; ++i) { // nothing to do! } From 2c6ac23a4e04127838b03eb4589861d9e22ef0f4 Mon Sep 17 00:00:00 2001 From: RichardTea <31507749+RichardTea@users.noreply.github.com> Date: Tue, 28 Apr 2020 17:46:07 +0100 Subject: [PATCH 018/115] Apply Assimp clangformat to touched Collada files --- code/Collada/ColladaExporter.cpp | 1545 ++++++++++++++--------------- code/Collada/ColladaExporter.h | 135 +-- code/Collada/ColladaHelper.cpp | 23 +- code/Collada/ColladaHelper.h | 403 ++++---- code/Collada/ColladaLoader.cpp | 692 ++++++------- code/Collada/ColladaParser.cpp | 1572 +++++++++++------------------- code/Collada/ColladaParser.h | 503 +++++----- 7 files changed, 2103 insertions(+), 2770 deletions(-) diff --git a/code/Collada/ColladaExporter.cpp b/code/Collada/ColladaExporter.cpp index e27e7aa90..0026fda26 100644 --- a/code/Collada/ColladaExporter.cpp +++ b/code/Collada/ColladaExporter.cpp @@ -45,24 +45,24 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "ColladaExporter.h" #include -#include +#include #include -#include #include #include #include -#include -#include -#include +#include +#include #include +#include +#include #include -#include #include +#include +#include #include #include -#include using namespace Assimp; @@ -70,32 +70,32 @@ namespace Assimp { // ------------------------------------------------------------------------------------------------ // Worker function for exporting a scene to Collada. Prototyped and registered in Exporter.cpp -void ExportSceneCollada(const char* pFile, IOSystem* pIOSystem, const aiScene* pScene, const ExportProperties* /*pProperties*/) { +void ExportSceneCollada(const char *pFile, IOSystem *pIOSystem, const aiScene *pScene, const ExportProperties * /*pProperties*/) { std::string path = DefaultIOSystem::absolutePath(std::string(pFile)); std::string file = DefaultIOSystem::completeBaseName(std::string(pFile)); // invoke the exporter - ColladaExporter iDoTheExportThing( pScene, pIOSystem, path, file); - + ColladaExporter iDoTheExportThing(pScene, pIOSystem, path, file); + if (iDoTheExportThing.mOutput.fail()) { throw DeadlyExportError("output data creation failed. Most likely the file became too large: " + std::string(pFile)); } // we're still here - export successfully completed. Write result to the given IOSYstem - std::unique_ptr outfile (pIOSystem->Open(pFile,"wt")); - if(outfile == NULL) { + std::unique_ptr outfile(pIOSystem->Open(pFile, "wt")); + if (outfile == NULL) { throw DeadlyExportError("could not open output .dae file: " + std::string(pFile)); } // XXX maybe use a small wrapper around IOStream that behaves like std::stringstream in order to avoid the extra copy. - outfile->Write( iDoTheExportThing.mOutput.str().c_str(), static_cast(iDoTheExportThing.mOutput.tellp()),1); + outfile->Write(iDoTheExportThing.mOutput.str().c_str(), static_cast(iDoTheExportThing.mOutput.tellp()), 1); } } // end of namespace Assimp // ------------------------------------------------------------------------------------------------ // Encodes a string into a valid XML ID using the xsd:ID schema qualifications. -static const std::string XMLIDEncode(const std::string& name) { +static const std::string XMLIDEncode(const std::string &name) { const char XML_ID_CHARS[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_-."; const unsigned int XML_ID_CHARS_COUNT = sizeof(XML_ID_CHARS) / sizeof(char); @@ -115,7 +115,7 @@ static const std::string XMLIDEncode(const std::string& name) { if (strchr(XML_ID_CHARS, *it) != nullptr) { idEncoded << *it; } else { - // Select placeholder character based on invalid character to prevent name collisions + // Select placeholder character based on invalid character to prevent name collisions idEncoded << XML_ID_CHARS[(*it) % XML_ID_CHARS_COUNT]; } } @@ -125,12 +125,12 @@ static const std::string XMLIDEncode(const std::string& name) { // ------------------------------------------------------------------------------------------------ // Constructor for a specific scene to export -ColladaExporter::ColladaExporter( const aiScene* pScene, IOSystem* pIOSystem, const std::string& path, const std::string& file) -: mIOSystem(pIOSystem) -, mPath(path) -, mFile(file) { +ColladaExporter::ColladaExporter(const aiScene *pScene, IOSystem *pIOSystem, const std::string &path, const std::string &file) : + mIOSystem(pIOSystem), + mPath(path), + mFile(file) { // make sure that all formatting happens using the standard, C locale and not the user's current locale - mOutput.imbue( std::locale("C") ); + mOutput.imbue(std::locale("C")); mOutput.precision(ASSIMP_AI_REAL_TEXT_PRECISION); mScene = pScene; @@ -146,7 +146,7 @@ ColladaExporter::ColladaExporter( const aiScene* pScene, IOSystem* pIOSystem, co // ------------------------------------------------------------------------------------------------ // Destructor ColladaExporter::~ColladaExporter() { - if ( mSceneOwned ) { + if (mSceneOwned) { delete mScene; } } @@ -170,9 +170,9 @@ void ColladaExporter::WriteFile() { WriteControllerLibrary(); WriteSceneLibrary(); - - // customized, Writes the animation library - WriteAnimationsLibrary(); + + // customized, Writes the animation library + WriteAnimationsLibrary(); // useless Collada fu at the end, just in case we haven't had enough indirections, yet. mOutput << startstr << "" << endstr; @@ -189,17 +189,17 @@ void ColladaExporter::WriteFile() { void ColladaExporter::WriteHeader() { static const ai_real epsilon = Math::getEpsilon(); static const aiQuaternion x_rot(aiMatrix3x3( - 0, -1, 0, - 1, 0, 0, - 0, 0, 1)); + 0, -1, 0, + 1, 0, 0, + 0, 0, 1)); static const aiQuaternion y_rot(aiMatrix3x3( - 1, 0, 0, - 0, 1, 0, - 0, 0, 1)); + 1, 0, 0, + 0, 1, 0, + 0, 0, 1)); static const aiQuaternion z_rot(aiMatrix3x3( - 1, 0, 0, - 0, 0, 1, - 0, -1, 0)); + 1, 0, 0, + 0, 0, 1, + 0, -1, 0)); static const unsigned int date_nb_chars = 20; char date_str[date_nb_chars]; @@ -215,39 +215,39 @@ void ColladaExporter::WriteHeader() { bool add_root_node = false; ai_real scale = 1.0; - if(std::abs(scaling.x - scaling.y) <= epsilon && std::abs(scaling.x - scaling.z) <= epsilon && std::abs(scaling.y - scaling.z) <= epsilon) { - scale = (ai_real) ((((double) scaling.x) + ((double) scaling.y) + ((double) scaling.z)) / 3.0); + if (std::abs(scaling.x - scaling.y) <= epsilon && std::abs(scaling.x - scaling.z) <= epsilon && std::abs(scaling.y - scaling.z) <= epsilon) { + scale = (ai_real)((((double)scaling.x) + ((double)scaling.y) + ((double)scaling.z)) / 3.0); } else { add_root_node = true; } std::string up_axis = "Y_UP"; - if(rotation.Equal(x_rot, epsilon)) { + if (rotation.Equal(x_rot, epsilon)) { up_axis = "X_UP"; - } else if(rotation.Equal(y_rot, epsilon)) { + } else if (rotation.Equal(y_rot, epsilon)) { up_axis = "Y_UP"; - } else if(rotation.Equal(z_rot, epsilon)) { + } else if (rotation.Equal(z_rot, epsilon)) { up_axis = "Z_UP"; } else { add_root_node = true; } - if(! position.Equal(aiVector3D(0, 0, 0))) { + if (!position.Equal(aiVector3D(0, 0, 0))) { add_root_node = true; } - if(mScene->mRootNode->mNumChildren == 0) { + if (mScene->mRootNode->mNumChildren == 0) { add_root_node = true; } - if(add_root_node) { - aiScene* scene; + if (add_root_node) { + aiScene *scene; SceneCombiner::CopyScene(&scene, mScene); - aiNode* root = new aiNode("Scene"); + aiNode *root = new aiNode("Scene"); root->mNumChildren = 1; - root->mChildren = new aiNode*[root->mNumChildren]; + root->mChildren = new aiNode *[root->mNumChildren]; root->mChildren[0] = scene->mRootNode; scene->mRootNode->mParent = root; @@ -266,20 +266,24 @@ void ColladaExporter::WriteHeader() { PushTag(); // If no Scene metadata, use root node metadata - aiMetadata* meta = mScene->mMetaData; + aiMetadata *meta = mScene->mMetaData; if (nullptr == meta) { meta = mScene->mRootNode->mMetaData; } aiString value; if (!meta || !meta->Get("Author", value)) { - mOutput << startstr << "" << "Assimp" << "" << endstr; + mOutput << startstr << "" + << "Assimp" + << "" << endstr; } else { mOutput << startstr << "" << XMLEscape(value.C_Str()) << "" << endstr; } if (nullptr == meta || !meta->Get(AI_METADATA_SOURCE_GENERATOR, value)) { - mOutput << startstr << "" << "Assimp Exporter" << "" << endstr; + mOutput << startstr << "" + << "Assimp Exporter" + << "" << endstr; } else { mOutput << startstr << "" << XMLEscape(value.C_Str()) << "" << endstr; } @@ -336,26 +340,26 @@ void ColladaExporter::WriteTextures() { char str[buffer_size]; if (mScene->HasTextures()) { - for(unsigned int i = 0; i < mScene->mNumTextures; i++) { + for (unsigned int i = 0; i < mScene->mNumTextures; i++) { // It would be great to be able to create a directory in portable standard C++, but it's not the case, // so we just write the textures in the current directory. - aiTexture* texture = mScene->mTextures[i]; - if ( nullptr == texture ) { + aiTexture *texture = mScene->mTextures[i]; + if (nullptr == texture) { continue; } ASSIMP_itoa10(str, buffer_size, i + 1); - std::string name = mFile + "_texture_" + (i < 1000 ? "0" : "") + (i < 100 ? "0" : "") + (i < 10 ? "0" : "") + str + "." + ((const char*) texture->achFormatHint); + std::string name = mFile + "_texture_" + (i < 1000 ? "0" : "") + (i < 100 ? "0" : "") + (i < 10 ? "0" : "") + str + "." + ((const char *)texture->achFormatHint); std::unique_ptr outfile(mIOSystem->Open(mPath + mIOSystem->getOsSeparator() + name, "wb")); - if(outfile == NULL) { + if (outfile == NULL) { throw DeadlyExportError("could not open output texture file: " + mPath + name); } - if(texture->mHeight == 0) { - outfile->Write((void*) texture->pcData, texture->mWidth, 1); + if (texture->mHeight == 0) { + outfile->Write((void *)texture->pcData, texture->mWidth, 1); } else { Bitmap::Save(texture, outfile.get()); } @@ -370,21 +374,20 @@ void ColladaExporter::WriteTextures() { // ------------------------------------------------------------------------------------------------ // Write the embedded textures void ColladaExporter::WriteCamerasLibrary() { - if(mScene->HasCameras()) { + if (mScene->HasCameras()) { mOutput << startstr << "" << endstr; PushTag(); - for( size_t a = 0; a < mScene->mNumCameras; ++a) - WriteCamera( a); + for (size_t a = 0; a < mScene->mNumCameras; ++a) + WriteCamera(a); PopTag(); mOutput << startstr << "" << endstr; - } } -void ColladaExporter::WriteCamera(size_t pIndex){ +void ColladaExporter::WriteCamera(size_t pIndex) { const aiCamera *cam = mScene->mCameras[pIndex]; const std::string cameraName = XMLEscape(cam->mName.C_Str()); @@ -400,18 +403,17 @@ void ColladaExporter::WriteCamera(size_t pIndex){ //always perspective mOutput << startstr << "" << endstr; PushTag(); - mOutput << startstr << ""<< - AI_RAD_TO_DEG(cam->mHorizontalFOV) - <<"" << endstr; + mOutput << startstr << "" << AI_RAD_TO_DEG(cam->mHorizontalFOV) + << "" << endstr; mOutput << startstr << "" - << cam->mAspect - << "" << endstr; + << cam->mAspect + << "" << endstr; mOutput << startstr << "" - << cam->mClipPlaneNear - << "" << endstr; + << cam->mClipPlaneNear + << "" << endstr; mOutput << startstr << "" - << cam->mClipPlaneFar - << "" << endstr; + << cam->mClipPlaneFar + << "" << endstr; PopTag(); mOutput << startstr << "" << endstr; PopTag(); @@ -420,28 +422,25 @@ void ColladaExporter::WriteCamera(size_t pIndex){ mOutput << startstr << "" << endstr; PopTag(); mOutput << startstr << "" << endstr; - } - // ------------------------------------------------------------------------------------------------ // Write the embedded textures void ColladaExporter::WriteLightsLibrary() { - if(mScene->HasLights()) { + if (mScene->HasLights()) { mOutput << startstr << "" << endstr; PushTag(); - for( size_t a = 0; a < mScene->mNumLights; ++a) - WriteLight( a); + for (size_t a = 0; a < mScene->mNumLights; ++a) + WriteLight(a); PopTag(); mOutput << startstr << "" << endstr; - } } -void ColladaExporter::WriteLight(size_t pIndex){ +void ColladaExporter::WriteLight(size_t pIndex) { const aiLight *light = mScene->mLights[pIndex]; const std::string lightName = XMLEscape(light->mName.C_Str()); @@ -452,116 +451,111 @@ void ColladaExporter::WriteLight(size_t pIndex){ PushTag(); mOutput << startstr << "" << endstr; PushTag(); - switch(light->mType){ - case aiLightSource_AMBIENT: - WriteAmbienttLight(light); - break; - case aiLightSource_DIRECTIONAL: - WriteDirectionalLight(light); - break; - case aiLightSource_POINT: - WritePointLight(light); - break; - case aiLightSource_SPOT: - WriteSpotLight(light); - break; - case aiLightSource_AREA: - case aiLightSource_UNDEFINED: - case _aiLightSource_Force32Bit: - break; + switch (light->mType) { + case aiLightSource_AMBIENT: + WriteAmbienttLight(light); + break; + case aiLightSource_DIRECTIONAL: + WriteDirectionalLight(light); + break; + case aiLightSource_POINT: + WritePointLight(light); + break; + case aiLightSource_SPOT: + WriteSpotLight(light); + break; + case aiLightSource_AREA: + case aiLightSource_UNDEFINED: + case _aiLightSource_Force32Bit: + break; } PopTag(); mOutput << startstr << "" << endstr; PopTag(); mOutput << startstr << "" << endstr; - } -void ColladaExporter::WritePointLight(const aiLight *const light){ - const aiColor3D &color= light->mColorDiffuse; +void ColladaExporter::WritePointLight(const aiLight *const light) { + const aiColor3D &color = light->mColorDiffuse; mOutput << startstr << "" << endstr; PushTag(); mOutput << startstr << "" - << color.r<<" "<" << endstr; + << color.r << " " << color.g << " " << color.b + << "" << endstr; mOutput << startstr << "" - << light->mAttenuationConstant - <<"" << endstr; + << light->mAttenuationConstant + << "" << endstr; mOutput << startstr << "" - << light->mAttenuationLinear - <<"" << endstr; + << light->mAttenuationLinear + << "" << endstr; mOutput << startstr << "" - << light->mAttenuationQuadratic - <<"" << endstr; + << light->mAttenuationQuadratic + << "" << endstr; PopTag(); mOutput << startstr << "" << endstr; - } -void ColladaExporter::WriteDirectionalLight(const aiLight *const light){ - const aiColor3D &color= light->mColorDiffuse; +void ColladaExporter::WriteDirectionalLight(const aiLight *const light) { + const aiColor3D &color = light->mColorDiffuse; mOutput << startstr << "" << endstr; PushTag(); mOutput << startstr << "" - << color.r<<" "<" << endstr; + << color.r << " " << color.g << " " << color.b + << "" << endstr; PopTag(); mOutput << startstr << "" << endstr; - } -void ColladaExporter::WriteSpotLight(const aiLight *const light){ +void ColladaExporter::WriteSpotLight(const aiLight *const light) { - const aiColor3D &color= light->mColorDiffuse; + const aiColor3D &color = light->mColorDiffuse; mOutput << startstr << "" << endstr; PushTag(); mOutput << startstr << "" - << color.r<<" "<" << endstr; + << color.r << " " << color.g << " " << color.b + << "" << endstr; mOutput << startstr << "" - << light->mAttenuationConstant - <<"" << endstr; + << light->mAttenuationConstant + << "" << endstr; mOutput << startstr << "" - << light->mAttenuationLinear - <<"" << endstr; + << light->mAttenuationLinear + << "" << endstr; mOutput << startstr << "" - << light->mAttenuationQuadratic - <<"" << endstr; + << light->mAttenuationQuadratic + << "" << endstr; /* out->mAngleOuterCone = AI_DEG_TO_RAD (std::acos(std::pow(0.1f,1.f/srcLight->mFalloffExponent))+ srcLight->mFalloffAngle); */ const ai_real fallOffAngle = AI_RAD_TO_DEG(light->mAngleInnerCone); - mOutput << startstr <<"" - << fallOffAngle - <<"" << endstr; - double temp = light->mAngleOuterCone-light->mAngleInnerCone; + mOutput << startstr << "" + << fallOffAngle + << "" << endstr; + double temp = light->mAngleOuterCone - light->mAngleInnerCone; temp = std::cos(temp); - temp = std::log(temp)/std::log(0.1); - temp = 1/temp; + temp = std::log(temp) / std::log(0.1); + temp = 1 / temp; mOutput << startstr << "" - << temp - <<"" << endstr; - + << temp + << "" << endstr; PopTag(); mOutput << startstr << "" << endstr; - } -void ColladaExporter::WriteAmbienttLight(const aiLight *const light){ +void ColladaExporter::WriteAmbienttLight(const aiLight *const light) { - const aiColor3D &color= light->mColorAmbient; + const aiColor3D &color = light->mColorAmbient; mOutput << startstr << "" << endstr; PushTag(); mOutput << startstr << "" - << color.r<<" "<" << endstr; + << color.r << " " << color.g << " " << color.b + << "" << endstr; PopTag(); mOutput << startstr << "" << endstr; @@ -569,130 +563,121 @@ void ColladaExporter::WriteAmbienttLight(const aiLight *const light){ // ------------------------------------------------------------------------------------------------ // Reads a single surface entry from the given material keys -void ColladaExporter::ReadMaterialSurface( Surface& poSurface, const aiMaterial* pSrcMat, - aiTextureType pTexture, const char* pKey, size_t pType, size_t pIndex) { - if( pSrcMat->GetTextureCount( pTexture) > 0 ) { - aiString texfile; - unsigned int uvChannel = 0; - pSrcMat->GetTexture( pTexture, 0, &texfile, NULL, &uvChannel); +void ColladaExporter::ReadMaterialSurface(Surface &poSurface, const aiMaterial *pSrcMat, + aiTextureType pTexture, const char *pKey, size_t pType, size_t pIndex) { + if (pSrcMat->GetTextureCount(pTexture) > 0) { + aiString texfile; + unsigned int uvChannel = 0; + pSrcMat->GetTexture(pTexture, 0, &texfile, NULL, &uvChannel); - std::string index_str(texfile.C_Str()); + std::string index_str(texfile.C_Str()); - if(index_str.size() != 0 && index_str[0] == '*') { - unsigned int index; + if (index_str.size() != 0 && index_str[0] == '*') { + unsigned int index; - index_str = index_str.substr(1, std::string::npos); + index_str = index_str.substr(1, std::string::npos); - try { - index = (unsigned int) strtoul10_64(index_str.c_str()); - } catch(std::exception& error) { - throw DeadlyExportError(error.what()); - } + try { + index = (unsigned int)strtoul10_64(index_str.c_str()); + } catch (std::exception &error) { + throw DeadlyExportError(error.what()); + } - std::map::const_iterator name = textures.find(index); + std::map::const_iterator name = textures.find(index); - if(name != textures.end()) { - poSurface.texture = name->second; + if (name != textures.end()) { + poSurface.texture = name->second; + } else { + throw DeadlyExportError("could not find embedded texture at index " + index_str); + } } else { - throw DeadlyExportError("could not find embedded texture at index " + index_str); + poSurface.texture = texfile.C_Str(); } - } else { - poSurface.texture = texfile.C_Str(); - } - poSurface.channel = uvChannel; - poSurface.exist = true; - } else { - if( pKey ) - poSurface.exist = pSrcMat->Get( pKey, static_cast(pType), static_cast(pIndex), poSurface.color) == aiReturn_SUCCESS; - } + poSurface.channel = uvChannel; + poSurface.exist = true; + } else { + if (pKey) + poSurface.exist = pSrcMat->Get(pKey, static_cast(pType), static_cast(pIndex), poSurface.color) == aiReturn_SUCCESS; + } } // ------------------------------------------------------------------------------------------------ // Reimplementation of isalnum(,C locale), because AppVeyor does not see standard version. static bool isalnum_C(char c) { - return ( nullptr != strchr("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",c) ); + return (nullptr != strchr("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", c)); } // ------------------------------------------------------------------------------------------------ // Writes an image entry for the given surface -void ColladaExporter::WriteImageEntry( const Surface& pSurface, const std::string& pNameAdd) { - if( !pSurface.texture.empty() ) - { - mOutput << startstr << "" << endstr; - PushTag(); - mOutput << startstr << ""; +void ColladaExporter::WriteImageEntry(const Surface &pSurface, const std::string &pNameAdd) { + if (!pSurface.texture.empty()) { + mOutput << startstr << "" << endstr; + PushTag(); + mOutput << startstr << ""; - // URL encode image file name first, then XML encode on top - std::stringstream imageUrlEncoded; - for( std::string::const_iterator it = pSurface.texture.begin(); it != pSurface.texture.end(); ++it ) - { - if( isalnum_C( (unsigned char) *it) || *it == ':' || *it == '_' || *it == '-' || *it == '.' || *it == '/' || *it == '\\' ) - imageUrlEncoded << *it; - else - imageUrlEncoded << '%' << std::hex << size_t( (unsigned char) *it) << std::dec; + // URL encode image file name first, then XML encode on top + std::stringstream imageUrlEncoded; + for (std::string::const_iterator it = pSurface.texture.begin(); it != pSurface.texture.end(); ++it) { + if (isalnum_C((unsigned char)*it) || *it == ':' || *it == '_' || *it == '-' || *it == '.' || *it == '/' || *it == '\\') + imageUrlEncoded << *it; + else + imageUrlEncoded << '%' << std::hex << size_t((unsigned char)*it) << std::dec; + } + mOutput << XMLEscape(imageUrlEncoded.str()); + mOutput << "" << endstr; + PopTag(); + mOutput << startstr << "" << endstr; } - mOutput << XMLEscape(imageUrlEncoded.str()); - mOutput << "" << endstr; - PopTag(); - mOutput << startstr << "" << endstr; - } } // ------------------------------------------------------------------------------------------------ // Writes a color-or-texture entry into an effect definition -void ColladaExporter::WriteTextureColorEntry( const Surface& pSurface, const std::string& pTypeName, const std::string& pImageName) -{ - if(pSurface.exist) { - mOutput << startstr << "<" << pTypeName << ">" << endstr; - PushTag(); - if( pSurface.texture.empty() ) - { - mOutput << startstr << "" << pSurface.color.r << " " << pSurface.color.g << " " << pSurface.color.b << " " << pSurface.color.a << "" << endstr; +void ColladaExporter::WriteTextureColorEntry(const Surface &pSurface, const std::string &pTypeName, const std::string &pImageName) { + if (pSurface.exist) { + mOutput << startstr << "<" << pTypeName << ">" << endstr; + PushTag(); + if (pSurface.texture.empty()) { + mOutput << startstr << "" << pSurface.color.r << " " << pSurface.color.g << " " << pSurface.color.b << " " << pSurface.color.a << "" << endstr; + } else { + mOutput << startstr << "" << endstr; + } + PopTag(); + mOutput << startstr << "" << endstr; } - else - { - mOutput << startstr << "" << endstr; - } - PopTag(); - mOutput << startstr << "" << endstr; - } } // ------------------------------------------------------------------------------------------------ // Writes the two parameters necessary for referencing a texture in an effect entry -void ColladaExporter::WriteTextureParamEntry( const Surface& pSurface, const std::string& pTypeName, const std::string& pMatName) -{ - // if surface is a texture, write out the sampler and the surface parameters necessary to reference the texture - if( !pSurface.texture.empty() ) - { - mOutput << startstr << "" << endstr; - PushTag(); - mOutput << startstr << "" << endstr; - PushTag(); - mOutput << startstr << "" << XMLIDEncode(pMatName) << "-" << pTypeName << "-image" << endstr; - PopTag(); - mOutput << startstr << "" << endstr; - PopTag(); - mOutput << startstr << "" << endstr; +void ColladaExporter::WriteTextureParamEntry(const Surface &pSurface, const std::string &pTypeName, const std::string &pMatName) { + // if surface is a texture, write out the sampler and the surface parameters necessary to reference the texture + if (!pSurface.texture.empty()) { + mOutput << startstr << "" << endstr; + PushTag(); + mOutput << startstr << "" << endstr; + PushTag(); + mOutput << startstr << "" << XMLIDEncode(pMatName) << "-" << pTypeName << "-image" << endstr; + PopTag(); + mOutput << startstr << "" << endstr; + PopTag(); + mOutput << startstr << "" << endstr; - mOutput << startstr << "" << endstr; - PushTag(); - mOutput << startstr << "" << endstr; - PushTag(); - mOutput << startstr << "" << XMLIDEncode(pMatName) << "-" << pTypeName << "-surface" << endstr; - PopTag(); - mOutput << startstr << "" << endstr; - PopTag(); - mOutput << startstr << "" << endstr; - } + mOutput << startstr << "" << endstr; + PushTag(); + mOutput << startstr << "" << endstr; + PushTag(); + mOutput << startstr << "" << XMLIDEncode(pMatName) << "-" << pTypeName << "-surface" << endstr; + PopTag(); + mOutput << startstr << "" << endstr; + PopTag(); + mOutput << startstr << "" << endstr; + } } // ------------------------------------------------------------------------------------------------ // Writes a scalar property -void ColladaExporter::WriteFloatEntry( const Property& pProperty, const std::string& pTypeName) -{ - if(pProperty.exist) { +void ColladaExporter::WriteFloatEntry(const Property &pProperty, const std::string &pTypeName) { + if (pProperty.exist) { mOutput << startstr << "<" << pTypeName << ">" << endstr; PushTag(); mOutput << startstr << "" << pProperty.value << "" << endstr; @@ -703,170 +688,162 @@ void ColladaExporter::WriteFloatEntry( const Property& pProperty, const std::str // ------------------------------------------------------------------------------------------------ // Writes the material setup -void ColladaExporter::WriteMaterials() -{ - materials.resize( mScene->mNumMaterials); +void ColladaExporter::WriteMaterials() { + materials.resize(mScene->mNumMaterials); - /// collect all materials from the scene - size_t numTextures = 0; - for( size_t a = 0; a < mScene->mNumMaterials; ++a ) - { - const aiMaterial* mat = mScene->mMaterials[a]; + /// collect all materials from the scene + size_t numTextures = 0; + for (size_t a = 0; a < mScene->mNumMaterials; ++a) { + const aiMaterial *mat = mScene->mMaterials[a]; - aiString name; - if( mat->Get( AI_MATKEY_NAME, name) != aiReturn_SUCCESS ) { - name = "mat"; - materials[a].name = std::string( "m") + to_string(a) + name.C_Str(); - } else { - // try to use the material's name if no other material has already taken it, else append # - std::string testName = name.C_Str(); - size_t materialCountWithThisName = 0; - for( size_t i = 0; i < a; i ++ ) { - if( materials[i].name == testName ) { - materialCountWithThisName ++; + aiString name; + if (mat->Get(AI_MATKEY_NAME, name) != aiReturn_SUCCESS) { + name = "mat"; + materials[a].name = std::string("m") + to_string(a) + name.C_Str(); + } else { + // try to use the material's name if no other material has already taken it, else append # + std::string testName = name.C_Str(); + size_t materialCountWithThisName = 0; + for (size_t i = 0; i < a; i++) { + if (materials[i].name == testName) { + materialCountWithThisName++; + } + } + if (materialCountWithThisName == 0) { + materials[a].name = name.C_Str(); + } else { + materials[a].name = std::string(name.C_Str()) + to_string(materialCountWithThisName); + } } - } - if( materialCountWithThisName == 0 ) { - materials[a].name = name.C_Str(); - } else { - materials[a].name = std::string(name.C_Str()) + to_string(materialCountWithThisName); - } - } - aiShadingMode shading = aiShadingMode_Flat; - materials[a].shading_model = "phong"; - if(mat->Get( AI_MATKEY_SHADING_MODEL, shading) == aiReturn_SUCCESS) { - if(shading == aiShadingMode_Phong) { - materials[a].shading_model = "phong"; - } else if(shading == aiShadingMode_Blinn) { - materials[a].shading_model = "blinn"; - } else if(shading == aiShadingMode_NoShading) { - materials[a].shading_model = "constant"; - } else if(shading == aiShadingMode_Gouraud) { - materials[a].shading_model = "lambert"; + aiShadingMode shading = aiShadingMode_Flat; + materials[a].shading_model = "phong"; + if (mat->Get(AI_MATKEY_SHADING_MODEL, shading) == aiReturn_SUCCESS) { + if (shading == aiShadingMode_Phong) { + materials[a].shading_model = "phong"; + } else if (shading == aiShadingMode_Blinn) { + materials[a].shading_model = "blinn"; + } else if (shading == aiShadingMode_NoShading) { + materials[a].shading_model = "constant"; + } else if (shading == aiShadingMode_Gouraud) { + materials[a].shading_model = "lambert"; + } } + + ReadMaterialSurface(materials[a].ambient, mat, aiTextureType_AMBIENT, AI_MATKEY_COLOR_AMBIENT); + if (!materials[a].ambient.texture.empty()) numTextures++; + ReadMaterialSurface(materials[a].diffuse, mat, aiTextureType_DIFFUSE, AI_MATKEY_COLOR_DIFFUSE); + if (!materials[a].diffuse.texture.empty()) numTextures++; + ReadMaterialSurface(materials[a].specular, mat, aiTextureType_SPECULAR, AI_MATKEY_COLOR_SPECULAR); + if (!materials[a].specular.texture.empty()) numTextures++; + ReadMaterialSurface(materials[a].emissive, mat, aiTextureType_EMISSIVE, AI_MATKEY_COLOR_EMISSIVE); + if (!materials[a].emissive.texture.empty()) numTextures++; + ReadMaterialSurface(materials[a].reflective, mat, aiTextureType_REFLECTION, AI_MATKEY_COLOR_REFLECTIVE); + if (!materials[a].reflective.texture.empty()) numTextures++; + ReadMaterialSurface(materials[a].transparent, mat, aiTextureType_OPACITY, AI_MATKEY_COLOR_TRANSPARENT); + if (!materials[a].transparent.texture.empty()) numTextures++; + ReadMaterialSurface(materials[a].normal, mat, aiTextureType_NORMALS, NULL, 0, 0); + if (!materials[a].normal.texture.empty()) numTextures++; + + materials[a].shininess.exist = mat->Get(AI_MATKEY_SHININESS, materials[a].shininess.value) == aiReturn_SUCCESS; + materials[a].transparency.exist = mat->Get(AI_MATKEY_OPACITY, materials[a].transparency.value) == aiReturn_SUCCESS; + materials[a].index_refraction.exist = mat->Get(AI_MATKEY_REFRACTI, materials[a].index_refraction.value) == aiReturn_SUCCESS; } - ReadMaterialSurface( materials[a].ambient, mat, aiTextureType_AMBIENT, AI_MATKEY_COLOR_AMBIENT); - if( !materials[a].ambient.texture.empty() ) numTextures++; - ReadMaterialSurface( materials[a].diffuse, mat, aiTextureType_DIFFUSE, AI_MATKEY_COLOR_DIFFUSE); - if( !materials[a].diffuse.texture.empty() ) numTextures++; - ReadMaterialSurface( materials[a].specular, mat, aiTextureType_SPECULAR, AI_MATKEY_COLOR_SPECULAR); - if( !materials[a].specular.texture.empty() ) numTextures++; - ReadMaterialSurface( materials[a].emissive, mat, aiTextureType_EMISSIVE, AI_MATKEY_COLOR_EMISSIVE); - if( !materials[a].emissive.texture.empty() ) numTextures++; - ReadMaterialSurface( materials[a].reflective, mat, aiTextureType_REFLECTION, AI_MATKEY_COLOR_REFLECTIVE); - if( !materials[a].reflective.texture.empty() ) numTextures++; - ReadMaterialSurface( materials[a].transparent, mat, aiTextureType_OPACITY, AI_MATKEY_COLOR_TRANSPARENT); - if( !materials[a].transparent.texture.empty() ) numTextures++; - ReadMaterialSurface( materials[a].normal, mat, aiTextureType_NORMALS, NULL, 0, 0); - if( !materials[a].normal.texture.empty() ) numTextures++; - - materials[a].shininess.exist = mat->Get( AI_MATKEY_SHININESS, materials[a].shininess.value) == aiReturn_SUCCESS; - materials[a].transparency.exist = mat->Get( AI_MATKEY_OPACITY, materials[a].transparency.value) == aiReturn_SUCCESS; - materials[a].index_refraction.exist = mat->Get( AI_MATKEY_REFRACTI, materials[a].index_refraction.value) == aiReturn_SUCCESS; - } - - // output textures if present - if( numTextures > 0 ) - { - mOutput << startstr << "" << endstr; - PushTag(); - for( std::vector::const_iterator it = materials.begin(); it != materials.end(); ++it ) - { - const Material& mat = *it; - WriteImageEntry( mat.ambient, mat.name + "-ambient-image"); - WriteImageEntry( mat.diffuse, mat.name + "-diffuse-image"); - WriteImageEntry( mat.specular, mat.name + "-specular-image"); - WriteImageEntry( mat.emissive, mat.name + "-emission-image"); - WriteImageEntry( mat.reflective, mat.name + "-reflective-image"); - WriteImageEntry( mat.transparent, mat.name + "-transparent-image"); - WriteImageEntry( mat.normal, mat.name + "-normal-image"); + // output textures if present + if (numTextures > 0) { + mOutput << startstr << "" << endstr; + PushTag(); + for (std::vector::const_iterator it = materials.begin(); it != materials.end(); ++it) { + const Material &mat = *it; + WriteImageEntry(mat.ambient, mat.name + "-ambient-image"); + WriteImageEntry(mat.diffuse, mat.name + "-diffuse-image"); + WriteImageEntry(mat.specular, mat.name + "-specular-image"); + WriteImageEntry(mat.emissive, mat.name + "-emission-image"); + WriteImageEntry(mat.reflective, mat.name + "-reflective-image"); + WriteImageEntry(mat.transparent, mat.name + "-transparent-image"); + WriteImageEntry(mat.normal, mat.name + "-normal-image"); + } + PopTag(); + mOutput << startstr << "" << endstr; } - PopTag(); - mOutput << startstr << "" << endstr; - } - // output effects - those are the actual carriers of information - if( !materials.empty() ) - { - mOutput << startstr << "" << endstr; - PushTag(); - for( std::vector::const_iterator it = materials.begin(); it != materials.end(); ++it ) - { - const Material& mat = *it; - // this is so ridiculous it must be right - mOutput << startstr << "" << endstr; - PushTag(); - mOutput << startstr << "" << endstr; - PushTag(); + // output effects - those are the actual carriers of information + if (!materials.empty()) { + mOutput << startstr << "" << endstr; + PushTag(); + for (std::vector::const_iterator it = materials.begin(); it != materials.end(); ++it) { + const Material &mat = *it; + // this is so ridiculous it must be right + mOutput << startstr << "" << endstr; + PushTag(); + mOutput << startstr << "" << endstr; + PushTag(); - // write sampler- and surface params for the texture entries - WriteTextureParamEntry( mat.emissive, "emission", mat.name); - WriteTextureParamEntry( mat.ambient, "ambient", mat.name); - WriteTextureParamEntry( mat.diffuse, "diffuse", mat.name); - WriteTextureParamEntry( mat.specular, "specular", mat.name); - WriteTextureParamEntry( mat.reflective, "reflective", mat.name); - WriteTextureParamEntry( mat.transparent, "transparent", mat.name); - WriteTextureParamEntry( mat.normal, "normal", mat.name); + // write sampler- and surface params for the texture entries + WriteTextureParamEntry(mat.emissive, "emission", mat.name); + WriteTextureParamEntry(mat.ambient, "ambient", mat.name); + WriteTextureParamEntry(mat.diffuse, "diffuse", mat.name); + WriteTextureParamEntry(mat.specular, "specular", mat.name); + WriteTextureParamEntry(mat.reflective, "reflective", mat.name); + WriteTextureParamEntry(mat.transparent, "transparent", mat.name); + WriteTextureParamEntry(mat.normal, "normal", mat.name); - mOutput << startstr << "" << endstr; - PushTag(); - mOutput << startstr << "<" << mat.shading_model << ">" << endstr; - PushTag(); + mOutput << startstr << "" << endstr; + PushTag(); + mOutput << startstr << "<" << mat.shading_model << ">" << endstr; + PushTag(); - WriteTextureColorEntry( mat.emissive, "emission", mat.name + "-emission-sampler"); - WriteTextureColorEntry( mat.ambient, "ambient", mat.name + "-ambient-sampler"); - WriteTextureColorEntry( mat.diffuse, "diffuse", mat.name + "-diffuse-sampler"); - WriteTextureColorEntry( mat.specular, "specular", mat.name + "-specular-sampler"); - WriteFloatEntry(mat.shininess, "shininess"); - WriteTextureColorEntry( mat.reflective, "reflective", mat.name + "-reflective-sampler"); - WriteTextureColorEntry( mat.transparent, "transparent", mat.name + "-transparent-sampler"); - WriteFloatEntry(mat.transparency, "transparency"); - WriteFloatEntry(mat.index_refraction, "index_of_refraction"); + WriteTextureColorEntry(mat.emissive, "emission", mat.name + "-emission-sampler"); + WriteTextureColorEntry(mat.ambient, "ambient", mat.name + "-ambient-sampler"); + WriteTextureColorEntry(mat.diffuse, "diffuse", mat.name + "-diffuse-sampler"); + WriteTextureColorEntry(mat.specular, "specular", mat.name + "-specular-sampler"); + WriteFloatEntry(mat.shininess, "shininess"); + WriteTextureColorEntry(mat.reflective, "reflective", mat.name + "-reflective-sampler"); + WriteTextureColorEntry(mat.transparent, "transparent", mat.name + "-transparent-sampler"); + WriteFloatEntry(mat.transparency, "transparency"); + WriteFloatEntry(mat.index_refraction, "index_of_refraction"); - if(! mat.normal.texture.empty()) { - WriteTextureColorEntry( mat.normal, "bump", mat.name + "-normal-sampler"); - } + if (!mat.normal.texture.empty()) { + WriteTextureColorEntry(mat.normal, "bump", mat.name + "-normal-sampler"); + } - PopTag(); - mOutput << startstr << "" << endstr; - PopTag(); - mOutput << startstr << "" << endstr; - PopTag(); - mOutput << startstr << "" << endstr; - PopTag(); - mOutput << startstr << "" << endstr; + PopTag(); + mOutput << startstr << "" << endstr; + PopTag(); + mOutput << startstr << "" << endstr; + PopTag(); + mOutput << startstr << "" << endstr; + PopTag(); + mOutput << startstr << "" << endstr; + } + PopTag(); + mOutput << startstr << "" << endstr; + + // write materials - they're just effect references + mOutput << startstr << "" << endstr; + PushTag(); + for (std::vector::const_iterator it = materials.begin(); it != materials.end(); ++it) { + const Material &mat = *it; + mOutput << startstr << "" << endstr; + PushTag(); + mOutput << startstr << "" << endstr; + PopTag(); + mOutput << startstr << "" << endstr; + } + PopTag(); + mOutput << startstr << "" << endstr; } - PopTag(); - mOutput << startstr << "" << endstr; - - // write materials - they're just effect references - mOutput << startstr << "" << endstr; - PushTag(); - for( std::vector::const_iterator it = materials.begin(); it != materials.end(); ++it ) - { - const Material& mat = *it; - mOutput << startstr << "" << endstr; - PushTag(); - mOutput << startstr << "" << endstr; - PopTag(); - mOutput << startstr << "" << endstr; - } - PopTag(); - mOutput << startstr << "" << endstr; - } } // ------------------------------------------------------------------------------------------------ // Writes the controller library -void ColladaExporter::WriteControllerLibrary() -{ +void ColladaExporter::WriteControllerLibrary() { mOutput << startstr << "" << endstr; PushTag(); - - for( size_t a = 0; a < mScene->mNumMeshes; ++a) { - WriteController( a); + + for (size_t a = 0; a < mScene->mNumMeshes; ++a) { + WriteController(a); } PopTag(); @@ -875,20 +852,19 @@ void ColladaExporter::WriteControllerLibrary() // ------------------------------------------------------------------------------------------------ // Writes a skin controller of the given mesh -void ColladaExporter::WriteController( size_t pIndex) -{ - const aiMesh* mesh = mScene->mMeshes[pIndex]; +void ColladaExporter::WriteController(size_t pIndex) { + const aiMesh *mesh = mScene->mMeshes[pIndex]; const std::string idstr = mesh->mName.length == 0 ? GetMeshId(pIndex) : mesh->mName.C_Str(); const std::string idstrEscaped = XMLIDEncode(idstr); - if ( mesh->mNumFaces == 0 || mesh->mNumVertices == 0 ) + if (mesh->mNumFaces == 0 || mesh->mNumVertices == 0) return; - if ( mesh->mNumBones == 0 ) + if (mesh->mNumBones == 0) return; mOutput << startstr << ""<< endstr; + mOutput << "name=\"skinCluster" << pIndex << "\">" << endstr; PushTag(); mOutput << startstr << "" << endstr; @@ -913,14 +889,14 @@ void ColladaExporter::WriteController( size_t pIndex) mOutput << startstr << "mNumBones << "\">"; - for( size_t i = 0; i < mesh->mNumBones; ++i ) + for (size_t i = 0; i < mesh->mNumBones; ++i) mOutput << XMLIDEncode(mesh->mBones[i]->mName.C_Str()) << " "; mOutput << "" << endstr; mOutput << startstr << "" << endstr; PushTag(); - + mOutput << startstr << "mNumBones << "\" stride=\"" << 1 << "\">" << endstr; PushTag(); @@ -937,21 +913,21 @@ void ColladaExporter::WriteController( size_t pIndex) std::vector bind_poses; bind_poses.reserve(mesh->mNumBones * 16); - for(unsigned int i = 0; i < mesh->mNumBones; ++i) - for( unsigned int j = 0; j < 4; ++j) + for (unsigned int i = 0; i < mesh->mNumBones; ++i) + for (unsigned int j = 0; j < 4; ++j) bind_poses.insert(bind_poses.end(), mesh->mBones[i]->mOffsetMatrix[j], mesh->mBones[i]->mOffsetMatrix[j] + 4); - WriteFloatArray( idstr + "-skin-bind_poses", FloatType_Mat4x4, (const ai_real*) bind_poses.data(), bind_poses.size() / 16); + WriteFloatArray(idstr + "-skin-bind_poses", FloatType_Mat4x4, (const ai_real *)bind_poses.data(), bind_poses.size() / 16); bind_poses.clear(); - + std::vector skin_weights; skin_weights.reserve(mesh->mNumVertices * mesh->mNumBones); - for( size_t i = 0; i < mesh->mNumBones; ++i) - for( size_t j = 0; j < mesh->mBones[i]->mNumWeights; ++j) + for (size_t i = 0; i < mesh->mNumBones; ++i) + for (size_t j = 0; j < mesh->mBones[i]->mNumWeights; ++j) skin_weights.push_back(mesh->mBones[i]->mWeights[j].mWeight); - WriteFloatArray( idstr + "-skin-weights", FloatType_Weight, (const ai_real*) skin_weights.data(), skin_weights.size()); + WriteFloatArray(idstr + "-skin-weights", FloatType_Weight, (const ai_real *)skin_weights.data(), skin_weights.size()); skin_weights.clear(); @@ -973,11 +949,11 @@ void ColladaExporter::WriteController( size_t pIndex) mOutput << startstr << ""; std::vector num_influences(mesh->mNumVertices, (ai_uint)0); - for( size_t i = 0; i < mesh->mNumBones; ++i) - for( size_t j = 0; j < mesh->mBones[i]->mNumWeights; ++j) + for (size_t i = 0; i < mesh->mNumBones; ++i) + for (size_t j = 0; j < mesh->mBones[i]->mNumWeights; ++j) ++num_influences[mesh->mBones[i]->mWeights[j].mVertexId]; - for( size_t i = 0; i < mesh->mNumVertices; ++i) + for (size_t i = 0; i < mesh->mNumVertices; ++i) mOutput << num_influences[i] << " "; mOutput << "" << endstr; @@ -987,22 +963,18 @@ void ColladaExporter::WriteController( size_t pIndex) ai_uint joint_weight_indices_length = 0; std::vector accum_influences; accum_influences.reserve(num_influences.size()); - for( size_t i = 0; i < num_influences.size(); ++i) - { + for (size_t i = 0; i < num_influences.size(); ++i) { accum_influences.push_back(joint_weight_indices_length); joint_weight_indices_length += num_influences[i]; } ai_uint weight_index = 0; std::vector joint_weight_indices(2 * joint_weight_indices_length, (ai_int)-1); - for( unsigned int i = 0; i < mesh->mNumBones; ++i) - for( unsigned j = 0; j < mesh->mBones[i]->mNumWeights; ++j) - { + for (unsigned int i = 0; i < mesh->mNumBones; ++i) + for (unsigned j = 0; j < mesh->mBones[i]->mNumWeights; ++j) { unsigned int vId = mesh->mBones[i]->mWeights[j].mVertexId; - for( ai_uint k = 0; k < num_influences[vId]; ++k) - { - if (joint_weight_indices[2 * (accum_influences[vId] + k)] == -1) - { + for (ai_uint k = 0; k < num_influences[vId]; ++k) { + if (joint_weight_indices[2 * (accum_influences[vId] + k)] == -1) { joint_weight_indices[2 * (accum_influences[vId] + k)] = i; joint_weight_indices[2 * (accum_influences[vId] + k) + 1] = weight_index; break; @@ -1011,7 +983,7 @@ void ColladaExporter::WriteController( size_t pIndex) ++weight_index; } - for( size_t i = 0; i < joint_weight_indices.size(); ++i) + for (size_t i = 0; i < joint_weight_indices.size(); ++i) mOutput << joint_weight_indices[i] << " "; num_influences.clear(); @@ -1025,20 +997,19 @@ void ColladaExporter::WriteController( size_t pIndex) PopTag(); mOutput << startstr << "" << endstr; - + PopTag(); mOutput << startstr << "" << endstr; } // ------------------------------------------------------------------------------------------------ // Writes the geometry library -void ColladaExporter::WriteGeometryLibrary() -{ +void ColladaExporter::WriteGeometryLibrary() { mOutput << startstr << "" << endstr; PushTag(); - for( size_t a = 0; a < mScene->mNumMeshes; ++a) - WriteGeometry( a); + for (size_t a = 0; a < mScene->mNumMeshes; ++a) + WriteGeometry(a); PopTag(); mOutput << startstr << "" << endstr; @@ -1046,14 +1017,13 @@ void ColladaExporter::WriteGeometryLibrary() // ------------------------------------------------------------------------------------------------ // Writes the given mesh -void ColladaExporter::WriteGeometry( size_t pIndex) -{ - const aiMesh* mesh = mScene->mMeshes[pIndex]; +void ColladaExporter::WriteGeometry(size_t pIndex) { + const aiMesh *mesh = mScene->mMeshes[pIndex]; const std::string idstr = mesh->mName.length == 0 ? GetMeshId(pIndex) : mesh->mName.C_Str(); const std::string geometryName = XMLEscape(idstr); const std::string geometryId = XMLIDEncode(idstr); - if ( mesh->mNumFaces == 0 || mesh->mNumVertices == 0 ) + if (mesh->mNumFaces == 0 || mesh->mNumVertices == 0) return; // opening tag @@ -1064,31 +1034,29 @@ void ColladaExporter::WriteGeometry( size_t pIndex) PushTag(); // Positions - WriteFloatArray( idstr + "-positions", FloatType_Vector, (ai_real*) mesh->mVertices, mesh->mNumVertices); + WriteFloatArray(idstr + "-positions", FloatType_Vector, (ai_real *)mesh->mVertices, mesh->mNumVertices); // Normals, if any - if( mesh->HasNormals() ) - WriteFloatArray( idstr + "-normals", FloatType_Vector, (ai_real*) mesh->mNormals, mesh->mNumVertices); + if (mesh->HasNormals()) + WriteFloatArray(idstr + "-normals", FloatType_Vector, (ai_real *)mesh->mNormals, mesh->mNumVertices); // texture coords - for( size_t a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++a) - { - if( mesh->HasTextureCoords(static_cast(a)) ) - { - WriteFloatArray( idstr + "-tex" + to_string(a), mesh->mNumUVComponents[a] == 3 ? FloatType_TexCoord3 : FloatType_TexCoord2, - (ai_real*) mesh->mTextureCoords[a], mesh->mNumVertices); + for (size_t a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++a) { + if (mesh->HasTextureCoords(static_cast(a))) { + WriteFloatArray(idstr + "-tex" + to_string(a), mesh->mNumUVComponents[a] == 3 ? FloatType_TexCoord3 : FloatType_TexCoord2, + (ai_real *)mesh->mTextureCoords[a], mesh->mNumVertices); } } // vertex colors - for( size_t a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++a) - { - if( mesh->HasVertexColors(static_cast(a)) ) - WriteFloatArray( idstr + "-color" + to_string(a), FloatType_Color, (ai_real*) mesh->mColors[a], mesh->mNumVertices); + for (size_t a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++a) { + if (mesh->HasVertexColors(static_cast(a))) + WriteFloatArray(idstr + "-color" + to_string(a), FloatType_Color, (ai_real *)mesh->mColors[a], mesh->mNumVertices); } // assemble vertex structure // Only write input for POSITION since we will write other as shared inputs in polygon definition - mOutput << startstr << "" << endstr; + mOutput << startstr << "" << endstr; PushTag(); mOutput << startstr << "" << endstr; PopTag(); @@ -1097,37 +1065,38 @@ void ColladaExporter::WriteGeometry( size_t pIndex) // count the number of lines, triangles and polygon meshes int countLines = 0; int countPoly = 0; - for( size_t a = 0; a < mesh->mNumFaces; ++a ) - { - if (mesh->mFaces[a].mNumIndices == 2) countLines++; - else if (mesh->mFaces[a].mNumIndices >= 3) countPoly++; + for (size_t a = 0; a < mesh->mNumFaces; ++a) { + if (mesh->mFaces[a].mNumIndices == 2) + countLines++; + else if (mesh->mFaces[a].mNumIndices >= 3) + countPoly++; } // lines - if (countLines) - { + if (countLines) { mOutput << startstr << "" << endstr; PushTag(); mOutput << startstr << "" << endstr; - if( mesh->HasNormals() ) + if (mesh->HasNormals()) mOutput << startstr << "" << endstr; - for( size_t a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++a ) - { - if( mesh->HasTextureCoords(static_cast(a)) ) - mOutput << startstr << "" << endstr; + for (size_t a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++a) { + if (mesh->HasTextureCoords(static_cast(a))) + mOutput << startstr << "" << endstr; } - for( size_t a = 0; a < AI_MAX_NUMBER_OF_COLOR_SETS; ++a ) - { - if( mesh->HasVertexColors(static_cast(a) ) ) - mOutput << startstr << "" << endstr; + for (size_t a = 0; a < AI_MAX_NUMBER_OF_COLOR_SETS; ++a) { + if (mesh->HasVertexColors(static_cast(a))) + mOutput << startstr << "" << endstr; } mOutput << startstr << "

"; - for( size_t a = 0; a < mesh->mNumFaces; ++a ) - { - const aiFace& face = mesh->mFaces[a]; + for (size_t a = 0; a < mesh->mNumFaces; ++a) { + const aiFace &face = mesh->mFaces[a]; if (face.mNumIndices != 2) continue; - for( size_t b = 0; b < face.mNumIndices; ++b ) + for (size_t b = 0; b < face.mNumIndices; ++b) mOutput << face.mIndices[b] << " "; } mOutput << "

" << endstr; @@ -1138,38 +1107,37 @@ void ColladaExporter::WriteGeometry( size_t pIndex) // triangle - don't use it, because compatibility problems // polygons - if (countPoly) - { + if (countPoly) { mOutput << startstr << "" << endstr; PushTag(); mOutput << startstr << "" << endstr; - if( mesh->HasNormals() ) + if (mesh->HasNormals()) mOutput << startstr << "" << endstr; - for( size_t a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++a ) - { - if( mesh->HasTextureCoords(static_cast(a)) ) - mOutput << startstr << "" << endstr; + for (size_t a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++a) { + if (mesh->HasTextureCoords(static_cast(a))) + mOutput << startstr << "" << endstr; } - for( size_t a = 0; a < AI_MAX_NUMBER_OF_COLOR_SETS; ++a ) - { - if( mesh->HasVertexColors(static_cast(a) ) ) - mOutput << startstr << "" << endstr; + for (size_t a = 0; a < AI_MAX_NUMBER_OF_COLOR_SETS; ++a) { + if (mesh->HasVertexColors(static_cast(a))) + mOutput << startstr << "" << endstr; } mOutput << startstr << ""; - for( size_t a = 0; a < mesh->mNumFaces; ++a ) - { + for (size_t a = 0; a < mesh->mNumFaces; ++a) { if (mesh->mFaces[a].mNumIndices < 3) continue; mOutput << mesh->mFaces[a].mNumIndices << " "; } mOutput << "" << endstr; mOutput << startstr << "

"; - for( size_t a = 0; a < mesh->mNumFaces; ++a ) - { - const aiFace& face = mesh->mFaces[a]; + for (size_t a = 0; a < mesh->mNumFaces; ++a) { + const aiFace &face = mesh->mFaces[a]; if (face.mNumIndices < 3) continue; - for( size_t b = 0; b < face.mNumIndices; ++b ) + for (size_t b = 0; b < face.mNumIndices; ++b) mOutput << face.mIndices[b] << " "; } mOutput << "

" << endstr; @@ -1186,20 +1154,18 @@ void ColladaExporter::WriteGeometry( size_t pIndex) // ------------------------------------------------------------------------------------------------ // Writes a float array of the given type -void ColladaExporter::WriteFloatArray( const std::string& pIdString, FloatDataType pType, const ai_real* pData, size_t pElementCount) -{ +void ColladaExporter::WriteFloatArray(const std::string &pIdString, FloatDataType pType, const ai_real *pData, size_t pElementCount) { size_t floatsPerElement = 0; - switch( pType ) - { - case FloatType_Vector: floatsPerElement = 3; break; - case FloatType_TexCoord2: floatsPerElement = 2; break; - case FloatType_TexCoord3: floatsPerElement = 3; break; - case FloatType_Color: floatsPerElement = 3; break; - case FloatType_Mat4x4: floatsPerElement = 16; break; - case FloatType_Weight: floatsPerElement = 1; break; - case FloatType_Time: floatsPerElement = 1; break; - default: - return; + switch (pType) { + case FloatType_Vector: floatsPerElement = 3; break; + case FloatType_TexCoord2: floatsPerElement = 2; break; + case FloatType_TexCoord3: floatsPerElement = 3; break; + case FloatType_Color: floatsPerElement = 3; break; + case FloatType_Mat4x4: floatsPerElement = 16; break; + case FloatType_Weight: floatsPerElement = 1; break; + case FloatType_Time: floatsPerElement = 1; break; + default: + return; } std::string arrayId = XMLIDEncode(pIdString) + "-array"; @@ -1211,26 +1177,19 @@ void ColladaExporter::WriteFloatArray( const std::string& pIdString, FloatDataTy mOutput << startstr << " "; PushTag(); - if( pType == FloatType_TexCoord2 ) - { - for( size_t a = 0; a < pElementCount; ++a ) - { - mOutput << pData[a*3+0] << " "; - mOutput << pData[a*3+1] << " "; + if (pType == FloatType_TexCoord2) { + for (size_t a = 0; a < pElementCount; ++a) { + mOutput << pData[a * 3 + 0] << " "; + mOutput << pData[a * 3 + 1] << " "; } - } - else if( pType == FloatType_Color ) - { - for( size_t a = 0; a < pElementCount; ++a ) - { - mOutput << pData[a*4+0] << " "; - mOutput << pData[a*4+1] << " "; - mOutput << pData[a*4+2] << " "; + } else if (pType == FloatType_Color) { + for (size_t a = 0; a < pElementCount; ++a) { + mOutput << pData[a * 4 + 0] << " "; + mOutput << pData[a * 4 + 1] << " "; + mOutput << pData[a * 4 + 2] << " "; } - } - else - { - for( size_t a = 0; a < pElementCount * floatsPerElement; ++a ) + } else { + for (size_t a = 0; a < pElementCount * floatsPerElement; ++a) mOutput << pData[a] << " "; } mOutput << "" << endstr; @@ -1242,45 +1201,43 @@ void ColladaExporter::WriteFloatArray( const std::string& pIdString, FloatDataTy mOutput << startstr << "" << endstr; PushTag(); - switch( pType ) - { - case FloatType_Vector: - mOutput << startstr << "" << endstr; - mOutput << startstr << "" << endstr; - mOutput << startstr << "" << endstr; - break; + switch (pType) { + case FloatType_Vector: + mOutput << startstr << "" << endstr; + mOutput << startstr << "" << endstr; + mOutput << startstr << "" << endstr; + break; - case FloatType_TexCoord2: - mOutput << startstr << "" << endstr; - mOutput << startstr << "" << endstr; - break; + case FloatType_TexCoord2: + mOutput << startstr << "" << endstr; + mOutput << startstr << "" << endstr; + break; - case FloatType_TexCoord3: - mOutput << startstr << "" << endstr; - mOutput << startstr << "" << endstr; - mOutput << startstr << "" << endstr; - break; + case FloatType_TexCoord3: + mOutput << startstr << "" << endstr; + mOutput << startstr << "" << endstr; + mOutput << startstr << "" << endstr; + break; - case FloatType_Color: - mOutput << startstr << "" << endstr; - mOutput << startstr << "" << endstr; - mOutput << startstr << "" << endstr; - break; + case FloatType_Color: + mOutput << startstr << "" << endstr; + mOutput << startstr << "" << endstr; + mOutput << startstr << "" << endstr; + break; - case FloatType_Mat4x4: - mOutput << startstr << "" << endstr; - break; + case FloatType_Mat4x4: + mOutput << startstr << "" << endstr; + break; - case FloatType_Weight: - mOutput << startstr << "" << endstr; - break; + case FloatType_Weight: + mOutput << startstr << "" << endstr; + break; - // customized, add animation related - case FloatType_Time: - mOutput << startstr << "" << endstr; - break; - - } + // customized, add animation related + case FloatType_Time: + mOutput << startstr << "" << endstr; + break; + } PopTag(); mOutput << startstr << "" << endstr; @@ -1292,8 +1249,7 @@ void ColladaExporter::WriteFloatArray( const std::string& pIdString, FloatDataTy // ------------------------------------------------------------------------------------------------ // Writes the scene library -void ColladaExporter::WriteSceneLibrary() -{ +void ColladaExporter::WriteSceneLibrary() { const std::string sceneName = XMLEscape(mScene->mRootNode->mName.C_Str()); const std::string sceneId = XMLIDEncode(mScene->mRootNode->mName.C_Str()); @@ -1303,8 +1259,8 @@ void ColladaExporter::WriteSceneLibrary() PushTag(); // start recursive write at the root node - for( size_t a = 0; a < mScene->mRootNode->mNumChildren; ++a ) - WriteNode( mScene, mScene->mRootNode->mChildren[a]); + for (size_t a = 0; a < mScene->mRootNode->mNumChildren; ++a) + WriteNode(mScene, mScene->mRootNode->mChildren[a]); PopTag(); mOutput << startstr << "" << endstr; @@ -1312,182 +1268,180 @@ void ColladaExporter::WriteSceneLibrary() mOutput << startstr << "" << endstr; } // ------------------------------------------------------------------------------------------------ -void ColladaExporter::WriteAnimationLibrary(size_t pIndex) -{ - const aiAnimation * anim = mScene->mAnimations[pIndex]; - - if ( anim->mNumChannels == 0 && anim->mNumMeshChannels == 0 && anim->mNumMorphMeshChannels ==0 ) - return; - - const std::string animation_name_escaped = XMLEscape( anim->mName.C_Str() ); - std::string idstr = anim->mName.C_Str(); - std::string ending = std::string( "AnimId" ) + to_string(pIndex); - if (idstr.length() >= ending.length()) { - if (0 != idstr.compare (idstr.length() - ending.length(), ending.length(), ending)) { - idstr = idstr + ending; - } - } else { - idstr = idstr + ending; - } +void ColladaExporter::WriteAnimationLibrary(size_t pIndex) { + const aiAnimation *anim = mScene->mAnimations[pIndex]; - const std::string idstrEscaped = XMLIDEncode(idstr); - - mOutput << startstr << "" << endstr; - PushTag(); + if (anim->mNumChannels == 0 && anim->mNumMeshChannels == 0 && anim->mNumMorphMeshChannels == 0) + return; + + const std::string animation_name_escaped = XMLEscape(anim->mName.C_Str()); + std::string idstr = anim->mName.C_Str(); + std::string ending = std::string("AnimId") + to_string(pIndex); + if (idstr.length() >= ending.length()) { + if (0 != idstr.compare(idstr.length() - ending.length(), ending.length(), ending)) { + idstr = idstr + ending; + } + } else { + idstr = idstr + ending; + } + + const std::string idstrEscaped = XMLIDEncode(idstr); + + mOutput << startstr << "" << endstr; + PushTag(); std::string cur_node_idstr; - for (size_t a = 0; a < anim->mNumChannels; ++a) { - const aiNodeAnim * nodeAnim = anim->mChannels[a]; - - // sanity check + for (size_t a = 0; a < anim->mNumChannels; ++a) { + const aiNodeAnim *nodeAnim = anim->mChannels[a]; + + // sanity check if (nodeAnim->mNumPositionKeys != nodeAnim->mNumScalingKeys || nodeAnim->mNumPositionKeys != nodeAnim->mNumRotationKeys) { continue; } - - { + + { cur_node_idstr.clear(); cur_node_idstr += nodeAnim->mNodeName.data; cur_node_idstr += std::string("_matrix-input"); - std::vector frames; - for( size_t i = 0; i < nodeAnim->mNumPositionKeys; ++i) { - frames.push_back(static_cast(nodeAnim->mPositionKeys[i].mTime)); - } - - WriteFloatArray(cur_node_idstr, FloatType_Time, (const ai_real *)frames.data(), frames.size()); - frames.clear(); - } - - { + std::vector frames; + for (size_t i = 0; i < nodeAnim->mNumPositionKeys; ++i) { + frames.push_back(static_cast(nodeAnim->mPositionKeys[i].mTime)); + } + + WriteFloatArray(cur_node_idstr, FloatType_Time, (const ai_real *)frames.data(), frames.size()); + frames.clear(); + } + + { cur_node_idstr.clear(); cur_node_idstr += nodeAnim->mNodeName.data; cur_node_idstr += std::string("_matrix-output"); - - std::vector keyframes; - keyframes.reserve(nodeAnim->mNumPositionKeys * 16); - for( size_t i = 0; i < nodeAnim->mNumPositionKeys; ++i) { - aiVector3D Scaling = nodeAnim->mScalingKeys[i].mValue; - aiMatrix4x4 ScalingM; // identity - ScalingM[0][0] = Scaling.x; ScalingM[1][1] = Scaling.y; ScalingM[2][2] = Scaling.z; - - aiQuaternion RotationQ = nodeAnim->mRotationKeys[i].mValue; - aiMatrix4x4 s = aiMatrix4x4( RotationQ.GetMatrix() ); - aiMatrix4x4 RotationM(s.a1, s.a2, s.a3, 0, s.b1, s.b2, s.b3, 0, s.c1, s.c2, s.c3, 0, 0, 0, 0, 1); - - aiVector3D Translation = nodeAnim->mPositionKeys[i].mValue; - aiMatrix4x4 TranslationM; // identity - TranslationM[0][3] = Translation.x; TranslationM[1][3] = Translation.y; TranslationM[2][3] = Translation.z; - - // Combine the above transformations - aiMatrix4x4 mat = TranslationM * RotationM * ScalingM; - - for( unsigned int j = 0; j < 4; ++j) { - keyframes.insert(keyframes.end(), mat[j], mat[j] + 4); + + std::vector keyframes; + keyframes.reserve(nodeAnim->mNumPositionKeys * 16); + for (size_t i = 0; i < nodeAnim->mNumPositionKeys; ++i) { + aiVector3D Scaling = nodeAnim->mScalingKeys[i].mValue; + aiMatrix4x4 ScalingM; // identity + ScalingM[0][0] = Scaling.x; + ScalingM[1][1] = Scaling.y; + ScalingM[2][2] = Scaling.z; + + aiQuaternion RotationQ = nodeAnim->mRotationKeys[i].mValue; + aiMatrix4x4 s = aiMatrix4x4(RotationQ.GetMatrix()); + aiMatrix4x4 RotationM(s.a1, s.a2, s.a3, 0, s.b1, s.b2, s.b3, 0, s.c1, s.c2, s.c3, 0, 0, 0, 0, 1); + + aiVector3D Translation = nodeAnim->mPositionKeys[i].mValue; + aiMatrix4x4 TranslationM; // identity + TranslationM[0][3] = Translation.x; + TranslationM[1][3] = Translation.y; + TranslationM[2][3] = Translation.z; + + // Combine the above transformations + aiMatrix4x4 mat = TranslationM * RotationM * ScalingM; + + for (unsigned int j = 0; j < 4; ++j) { + keyframes.insert(keyframes.end(), mat[j], mat[j] + 4); } - } - - WriteFloatArray(cur_node_idstr, FloatType_Mat4x4, (const ai_real *)keyframes.data(), keyframes.size() / 16); - } - - { - std::vector names; - for ( size_t i = 0; i < nodeAnim->mNumPositionKeys; ++i) { - if ( nodeAnim->mPreState == aiAnimBehaviour_DEFAULT - || nodeAnim->mPreState == aiAnimBehaviour_LINEAR - || nodeAnim->mPreState == aiAnimBehaviour_REPEAT - ) { - names.push_back( "LINEAR" ); - } else if (nodeAnim->mPostState == aiAnimBehaviour_CONSTANT) { - names.push_back( "STEP" ); - } - } - - const std::string cur_node_idstr2 = nodeAnim->mNodeName.data + std::string("_matrix-interpolation"); - std::string arrayId = XMLIDEncode(cur_node_idstr2) + "-array"; - - mOutput << startstr << "" << endstr; - PushTag(); - - // source array - mOutput << startstr << " "; - for( size_t aa = 0; aa < names.size(); ++aa ) { - mOutput << names[aa] << " "; } - mOutput << "" << endstr; - - mOutput << startstr << "" << endstr; - PushTag(); - mOutput << startstr << "" << endstr; - PushTag(); - - mOutput << startstr << "" << endstr; - - PopTag(); - mOutput << startstr << "" << endstr; - - PopTag(); - mOutput << startstr << "" << endstr; + WriteFloatArray(cur_node_idstr, FloatType_Mat4x4, (const ai_real *)keyframes.data(), keyframes.size() / 16); + } - PopTag(); - mOutput << startstr << "" << endstr; - } - } - - for (size_t a = 0; a < anim->mNumChannels; ++a) { - const aiNodeAnim * nodeAnim = anim->mChannels[a]; - - { - // samplers - const std::string node_idstr = nodeAnim->mNodeName.data + std::string("_matrix-sampler"); - mOutput << startstr << "" << endstr; - PushTag(); - - mOutput << startstr << "mNodeName.data + std::string("_matrix-input") ) << "\"/>" << endstr; - mOutput << startstr << "mNodeName.data + std::string("_matrix-output") ) << "\"/>" << endstr; - mOutput << startstr << "mNodeName.data + std::string("_matrix-interpolation") ) << "\"/>" << endstr; - - PopTag(); - mOutput << startstr << "" << endstr; - } - } - - for (size_t a = 0; a < anim->mNumChannels; ++a) { - const aiNodeAnim * nodeAnim = anim->mChannels[a]; - - { - // channels - mOutput << startstr << "mNodeName.data + std::string("_matrix-sampler") ) << "\" target=\"" << XMLIDEncode(nodeAnim->mNodeName.data) << "/matrix\"/>" << endstr; - } - } - - PopTag(); - mOutput << startstr << "" << endstr; - + { + std::vector names; + for (size_t i = 0; i < nodeAnim->mNumPositionKeys; ++i) { + if (nodeAnim->mPreState == aiAnimBehaviour_DEFAULT || nodeAnim->mPreState == aiAnimBehaviour_LINEAR || nodeAnim->mPreState == aiAnimBehaviour_REPEAT) { + names.push_back("LINEAR"); + } else if (nodeAnim->mPostState == aiAnimBehaviour_CONSTANT) { + names.push_back("STEP"); + } + } + + const std::string cur_node_idstr2 = nodeAnim->mNodeName.data + std::string("_matrix-interpolation"); + std::string arrayId = XMLIDEncode(cur_node_idstr2) + "-array"; + + mOutput << startstr << "" << endstr; + PushTag(); + + // source array + mOutput << startstr << " "; + for (size_t aa = 0; aa < names.size(); ++aa) { + mOutput << names[aa] << " "; + } + mOutput << "" << endstr; + + mOutput << startstr << "" << endstr; + PushTag(); + + mOutput << startstr << "" << endstr; + PushTag(); + + mOutput << startstr << "" << endstr; + + PopTag(); + mOutput << startstr << "" << endstr; + + PopTag(); + mOutput << startstr << "" << endstr; + + PopTag(); + mOutput << startstr << "" << endstr; + } + } + + for (size_t a = 0; a < anim->mNumChannels; ++a) { + const aiNodeAnim *nodeAnim = anim->mChannels[a]; + + { + // samplers + const std::string node_idstr = nodeAnim->mNodeName.data + std::string("_matrix-sampler"); + mOutput << startstr << "" << endstr; + PushTag(); + + mOutput << startstr << "mNodeName.data + std::string("_matrix-input")) << "\"/>" << endstr; + mOutput << startstr << "mNodeName.data + std::string("_matrix-output")) << "\"/>" << endstr; + mOutput << startstr << "mNodeName.data + std::string("_matrix-interpolation")) << "\"/>" << endstr; + + PopTag(); + mOutput << startstr << "" << endstr; + } + } + + for (size_t a = 0; a < anim->mNumChannels; ++a) { + const aiNodeAnim *nodeAnim = anim->mChannels[a]; + + { + // channels + mOutput << startstr << "mNodeName.data + std::string("_matrix-sampler")) << "\" target=\"" << XMLIDEncode(nodeAnim->mNodeName.data) << "/matrix\"/>" << endstr; + } + } + + PopTag(); + mOutput << startstr << "" << endstr; } // ------------------------------------------------------------------------------------------------ -void ColladaExporter::WriteAnimationsLibrary() -{ - if ( mScene->mNumAnimations > 0 ) { - mOutput << startstr << "" << endstr; - PushTag(); - - // start recursive write at the root node - for( size_t a = 0; a < mScene->mNumAnimations; ++a) - WriteAnimationLibrary( a ); +void ColladaExporter::WriteAnimationsLibrary() { + if (mScene->mNumAnimations > 0) { + mOutput << startstr << "" << endstr; + PushTag(); - PopTag(); - mOutput << startstr << "" << endstr; - } + // start recursive write at the root node + for (size_t a = 0; a < mScene->mNumAnimations; ++a) + WriteAnimationLibrary(a); + + PopTag(); + mOutput << startstr << "" << endstr; + } } // ------------------------------------------------------------------------------------------------ // Helper to find a bone by name in the scene -aiBone* findBone( const aiScene* scene, const char * name) { - for (size_t m=0; mmNumMeshes; m++) { - aiMesh * mesh = scene->mMeshes[m]; - for (size_t b=0; bmNumBones; b++) { - aiBone * bone = mesh->mBones[b]; +aiBone *findBone(const aiScene *scene, const char *name) { + for (size_t m = 0; m < scene->mNumMeshes; m++) { + aiMesh *mesh = scene->mMeshes[m]; + for (size_t b = 0; b < mesh->mNumBones; b++) { + aiBone *bone = mesh->mBones[b]; if (0 == strcmp(name, bone->mName.C_Str())) { return bone; } @@ -1497,65 +1451,61 @@ aiBone* findBone( const aiScene* scene, const char * name) { } // ------------------------------------------------------------------------------------------------ -const aiNode * findBoneNode( const aiNode* aNode, const aiBone* bone) -{ - if ( aNode && bone && aNode->mName == bone->mName ) { - return aNode; - } - - if ( aNode && bone ) { - for (unsigned int i=0; i < aNode->mNumChildren; ++i) { - aiNode * aChild = aNode->mChildren[i]; - const aiNode * foundFromChild = 0; - if ( aChild ) { - foundFromChild = findBoneNode( aChild, bone ); - if ( foundFromChild ) return foundFromChild; - } - } - } - - return NULL; +const aiNode *findBoneNode(const aiNode *aNode, const aiBone *bone) { + if (aNode && bone && aNode->mName == bone->mName) { + return aNode; + } + + if (aNode && bone) { + for (unsigned int i = 0; i < aNode->mNumChildren; ++i) { + aiNode *aChild = aNode->mChildren[i]; + const aiNode *foundFromChild = 0; + if (aChild) { + foundFromChild = findBoneNode(aChild, bone); + if (foundFromChild) return foundFromChild; + } + } + } + + return NULL; } -const aiNode * findSkeletonRootNode( const aiScene* scene, const aiMesh * mesh) -{ - std::set topParentBoneNodes; - if ( mesh && mesh->mNumBones > 0 ) { - for (unsigned int i=0; i < mesh->mNumBones; ++i) { - aiBone * bone = mesh->mBones[i]; +const aiNode *findSkeletonRootNode(const aiScene *scene, const aiMesh *mesh) { + std::set topParentBoneNodes; + if (mesh && mesh->mNumBones > 0) { + for (unsigned int i = 0; i < mesh->mNumBones; ++i) { + aiBone *bone = mesh->mBones[i]; - const aiNode * node = findBoneNode( scene->mRootNode, bone); - if ( node ) { - while ( node->mParent && findBone(scene, node->mParent->mName.C_Str() ) != 0 ) { - node = node->mParent; - } - topParentBoneNodes.insert( node ); - } - } - } - - if ( !topParentBoneNodes.empty() ) { - const aiNode * parentBoneNode = *topParentBoneNodes.begin(); - if ( topParentBoneNodes.size() == 1 ) { - return parentBoneNode; - } else { - for (auto it : topParentBoneNodes) { - if ( it->mParent ) return it->mParent; - } - return parentBoneNode; - } - } - - return NULL; + const aiNode *node = findBoneNode(scene->mRootNode, bone); + if (node) { + while (node->mParent && findBone(scene, node->mParent->mName.C_Str()) != 0) { + node = node->mParent; + } + topParentBoneNodes.insert(node); + } + } + } + + if (!topParentBoneNodes.empty()) { + const aiNode *parentBoneNode = *topParentBoneNodes.begin(); + if (topParentBoneNodes.size() == 1) { + return parentBoneNode; + } else { + for (auto it : topParentBoneNodes) { + if (it->mParent) return it->mParent; + } + return parentBoneNode; + } + } + + return NULL; } // ------------------------------------------------------------------------------------------------ // Recursively writes the given node -void ColladaExporter::WriteNode( const aiScene* pScene, aiNode* pNode) -{ +void ColladaExporter::WriteNode(const aiScene *pScene, aiNode *pNode) { // the node must have a name - if (pNode->mName.length == 0) - { + if (pNode->mName.length == 0) { std::stringstream ss; ss << "Node_" << pNode; pNode->mName.Set(ss.str()); @@ -1563,7 +1513,7 @@ void ColladaExporter::WriteNode( const aiScene* pScene, aiNode* pNode) // If the node is associated with a bone, it is a joint node (JOINT) // otherwise it is a normal node (NODE) - const char * node_type; + const char *node_type; bool is_joint, is_skeleton_root = false; if (nullptr == findBone(pScene, pNode->mName.C_Str())) { node_type = "NODE"; @@ -1578,14 +1528,14 @@ void ColladaExporter::WriteNode( const aiScene* pScene, aiNode* pNode) const std::string node_id = XMLIDEncode(pNode->mName.data); const std::string node_name = XMLEscape(pNode->mName.data); - mOutput << startstr << "" << endstr; @@ -1599,8 +1549,8 @@ void ColladaExporter::WriteNode( const aiScene* pScene, aiNode* pNode) // When importing from Collada, the mLookAt is set to 0, 0, -1, and the node transform is unchanged. // When importing from a different format, mLookAt is set to 0, 0, 1. Therefore, the local camera // coordinate system must be changed to matche the Collada specification. - for (size_t i = 0; imNumCameras; i++){ - if (mScene->mCameras[i]->mName == pNode->mName){ + for (size_t i = 0; i < mScene->mNumCameras; i++) { + if (mScene->mCameras[i]->mName == pNode->mName) { aiMatrix4x4 sourceView; mScene->mCameras[i]->GetCameraMatrix(sourceView); @@ -1610,95 +1560,90 @@ void ColladaExporter::WriteNode( const aiScene* pScene, aiNode* pNode) break; } } - - // customized, sid should be 'matrix' to match with loader code. + + // customized, sid should be 'matrix' to match with loader code. //mOutput << startstr << ""; - mOutput << startstr << ""; - + mOutput << startstr << ""; + mOutput << mat.a1 << " " << mat.a2 << " " << mat.a3 << " " << mat.a4 << " "; mOutput << mat.b1 << " " << mat.b2 << " " << mat.b3 << " " << mat.b4 << " "; mOutput << mat.c1 << " " << mat.c2 << " " << mat.c3 << " " << mat.c4 << " "; mOutput << mat.d1 << " " << mat.d2 << " " << mat.d3 << " " << mat.d4; mOutput << "" << endstr; - if(pNode->mNumMeshes==0){ + if (pNode->mNumMeshes == 0) { //check if it is a camera node - for(size_t i=0; imNumCameras; i++){ - if(mScene->mCameras[i]->mName == pNode->mName){ - mOutput << startstr <<"" << endstr; + for (size_t i = 0; i < mScene->mNumCameras; i++) { + if (mScene->mCameras[i]->mName == pNode->mName) { + mOutput << startstr << "" << endstr; break; } } //check if it is a light node - for(size_t i=0; imNumLights; i++){ - if(mScene->mLights[i]->mName == pNode->mName){ - mOutput << startstr <<"" << endstr; + for (size_t i = 0; i < mScene->mNumLights; i++) { + if (mScene->mLights[i]->mName == pNode->mName) { + mOutput << startstr << "" << endstr; break; } } - }else - // instance every geometry - for( size_t a = 0; a < pNode->mNumMeshes; ++a ) - { - const aiMesh* mesh = mScene->mMeshes[pNode->mMeshes[a]]; - // do not instantiate mesh if empty. I wonder how this could happen - if( mesh->mNumFaces == 0 || mesh->mNumVertices == 0 ) - continue; + } else + // instance every geometry + for (size_t a = 0; a < pNode->mNumMeshes; ++a) { + const aiMesh *mesh = mScene->mMeshes[pNode->mMeshes[a]]; + // do not instantiate mesh if empty. I wonder how this could happen + if (mesh->mNumFaces == 0 || mesh->mNumVertices == 0) + continue; - const std::string meshName = mesh->mName.length == 0 ? GetMeshId(pNode->mMeshes[a]) : mesh->mName.C_Str(); + const std::string meshName = mesh->mName.length == 0 ? GetMeshId(pNode->mMeshes[a]) : mesh->mName.C_Str(); - if( mesh->mNumBones == 0 ) - { - mOutput << startstr << "" << endstr; + if (mesh->mNumBones == 0) { + mOutput << startstr << "" << endstr; + PushTag(); + } else { + mOutput << startstr + << "" + << endstr; + PushTag(); + + // note! this mFoundSkeletonRootNodeID some how affects animation, it makes the mesh attaches to armature skeleton root node. + // use the first bone to find skeleton root + const aiNode *skeletonRootBoneNode = findSkeletonRootNode(pScene, mesh); + if (skeletonRootBoneNode) { + mFoundSkeletonRootNodeID = XMLIDEncode(skeletonRootBoneNode->mName.C_Str()); + } + mOutput << startstr << "#" << mFoundSkeletonRootNodeID << "" << endstr; + } + mOutput << startstr << "" << endstr; PushTag(); - } - else - { - mOutput << startstr - << "" - << endstr; + mOutput << startstr << "" << endstr; PushTag(); + mOutput << startstr << "mMaterialIndex].name) << "\">" << endstr; + PushTag(); + for (size_t aa = 0; aa < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++aa) { + if (mesh->HasTextureCoords(static_cast(aa))) + // semantic as in + // input_semantic as in + // input_set as in + mOutput << startstr << "" << endstr; + } + PopTag(); + mOutput << startstr << "" << endstr; + PopTag(); + mOutput << startstr << "" << endstr; + PopTag(); + mOutput << startstr << "" << endstr; - // note! this mFoundSkeletonRootNodeID some how affects animation, it makes the mesh attaches to armature skeleton root node. - // use the first bone to find skeleton root - const aiNode * skeletonRootBoneNode = findSkeletonRootNode( pScene, mesh ); - if ( skeletonRootBoneNode ) { - mFoundSkeletonRootNodeID = XMLIDEncode( skeletonRootBoneNode->mName.C_Str() ); - } - mOutput << startstr << "#" << mFoundSkeletonRootNodeID << "" << endstr; + PopTag(); + if (mesh->mNumBones == 0) + mOutput << startstr << "" << endstr; + else + mOutput << startstr << "" << endstr; } - mOutput << startstr << "" << endstr; - PushTag(); - mOutput << startstr << "" << endstr; - PushTag(); - mOutput << startstr << "mMaterialIndex].name) << "\">" << endstr; - PushTag(); - for( size_t aa = 0; aa < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++aa ) - { - if( mesh->HasTextureCoords( static_cast(aa) ) ) - // semantic as in - // input_semantic as in - // input_set as in - mOutput << startstr << "" << endstr; - } - PopTag(); - mOutput << startstr << "" << endstr; - PopTag(); - mOutput << startstr << "" << endstr; - PopTag(); - mOutput << startstr << "" << endstr; - - PopTag(); - if( mesh->mNumBones == 0) - mOutput << startstr << "" << endstr; - else - mOutput << startstr << "" << endstr; - } // recurse into subnodes - for( size_t a = 0; a < pNode->mNumChildren; ++a ) - WriteNode( pScene, pNode->mChildren[a]); + for (size_t a = 0; a < pNode->mNumChildren; ++a) + WriteNode(pScene, pNode->mChildren[a]); PopTag(); mOutput << startstr << "" << endstr; diff --git a/code/Collada/ColladaExporter.h b/code/Collada/ColladaExporter.h index f6c66e279..fa7e6ee80 100644 --- a/code/Collada/ColladaExporter.h +++ b/code/Collada/ColladaExporter.h @@ -47,29 +47,27 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define AI_COLLADAEXPORTER_H_INC #include +#include #include #include -#include #include +#include #include #include -#include #include struct aiScene; struct aiNode; -namespace Assimp -{ +namespace Assimp { /// Helper class to export a given scene to a Collada file. Just for my personal /// comfort when implementing it. -class ColladaExporter -{ +class ColladaExporter { public: /// Constructor for a specific scene to export - ColladaExporter( const aiScene* pScene, IOSystem* pIOSystem, const std::string& path, const std::string& file); + ColladaExporter(const aiScene *pScene, IOSystem *pIOSystem, const std::string &path, const std::string &file); /// Destructor virtual ~ColladaExporter(); @@ -107,43 +105,49 @@ protected: void WriteControllerLibrary(); /// Writes a skin controller of the given mesh - void WriteController( size_t pIndex); + void WriteController(size_t pIndex); /// Writes the geometry library void WriteGeometryLibrary(); /// Writes the given mesh - void WriteGeometry( size_t pIndex); + void WriteGeometry(size_t pIndex); //enum FloatDataType { FloatType_Vector, FloatType_TexCoord2, FloatType_TexCoord3, FloatType_Color, FloatType_Mat4x4, FloatType_Weight }; // customized to add animation related type - enum FloatDataType { FloatType_Vector, FloatType_TexCoord2, FloatType_TexCoord3, FloatType_Color, FloatType_Mat4x4, FloatType_Weight, FloatType_Time }; + enum FloatDataType { FloatType_Vector, + FloatType_TexCoord2, + FloatType_TexCoord3, + FloatType_Color, + FloatType_Mat4x4, + FloatType_Weight, + FloatType_Time }; /// Writes a float array of the given type - void WriteFloatArray( const std::string& pIdString, FloatDataType pType, const ai_real* pData, size_t pElementCount); + void WriteFloatArray(const std::string &pIdString, FloatDataType pType, const ai_real *pData, size_t pElementCount); /// Writes the scene library void WriteSceneLibrary(); - // customized, Writes the animation library - void WriteAnimationsLibrary(); - void WriteAnimationLibrary( size_t pIndex); - std::string mFoundSkeletonRootNodeID = "skeleton_root"; // will be replaced by found node id in the WriteNode call. - + // customized, Writes the animation library + void WriteAnimationsLibrary(); + void WriteAnimationLibrary(size_t pIndex); + std::string mFoundSkeletonRootNodeID = "skeleton_root"; // will be replaced by found node id in the WriteNode call. + /// Recursively writes the given node - void WriteNode( const aiScene* scene, aiNode* pNode); + void WriteNode(const aiScene *scene, aiNode *pNode); /// Enters a new xml element, which increases the indentation - void PushTag() { startstr.append( " "); } + void PushTag() { startstr.append(" "); } /// Leaves an element, decreasing the indentation - void PopTag() { - ai_assert( startstr.length() > 1); - startstr.erase( startstr.length() - 2); + void PopTag() { + ai_assert(startstr.length() > 1); + startstr.erase(startstr.length() - 2); } /// Creates a mesh ID for the given mesh - std::string GetMeshId( size_t pIndex) const { - return std::string( "meshId" ) + to_string(pIndex); + std::string GetMeshId(size_t pIndex) const { + return std::string("meshId") + to_string(pIndex); } public: @@ -151,7 +155,7 @@ public: std::stringstream mOutput; /// The IOSystem for output - IOSystem* mIOSystem; + IOSystem *mIOSystem; /// Path of the directory where the scene will be exported const std::string mPath; @@ -160,7 +164,7 @@ public: const std::string mFile; /// The scene to be written - const aiScene* mScene; + const aiScene *mScene; bool mSceneOwned; /// current line start string, contains the current indentation for simple stream insertion @@ -168,55 +172,54 @@ public: /// current line end string for simple stream insertion std::string endstr; - // pair of color and texture - texture precedences color - struct Surface - { - bool exist; - aiColor4D color; - std::string texture; - size_t channel; - Surface() { exist = false; channel = 0; } - }; + // pair of color and texture - texture precedences color + struct Surface { + bool exist; + aiColor4D color; + std::string texture; + size_t channel; + Surface() { + exist = false; + channel = 0; + } + }; - struct Property - { - bool exist; - ai_real value; - Property() - : exist(false) - , value(0.0) - {} - }; + struct Property { + bool exist; + ai_real value; + Property() : + exist(false), + value(0.0) {} + }; - // summarize a material in an convenient way. - struct Material - { - std::string name; - std::string shading_model; - Surface ambient, diffuse, specular, emissive, reflective, transparent, normal; - Property shininess, transparency, index_refraction; + // summarize a material in an convenient way. + struct Material { + std::string name; + std::string shading_model; + Surface ambient, diffuse, specular, emissive, reflective, transparent, normal; + Property shininess, transparency, index_refraction; - Material() {} - }; + Material() {} + }; - std::vector materials; + std::vector materials; - std::map textures; + std::map textures; public: - /// Dammit C++ - y u no compile two-pass? No I have to add all methods below the struct definitions - /// Reads a single surface entry from the given material keys - void ReadMaterialSurface( Surface& poSurface, const aiMaterial* pSrcMat, aiTextureType pTexture, const char* pKey, size_t pType, size_t pIndex); - /// Writes an image entry for the given surface - void WriteImageEntry( const Surface& pSurface, const std::string& pNameAdd); - /// Writes the two parameters necessary for referencing a texture in an effect entry - void WriteTextureParamEntry( const Surface& pSurface, const std::string& pTypeName, const std::string& pMatName); - /// Writes a color-or-texture entry into an effect definition - void WriteTextureColorEntry( const Surface& pSurface, const std::string& pTypeName, const std::string& pImageName); - /// Writes a scalar property - void WriteFloatEntry( const Property& pProperty, const std::string& pTypeName); + /// Dammit C++ - y u no compile two-pass? No I have to add all methods below the struct definitions + /// Reads a single surface entry from the given material keys + void ReadMaterialSurface(Surface &poSurface, const aiMaterial *pSrcMat, aiTextureType pTexture, const char *pKey, size_t pType, size_t pIndex); + /// Writes an image entry for the given surface + void WriteImageEntry(const Surface &pSurface, const std::string &pNameAdd); + /// Writes the two parameters necessary for referencing a texture in an effect entry + void WriteTextureParamEntry(const Surface &pSurface, const std::string &pTypeName, const std::string &pMatName); + /// Writes a color-or-texture entry into an effect definition + void WriteTextureColorEntry(const Surface &pSurface, const std::string &pTypeName, const std::string &pImageName); + /// Writes a scalar property + void WriteFloatEntry(const Property &pProperty, const std::string &pTypeName); }; -} +} // namespace Assimp #endif // !! AI_COLLADAEXPORTER_H_INC diff --git a/code/Collada/ColladaHelper.cpp b/code/Collada/ColladaHelper.cpp index 6f1fed366..50d70e640 100644 --- a/code/Collada/ColladaHelper.cpp +++ b/code/Collada/ColladaHelper.cpp @@ -43,8 +43,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "ColladaHelper.h" -#include #include +#include namespace Assimp { namespace Collada { @@ -63,42 +63,35 @@ const MetaKeyPairVector &GetColladaAssimpMetaKeys() { const MetaKeyPairVector MakeColladaAssimpMetaKeysCamelCase() { MetaKeyPairVector result = MakeColladaAssimpMetaKeys(); - for (auto &val : result) - { + for (auto &val : result) { ToCamelCase(val.first); } return result; }; -const MetaKeyPairVector &GetColladaAssimpMetaKeysCamelCase() -{ +const MetaKeyPairVector &GetColladaAssimpMetaKeysCamelCase() { static const MetaKeyPairVector result = MakeColladaAssimpMetaKeysCamelCase(); return result; } // ------------------------------------------------------------------------------------------------ // Convert underscore_separated to CamelCase: "authoring_tool" becomes "AuthoringTool" -void ToCamelCase(std::string &text) -{ +void ToCamelCase(std::string &text) { if (text.empty()) return; // Capitalise first character auto it = text.begin(); (*it) = ToUpper(*it); ++it; - for (/*started above*/ ; it != text.end(); /*iterated below*/) - { - if ((*it) == '_') - { + for (/*started above*/; it != text.end(); /*iterated below*/) { + if ((*it) == '_') { it = text.erase(it); if (it != text.end()) (*it) = ToUpper(*it); - } - else - { + } else { // Make lower case (*it) = ToLower(*it); - ++it; + ++it; } } } diff --git a/code/Collada/ColladaHelper.h b/code/Collada/ColladaHelper.h index c6e2e7ddd..3eb073cd9 100644 --- a/code/Collada/ColladaHelper.h +++ b/code/Collada/ColladaHelper.h @@ -45,31 +45,28 @@ 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 #include -#include #include +#include +#include +#include +#include +#include struct aiMaterial; -namespace Assimp { -namespace Collada { +namespace Assimp { +namespace Collada { /** Collada file versions which evolved during the years ... */ -enum FormatVersion -{ +enum FormatVersion { FV_1_5_n, FV_1_4_n, FV_1_3_n }; - /** Transformation types that can be applied to a node */ -enum TransformType -{ +enum TransformType { TF_LOOKAT, TF_ROTATE, TF_TRANSLATE, @@ -79,10 +76,9 @@ enum TransformType }; /** Different types of input data to a vertex or face */ -enum InputType -{ +enum InputType { IT_Invalid, - IT_Vertex, // special type for per-index data referring to the element carrying the per-vertex data. + IT_Vertex, // special type for per-index data referring to the element carrying the per-vertex data. IT_Position, IT_Normal, IT_Texcoord, @@ -92,15 +88,13 @@ enum InputType }; /** Supported controller types */ -enum ControllerType -{ +enum ControllerType { Skin, Morph }; /** Supported morph methods */ -enum MorphMethod -{ +enum MorphMethod { Normalized, Relative }; @@ -118,24 +112,21 @@ const MetaKeyPairVector &GetColladaAssimpMetaKeysCamelCase(); void ToCamelCase(std::string &text); /** Contains all data for one of the different transformation types */ -struct Transform -{ - std::string mID; ///< SID of the transform step, by which anim channels address their target node +struct Transform { + std::string mID; ///< SID of the transform step, by which anim channels address their target node TransformType mType; ai_real f[16]; ///< Interpretation of data depends on the type of the transformation }; /** A collada camera. */ -struct Camera -{ - Camera() - : mOrtho (false) - , mHorFov (10e10f) - , mVerFov (10e10f) - , mAspect (10e10f) - , mZNear (0.1f) - , mZFar (1000.f) - {} +struct Camera { + Camera() : + mOrtho(false), + mHorFov(10e10f), + mVerFov(10e10f), + mAspect(10e10f), + mZNear(0.1f), + mZFar(1000.f) {} // Name of camera std::string mName; @@ -159,19 +150,17 @@ struct Camera #define ASSIMP_COLLADA_LIGHT_ANGLE_NOT_SET 1e9f /** A collada light source. */ -struct Light -{ - Light() - : mType (aiLightSource_UNDEFINED) - , mAttConstant (1.f) - , mAttLinear (0.f) - , mAttQuadratic (0.f) - , mFalloffAngle (180.f) - , mFalloffExponent (0.f) - , mPenumbraAngle (ASSIMP_COLLADA_LIGHT_ANGLE_NOT_SET) - , mOuterAngle (ASSIMP_COLLADA_LIGHT_ANGLE_NOT_SET) - , mIntensity (1.f) - {} +struct Light { + Light() : + mType(aiLightSource_UNDEFINED), + mAttConstant(1.f), + mAttLinear(0.f), + mAttQuadratic(0.f), + mFalloffAngle(180.f), + mFalloffExponent(0.f), + mPenumbraAngle(ASSIMP_COLLADA_LIGHT_ANGLE_NOT_SET), + mOuterAngle(ASSIMP_COLLADA_LIGHT_ANGLE_NOT_SET), + mIntensity(1.f) {} //! Type of the light source aiLightSourceType + ambient unsigned int mType; @@ -180,7 +169,7 @@ struct Light aiColor3D mColor; //! Light attenuation - ai_real mAttConstant,mAttLinear,mAttQuadratic; + ai_real mAttConstant, mAttLinear, mAttQuadratic; //! Spot light falloff ai_real mFalloffAngle; @@ -198,12 +187,10 @@ struct Light }; /** Short vertex index description */ -struct InputSemanticMapEntry -{ - InputSemanticMapEntry() - : mSet(0) - , mType(IT_Invalid) - {} +struct InputSemanticMapEntry { + InputSemanticMapEntry() : + mSet(0), + mType(IT_Invalid) {} //! Index of set, optional unsigned int mSet; @@ -213,8 +200,7 @@ struct InputSemanticMapEntry }; /** Table to map from effect to vertex input semantics */ -struct SemanticMappingTable -{ +struct SemanticMappingTable { //! Name of material std::string mMatName; @@ -222,7 +208,7 @@ struct SemanticMappingTable std::map mMap; //! For std::find - bool operator == (const std::string& s) const { + bool operator==(const std::string &s) const { return s == mMatName; } }; @@ -230,8 +216,7 @@ struct SemanticMappingTable /** A reference to a mesh inside a node, including materials assigned to the various subgroups. * The ID refers to either a mesh or a controller which specifies the mesh */ -struct MeshInstance -{ +struct MeshInstance { ///< ID of the mesh or controller to be instanced std::string mMeshOrController; @@ -240,34 +225,30 @@ struct MeshInstance }; /** A reference to a camera inside a node*/ -struct CameraInstance -{ - ///< ID of the camera +struct CameraInstance { + ///< ID of the camera std::string mCamera; }; /** A reference to a light inside a node*/ -struct LightInstance -{ - ///< ID of the camera +struct LightInstance { + ///< ID of the camera std::string mLight; }; /** A reference to a node inside a node*/ -struct NodeInstance -{ - ///< ID of the node +struct NodeInstance { + ///< ID of the node std::string mNode; }; /** A node in a scene hierarchy */ -struct Node -{ +struct Node { std::string mName; std::string mID; std::string mSID; - Node* mParent; - std::vector mChildren; + Node *mParent; + std::vector mChildren; /** Operations in order to calculate the resulting transformation to parent. */ std::vector mTransforms; @@ -288,77 +269,78 @@ struct Node std::string mPrimaryCamera; //! Constructor. Begin with a zero parent - Node() - : mParent( nullptr ){ + Node() : + mParent(nullptr) { // empty } //! Destructor: delete all children subsequently ~Node() { - for( std::vector::iterator it = mChildren.begin(); it != mChildren.end(); ++it) + for (std::vector::iterator it = mChildren.begin(); it != mChildren.end(); ++it) delete *it; } }; /** Data source array: either floats or strings */ -struct Data -{ +struct Data { bool mIsStringArray; std::vector mValues; std::vector mStrings; }; /** Accessor to a data array */ -struct Accessor -{ - size_t mCount; // in number of objects - size_t mSize; // size of an object, in elements (floats or strings, mostly 1) - size_t mOffset; // in number of values - size_t mStride; // Stride in number of values +struct Accessor { + size_t mCount; // in number of objects + size_t mSize; // size of an object, in elements (floats or strings, mostly 1) + size_t mOffset; // in number of values + size_t mStride; // Stride in number of values std::vector mParams; // names of the data streams in the accessors. Empty string tells to ignore. size_t mSubOffset[4]; // Suboffset inside the object for the common 4 elements. For a vector, that's XYZ, for a color RGBA and so on. - // For example, SubOffset[0] denotes which of the values inside the object is the vector X component. - std::string mSource; // URL of the source array - mutable const Data* mData; // Pointer to the source array, if resolved. NULL else + // For example, SubOffset[0] denotes which of the values inside the object is the vector X component. + std::string mSource; // URL of the source array + mutable const Data *mData; // Pointer to the source array, if resolved. NULL else - Accessor() - { - mCount = 0; mSize = 0; mOffset = 0; mStride = 0; mData = NULL; + Accessor() { + mCount = 0; + mSize = 0; + mOffset = 0; + mStride = 0; + mData = NULL; mSubOffset[0] = mSubOffset[1] = mSubOffset[2] = mSubOffset[3] = 0; } }; /** A single face in a mesh */ -struct Face -{ +struct Face { std::vector mIndices; }; /** An input channel for mesh data, referring to a single accessor */ -struct InputChannel -{ - InputType mType; // Type of the data - size_t mIndex; // Optional index, if multiple sets of the same data type are given - size_t mOffset; // Index offset in the indices array of per-face indices. Don't ask, can't explain that any better. +struct InputChannel { + InputType mType; // Type of the data + size_t mIndex; // Optional index, if multiple sets of the same data type are given + size_t mOffset; // Index offset in the indices array of per-face indices. Don't ask, can't explain that any better. std::string mAccessor; // ID of the accessor where to read the actual values from. - mutable const Accessor* mResolved; // Pointer to the accessor, if resolved. NULL else + mutable const Accessor *mResolved; // Pointer to the accessor, if resolved. NULL else - InputChannel() { mType = IT_Invalid; mIndex = 0; mOffset = 0; mResolved = NULL; } + InputChannel() { + mType = IT_Invalid; + mIndex = 0; + mOffset = 0; + mResolved = NULL; + } }; /** Subset of a mesh with a certain material */ -struct SubMesh -{ +struct SubMesh { std::string mMaterial; ///< subgroup identifier size_t mNumFaces; ///< number of faces in this submesh }; /** Contains data for a single mesh */ -struct Mesh -{ - Mesh() - { - for (unsigned int i = 0; i < AI_MAX_NUMBER_OF_TEXTURECOORDS;++i) +struct Mesh { + Mesh() { + for (unsigned int i = 0; i < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++i) mNumUVComponents[i] = 2; } @@ -377,7 +359,7 @@ struct Mesh std::vector mTangents; std::vector mBitangents; std::vector mTexCoords[AI_MAX_NUMBER_OF_TEXTURECOORDS]; - std::vector mColors[AI_MAX_NUMBER_OF_COLOR_SETS]; + std::vector mColors[AI_MAX_NUMBER_OF_COLOR_SETS]; unsigned int mNumUVComponents[AI_MAX_NUMBER_OF_TEXTURECOORDS]; @@ -394,8 +376,7 @@ struct Mesh }; /** Which type of primitives the ReadPrimitives() function is going to read */ -enum PrimitiveType -{ +enum PrimitiveType { Prim_Invalid, Prim_Lines, Prim_LineStrip, @@ -407,8 +388,7 @@ enum PrimitiveType }; /** A skeleton controller to deform a mesh with the use of joints */ -struct Controller -{ +struct Controller { // controller type ControllerType mType; @@ -436,36 +416,32 @@ struct Controller std::vector mWeightCounts; // JointIndex-WeightIndex pairs for all vertices - std::vector< std::pair > mWeights; + std::vector> mWeights; std::string mMorphTarget; std::string mMorphWeight; }; /** A collada material. Pretty much the only member is a reference to an effect. */ -struct Material -{ +struct Material { std::string mName; std::string mEffect; }; /** Type of the effect param */ -enum ParamType -{ +enum ParamType { Param_Sampler, Param_Surface }; /** A param for an effect. Might be of several types, but they all just refer to each other, so I summarize them */ -struct EffectParam -{ +struct EffectParam { ParamType mType; std::string mReference; // to which other thing the param is referring to. }; /** Shading type supported by the standard effect spec of Collada */ -enum ShadeType -{ +enum ShadeType { Shade_Invalid, Shade_Constant, Shade_Lambert, @@ -474,18 +450,16 @@ enum ShadeType }; /** Represents a texture sampler in collada */ -struct Sampler -{ - Sampler() - : mWrapU (true) - , mWrapV (true) - , mMirrorU () - , mMirrorV () - , mOp (aiTextureOp_Multiply) - , mUVId (UINT_MAX) - , mWeighting (1.f) - , mMixWithPrevious (1.f) - {} +struct Sampler { + Sampler() : + mWrapU(true), + mWrapV(true), + mMirrorU(), + mMirrorV(), + mOp(aiTextureOp_Multiply), + mUVId(UINT_MAX), + mWeighting(1.f), + mMixWithPrevious(1.f) {} /** Name of image reference */ @@ -537,18 +511,17 @@ struct Sampler /** A collada effect. Can contain about anything according to the Collada spec, but we limit our version to a reasonable subset. */ -struct Effect -{ +struct Effect { // Shading mode ShadeType mShadeType; // Colors aiColor4D mEmissive, mAmbient, mDiffuse, mSpecular, - mTransparent, mReflective; + mTransparent, mReflective; // Textures Sampler mTexEmissive, mTexAmbient, mTexDiffuse, mTexSpecular, - mTexTransparent, mTexBump, mTexReflective; + mTexTransparent, mTexBump, mTexReflective; // Scalar factory ai_real mShininess, mRefractIndex, mReflectivity; @@ -566,30 +539,28 @@ struct Effect // Double-sided? bool mDoubleSided, mWireframe, mFaceted; - Effect() - : mShadeType (Shade_Phong) - , mEmissive ( 0, 0, 0, 1) - , mAmbient ( 0.1f, 0.1f, 0.1f, 1) - , mDiffuse ( 0.6f, 0.6f, 0.6f, 1) - , mSpecular ( 0.4f, 0.4f, 0.4f, 1) - , mTransparent ( 0, 0, 0, 1) - , mShininess (10.0f) - , mRefractIndex (1.f) - , mReflectivity (0.f) - , mTransparency (1.f) - , mHasTransparency (false) - , mRGBTransparency(false) - , mInvertTransparency(false) - , mDoubleSided (false) - , mWireframe (false) - , mFaceted (false) - { + Effect() : + mShadeType(Shade_Phong), + mEmissive(0, 0, 0, 1), + mAmbient(0.1f, 0.1f, 0.1f, 1), + mDiffuse(0.6f, 0.6f, 0.6f, 1), + mSpecular(0.4f, 0.4f, 0.4f, 1), + mTransparent(0, 0, 0, 1), + mShininess(10.0f), + mRefractIndex(1.f), + mReflectivity(0.f), + mTransparency(1.f), + mHasTransparency(false), + mRGBTransparency(false), + mInvertTransparency(false), + mDoubleSided(false), + mWireframe(false), + mFaceted(false) { } }; /** An image, meaning texture */ -struct Image -{ +struct Image { std::string mFileName; /** Embedded image data */ @@ -600,8 +571,7 @@ struct Image }; /** An animation channel. */ -struct AnimationChannel -{ +struct AnimationChannel { /** URL of the data to animate. Could be about anything, but we support only the * "NodeID/TransformID.SubElement" notation */ @@ -620,8 +590,7 @@ struct AnimationChannel }; /** An animation. Container for 0-x animation channels or 0-x animations */ -struct Animation -{ +struct Animation { /** Anim name */ std::string mName; @@ -629,96 +598,86 @@ struct Animation std::vector mChannels; /** the sub-animations, if any */ - std::vector mSubAnims; + std::vector mSubAnims; /** Destructor */ - ~Animation() - { - for( std::vector::iterator it = mSubAnims.begin(); it != mSubAnims.end(); ++it) + ~Animation() { + for (std::vector::iterator it = mSubAnims.begin(); it != mSubAnims.end(); ++it) delete *it; } - /** Collect all channels in the animation hierarchy into a single channel list. */ - void CollectChannelsRecursively(std::vector &channels) - { - channels.insert(channels.end(), mChannels.begin(), mChannels.end()); + /** Collect all channels in the animation hierarchy into a single channel list. */ + void CollectChannelsRecursively(std::vector &channels) { + channels.insert(channels.end(), mChannels.begin(), mChannels.end()); - for (std::vector::iterator it = mSubAnims.begin(); it != mSubAnims.end(); ++it) - { - Animation *pAnim = (*it); + for (std::vector::iterator it = mSubAnims.begin(); it != mSubAnims.end(); ++it) { + Animation *pAnim = (*it); - pAnim->CollectChannelsRecursively(channels); - } - } + pAnim->CollectChannelsRecursively(channels); + } + } - /** Combine all single-channel animations' channel into the same (parent) animation channel list. */ - void CombineSingleChannelAnimations() - { - CombineSingleChannelAnimationsRecursively(this); - } + /** Combine all single-channel animations' channel into the same (parent) animation channel list. */ + void CombineSingleChannelAnimations() { + CombineSingleChannelAnimationsRecursively(this); + } - void CombineSingleChannelAnimationsRecursively(Animation *pParent) - { - std::set childrenTargets; - bool childrenAnimationsHaveDifferentChannels = true; + void CombineSingleChannelAnimationsRecursively(Animation *pParent) { + std::set childrenTargets; + bool childrenAnimationsHaveDifferentChannels = true; - for (std::vector::iterator it = pParent->mSubAnims.begin(); it != pParent->mSubAnims.end();) - { - Animation *anim = *it; - CombineSingleChannelAnimationsRecursively(anim); + for (std::vector::iterator it = pParent->mSubAnims.begin(); it != pParent->mSubAnims.end();) { + Animation *anim = *it; + CombineSingleChannelAnimationsRecursively(anim); - if (childrenAnimationsHaveDifferentChannels && anim->mChannels.size() == 1 && - childrenTargets.find(anim->mChannels[0].mTarget) == childrenTargets.end()) { - childrenTargets.insert(anim->mChannels[0].mTarget); - } else { - childrenAnimationsHaveDifferentChannels = false; - } + if (childrenAnimationsHaveDifferentChannels && anim->mChannels.size() == 1 && + childrenTargets.find(anim->mChannels[0].mTarget) == childrenTargets.end()) { + childrenTargets.insert(anim->mChannels[0].mTarget); + } else { + childrenAnimationsHaveDifferentChannels = false; + } - ++it; - } + ++it; + } - // We only want to combine animations if they have different channels - if (childrenAnimationsHaveDifferentChannels) - { - for (std::vector::iterator it = pParent->mSubAnims.begin(); it != pParent->mSubAnims.end();) - { - Animation *anim = *it; + // We only want to combine animations if they have different channels + if (childrenAnimationsHaveDifferentChannels) { + for (std::vector::iterator it = pParent->mSubAnims.begin(); it != pParent->mSubAnims.end();) { + Animation *anim = *it; - pParent->mChannels.push_back(anim->mChannels[0]); + pParent->mChannels.push_back(anim->mChannels[0]); - it = pParent->mSubAnims.erase(it); + it = pParent->mSubAnims.erase(it); - delete anim; - continue; - } - } - } + delete anim; + continue; + } + } + } }; /** Description of a collada animation channel which has been determined to affect the current node */ -struct ChannelEntry -{ - const Collada::AnimationChannel* mChannel; ///> the source channel +struct ChannelEntry { + const Collada::AnimationChannel *mChannel; ///> the source channel std::string mTargetId; - std::string mTransformId; // the ID of the transformation step of the node which is influenced + std::string mTransformId; // the ID of the transformation step of the node which is influenced size_t mTransformIndex; // Index into the node's transform chain to apply the channel to size_t mSubElement; // starting index inside the transform data // resolved data references - const Collada::Accessor* mTimeAccessor; ///> Collada accessor to the time values - const Collada::Data* mTimeData; ///> Source data array for the time values - const Collada::Accessor* mValueAccessor; ///> Collada accessor to the key value values - const Collada::Data* mValueData; ///> Source datat array for the key value values + const Collada::Accessor *mTimeAccessor; ///> Collada accessor to the time values + const Collada::Data *mTimeData; ///> Source data array for the time values + const Collada::Accessor *mValueAccessor; ///> Collada accessor to the key value values + const Collada::Data *mValueData; ///> Source datat array for the key value values - ChannelEntry() - : mChannel() - , mTransformIndex() - , mSubElement() - , mTimeAccessor() - , mTimeData() - , mValueAccessor() - , mValueData() - {} + ChannelEntry() : + mChannel(), + mTransformIndex(), + mSubElement(), + mTimeAccessor(), + mTimeData(), + mValueAccessor(), + mValueData() {} }; } // end of namespace Collada diff --git a/code/Collada/ColladaLoader.cpp b/code/Collada/ColladaLoader.cpp index b78fc0e3b..44d65e40d 100644 --- a/code/Collada/ColladaLoader.cpp +++ b/code/Collada/ColladaLoader.cpp @@ -46,27 +46,27 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "ColladaLoader.h" #include "ColladaParser.h" +#include #include +#include #include #include #include -#include -#include -#include +#include #include #include -#include #include +#include -#include "time.h" #include "math.h" +#include "time.h" #include -#include #include +#include namespace Assimp { - + using namespace Assimp::Formatter; static const aiImporterDesc desc = { @@ -84,20 +84,20 @@ static const aiImporterDesc desc = { // ------------------------------------------------------------------------------------------------ // Constructor to be privately used by Importer -ColladaLoader::ColladaLoader() - : mFileName() - , mMeshIndexByID() - , mMaterialIndexByName() - , mMeshes() - , newMats() - , mCameras() - , mLights() - , mTextures() - , mAnims() - , noSkeletonMesh(false) - , ignoreUpDirection(false) - , useColladaName(false) - , mNodeNameCounter(0) { +ColladaLoader::ColladaLoader() : + mFileName(), + mMeshIndexByID(), + mMaterialIndexByName(), + mMeshes(), + newMats(), + mCameras(), + mLights(), + mTextures(), + mAnims(), + noSkeletonMesh(false), + ignoreUpDirection(false), + useColladaName(false), + mNodeNameCounter(0) { // empty } @@ -109,7 +109,7 @@ ColladaLoader::~ColladaLoader() { // ------------------------------------------------------------------------------------------------ // Returns whether the class can handle the format of the given file. -bool ColladaLoader::CanRead(const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const { +bool ColladaLoader::CanRead(const std::string &pFile, IOSystem *pIOHandler, bool checkSig) const { // check file extension const std::string extension = GetExtension(pFile); @@ -137,7 +137,7 @@ bool ColladaLoader::CanRead(const std::string& pFile, IOSystem* pIOHandler, bool if (!pIOHandler) { return true; } - static const char* tokens[] = { "GetPropertyInteger(AI_CONFIG_IMPORT_NO_SKELETON_MESHES, 0) != 0; ignoreUpDirection = pImp->GetPropertyInteger(AI_CONFIG_IMPORT_COLLADA_IGNORE_UP_DIRECTION, 0) != 0; useColladaName = pImp->GetPropertyInteger(AI_CONFIG_IMPORT_COLLADA_USE_COLLADA_NAMES, 0) != 0; @@ -153,13 +153,13 @@ void ColladaLoader::SetupProperties(const Importer* pImp) { // ------------------------------------------------------------------------------------------------ // Get file extension list -const aiImporterDesc* ColladaLoader::GetInfo() const { +const aiImporterDesc *ColladaLoader::GetInfo() const { return &desc; } // ------------------------------------------------------------------------------------------------ // Imports the given file into the given scene structure. -void ColladaLoader::InternReadFile(const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler) { +void ColladaLoader::InternReadFile(const std::string &pFile, aiScene *pScene, IOSystem *pIOHandler) { mFileName = pFile; // clean all member arrays - just for safety, it should work even if we did not @@ -176,14 +176,13 @@ void ColladaLoader::InternReadFile(const std::string& pFile, aiScene* pScene, IO // parse the input file ColladaParser parser(pIOHandler, pFile); - - if( !parser.mRootNode) { - throw DeadlyImportError( "Collada: File came out empty. Something is wrong here."); + if (!parser.mRootNode) { + throw DeadlyImportError("Collada: File came out empty. Something is wrong here."); } // reserve some storage to avoid unnecessary reallocs - newMats.reserve(parser.mMaterialLibrary.size()*2u); - mMeshes.reserve(parser.mMeshLibrary.size()*2u); + newMats.reserve(parser.mMaterialLibrary.size() * 2u); + mMeshes.reserve(parser.mMeshLibrary.size() * 2u); mCameras.reserve(parser.mCameraLibrary.size()); mLights.reserve(parser.mLightLibrary.size()); @@ -199,24 +198,24 @@ void ColladaLoader::InternReadFile(const std::string& pFile, aiScene* pScene, IO // Apply unit-size scale calculation - pScene->mRootNode->mTransformation *= aiMatrix4x4(parser.mUnitSize, 0, 0, 0, - 0, parser.mUnitSize, 0, 0, - 0, 0, parser.mUnitSize, 0, - 0, 0, 0, 1); - if( !ignoreUpDirection ) { + pScene->mRootNode->mTransformation *= aiMatrix4x4(parser.mUnitSize, 0, 0, 0, + 0, parser.mUnitSize, 0, 0, + 0, 0, parser.mUnitSize, 0, + 0, 0, 0, 1); + if (!ignoreUpDirection) { // Convert to Y_UP, if different orientation - if( parser.mUpDirection == ColladaParser::UP_X) { + if (parser.mUpDirection == ColladaParser::UP_X) { pScene->mRootNode->mTransformation *= aiMatrix4x4( - 0, -1, 0, 0, - 1, 0, 0, 0, - 0, 0, 1, 0, - 0, 0, 0, 1); - } else if( parser.mUpDirection == ColladaParser::UP_Z) { + 0, -1, 0, 0, + 1, 0, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1); + } else if (parser.mUpDirection == ColladaParser::UP_Z) { pScene->mRootNode->mTransformation *= aiMatrix4x4( - 1, 0, 0, 0, - 0, 0, 1, 0, - 0, -1, 0, 0, - 0, 0, 0, 1); + 1, 0, 0, 0, + 0, 0, 1, 0, + 0, -1, 0, 0, + 0, 0, 0, 1); } } @@ -249,7 +248,7 @@ void ColladaLoader::InternReadFile(const std::string& pFile, aiScene* pScene, IO StoreAnimations(pScene, parser); // If no meshes have been loaded, it's probably just an animated skeleton. - if ( 0u == pScene->mNumMeshes) { + if (0u == pScene->mNumMeshes) { if (!noSkeletonMesh) { SkeletonMeshBuilder hero(pScene); @@ -260,9 +259,9 @@ void ColladaLoader::InternReadFile(const std::string& pFile, aiScene* pScene, IO // ------------------------------------------------------------------------------------------------ // Recursively constructs a scene node for the given parser node and returns it. -aiNode* ColladaLoader::BuildHierarchy(const ColladaParser& pParser, const Collada::Node* pNode) { +aiNode *ColladaLoader::BuildHierarchy(const ColladaParser &pParser, const Collada::Node *pNode) { // create a node for it - aiNode* node = new aiNode(); + aiNode *node = new aiNode(); // find a name for the new node. It's more complicated than you might think node->mName.Set(FindNameForNode(pNode)); @@ -271,12 +270,12 @@ aiNode* ColladaLoader::BuildHierarchy(const ColladaParser& pParser, const Collad node->mTransformation = pParser.CalculateResultTransform(pNode->mTransforms); // now resolve node instances - std::vector instances; + std::vector instances; ResolveNodeInstances(pParser, pNode, instances); // add children. first the *real* ones node->mNumChildren = static_cast(pNode->mChildren.size() + instances.size()); - node->mChildren = new aiNode*[node->mNumChildren]; + node->mChildren = new aiNode *[node->mNumChildren]; for (size_t a = 0; a < pNode->mChildren.size(); ++a) { node->mChildren[a] = BuildHierarchy(pParser, pNode->mChildren[a]); @@ -303,8 +302,8 @@ aiNode* ColladaLoader::BuildHierarchy(const ColladaParser& pParser, const Collad // ------------------------------------------------------------------------------------------------ // Resolve node instances -void ColladaLoader::ResolveNodeInstances(const ColladaParser& pParser, const Collada::Node* pNode, - std::vector& resolved) { +void ColladaLoader::ResolveNodeInstances(const ColladaParser &pParser, const Collada::Node *pNode, + std::vector &resolved) { // reserve enough storage resolved.reserve(pNode->mNodeInstances.size()); @@ -312,7 +311,7 @@ void ColladaLoader::ResolveNodeInstances(const ColladaParser& pParser, const Col for (const auto &nodeInst : pNode->mNodeInstances) { // find the corresponding node in the library const ColladaParser::NodeLibrary::const_iterator itt = pParser.mNodeLibrary.find(nodeInst.mNode); - const Collada::Node* nd = itt == pParser.mNodeLibrary.end() ? NULL : (*itt).second; + const Collada::Node *nd = itt == pParser.mNodeLibrary.end() ? NULL : (*itt).second; // FIX for http://sourceforge.net/tracker/?func=detail&aid=3054873&group_id=226462&atid=1067632 // need to check for both name and ID to catch all. To avoid breaking valid files, @@ -331,9 +330,9 @@ void ColladaLoader::ResolveNodeInstances(const ColladaParser& pParser, const Col // ------------------------------------------------------------------------------------------------ // Resolve UV channels -void ColladaLoader::ApplyVertexToEffectSemanticMapping(Collada::Sampler& sampler, +void ColladaLoader::ApplyVertexToEffectSemanticMapping(Collada::Sampler &sampler, - const Collada::SemanticMappingTable& table) { + const Collada::SemanticMappingTable &table) { std::map::const_iterator it = table.mMap.find(sampler.mUVChannel); if (it != table.mMap.end()) { if (it->second.mType != Collada::IT_Texcoord) { @@ -346,18 +345,18 @@ void ColladaLoader::ApplyVertexToEffectSemanticMapping(Collada::Sampler& sampler // ------------------------------------------------------------------------------------------------ // Builds lights for the given node and references them -void ColladaLoader::BuildLightsForNode(const ColladaParser& pParser, const Collada::Node* pNode, aiNode* pTarget) { - for (const Collada::LightInstance& lid : pNode->mLights) { +void ColladaLoader::BuildLightsForNode(const ColladaParser &pParser, const Collada::Node *pNode, aiNode *pTarget) { + for (const Collada::LightInstance &lid : pNode->mLights) { // find the referred light ColladaParser::LightLibrary::const_iterator srcLightIt = pParser.mLightLibrary.find(lid.mLight); if (srcLightIt == pParser.mLightLibrary.end()) { ASSIMP_LOG_WARN_F("Collada: Unable to find light for ID \"", lid.mLight, "\". Skipping."); continue; } - const Collada::Light* srcLight = &srcLightIt->second; + const Collada::Light *srcLight = &srcLightIt->second; // now fill our ai data structure - aiLight* out = new aiLight(); + aiLight *out = new aiLight(); out->mName = pTarget->mName; out->mType = (aiLightSourceType)srcLight->mType; @@ -368,14 +367,13 @@ void ColladaLoader::BuildLightsForNode(const ColladaParser& pParser, const Colla out->mAttenuationLinear = srcLight->mAttLinear; out->mAttenuationQuadratic = srcLight->mAttQuadratic; - out->mColorDiffuse = out->mColorSpecular = out->mColorAmbient = srcLight->mColor*srcLight->mIntensity; + out->mColorDiffuse = out->mColorSpecular = out->mColorAmbient = srcLight->mColor * srcLight->mIntensity; if (out->mType == aiLightSource_AMBIENT) { out->mColorDiffuse = out->mColorSpecular = aiColor3D(0, 0, 0); - out->mColorAmbient = srcLight->mColor*srcLight->mIntensity; - } - else { + out->mColorAmbient = srcLight->mColor * srcLight->mIntensity; + } else { // collada doesn't differentiate between these color types - out->mColorDiffuse = out->mColorSpecular = srcLight->mColor*srcLight->mIntensity; + out->mColorDiffuse = out->mColorSpecular = srcLight->mColor * srcLight->mIntensity; out->mColorAmbient = aiColor3D(0, 0, 0); } @@ -390,15 +388,13 @@ void ColladaLoader::BuildLightsForNode(const ColladaParser& pParser, const Colla // Need to rely on falloff_exponent. I don't know how to interpret it, so I need to guess .... // epsilon chosen to be 0.1 out->mAngleOuterCone = std::acos(std::pow(0.1f, 1.f / srcLight->mFalloffExponent)) + - out->mAngleInnerCone; - } - else { + out->mAngleInnerCone; + } else { out->mAngleOuterCone = out->mAngleInnerCone + AI_DEG_TO_RAD(srcLight->mPenumbraAngle); if (out->mAngleOuterCone < out->mAngleInnerCone) std::swap(out->mAngleInnerCone, out->mAngleOuterCone); } - } - else { + } else { out->mAngleOuterCone = AI_DEG_TO_RAD(srcLight->mOuterAngle); } } @@ -410,15 +406,15 @@ void ColladaLoader::BuildLightsForNode(const ColladaParser& pParser, const Colla // ------------------------------------------------------------------------------------------------ // Builds cameras for the given node and references them -void ColladaLoader::BuildCamerasForNode(const ColladaParser& pParser, const Collada::Node* pNode, aiNode* pTarget) { - for (const Collada::CameraInstance& cid : pNode->mCameras) { +void ColladaLoader::BuildCamerasForNode(const ColladaParser &pParser, const Collada::Node *pNode, aiNode *pTarget) { + for (const Collada::CameraInstance &cid : pNode->mCameras) { // find the referred light ColladaParser::CameraLibrary::const_iterator srcCameraIt = pParser.mCameraLibrary.find(cid.mCamera); if (srcCameraIt == pParser.mCameraLibrary.end()) { ASSIMP_LOG_WARN_F("Collada: Unable to find camera for ID \"", cid.mCamera, "\". Skipping."); continue; } - const Collada::Camera* srcCamera = &srcCameraIt->second; + const Collada::Camera *srcCamera = &srcCameraIt->second; // orthographic cameras not yet supported in Assimp if (srcCamera->mOrtho) { @@ -426,7 +422,7 @@ void ColladaLoader::BuildCamerasForNode(const ColladaParser& pParser, const Coll } // now fill our ai data structure - aiCamera* out = new aiCamera(); + aiCamera *out = new aiCamera(); out->mName = pTarget->mName; // collada cameras point in -Z by default, rest is specified in node transform @@ -447,12 +443,12 @@ void ColladaLoader::BuildCamerasForNode(const ColladaParser& pParser, const Coll if (srcCamera->mVerFov != 10e10f && srcCamera->mAspect == 10e10f) { out->mAspect = std::tan(AI_DEG_TO_RAD(srcCamera->mHorFov)) / - std::tan(AI_DEG_TO_RAD(srcCamera->mVerFov)); + std::tan(AI_DEG_TO_RAD(srcCamera->mVerFov)); } - } else if (srcCamera->mAspect != 10e10f && srcCamera->mVerFov != 10e10f) { + } else if (srcCamera->mAspect != 10e10f && srcCamera->mVerFov != 10e10f) { out->mHorizontalFOV = 2.0f * AI_RAD_TO_DEG(std::atan(srcCamera->mAspect * - std::tan(AI_DEG_TO_RAD(srcCamera->mVerFov) * 0.5f))); + std::tan(AI_DEG_TO_RAD(srcCamera->mVerFov) * 0.5f))); } // Collada uses degrees, we use radians @@ -465,15 +461,15 @@ void ColladaLoader::BuildCamerasForNode(const ColladaParser& pParser, const Coll // ------------------------------------------------------------------------------------------------ // Builds meshes for the given node and references them -void ColladaLoader::BuildMeshesForNode(const ColladaParser& pParser, const Collada::Node* pNode, aiNode* pTarget) { +void ColladaLoader::BuildMeshesForNode(const ColladaParser &pParser, const Collada::Node *pNode, aiNode *pTarget) { // accumulated mesh references by this node std::vector newMeshRefs; newMeshRefs.reserve(pNode->mMeshes.size()); // add a mesh for each subgroup in each collada mesh - for (const Collada::MeshInstance& mid : pNode->mMeshes) { - const Collada::Mesh* srcMesh = nullptr; - const Collada::Controller* srcController = nullptr; + for (const Collada::MeshInstance &mid : pNode->mMeshes) { + const Collada::Mesh *srcMesh = nullptr; + const Collada::Controller *srcController = nullptr; // find the referred mesh ColladaParser::MeshLibrary::const_iterator srcMeshIt = pParser.mMeshLibrary.find(mid.mMeshOrController); @@ -488,13 +484,11 @@ void ColladaLoader::BuildMeshesForNode(const ColladaParser& pParser, const Colla } } - - if( nullptr == srcMesh) { - ASSIMP_LOG_WARN_F( "Collada: Unable to find geometry for ID \"", mid.mMeshOrController, "\". Skipping." ); + if (nullptr == srcMesh) { + ASSIMP_LOG_WARN_F("Collada: Unable to find geometry for ID \"", mid.mMeshOrController, "\". Skipping."); continue; } - } - else { + } else { // ID found in the mesh library -> direct reference to an unskinned mesh srcMesh = srcMeshIt->second; } @@ -502,23 +496,22 @@ void ColladaLoader::BuildMeshesForNode(const ColladaParser& pParser, const Colla // build a mesh for each of its subgroups size_t vertexStart = 0, faceStart = 0; for (size_t sm = 0; sm < srcMesh->mSubMeshes.size(); ++sm) { - const Collada::SubMesh& submesh = srcMesh->mSubMeshes[sm]; + const Collada::SubMesh &submesh = srcMesh->mSubMeshes[sm]; if (submesh.mNumFaces == 0) { continue; } // find material assigned to this submesh std::string meshMaterial; - std::map::const_iterator meshMatIt = mid.mMaterials.find(submesh.mMaterial); + std::map::const_iterator meshMatIt = mid.mMaterials.find(submesh.mMaterial); - const Collada::SemanticMappingTable* table = nullptr; + const Collada::SemanticMappingTable *table = nullptr; if (meshMatIt != mid.mMaterials.end()) { table = &meshMatIt->second; meshMaterial = table->mMatName; - } - else { + } else { ASSIMP_LOG_WARN_F("Collada: No material specified for subgroup <", submesh.mMaterial, "> in geometry <", - mid.mMeshOrController, ">."); + mid.mMeshOrController, ">."); if (!mid.mMaterials.empty()) { meshMaterial = mid.mMaterials.begin()->second.mMatName; } @@ -533,7 +526,7 @@ void ColladaLoader::BuildMeshesForNode(const ColladaParser& pParser, const Colla } if (table && !table->mMap.empty()) { - std::pair& mat = newMats[matIdx]; + std::pair &mat = newMats[matIdx]; // Iterate through all texture channels assigned to the effect and // check whether we have mapping information for it. @@ -552,16 +545,16 @@ void ColladaLoader::BuildMeshesForNode(const ColladaParser& pParser, const Colla std::map::const_iterator dstMeshIt = mMeshIndexByID.find(index); if (dstMeshIt != mMeshIndexByID.end()) { newMeshRefs.push_back(dstMeshIt->second); - } - else { + } else { // else we have to add the mesh to the collection and store its newly assigned index at the node - aiMesh* dstMesh = CreateMesh(pParser, srcMesh, submesh, srcController, vertexStart, faceStart); + aiMesh *dstMesh = CreateMesh(pParser, srcMesh, submesh, srcController, vertexStart, faceStart); // store the mesh, and store its new index in the node newMeshRefs.push_back(mMeshes.size()); mMeshIndexByID[index] = mMeshes.size(); mMeshes.push_back(dstMesh); - vertexStart += dstMesh->mNumVertices; faceStart += submesh.mNumFaces; + vertexStart += dstMesh->mNumVertices; + faceStart += submesh.mNumFaces; // assign the material index dstMesh->mMaterialIndex = matIdx; @@ -576,7 +569,7 @@ void ColladaLoader::BuildMeshesForNode(const ColladaParser& pParser, const Colla pTarget->mNumMeshes = static_cast(newMeshRefs.size()); if (newMeshRefs.size()) { struct UIntTypeConverter { - unsigned int operator()(const size_t& v) const { + unsigned int operator()(const size_t &v) const { return static_cast(v); } }; @@ -588,7 +581,7 @@ void ColladaLoader::BuildMeshesForNode(const ColladaParser& pParser, const Colla // ------------------------------------------------------------------------------------------------ // Find mesh from either meshes or morph target meshes -aiMesh *ColladaLoader::findMesh(const std::string& meshid) { +aiMesh *ColladaLoader::findMesh(const std::string &meshid) { for (unsigned int i = 0; i < mMeshes.size(); ++i) { if (std::string(mMeshes[i]->mName.data) == meshid) { return mMeshes[i]; @@ -606,43 +599,39 @@ aiMesh *ColladaLoader::findMesh(const std::string& meshid) { // ------------------------------------------------------------------------------------------------ // Creates a mesh for the given ColladaMesh face subset and returns the newly created mesh -aiMesh* ColladaLoader::CreateMesh(const ColladaParser& pParser, const Collada::Mesh* pSrcMesh, const Collada::SubMesh& pSubMesh, - const Collada::Controller* pSrcController, size_t pStartVertex, size_t pStartFace) { +aiMesh *ColladaLoader::CreateMesh(const ColladaParser &pParser, const Collada::Mesh *pSrcMesh, const Collada::SubMesh &pSubMesh, + const Collada::Controller *pSrcController, size_t pStartVertex, size_t pStartFace) { std::unique_ptr dstMesh(new aiMesh); dstMesh->mName = pSrcMesh->mName; // count the vertices addressed by its faces const size_t numVertices = std::accumulate(pSrcMesh->mFaceSize.begin() + pStartFace, - pSrcMesh->mFaceSize.begin() + pStartFace + pSubMesh.mNumFaces, size_t(0)); + pSrcMesh->mFaceSize.begin() + pStartFace + pSubMesh.mNumFaces, size_t(0)); // copy positions dstMesh->mNumVertices = static_cast(numVertices); dstMesh->mVertices = new aiVector3D[numVertices]; - std::copy(pSrcMesh->mPositions.begin() + pStartVertex, pSrcMesh->mPositions.begin() + - pStartVertex + numVertices, dstMesh->mVertices); + std::copy(pSrcMesh->mPositions.begin() + pStartVertex, pSrcMesh->mPositions.begin() + pStartVertex + numVertices, dstMesh->mVertices); // normals, if given. HACK: (thom) Due to the glorious Collada spec we never // know if we have the same number of normals as there are positions. So we // also ignore any vertex attribute if it has a different count if (pSrcMesh->mNormals.size() >= pStartVertex + numVertices) { dstMesh->mNormals = new aiVector3D[numVertices]; - std::copy(pSrcMesh->mNormals.begin() + pStartVertex, pSrcMesh->mNormals.begin() + - pStartVertex + numVertices, dstMesh->mNormals); + std::copy(pSrcMesh->mNormals.begin() + pStartVertex, pSrcMesh->mNormals.begin() + pStartVertex + numVertices, dstMesh->mNormals); } // tangents, if given. if (pSrcMesh->mTangents.size() >= pStartVertex + numVertices) { dstMesh->mTangents = new aiVector3D[numVertices]; - std::copy(pSrcMesh->mTangents.begin() + pStartVertex, pSrcMesh->mTangents.begin() + - pStartVertex + numVertices, dstMesh->mTangents); + std::copy(pSrcMesh->mTangents.begin() + pStartVertex, pSrcMesh->mTangents.begin() + pStartVertex + numVertices, dstMesh->mTangents); } // bitangents, if given. if (pSrcMesh->mBitangents.size() >= pStartVertex + numVertices) { dstMesh->mBitangents = new aiVector3D[numVertices]; - std::copy(pSrcMesh->mBitangents.begin() + pStartVertex, pSrcMesh->mBitangents.begin() + - pStartVertex + numVertices, dstMesh->mBitangents); + std::copy(pSrcMesh->mBitangents.begin() + pStartVertex, pSrcMesh->mBitangents.begin() + pStartVertex + numVertices, dstMesh->mBitangents); } // same for texturecoords, as many as we have @@ -674,7 +663,7 @@ aiMesh* ColladaLoader::CreateMesh(const ColladaParser& pParser, const Collada::M dstMesh->mFaces = new aiFace[dstMesh->mNumFaces]; for (size_t a = 0; a < dstMesh->mNumFaces; ++a) { size_t s = pSrcMesh->mFaceSize[pStartFace + a]; - aiFace& face = dstMesh->mFaces[a]; + aiFace &face = dstMesh->mFaces[a]; face.mNumIndices = static_cast(s); face.mIndices = new unsigned int[s]; for (size_t b = 0; b < s; ++b) { @@ -683,20 +672,20 @@ aiMesh* ColladaLoader::CreateMesh(const ColladaParser& pParser, const Collada::M } // create morph target meshes if any - std::vector targetMeshes; + std::vector targetMeshes; std::vector targetWeights; Collada::MorphMethod method = Collada::Normalized; for (std::map::const_iterator it = pParser.mControllerLibrary.begin(); - it != pParser.mControllerLibrary.end(); ++it) { + it != pParser.mControllerLibrary.end(); ++it) { const Collada::Controller &c = it->second; - const Collada::Mesh* baseMesh = pParser.ResolveLibraryReference(pParser.mMeshLibrary, c.mMeshId); + const Collada::Mesh *baseMesh = pParser.ResolveLibraryReference(pParser.mMeshLibrary, c.mMeshId); if (c.mType == Collada::Morph && baseMesh->mName == pSrcMesh->mName) { - const Collada::Accessor& targetAccessor = pParser.ResolveLibraryReference(pParser.mAccessorLibrary, c.mMorphTarget); - const Collada::Accessor& weightAccessor = pParser.ResolveLibraryReference(pParser.mAccessorLibrary, c.mMorphWeight); - const Collada::Data& targetData = pParser.ResolveLibraryReference(pParser.mDataLibrary, targetAccessor.mSource); - const Collada::Data& weightData = pParser.ResolveLibraryReference(pParser.mDataLibrary, weightAccessor.mSource); + const Collada::Accessor &targetAccessor = pParser.ResolveLibraryReference(pParser.mAccessorLibrary, c.mMorphTarget); + const Collada::Accessor &weightAccessor = pParser.ResolveLibraryReference(pParser.mAccessorLibrary, c.mMorphWeight); + const Collada::Data &targetData = pParser.ResolveLibraryReference(pParser.mDataLibrary, targetAccessor.mSource); + const Collada::Data &weightData = pParser.ResolveLibraryReference(pParser.mDataLibrary, weightAccessor.mSource); // take method method = c.mMethod; @@ -709,7 +698,7 @@ aiMesh* ColladaLoader::CreateMesh(const ColladaParser& pParser, const Collada::M } for (unsigned int i = 0; i < targetData.mStrings.size(); ++i) { - const Collada::Mesh* targetMesh = pParser.ResolveLibraryReference(pParser.mMeshLibrary, targetData.mStrings.at(i)); + const Collada::Mesh *targetMesh = pParser.ResolveLibraryReference(pParser.mMeshLibrary, targetData.mStrings.at(i)); aiMesh *aimesh = findMesh(targetMesh->mName); if (!aimesh) { @@ -727,19 +716,17 @@ aiMesh* ColladaLoader::CreateMesh(const ColladaParser& pParser, const Collada::M } } if (targetMeshes.size() > 0 && targetWeights.size() == targetMeshes.size()) { - std::vector animMeshes; + std::vector animMeshes; for (unsigned int i = 0; i < targetMeshes.size(); ++i) { - aiMesh* targetMesh = targetMeshes.at(i); + aiMesh *targetMesh = targetMeshes.at(i); aiAnimMesh *animMesh = aiCreateAnimMesh(targetMesh); float weight = targetWeights[i]; animMesh->mWeight = weight == 0 ? 1.0f : weight; animMesh->mName = targetMesh->mName; animMeshes.push_back(animMesh); } - dstMesh->mMethod = (method == Collada::Relative) - ? aiMorphingMethod_MORPH_RELATIVE - : aiMorphingMethod_MORPH_NORMALIZED; - dstMesh->mAnimMeshes = new aiAnimMesh*[animMeshes.size()]; + dstMesh->mMethod = (method == Collada::Relative) ? aiMorphingMethod_MORPH_RELATIVE : aiMorphingMethod_MORPH_NORMALIZED; + dstMesh->mAnimMeshes = new aiAnimMesh *[animMeshes.size()]; dstMesh->mNumAnimMeshes = static_cast(animMeshes.size()); for (unsigned int i = 0; i < animMeshes.size(); ++i) { dstMesh->mAnimMeshes[i] = animMeshes.at(i); @@ -749,18 +736,18 @@ aiMesh* ColladaLoader::CreateMesh(const ColladaParser& pParser, const Collada::M // create bones if given if (pSrcController && pSrcController->mType == Collada::Skin) { // resolve references - joint names - const Collada::Accessor& jointNamesAcc = pParser.ResolveLibraryReference(pParser.mAccessorLibrary, pSrcController->mJointNameSource); - const Collada::Data& jointNames = pParser.ResolveLibraryReference(pParser.mDataLibrary, jointNamesAcc.mSource); + const Collada::Accessor &jointNamesAcc = pParser.ResolveLibraryReference(pParser.mAccessorLibrary, pSrcController->mJointNameSource); + const Collada::Data &jointNames = pParser.ResolveLibraryReference(pParser.mDataLibrary, jointNamesAcc.mSource); // joint offset matrices - const Collada::Accessor& jointMatrixAcc = pParser.ResolveLibraryReference(pParser.mAccessorLibrary, pSrcController->mJointOffsetMatrixSource); - const Collada::Data& jointMatrices = pParser.ResolveLibraryReference(pParser.mDataLibrary, jointMatrixAcc.mSource); + const Collada::Accessor &jointMatrixAcc = pParser.ResolveLibraryReference(pParser.mAccessorLibrary, pSrcController->mJointOffsetMatrixSource); + const Collada::Data &jointMatrices = pParser.ResolveLibraryReference(pParser.mDataLibrary, jointMatrixAcc.mSource); // joint vertex_weight name list - should refer to the same list as the joint names above. If not, report and reconsider - const Collada::Accessor& weightNamesAcc = pParser.ResolveLibraryReference(pParser.mAccessorLibrary, pSrcController->mWeightInputJoints.mAccessor); + const Collada::Accessor &weightNamesAcc = pParser.ResolveLibraryReference(pParser.mAccessorLibrary, pSrcController->mWeightInputJoints.mAccessor); if (&weightNamesAcc != &jointNamesAcc) throw DeadlyImportError("Temporary implementational laziness. If you read this, please report to the author."); // vertex weights - const Collada::Accessor& weightsAcc = pParser.ResolveLibraryReference(pParser.mAccessorLibrary, pSrcController->mWeightInputWeights.mAccessor); - const Collada::Data& weights = pParser.ResolveLibraryReference(pParser.mDataLibrary, weightsAcc.mSource); + const Collada::Accessor &weightsAcc = pParser.ResolveLibraryReference(pParser.mAccessorLibrary, pSrcController->mWeightInputWeights.mAccessor); + const Collada::Data &weights = pParser.ResolveLibraryReference(pParser.mDataLibrary, weightsAcc.mSource); if (!jointNames.mIsStringArray || jointMatrices.mIsStringArray || weights.mIsStringArray) throw DeadlyImportError("Data type mismatch while resolving mesh joints"); @@ -770,10 +757,10 @@ aiMesh* ColladaLoader::CreateMesh(const ColladaParser& pParser, const Collada::M // create containers to collect the weights for each bone size_t numBones = jointNames.mStrings.size(); - std::vector > dstBones(numBones); + std::vector> dstBones(numBones); // build a temporary array of pointers to the start of each vertex's weights - typedef std::vector< std::pair > IndexPairVector; + typedef std::vector> IndexPairVector; std::vector weightStartPerVertex; weightStartPerVertex.resize(pSrcController->mWeightCounts.size(), pSrcController->mWeights.end()); @@ -792,18 +779,16 @@ aiMesh* ColladaLoader::CreateMesh(const ColladaParser& pParser, const Collada::M IndexPairVector::const_iterator iit = weightStartPerVertex[orgIndex]; size_t pairCount = pSrcController->mWeightCounts[orgIndex]; - - for( size_t b = 0; b < pairCount; ++b, ++iit) { + for (size_t b = 0; b < pairCount; ++b, ++iit) { const size_t jointIndex = iit->first; - const size_t vertexIndex = iit->second; + const size_t vertexIndex = iit->second; ai_real weight = 1.0f; if (!weights.mValues.empty()) { weight = ReadFloat(weightsAcc, weights, vertexIndex, 0); } // one day I gonna kill that XSI Collada exporter - if (weight > 0.0f) - { + if (weight > 0.0f) { aiVertexWeight w; w.mVertexId = static_cast(a - pStartVertex); w.mWeight = weight; @@ -814,24 +799,24 @@ aiMesh* ColladaLoader::CreateMesh(const ColladaParser& pParser, const Collada::M // count the number of bones which influence vertices of the current submesh size_t numRemainingBones = 0; - for( std::vector >::const_iterator it = dstBones.begin(); it != dstBones.end(); ++it) { - if( it->size() > 0) { + for (std::vector>::const_iterator it = dstBones.begin(); it != dstBones.end(); ++it) { + if (it->size() > 0) { ++numRemainingBones; } } // create bone array and copy bone weights one by one dstMesh->mNumBones = static_cast(numRemainingBones); - dstMesh->mBones = new aiBone*[numRemainingBones]; + dstMesh->mBones = new aiBone *[numRemainingBones]; size_t boneCount = 0; - for( size_t a = 0; a < numBones; ++a) { + for (size_t a = 0; a < numBones; ++a) { // omit bones without weights - if( dstBones[a].empty() ) { + if (dstBones[a].empty()) { continue; } // create bone with its weights - aiBone* bone = new aiBone; + aiBone *bone = new aiBone; bone->mName = ReadString(jointNamesAcc, jointNames, a); bone->mOffsetMatrix.a1 = ReadFloat(jointMatrixAcc, jointMatrices, a, 0); bone->mOffsetMatrix.a2 = ReadFloat(jointMatrixAcc, jointMatrices, a, 1); @@ -873,16 +858,16 @@ aiMesh* ColladaLoader::CreateMesh(const ColladaParser& pParser, const Collada::M // Therefore I added a little name replacement here: I search for the bone's node by either name, ID or SID, // and replace the bone's name by the node's name so that the user can use the standard // find-by-name method to associate nodes with bones. - const Collada::Node* bnode = FindNode( pParser.mRootNode, bone->mName.data); - if( !bnode) { - bnode = FindNodeBySID( pParser.mRootNode, bone->mName.data); + const Collada::Node *bnode = FindNode(pParser.mRootNode, bone->mName.data); + if (!bnode) { + bnode = FindNodeBySID(pParser.mRootNode, bone->mName.data); } // assign the name that we would have assigned for the source node - if( bnode) { - bone->mName.Set( FindNameForNode( bnode)); + if (bnode) { + bone->mName.Set(FindNameForNode(bnode)); } else { - ASSIMP_LOG_WARN_F( "ColladaLoader::CreateMesh(): could not find corresponding node for joint \"", bone->mName.data, "\"." ); + ASSIMP_LOG_WARN_F("ColladaLoader::CreateMesh(): could not find corresponding node for joint \"", bone->mName.data, "\"."); } // and insert bone @@ -895,61 +880,61 @@ aiMesh* ColladaLoader::CreateMesh(const ColladaParser& pParser, const Collada::M // ------------------------------------------------------------------------------------------------ // Stores all meshes in the given scene -void ColladaLoader::StoreSceneMeshes( aiScene* pScene) { +void ColladaLoader::StoreSceneMeshes(aiScene *pScene) { pScene->mNumMeshes = static_cast(mMeshes.size()); - if( mMeshes.empty() ) { + if (mMeshes.empty()) { return; } - pScene->mMeshes = new aiMesh*[mMeshes.size()]; - std::copy( mMeshes.begin(), mMeshes.end(), pScene->mMeshes); + pScene->mMeshes = new aiMesh *[mMeshes.size()]; + std::copy(mMeshes.begin(), mMeshes.end(), pScene->mMeshes); mMeshes.clear(); } // ------------------------------------------------------------------------------------------------ // Stores all cameras in the given scene -void ColladaLoader::StoreSceneCameras( aiScene* pScene) { +void ColladaLoader::StoreSceneCameras(aiScene *pScene) { pScene->mNumCameras = static_cast(mCameras.size()); - if( mCameras.empty() ) { + if (mCameras.empty()) { return; } - pScene->mCameras = new aiCamera*[mCameras.size()]; - std::copy( mCameras.begin(), mCameras.end(), pScene->mCameras); + pScene->mCameras = new aiCamera *[mCameras.size()]; + std::copy(mCameras.begin(), mCameras.end(), pScene->mCameras); mCameras.clear(); } // ------------------------------------------------------------------------------------------------ // Stores all lights in the given scene -void ColladaLoader::StoreSceneLights( aiScene* pScene) { +void ColladaLoader::StoreSceneLights(aiScene *pScene) { pScene->mNumLights = static_cast(mLights.size()); - if( mLights.empty() ) { + if (mLights.empty()) { return; } - pScene->mLights = new aiLight*[mLights.size()]; - std::copy( mLights.begin(), mLights.end(), pScene->mLights); + pScene->mLights = new aiLight *[mLights.size()]; + std::copy(mLights.begin(), mLights.end(), pScene->mLights); mLights.clear(); } // ------------------------------------------------------------------------------------------------ // Stores all textures in the given scene -void ColladaLoader::StoreSceneTextures( aiScene* pScene) { +void ColladaLoader::StoreSceneTextures(aiScene *pScene) { pScene->mNumTextures = static_cast(mTextures.size()); - if( mTextures.empty() ) { + if (mTextures.empty()) { return; } - pScene->mTextures = new aiTexture*[mTextures.size()]; - std::copy( mTextures.begin(), mTextures.end(), pScene->mTextures); + pScene->mTextures = new aiTexture *[mTextures.size()]; + std::copy(mTextures.begin(), mTextures.end(), pScene->mTextures); mTextures.clear(); } // ------------------------------------------------------------------------------------------------ // Stores all materials in the given scene -void ColladaLoader::StoreSceneMaterials( aiScene* pScene) { +void ColladaLoader::StoreSceneMaterials(aiScene *pScene) { pScene->mNumMaterials = static_cast(newMats.size()); - if (newMats.empty() ) { + if (newMats.empty()) { return; } - pScene->mMaterials = new aiMaterial*[newMats.size()]; - for (unsigned int i = 0; i < newMats.size();++i) { + pScene->mMaterials = new aiMaterial *[newMats.size()]; + for (unsigned int i = 0; i < newMats.size(); ++i) { pScene->mMaterials[i] = newMats[i].second; } newMats.clear(); @@ -957,53 +942,51 @@ void ColladaLoader::StoreSceneMaterials( aiScene* pScene) { // ------------------------------------------------------------------------------------------------ // Stores all animations -void ColladaLoader::StoreAnimations( aiScene* pScene, const ColladaParser& pParser) { +void ColladaLoader::StoreAnimations(aiScene *pScene, const ColladaParser &pParser) { // recursively collect all animations from the collada scene StoreAnimations(pScene, pParser, &pParser.mAnims, ""); // catch special case: many animations with the same length, each affecting only a single node. // we need to unite all those single-node-anims to a proper combined animation - for(size_t a = 0; a < mAnims.size(); ++a) { - aiAnimation* templateAnim = mAnims[a]; + for (size_t a = 0; a < mAnims.size(); ++a) { + aiAnimation *templateAnim = mAnims[a]; if (templateAnim->mNumChannels == 1) { // search for other single-channel-anims with the same duration std::vector collectedAnimIndices; - for( size_t b = a+1; b < mAnims.size(); ++b) { - aiAnimation* other = mAnims[b]; + for (size_t b = a + 1; b < mAnims.size(); ++b) { + aiAnimation *other = mAnims[b]; if (other->mNumChannels == 1 && other->mDuration == templateAnim->mDuration && - other->mTicksPerSecond == templateAnim->mTicksPerSecond) - collectedAnimIndices.push_back(b); + other->mTicksPerSecond == templateAnim->mTicksPerSecond) + collectedAnimIndices.push_back(b); } - // We only want to combine the animations if they have different channels - std::set animTargets; - animTargets.insert(templateAnim->mChannels[0]->mNodeName.C_Str()); - bool collectedAnimationsHaveDifferentChannels = true; - for (size_t b = 0; b < collectedAnimIndices.size(); ++b) - { - aiAnimation* srcAnimation = mAnims[collectedAnimIndices[b]]; - std::string channelName = std::string(srcAnimation->mChannels[0]->mNodeName.C_Str()); - if (animTargets.find(channelName) == animTargets.end()) { - animTargets.insert(channelName); - } else { - collectedAnimationsHaveDifferentChannels = false; - break; - } - } + // We only want to combine the animations if they have different channels + std::set animTargets; + animTargets.insert(templateAnim->mChannels[0]->mNodeName.C_Str()); + bool collectedAnimationsHaveDifferentChannels = true; + for (size_t b = 0; b < collectedAnimIndices.size(); ++b) { + aiAnimation *srcAnimation = mAnims[collectedAnimIndices[b]]; + std::string channelName = std::string(srcAnimation->mChannels[0]->mNodeName.C_Str()); + if (animTargets.find(channelName) == animTargets.end()) { + animTargets.insert(channelName); + } else { + collectedAnimationsHaveDifferentChannels = false; + break; + } + } - if (!collectedAnimationsHaveDifferentChannels) - continue; + if (!collectedAnimationsHaveDifferentChannels) + continue; // if there are other animations which fit the template anim, combine all channels into a single anim - if (!collectedAnimIndices.empty()) - { - aiAnimation* combinedAnim = new aiAnimation(); + if (!collectedAnimIndices.empty()) { + aiAnimation *combinedAnim = new aiAnimation(); combinedAnim->mName = aiString(std::string("combinedAnim_") + char('0' + a)); combinedAnim->mDuration = templateAnim->mDuration; combinedAnim->mTicksPerSecond = templateAnim->mTicksPerSecond; combinedAnim->mNumChannels = static_cast(collectedAnimIndices.size() + 1); - combinedAnim->mChannels = new aiNodeAnim*[combinedAnim->mNumChannels]; + combinedAnim->mChannels = new aiNodeAnim *[combinedAnim->mNumChannels]; // add the template anim as first channel by moving its aiNodeAnim to the combined animation combinedAnim->mChannels[0] = templateAnim->mChannels[0]; templateAnim->mChannels[0] = NULL; @@ -1012,9 +995,8 @@ void ColladaLoader::StoreAnimations( aiScene* pScene, const ColladaParser& pPars mAnims[a] = combinedAnim; // move the memory of all other anims to the combined anim and erase them from the source anims - for (size_t b = 0; b < collectedAnimIndices.size(); ++b) - { - aiAnimation* srcAnimation = mAnims[collectedAnimIndices[b]]; + for (size_t b = 0; b < collectedAnimIndices.size(); ++b) { + aiAnimation *srcAnimation = mAnims[collectedAnimIndices[b]]; combinedAnim->mChannels[1 + b] = srcAnimation->mChannels[0]; srcAnimation->mChannels[0] = NULL; delete srcAnimation; @@ -1022,8 +1004,7 @@ void ColladaLoader::StoreAnimations( aiScene* pScene, const ColladaParser& pPars // in a second go, delete all the single-channel-anims that we've stripped from their channels // back to front to preserve indices - you know, removing an element from a vector moves all elements behind the removed one - while (!collectedAnimIndices.empty()) - { + while (!collectedAnimIndices.empty()) { mAnims.erase(mAnims.begin() + collectedAnimIndices.back()); collectedAnimIndices.pop_back(); } @@ -1032,10 +1013,9 @@ void ColladaLoader::StoreAnimations( aiScene* pScene, const ColladaParser& pPars } // now store all anims in the scene - if (!mAnims.empty()) - { + if (!mAnims.empty()) { pScene->mNumAnimations = static_cast(mAnims.size()); - pScene->mAnimations = new aiAnimation*[mAnims.size()]; + pScene->mAnimations = new aiAnimation *[mAnims.size()]; std::copy(mAnims.begin(), mAnims.end(), pScene->mAnimations); } @@ -1044,12 +1024,11 @@ void ColladaLoader::StoreAnimations( aiScene* pScene, const ColladaParser& pPars // ------------------------------------------------------------------------------------------------ // Constructs the animations for the given source anim -void ColladaLoader::StoreAnimations(aiScene* pScene, const ColladaParser& pParser, const Collada::Animation* pSrcAnim, const std::string &pPrefix) -{ +void ColladaLoader::StoreAnimations(aiScene *pScene, const ColladaParser &pParser, const Collada::Animation *pSrcAnim, const std::string &pPrefix) { std::string animName = pPrefix.empty() ? pSrcAnim->mName : pPrefix + "_" + pSrcAnim->mName; // create nested animations, if given - for (std::vector::const_iterator it = pSrcAnim->mSubAnims.begin(); it != pSrcAnim->mSubAnims.end(); ++it) + for (std::vector::const_iterator it = pSrcAnim->mSubAnims.begin(); it != pSrcAnim->mSubAnims.end(); ++it) StoreAnimations(pScene, pParser, *it, animName); // create animation channels, if any @@ -1057,47 +1036,38 @@ void ColladaLoader::StoreAnimations(aiScene* pScene, const ColladaParser& pParse CreateAnimation(pScene, pParser, pSrcAnim, animName); } -struct MorphTimeValues -{ +struct MorphTimeValues { float mTime; - struct key - { + struct key { float mWeight; unsigned int mValue; }; std::vector mKeys; }; -void insertMorphTimeValue(std::vector &values, float time, float weight, unsigned int value) -{ +void insertMorphTimeValue(std::vector &values, float time, float weight, unsigned int value) { MorphTimeValues::key k; k.mValue = value; k.mWeight = weight; - if (values.size() == 0 || time < values[0].mTime) - { + if (values.size() == 0 || time < values[0].mTime) { MorphTimeValues val; val.mTime = time; val.mKeys.push_back(k); values.insert(values.begin(), val); return; } - if (time > values.back().mTime) - { + if (time > values.back().mTime) { MorphTimeValues val; val.mTime = time; val.mKeys.push_back(k); values.insert(values.end(), val); return; } - for (unsigned int i = 0; i < values.size(); i++) - { - if (std::abs(time - values[i].mTime) < 1e-6f) - { + for (unsigned int i = 0; i < values.size(); i++) { + if (std::abs(time - values[i].mTime) < 1e-6f) { values[i].mKeys.push_back(k); return; - } - else if (time > values[i].mTime && time < values[i + 1].mTime) - { + } else if (time > values[i].mTime && time < values[i + 1].mTime) { MorphTimeValues val; val.mTime = time; val.mKeys.push_back(k); @@ -1108,10 +1078,8 @@ void insertMorphTimeValue(std::vector &values, float time, floa // should not get here } -float getWeightAtKey(const std::vector &values, int key, unsigned int value) -{ - for (unsigned int i = 0; i < values[key].mKeys.size(); i++) - { +float getWeightAtKey(const std::vector &values, int key, unsigned int value) { + for (unsigned int i = 0; i < values[key].mKeys.size(); i++) { if (values[key].mKeys[i].mValue == value) return values[key].mKeys[i].mWeight; } @@ -1122,23 +1090,21 @@ float getWeightAtKey(const std::vector &values, int key, unsign // ------------------------------------------------------------------------------------------------ // Constructs the animation for the given source anim -void ColladaLoader::CreateAnimation(aiScene* pScene, const ColladaParser& pParser, const Collada::Animation* pSrcAnim, const std::string& pName) -{ +void ColladaLoader::CreateAnimation(aiScene *pScene, const ColladaParser &pParser, const Collada::Animation *pSrcAnim, const std::string &pName) { // collect a list of animatable nodes - std::vector nodes; + std::vector nodes; CollectNodes(pScene->mRootNode, nodes); - std::vector anims; - std::vector morphAnims; + std::vector anims; + std::vector morphAnims; - for (std::vector::const_iterator nit = nodes.begin(); nit != nodes.end(); ++nit) - { + for (std::vector::const_iterator nit = nodes.begin(); nit != nodes.end(); ++nit) { // find all the collada anim channels which refer to the current node std::vector entries; std::string nodeName = (*nit)->mName.data; // find the collada node corresponding to the aiNode - const Collada::Node* srcNode = FindNode(pParser.mRootNode, nodeName); + const Collada::Node *srcNode = FindNode(pParser.mRootNode, nodeName); // ai_assert( srcNode != NULL); if (!srcNode) continue; @@ -1146,16 +1112,14 @@ void ColladaLoader::CreateAnimation(aiScene* pScene, const ColladaParser& pParse // now check all channels if they affect the current node std::string targetID, subElement; for (std::vector::const_iterator cit = pSrcAnim->mChannels.begin(); - cit != pSrcAnim->mChannels.end(); ++cit) - { - const Collada::AnimationChannel& srcChannel = *cit; + cit != pSrcAnim->mChannels.end(); ++cit) { + const Collada::AnimationChannel &srcChannel = *cit; Collada::ChannelEntry entry; // we expect the animation target to be of type "nodeName/transformID.subElement". Ignore all others // find the slash that separates the node name - there should be only one std::string::size_type slashPos = srcChannel.mTarget.find('/'); - if (slashPos == std::string::npos) - { + if (slashPos == std::string::npos) { std::string::size_type targetPos = srcChannel.mTarget.find(srcNode->mID); if (targetPos == std::string::npos) continue; @@ -1163,7 +1127,7 @@ void ColladaLoader::CreateAnimation(aiScene* pScene, const ColladaParser& pParse // not node transform, but something else. store as unknown animation channel for now entry.mChannel = &(*cit); entry.mTargetId = srcChannel.mTarget.substr(targetPos + pSrcAnim->mName.length(), - srcChannel.mTarget.length() - targetPos - pSrcAnim->mName.length()); + srcChannel.mTarget.length() - targetPos - pSrcAnim->mName.length()); if (entry.mTargetId.front() == '-') entry.mTargetId = entry.mTargetId.substr(1); entries.push_back(entry); @@ -1179,8 +1143,7 @@ void ColladaLoader::CreateAnimation(aiScene* pScene, const ColladaParser& pParse // find the dot that separates the transformID - there should be only one or zero std::string::size_type dotPos = srcChannel.mTarget.find('.'); - if (dotPos != std::string::npos) - { + if (dotPos != std::string::npos) { if (srcChannel.mTarget.find('.', dotPos + 1) != std::string::npos) continue; @@ -1198,15 +1161,13 @@ void ColladaLoader::CreateAnimation(aiScene* pScene, const ColladaParser& pParse entry.mSubElement = 2; else ASSIMP_LOG_WARN_F("Unknown anim subelement <", subElement, ">. Ignoring"); - } - else { + } else { // no subelement following, transformId is remaining string entry.mTransformId = srcChannel.mTarget.substr(slashPos + 1); } std::string::size_type bracketPos = srcChannel.mTarget.find('('); - if (bracketPos != std::string::npos) - { + if (bracketPos != std::string::npos) { entry.mTransformId = srcChannel.mTarget.substr(slashPos + 1, bracketPos - slashPos - 1); subElement.clear(); subElement = srcChannel.mTarget.substr(bracketPos); @@ -1251,14 +1212,11 @@ void ColladaLoader::CreateAnimation(aiScene* pScene, const ColladaParser& pParse if (srcNode->mTransforms[a].mID == entry.mTransformId) entry.mTransformIndex = a; - if (entry.mTransformIndex == SIZE_MAX) - { - if (entry.mTransformId.find("morph-weights") != std::string::npos) - { + if (entry.mTransformIndex == SIZE_MAX) { + if (entry.mTransformId.find("morph-weights") != std::string::npos) { entry.mTargetId = entry.mTransformId; entry.mTransformId = ""; - } - else + } else continue; } @@ -1272,9 +1230,8 @@ void ColladaLoader::CreateAnimation(aiScene* pScene, const ColladaParser& pParse // resolve the data pointers for all anim channels. Find the minimum time while we're at it ai_real startTime = ai_real(1e20), endTime = ai_real(-1e20); - for (std::vector::iterator it = entries.begin(); it != entries.end(); ++it) - { - Collada::ChannelEntry& e = *it; + for (std::vector::iterator it = entries.begin(); it != entries.end(); ++it) { + Collada::ChannelEntry &e = *it; e.mTimeAccessor = &pParser.ResolveLibraryReference(pParser.mAccessorLibrary, e.mChannel->mSourceTimes); e.mTimeData = &pParser.ResolveLibraryReference(pParser.mDataLibrary, e.mTimeAccessor->mSource); e.mValueAccessor = &pParser.ResolveLibraryReference(pParser.mAccessorLibrary, e.mChannel->mSourceValues); @@ -1284,8 +1241,7 @@ void ColladaLoader::CreateAnimation(aiScene* pScene, const ColladaParser& pParse if (e.mTimeAccessor->mCount != e.mValueAccessor->mCount) throw DeadlyImportError(format() << "Time count / value count mismatch in animation channel \"" << e.mChannel->mTarget << "\"."); - if (e.mTimeAccessor->mCount > 0) - { + if (e.mTimeAccessor->mCount > 0) { // find bounding times startTime = std::min(startTime, ReadFloat(*e.mTimeAccessor, *e.mTimeData, 0, 0)); endTime = std::max(endTime, ReadFloat(*e.mTimeAccessor, *e.mTimeData, e.mTimeAccessor->mCount - 1, 0)); @@ -1293,25 +1249,21 @@ void ColladaLoader::CreateAnimation(aiScene* pScene, const ColladaParser& pParse } std::vector resultTrafos; - if (!entries.empty() && entries.front().mTimeAccessor->mCount > 0) - { + if (!entries.empty() && entries.front().mTimeAccessor->mCount > 0) { // create a local transformation chain of the node's transforms std::vector transforms = srcNode->mTransforms; // now for every unique point in time, find or interpolate the key values for that time // and apply them to the transform chain. Then the node's present transformation can be calculated. ai_real time = startTime; - while (1) - { - for (std::vector::iterator it = entries.begin(); it != entries.end(); ++it) - { - Collada::ChannelEntry& e = *it; + while (1) { + for (std::vector::iterator it = entries.begin(); it != entries.end(); ++it) { + Collada::ChannelEntry &e = *it; // find the keyframe behind the current point in time size_t pos = 0; ai_real postTime = 0.0; - while (1) - { + while (1) { if (pos >= e.mTimeAccessor->mCount) break; postTime = ReadFloat(*e.mTimeAccessor, *e.mTimeData, pos, 0); @@ -1328,13 +1280,11 @@ void ColladaLoader::CreateAnimation(aiScene* pScene, const ColladaParser& pParse temp[c] = ReadFloat(*e.mValueAccessor, *e.mValueData, pos, c); // if not exactly at the key time, interpolate with previous value set - if (postTime > time && pos > 0) - { + if (postTime > time && pos > 0) { ai_real preTime = ReadFloat(*e.mTimeAccessor, *e.mTimeData, pos - 1, 0); ai_real factor = (time - postTime) / (preTime - postTime); - for (size_t c = 0; c < e.mValueAccessor->mSize; ++c) - { + for (size_t c = 0; c < e.mValueAccessor->mSize; ++c) { ai_real v = ReadFloat(*e.mValueAccessor, *e.mValueData, pos - 1, c); temp[c] += (v - temp[c]) * factor; } @@ -1353,17 +1303,14 @@ void ColladaLoader::CreateAnimation(aiScene* pScene, const ColladaParser& pParse // find next point in time to evaluate. That's the closest frame larger than the current in any channel ai_real nextTime = ai_real(1e20); - for (std::vector::iterator it = entries.begin(); it != entries.end(); ++it) - { - Collada::ChannelEntry& channelElement = *it; + for (std::vector::iterator it = entries.begin(); it != entries.end(); ++it) { + Collada::ChannelEntry &channelElement = *it; // find the next time value larger than the current size_t pos = 0; - while (pos < channelElement.mTimeAccessor->mCount) - { + while (pos < channelElement.mTimeAccessor->mCount) { const ai_real t = ReadFloat(*channelElement.mTimeAccessor, *channelElement.mTimeData, pos, 0); - if (t > time) - { + if (t > time) { nextTime = std::min(nextTime, t); break; } @@ -1400,12 +1347,11 @@ void ColladaLoader::CreateAnimation(aiScene* pScene, const ColladaParser& pParse } // there should be some keyframes, but we aren't that fixated on valid input data -// ai_assert( resultTrafos.size() > 0); + // ai_assert( resultTrafos.size() > 0); // build an animation channel for the given node out of these trafo keys - if (!resultTrafos.empty()) - { - aiNodeAnim* dstAnim = new aiNodeAnim; + if (!resultTrafos.empty()) { + aiNodeAnim *dstAnim = new aiNodeAnim; dstAnim->mNodeName = nodeName; dstAnim->mNumPositionKeys = static_cast(resultTrafos.size()); dstAnim->mNumRotationKeys = static_cast(resultTrafos.size()); @@ -1414,8 +1360,7 @@ void ColladaLoader::CreateAnimation(aiScene* pScene, const ColladaParser& pParse dstAnim->mRotationKeys = new aiQuatKey[resultTrafos.size()]; dstAnim->mScalingKeys = new aiVectorKey[resultTrafos.size()]; - for (size_t a = 0; a < resultTrafos.size(); ++a) - { + for (size_t a = 0; a < resultTrafos.size(); ++a) { aiMatrix4x4 mat = resultTrafos[a]; double time = double(mat.d4); // remember? time is stored in mat.d4 mat.d4 = 1.0f; @@ -1427,18 +1372,14 @@ void ColladaLoader::CreateAnimation(aiScene* pScene, const ColladaParser& pParse } anims.push_back(dstAnim); - } - else - { + } else { ASSIMP_LOG_WARN("Collada loader: found empty animation channel, ignored. Please check your exporter."); } - if (!entries.empty() && entries.front().mTimeAccessor->mCount > 0) - { + if (!entries.empty() && entries.front().mTimeAccessor->mCount > 0) { std::vector morphChannels; - for (std::vector::iterator it = entries.begin(); it != entries.end(); ++it) - { - Collada::ChannelEntry& e = *it; + for (std::vector::iterator it = entries.begin(); it != entries.end(); ++it) { + Collada::ChannelEntry &e = *it; // skip non-transform types if (e.mTargetId.empty()) @@ -1447,8 +1388,7 @@ void ColladaLoader::CreateAnimation(aiScene* pScene, const ColladaParser& pParse if (e.mTargetId.find("morph-weights") != std::string::npos) morphChannels.push_back(e); } - if (morphChannels.size() > 0) - { + if (morphChannels.size() > 0) { // either 1) morph weight animation count should contain morph target count channels // or 2) one channel with morph target count arrays // assume first @@ -1459,9 +1399,8 @@ void ColladaLoader::CreateAnimation(aiScene* pScene, const ColladaParser& pParse std::vector morphTimeValues; int morphAnimChannelIndex = 0; - for (std::vector::iterator it = morphChannels.begin(); it != morphChannels.end(); ++it) - { - Collada::ChannelEntry& e = *it; + for (std::vector::iterator it = morphChannels.begin(); it != morphChannels.end(); ++it) { + Collada::ChannelEntry &e = *it; std::string::size_type apos = e.mTargetId.find('('); std::string::size_type bpos = e.mTargetId.find(')'); if (apos == std::string::npos || bpos == std::string::npos) @@ -1478,15 +1417,13 @@ void ColladaLoader::CreateAnimation(aiScene* pScene, const ColladaParser& pParse morphAnim->mNumKeys = static_cast(morphTimeValues.size()); morphAnim->mKeys = new aiMeshMorphKey[morphAnim->mNumKeys]; - for (unsigned int key = 0; key < morphAnim->mNumKeys; key++) - { + for (unsigned int key = 0; key < morphAnim->mNumKeys; key++) { morphAnim->mKeys[key].mNumValuesAndWeights = static_cast(morphChannels.size()); morphAnim->mKeys[key].mValues = new unsigned int[morphChannels.size()]; morphAnim->mKeys[key].mWeights = new double[morphChannels.size()]; morphAnim->mKeys[key].mTime = morphTimeValues[key].mTime; - for (unsigned int valueIndex = 0; valueIndex < morphChannels.size(); valueIndex++) - { + for (unsigned int valueIndex = 0; valueIndex < morphChannels.size(); valueIndex++) { morphAnim->mKeys[key].mValues[valueIndex] = valueIndex; morphAnim->mKeys[key].mWeights[valueIndex] = getWeightAtKey(morphTimeValues, key, valueIndex); } @@ -1497,31 +1434,26 @@ void ColladaLoader::CreateAnimation(aiScene* pScene, const ColladaParser& pParse } } - if (!anims.empty() || !morphAnims.empty()) - { - aiAnimation* anim = new aiAnimation; + if (!anims.empty() || !morphAnims.empty()) { + aiAnimation *anim = new aiAnimation; anim->mName.Set(pName); anim->mNumChannels = static_cast(anims.size()); - if (anim->mNumChannels > 0) - { - anim->mChannels = new aiNodeAnim*[anims.size()]; + if (anim->mNumChannels > 0) { + anim->mChannels = new aiNodeAnim *[anims.size()]; std::copy(anims.begin(), anims.end(), anim->mChannels); } anim->mNumMorphMeshChannels = static_cast(morphAnims.size()); - if (anim->mNumMorphMeshChannels > 0) - { - anim->mMorphMeshChannels = new aiMeshMorphAnim*[anim->mNumMorphMeshChannels]; + if (anim->mNumMorphMeshChannels > 0) { + anim->mMorphMeshChannels = new aiMeshMorphAnim *[anim->mNumMorphMeshChannels]; std::copy(morphAnims.begin(), morphAnims.end(), anim->mMorphMeshChannels); } anim->mDuration = 0.0f; - for (size_t a = 0; a < anims.size(); ++a) - { + for (size_t a = 0; a < anims.size(); ++a) { anim->mDuration = std::max(anim->mDuration, anims[a]->mPositionKeys[anims[a]->mNumPositionKeys - 1].mTime); anim->mDuration = std::max(anim->mDuration, anims[a]->mRotationKeys[anims[a]->mNumRotationKeys - 1].mTime); anim->mDuration = std::max(anim->mDuration, anims[a]->mScalingKeys[anims[a]->mNumScalingKeys - 1].mTime); } - for (size_t a = 0; a < morphAnims.size(); ++a) - { + for (size_t a = 0; a < morphAnims.size(); ++a) { anim->mDuration = std::max(anim->mDuration, morphAnims[a]->mKeys[morphAnims[a]->mNumKeys - 1].mTime); } anim->mTicksPerSecond = 1; @@ -1531,11 +1463,10 @@ void ColladaLoader::CreateAnimation(aiScene* pScene, const ColladaParser& pParse // ------------------------------------------------------------------------------------------------ // Add a texture to a material structure -void ColladaLoader::AddTexture(aiMaterial& mat, const ColladaParser& pParser, - const Collada::Effect& effect, - const Collada::Sampler& sampler, - aiTextureType type, unsigned int idx) -{ +void ColladaLoader::AddTexture(aiMaterial &mat, const ColladaParser &pParser, + const Collada::Effect &effect, + const Collada::Sampler &sampler, + aiTextureType type, unsigned int idx) { // first of all, basic file name const aiString name = FindFilenameForEffectTexture(pParser, effect, sampler.mName); mat.AddProperty(&name, _AI_MATKEY_TEXTURE_BASE, type, idx); @@ -1559,15 +1490,15 @@ void ColladaLoader::AddTexture(aiMaterial& mat, const ColladaParser& pParser, // UV transformation mat.AddProperty(&sampler.mTransform, 1, - _AI_MATKEY_UVTRANSFORM_BASE, type, idx); + _AI_MATKEY_UVTRANSFORM_BASE, type, idx); // Blend mode - mat.AddProperty((int*)&sampler.mOp, 1, - _AI_MATKEY_TEXBLEND_BASE, type, idx); + mat.AddProperty((int *)&sampler.mOp, 1, + _AI_MATKEY_TEXBLEND_BASE, type, idx); // Blend factor - mat.AddProperty((ai_real*)&sampler.mWeighting, 1, - _AI_MATKEY_TEXBLEND_BASE, type, idx); + mat.AddProperty((ai_real *)&sampler.mWeighting, 1, + _AI_MATKEY_TEXBLEND_BASE, type, idx); // UV source index ... if we didn't resolve the mapping, it is actually just // a guess but it works in most cases. We search for the frst occurrence of a @@ -1594,20 +1525,17 @@ void ColladaLoader::AddTexture(aiMaterial& mat, const ColladaParser& pParser, // ------------------------------------------------------------------------------------------------ // Fills materials from the collada material definitions -void ColladaLoader::FillMaterials(const ColladaParser& pParser, aiScene* /*pScene*/) -{ - for (auto &elem : newMats) - { - aiMaterial& mat = (aiMaterial&)*elem.second; - Collada::Effect& effect = *elem.first; +void ColladaLoader::FillMaterials(const ColladaParser &pParser, aiScene * /*pScene*/) { + for (auto &elem : newMats) { + aiMaterial &mat = (aiMaterial &)*elem.second; + Collada::Effect &effect = *elem.first; // resolve shading mode int shadeMode; if (effect.mFaceted) /* fixme */ shadeMode = aiShadingMode_Flat; else { - switch (effect.mShadeType) - { + switch (effect.mShadeType) { case Collada::Shade_Constant: shadeMode = aiShadingMode_NoShading; break; @@ -1657,17 +1585,14 @@ void ColladaLoader::FillMaterials(const ColladaParser& pParser, aiScene* /*pScen // handle RGB transparency completely, cf Collada specs 1.5.0 pages 249 and 304 if (effect.mRGBTransparency) { // use luminance as defined by ISO/CIE color standards (see ITU-R Recommendation BT.709-4) - effect.mTransparency *= ( - 0.212671f * effect.mTransparent.r + - 0.715160f * effect.mTransparent.g + - 0.072169f * effect.mTransparent.b - ); + effect.mTransparency *= (0.212671f * effect.mTransparent.r + + 0.715160f * effect.mTransparent.g + + 0.072169f * effect.mTransparent.b); effect.mTransparent.a = 1.f; mat.AddProperty(&effect.mTransparent, 1, AI_MATKEY_COLOR_TRANSPARENT); - } - else { + } else { effect.mTransparency *= effect.mTransparent.a; } @@ -1709,27 +1634,26 @@ void ColladaLoader::FillMaterials(const ColladaParser& pParser, aiScene* /*pScen // ------------------------------------------------------------------------------------------------ // Constructs materials from the collada material definitions -void ColladaLoader::BuildMaterials(ColladaParser& pParser, aiScene* /*pScene*/) -{ +void ColladaLoader::BuildMaterials(ColladaParser &pParser, aiScene * /*pScene*/) { newMats.reserve(pParser.mMaterialLibrary.size()); for (ColladaParser::MaterialLibrary::const_iterator matIt = pParser.mMaterialLibrary.begin(); - matIt != pParser.mMaterialLibrary.end(); ++matIt) { - const Collada::Material& material = matIt->second; + matIt != pParser.mMaterialLibrary.end(); ++matIt) { + const Collada::Material &material = matIt->second; // a material is only a reference to an effect ColladaParser::EffectLibrary::iterator effIt = pParser.mEffectLibrary.find(material.mEffect); if (effIt == pParser.mEffectLibrary.end()) continue; - Collada::Effect& effect = effIt->second; + Collada::Effect &effect = effIt->second; // create material - aiMaterial* mat = new aiMaterial; + aiMaterial *mat = new aiMaterial; aiString name(material.mName.empty() ? matIt->first : material.mName); mat->AddProperty(&name, AI_MATKEY_NAME); // store the material mMaterialIndexByName[matIt->first] = newMats.size(); - newMats.push_back(std::pair(&effect, mat)); + newMats.push_back(std::pair(&effect, mat)); } // ScenePreprocessor generates a default material automatically if none is there. // All further code here in this loader works well without a valid material so @@ -1755,16 +1679,14 @@ void ColladaLoader::BuildMaterials(ColladaParser& pParser, aiScene* /*pScene*/) // ------------------------------------------------------------------------------------------------ // Resolves the texture name for the given effect texture entry -// and loads the texture data -aiString ColladaLoader::FindFilenameForEffectTexture(const ColladaParser& pParser, - const Collada::Effect& pEffect, const std::string& pName) -{ +// and loads the texture data +aiString ColladaLoader::FindFilenameForEffectTexture(const ColladaParser &pParser, + const Collada::Effect &pEffect, const std::string &pName) { aiString result; // recurse through the param references until we end up at an image std::string name = pName; - while (1) - { + while (1) { // the given string is a param entry. Find it Collada::Effect::ParamLibrary::const_iterator it = pEffect.mParams.find(name); // if not found, we're at the end of the recursion. The resulting string should be the image ID @@ -1777,8 +1699,7 @@ aiString ColladaLoader::FindFilenameForEffectTexture(const ColladaParser& pParse // find the image referred by this name in the image library of the scene ColladaParser::ImageLibrary::const_iterator imIt = pParser.mImageLibrary.find(name); - if (imIt == pParser.mImageLibrary.end()) - { + if (imIt == pParser.mImageLibrary.end()) { ASSIMP_LOG_WARN_F("Collada: Unable to resolve effect texture entry \"", pName, "\", ended up at ID \"", name, "\"."); //set default texture file name @@ -1788,18 +1709,16 @@ aiString ColladaLoader::FindFilenameForEffectTexture(const ColladaParser& pParse } // if this is an embedded texture image setup an aiTexture for it - if (!imIt->second.mImageData.empty()) - { - aiTexture* tex = new aiTexture(); + if (!imIt->second.mImageData.empty()) { + aiTexture *tex = new aiTexture(); // Store embedded texture name reference tex->mFilename.Set(imIt->second.mFileName.c_str()); result.Set(imIt->second.mFileName); // TODO: check the possibility of using the flag "AI_CONFIG_IMPORT_FBX_EMBEDDED_TEXTURES_LEGACY_NAMING" -// result.data[0] = '*'; -// result.length = 1 + ASSIMP_itoa10(result.data + 1, static_cast(MAXLEN - 1), static_cast(mTextures.size())); - + // result.data[0] = '*'; + // result.length = 1 + ASSIMP_itoa10(result.data + 1, static_cast(MAXLEN - 1), static_cast(mTextures.size())); // setup format hint if (imIt->second.mEmbeddedFormat.length() >= HINTMAXTEXTURELEN) { @@ -1810,14 +1729,12 @@ aiString ColladaLoader::FindFilenameForEffectTexture(const ColladaParser& pParse // and copy texture data tex->mHeight = 0; tex->mWidth = static_cast(imIt->second.mImageData.size()); - tex->pcData = (aiTexel*)new char[tex->mWidth]; + tex->pcData = (aiTexel *)new char[tex->mWidth]; memcpy(tex->pcData, &imIt->second.mImageData[0], tex->mWidth); // and add this texture to the list mTextures.push_back(tex); - } - else - { + } else { if (imIt->second.mFileName.empty()) { throw DeadlyImportError("Collada: Invalid texture, no data or file reference given"); } @@ -1829,8 +1746,7 @@ aiString ColladaLoader::FindFilenameForEffectTexture(const ColladaParser& pParse // ------------------------------------------------------------------------------------------------ // Reads a float value from an accessor and its data array. -ai_real ColladaLoader::ReadFloat(const Collada::Accessor& pAccessor, const Collada::Data& pData, size_t pIndex, size_t pOffset) const -{ +ai_real ColladaLoader::ReadFloat(const Collada::Accessor &pAccessor, const Collada::Data &pData, size_t pIndex, size_t pOffset) const { // FIXME: (thom) Test for data type here in every access? For the moment, I leave this to the caller size_t pos = pAccessor.mStride * pIndex + pAccessor.mOffset + pOffset; ai_assert(pos < pData.mValues.size()); @@ -1839,8 +1755,7 @@ ai_real ColladaLoader::ReadFloat(const Collada::Accessor& pAccessor, const Colla // ------------------------------------------------------------------------------------------------ // Reads a string value from an accessor and its data array. -const std::string& ColladaLoader::ReadString(const Collada::Accessor& pAccessor, const Collada::Data& pData, size_t pIndex) const -{ +const std::string &ColladaLoader::ReadString(const Collada::Accessor &pAccessor, const Collada::Data &pData, size_t pIndex) const { size_t pos = pAccessor.mStride * pIndex + pAccessor.mOffset; ai_assert(pos < pData.mStrings.size()); return pData.mStrings[pos]; @@ -1848,8 +1763,7 @@ const std::string& ColladaLoader::ReadString(const Collada::Accessor& pAccessor, // ------------------------------------------------------------------------------------------------ // Collects all nodes into the given array -void ColladaLoader::CollectNodes(const aiNode* pNode, std::vector& poNodes) const -{ +void ColladaLoader::CollectNodes(const aiNode *pNode, std::vector &poNodes) const { poNodes.push_back(pNode); for (size_t a = 0; a < pNode->mNumChildren; ++a) { CollectNodes(pNode->mChildren[a], poNodes); @@ -1858,14 +1772,12 @@ void ColladaLoader::CollectNodes(const aiNode* pNode, std::vector // ------------------------------------------------------------------------------------------------ // Finds a node in the collada scene by the given name -const Collada::Node* ColladaLoader::FindNode(const Collada::Node* pNode, const std::string& pName) const -{ +const Collada::Node *ColladaLoader::FindNode(const Collada::Node *pNode, const std::string &pName) const { if (pNode->mName == pName || pNode->mID == pName) return pNode; - for (size_t a = 0; a < pNode->mChildren.size(); ++a) - { - const Collada::Node* node = FindNode(pNode->mChildren[a], pName); + for (size_t a = 0; a < pNode->mChildren.size(); ++a) { + const Collada::Node *node = FindNode(pNode->mChildren[a], pName); if (node) return node; } @@ -1875,7 +1787,7 @@ const Collada::Node* ColladaLoader::FindNode(const Collada::Node* pNode, const s // ------------------------------------------------------------------------------------------------ // Finds a node in the collada scene by the given SID -const Collada::Node* ColladaLoader::FindNodeBySID( const Collada::Node* pNode, const std::string& pSID) const { +const Collada::Node *ColladaLoader::FindNodeBySID(const Collada::Node *pNode, const std::string &pSID) const { if (nullptr == pNode) { return nullptr; } @@ -1884,8 +1796,8 @@ const Collada::Node* ColladaLoader::FindNodeBySID( const Collada::Node* pNode, c return pNode; } - for( size_t a = 0; a < pNode->mChildren.size(); ++a) { - const Collada::Node* node = FindNodeBySID( pNode->mChildren[a], pSID); + for (size_t a = 0; a < pNode->mChildren.size(); ++a) { + const Collada::Node *node = FindNodeBySID(pNode->mChildren[a], pSID); if (node) { return node; } @@ -1897,28 +1809,22 @@ const Collada::Node* ColladaLoader::FindNodeBySID( const Collada::Node* pNode, c // ------------------------------------------------------------------------------------------------ // Finds a proper unique name for a node derived from the collada-node's properties. // The name must be unique for proper node-bone association. -std::string ColladaLoader::FindNameForNode(const Collada::Node* pNode) -{ +std::string ColladaLoader::FindNameForNode(const Collada::Node *pNode) { // If explicitly requested, just use the collada name. - if (useColladaName) - { + if (useColladaName) { if (!pNode->mName.empty()) { return pNode->mName; - } - else { + } else { return format() << "$ColladaAutoName$_" << mNodeNameCounter++; } - } - else - { + } else { // Now setup the name of the assimp node. The collada name might not be // unique, so we use the collada ID. if (!pNode->mID.empty()) return pNode->mID; else if (!pNode->mSID.empty()) return pNode->mSID; - else - { + else { // No need to worry. Unnamed nodes are no problem at all, except // if cameras or lights need to be assigned to them. return format() << "$ColladaAutoName$_" << mNodeNameCounter++; diff --git a/code/Collada/ColladaParser.cpp b/code/Collada/ColladaParser.cpp index 25ee2bc3c..5080094c1 100644 --- a/code/Collada/ColladaParser.cpp +++ b/code/Collada/ColladaParser.cpp @@ -47,18 +47,18 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef ASSIMP_BUILD_NO_COLLADA_IMPORTER -#include -#include #include "ColladaParser.h" -#include -#include #include #include -#include -#include -#include #include #include +#include +#include +#include +#include +#include +#include +#include #include @@ -68,24 +68,24 @@ using namespace Assimp::Formatter; // ------------------------------------------------------------------------------------------------ // Constructor to be privately used by Importer -ColladaParser::ColladaParser(IOSystem* pIOHandler, const std::string& pFile) - : mFileName(pFile) - , mReader(nullptr) - , mDataLibrary() - , mAccessorLibrary() - , mMeshLibrary() - , mNodeLibrary() - , mImageLibrary() - , mEffectLibrary() - , mMaterialLibrary() - , mLightLibrary() - , mCameraLibrary() - , mControllerLibrary() - , mRootNode(nullptr) - , mAnims() - , mUnitSize(1.0f) - , mUpDirection(UP_Y) - , mFormat(FV_1_5_n) // We assume the newest file format by default +ColladaParser::ColladaParser(IOSystem *pIOHandler, const std::string &pFile) : + mFileName(pFile), + mReader(nullptr), + mDataLibrary(), + mAccessorLibrary(), + mMeshLibrary(), + mNodeLibrary(), + mImageLibrary(), + mEffectLibrary(), + mMaterialLibrary(), + mLightLibrary(), + mCameraLibrary(), + mControllerLibrary(), + mRootNode(nullptr), + mAnims(), + mUnitSize(1.0f), + mUpDirection(UP_Y), + mFormat(FV_1_5_n) // We assume the newest file format by default { // validate io-handler instance if (nullptr == pIOHandler) { @@ -112,8 +112,7 @@ ColladaParser::ColladaParser(IOSystem* pIOHandler, const std::string& pFile) if (daefile == nullptr) { ThrowException(std::string("Invalid ZAE manifest: '") + std::string(dae_filename) + std::string("' is missing")); } - } - else { + } else { // attempt to open the file directly daefile.reset(pIOHandler->Open(pFile)); if (daefile.get() == nullptr) { @@ -139,8 +138,7 @@ ColladaParser::ColladaParser(IOSystem* pIOHandler, const std::string& pFile) // ------------------------------------------------------------------------------------------------ // Destructor, private as well -ColladaParser::~ColladaParser() -{ +ColladaParser::~ColladaParser() { delete mReader; for (NodeLibrary::iterator it = mNodeLibrary.begin(); it != mNodeLibrary.end(); ++it) delete it->second; @@ -153,8 +151,7 @@ ColladaParser::~ColladaParser() std::string ColladaParser::ReadZaeManifest(ZipArchiveIOSystem &zip_archive) { // Open the manifest std::unique_ptr manifestfile(zip_archive.Open("manifest.xml")); - if (manifestfile == nullptr) - { + if (manifestfile == nullptr) { // No manifest, hope there is only one .DAE inside std::vector file_list; zip_archive.getFileListExtension(file_list, "dae"); @@ -168,19 +165,16 @@ std::string ColladaParser::ReadZaeManifest(ZipArchiveIOSystem &zip_archive) { std::unique_ptr mIOWrapper(new CIrrXML_IOStreamReader(manifestfile.get())); std::unique_ptr manifest_reader(irr::io::createIrrXMLReader(mIOWrapper.get())); - while (manifest_reader->read()) - { + while (manifest_reader->read()) { // find the manifest "dae_root" element - if (manifest_reader->getNodeType() == irr::io::EXN_ELEMENT) - { - if (::strcmp(manifest_reader->getNodeName(), "dae_root") == 0) - { + if (manifest_reader->getNodeType() == irr::io::EXN_ELEMENT) { + if (::strcmp(manifest_reader->getNodeName(), "dae_root") == 0) { if (!manifest_reader->read()) return std::string(); if (manifest_reader->getNodeType() != irr::io::EXN_TEXT && manifest_reader->getNodeType() != irr::io::EXN_CDATA) return std::string(); - const char* filepath = manifest_reader->getNodeData(); + const char *filepath = manifest_reader->getNodeData(); if (filepath == nullptr) return std::string(); @@ -196,14 +190,12 @@ std::string ColladaParser::ReadZaeManifest(ZipArchiveIOSystem &zip_archive) { // ------------------------------------------------------------------------------------------------ // Convert a path read from a collada file to the usual representation -void ColladaParser::UriDecodePath(aiString& ss) -{ +void ColladaParser::UriDecodePath(aiString &ss) { // TODO: collada spec, p 22. Handle URI correctly. // For the moment we're just stripping the file:// away to make it work. // Windows doesn't seem to be able to find stuff like // 'file://..\LWO\LWO2\MappingModes\earthSpherical.jpg' - if (0 == strncmp(ss.data, "file://", 7)) - { + if (0 == strncmp(ss.data, "file://", 7)) { ss.length -= 7; memmove(ss.data, ss.data + 7, ss.length); ss.data[ss.length] = '\0'; @@ -211,7 +203,7 @@ void ColladaParser::UriDecodePath(aiString& ss) // Maxon Cinema Collada Export writes "file:///C:\andsoon" with three slashes... // I need to filter it without destroying linux paths starting with "/somewhere" -#if defined( _MSC_VER ) +#if defined(_MSC_VER) if (ss.data[0] == '/' && isalpha((unsigned char)ss.data[1]) && ss.data[2] == ':') { #else if (ss.data[0] == '/' && isalpha(ss.data[1]) && ss.data[2] == ':') { @@ -222,19 +214,15 @@ void ColladaParser::UriDecodePath(aiString& ss) } // find and convert all %xy special chars - char* out = ss.data; - for (const char* it = ss.data; it != ss.data + ss.length; /**/) - { - if (*it == '%' && (it + 3) < ss.data + ss.length) - { + char *out = ss.data; + for (const char *it = ss.data; it != ss.data + ss.length; /**/) { + if (*it == '%' && (it + 3) < ss.data + ss.length) { // separate the number to avoid dragging in chars from behind into the parsing char mychar[3] = { it[1], it[2], 0 }; size_t nbr = strtoul16(mychar); it += 3; *out++ = (char)(nbr & 0xFF); - } - else - { + } else { *out++ = *it++; } } @@ -247,10 +235,9 @@ void ColladaParser::UriDecodePath(aiString& ss) // ------------------------------------------------------------------------------------------------ // Read bool from text contents of current element -bool ColladaParser::ReadBoolFromTextContent() -{ - const char* cur = GetTextContent(); - if ( nullptr == cur) { +bool ColladaParser::ReadBoolFromTextContent() { + const char *cur = GetTextContent(); + if (nullptr == cur) { return false; } return (!ASSIMP_strincmp(cur, "true", 4) || '0' != *cur); @@ -258,10 +245,9 @@ bool ColladaParser::ReadBoolFromTextContent() // ------------------------------------------------------------------------------------------------ // Read float from text contents of current element -ai_real ColladaParser::ReadFloatFromTextContent() -{ - const char* cur = GetTextContent(); - if ( nullptr == cur ) { +ai_real ColladaParser::ReadFloatFromTextContent() { + const char *cur = GetTextContent(); + if (nullptr == cur) { return 0.0; } return fast_atof(cur); @@ -269,49 +255,39 @@ ai_real ColladaParser::ReadFloatFromTextContent() // ------------------------------------------------------------------------------------------------ // Reads the contents of the file -void ColladaParser::ReadContents() -{ - while (mReader->read()) - { +void ColladaParser::ReadContents() { + while (mReader->read()) { // handle the root element "COLLADA" - if (mReader->getNodeType() == irr::io::EXN_ELEMENT) - { - if (IsElement("COLLADA")) - { + if (mReader->getNodeType() == irr::io::EXN_ELEMENT) { + if (IsElement("COLLADA")) { // check for 'version' attribute const int attrib = TestAttribute("version"); if (attrib != -1) { - const char* version = mReader->getAttributeValue(attrib); + const char *version = mReader->getAttributeValue(attrib); // Store declared format version string aiString v; v.Set(version); - mAssetMetaData.emplace(AI_METADATA_SOURCE_FORMAT_VERSION, v ); + mAssetMetaData.emplace(AI_METADATA_SOURCE_FORMAT_VERSION, v); if (!::strncmp(version, "1.5", 3)) { mFormat = FV_1_5_n; ASSIMP_LOG_DEBUG("Collada schema version is 1.5.n"); - } - else if (!::strncmp(version, "1.4", 3)) { + } else if (!::strncmp(version, "1.4", 3)) { mFormat = FV_1_4_n; ASSIMP_LOG_DEBUG("Collada schema version is 1.4.n"); - } - else if (!::strncmp(version, "1.3", 3)) { + } else if (!::strncmp(version, "1.3", 3)) { mFormat = FV_1_3_n; ASSIMP_LOG_DEBUG("Collada schema version is 1.3.n"); } } ReadStructure(); - } - else - { + } else { ASSIMP_LOG_DEBUG_F("Ignoring global element <", mReader->getNodeName(), ">."); SkipElement(); } - } - else - { + } else { // skip everything else silently } } @@ -319,13 +295,10 @@ void ColladaParser::ReadContents() // ------------------------------------------------------------------------------------------------ // Reads the structure of the file -void ColladaParser::ReadStructure() -{ - while (mReader->read()) - { +void ColladaParser::ReadStructure() { + while (mReader->read()) { // beginning of elements - if (mReader->getNodeType() == irr::io::EXN_ELEMENT) - { + if (mReader->getNodeType() == irr::io::EXN_ELEMENT) { if (IsElement("asset")) ReadAssetInfo(); else if (IsElement("library_animations")) @@ -354,9 +327,7 @@ void ColladaParser::ReadStructure() ReadScene(); else SkipElement(); - } - else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) - { + } else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { break; } } @@ -367,34 +338,27 @@ void ColladaParser::ReadStructure() // ------------------------------------------------------------------------------------------------ // Reads asset information such as coordinate system information and legal blah -void ColladaParser::ReadAssetInfo() -{ +void ColladaParser::ReadAssetInfo() { if (mReader->isEmptyElement()) return; - while (mReader->read()) - { - if (mReader->getNodeType() == irr::io::EXN_ELEMENT) - { - if (IsElement("unit")) - { + while (mReader->read()) { + if (mReader->getNodeType() == irr::io::EXN_ELEMENT) { + if (IsElement("unit")) { // read unit data from the element's attributes const int attrIndex = TestAttribute("meter"); if (attrIndex == -1) { mUnitSize = 1.f; - } - else { + } else { mUnitSize = mReader->getAttributeValueAsFloat(attrIndex); } // consume the trailing stuff if (!mReader->isEmptyElement()) SkipElement(); - } - else if (IsElement("up_axis")) - { + } else if (IsElement("up_axis")) { // read content, strip whitespace, compare - const char* content = GetTextContent(); + const char *content = GetTextContent(); if (strncmp(content, "X_UP", 4) == 0) mUpDirection = UP_X; else if (strncmp(content, "Z_UP", 4) == 0) @@ -404,18 +368,12 @@ void ColladaParser::ReadAssetInfo() // check element end TestClosing("up_axis"); - } - else if (IsElement("contributor")) - { + } else if (IsElement("contributor")) { ReadContributorInfo(); - } - else - { + } else { ReadMetaDataItem(mAssetMetaData); } - } - else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) - { + } else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { if (strcmp(mReader->getNodeName(), "asset") != 0) ThrowException("Expected end of element."); @@ -426,19 +384,14 @@ void ColladaParser::ReadAssetInfo() // ------------------------------------------------------------------------------------------------ // Reads the contributor info -void ColladaParser::ReadContributorInfo() -{ +void ColladaParser::ReadContributorInfo() { if (mReader->isEmptyElement()) return; - while (mReader->read()) - { - if (mReader->getNodeType() == irr::io::EXN_ELEMENT) - { + while (mReader->read()) { + if (mReader->getNodeType() == irr::io::EXN_ELEMENT) { ReadMetaDataItem(mAssetMetaData); - } - else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) - { + } else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { if (strcmp(mReader->getNodeName(), "contributor") != 0) ThrowException("Expected end of element."); break; @@ -448,11 +401,11 @@ void ColladaParser::ReadContributorInfo() static bool FindCommonKey(const std::string &collada_key, const MetaKeyPairVector &key_renaming, size_t &found_index) { for (size_t i = 0; i < key_renaming.size(); ++i) { - if (key_renaming[i].first == collada_key) { + if (key_renaming[i].first == collada_key) { found_index = i; return true; - } - } + } + } found_index = std::numeric_limits::max(); return false; } @@ -461,44 +414,39 @@ static bool FindCommonKey(const std::string &collada_key, const MetaKeyPairVecto // Reads a single string metadata item void ColladaParser::ReadMetaDataItem(StringMetaData &metadata) { const Collada::MetaKeyPairVector &key_renaming = GetColladaAssimpMetaKeysCamelCase(); - // Metadata such as created, keywords, subject etc - const char *key_char = mReader->getNodeName(); - if (key_char != nullptr) { + // Metadata such as created, keywords, subject etc + const char *key_char = mReader->getNodeName(); + if (key_char != nullptr) { const std::string key_str(key_char); - const char *value_char = TestTextContent(); - if (value_char != nullptr) { + const char *value_char = TestTextContent(); + if (value_char != nullptr) { aiString aistr; - aistr.Set(value_char); + aistr.Set(value_char); std::string camel_key_str(key_str); - ToCamelCase(camel_key_str); + ToCamelCase(camel_key_str); - size_t found_index; - if (FindCommonKey(camel_key_str, key_renaming, found_index)) { + size_t found_index; + if (FindCommonKey(camel_key_str, key_renaming, found_index)) { metadata.emplace(key_renaming[found_index].second, aistr); } else { - metadata.emplace(camel_key_str, aistr); - } + metadata.emplace(camel_key_str, aistr); + } } TestClosing(key_str.c_str()); - } - else + } else SkipElement(); } // ------------------------------------------------------------------------------------------------ // Reads the animation clips -void ColladaParser::ReadAnimationClipLibrary() -{ +void ColladaParser::ReadAnimationClipLibrary() { if (mReader->isEmptyElement()) return; - while (mReader->read()) - { - if (mReader->getNodeType() == irr::io::EXN_ELEMENT) - { - if (IsElement("animation_clip")) - { + while (mReader->read()) { + if (mReader->getNodeType() == irr::io::EXN_ELEMENT) { + if (IsElement("animation_clip")) { // optional name given as an attribute std::string animName; int indexName = TestAttribute("name"); @@ -510,20 +458,16 @@ void ColladaParser::ReadAnimationClipLibrary() else animName = std::string("animation_") + to_string(mAnimationClipLibrary.size()); - std::pair > clip; + std::pair> clip; clip.first = animName; - while (mReader->read()) - { - if (mReader->getNodeType() == irr::io::EXN_ELEMENT) - { - if (IsElement("instance_animation")) - { + while (mReader->read()) { + if (mReader->getNodeType() == irr::io::EXN_ELEMENT) { + if (IsElement("instance_animation")) { int indexUrl = TestAttribute("url"); - if (indexUrl >= 0) - { - const char* url = mReader->getAttributeValue(indexUrl); + if (indexUrl >= 0) { + const char *url = mReader->getAttributeValue(indexUrl); if (url[0] != '#') ThrowException("Unknown reference format"); @@ -531,15 +475,11 @@ void ColladaParser::ReadAnimationClipLibrary() clip.second.push_back(url); } - } - else - { + } else { // ignore the rest SkipElement(); } - } - else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) - { + } else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { if (strcmp(mReader->getNodeName(), "animation_clip") != 0) ThrowException("Expected end of element."); @@ -547,19 +487,14 @@ void ColladaParser::ReadAnimationClipLibrary() } } - if (clip.second.size() > 0) - { + if (clip.second.size() > 0) { mAnimationClipLibrary.push_back(clip); } - } - else - { + } else { // ignore the rest SkipElement(); } - } - else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) - { + } else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { if (strcmp(mReader->getNodeName(), "library_animation_clips") != 0) ThrowException("Expected end of element."); @@ -568,8 +503,7 @@ void ColladaParser::ReadAnimationClipLibrary() } } -void ColladaParser::PostProcessControllers() -{ +void ColladaParser::PostProcessControllers() { std::string meshId; for (ControllerLibrary::iterator it = mControllerLibrary.begin(); it != mControllerLibrary.end(); ++it) { meshId = it->second.mMeshId; @@ -585,14 +519,11 @@ void ColladaParser::PostProcessControllers() // ------------------------------------------------------------------------------------------------ // Re-build animations from animation clip library, if present, otherwise combine single-channel animations -void ColladaParser::PostProcessRootAnimations() -{ - if (mAnimationClipLibrary.size() > 0) - { +void ColladaParser::PostProcessRootAnimations() { + if (mAnimationClipLibrary.size() > 0) { Animation temp; - for (AnimationClipLibrary::iterator it = mAnimationClipLibrary.begin(); it != mAnimationClipLibrary.end(); ++it) - { + for (AnimationClipLibrary::iterator it = mAnimationClipLibrary.begin(); it != mAnimationClipLibrary.end(); ++it) { std::string clipName = it->first; Animation *clip = new Animation(); @@ -600,14 +531,12 @@ void ColladaParser::PostProcessRootAnimations() temp.mSubAnims.push_back(clip); - for (std::vector::iterator a = it->second.begin(); a != it->second.end(); ++a) - { + for (std::vector::iterator a = it->second.begin(); a != it->second.end(); ++a) { std::string animationID = *a; AnimationLibrary::iterator animation = mAnimationLibrary.find(animationID); - if (animation != mAnimationLibrary.end()) - { + if (animation != mAnimationLibrary.end()) { Animation *pSourceAnimation = animation->second; pSourceAnimation->CollectChannelsRecursively(clip->mChannels); @@ -619,37 +548,27 @@ void ColladaParser::PostProcessRootAnimations() // Ensure no double deletes. temp.mSubAnims.clear(); - } - else - { + } else { mAnims.CombineSingleChannelAnimations(); } } // ------------------------------------------------------------------------------------------------ // Reads the animation library -void ColladaParser::ReadAnimationLibrary() -{ +void ColladaParser::ReadAnimationLibrary() { if (mReader->isEmptyElement()) return; - while (mReader->read()) - { - if (mReader->getNodeType() == irr::io::EXN_ELEMENT) - { - if (IsElement("animation")) - { + while (mReader->read()) { + if (mReader->getNodeType() == irr::io::EXN_ELEMENT) { + if (IsElement("animation")) { // delegate the reading. Depending on the inner elements it will be a container or a anim channel ReadAnimation(&mAnims); - } - else - { + } else { // ignore the rest SkipElement(); } - } - else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) - { + } else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { if (strcmp(mReader->getNodeName(), "library_animations") != 0) ThrowException("Expected end of element."); @@ -660,8 +579,7 @@ void ColladaParser::ReadAnimationLibrary() // ------------------------------------------------------------------------------------------------ // Reads an animation into the given parent structure -void ColladaParser::ReadAnimation(Collada::Animation* pParent) -{ +void ColladaParser::ReadAnimation(Collada::Animation *pParent) { if (mReader->isEmptyElement()) return; @@ -670,7 +588,7 @@ void ColladaParser::ReadAnimation(Collada::Animation* pParent) typedef std::map ChannelMap; ChannelMap channels; // this is the anim container in case we're a container - Animation* anim = NULL; + Animation *anim = NULL; // optional name given as an attribute std::string animName; @@ -688,16 +606,12 @@ void ColladaParser::ReadAnimation(Collada::Animation* pParent) else animName = "animation"; - while (mReader->read()) - { - if (mReader->getNodeType() == irr::io::EXN_ELEMENT) - { + while (mReader->read()) { + if (mReader->getNodeType() == irr::io::EXN_ELEMENT) { // we have subanimations - if (IsElement("animation")) - { + if (IsElement("animation")) { // create container from our element - if (!anim) - { + if (!anim) { anim = new Animation; anim->mName = animName; pParent->mSubAnims.push_back(anim); @@ -705,14 +619,10 @@ void ColladaParser::ReadAnimation(Collada::Animation* pParent) // recurse into the subelement ReadAnimation(anim); - } - else if (IsElement("source")) - { + } else if (IsElement("source")) { // possible animation data - we'll never know. Better store it ReadSource(); - } - else if (IsElement("sampler")) - { + } else if (IsElement("sampler")) { // read the ID to assign the corresponding collada channel afterwards. int indexId = GetAttribute("id"); std::string id = mReader->getAttributeValue(indexId); @@ -720,15 +630,13 @@ void ColladaParser::ReadAnimation(Collada::Animation* pParent) // have it read into a channel ReadAnimationSampler(newChannel->second); - } - else if (IsElement("channel")) - { + } else if (IsElement("channel")) { // the binding element whose whole purpose is to provide the target to animate // Thanks, Collada! A directly posted information would have been too simple, I guess. // Better add another indirection to that! Can't have enough of those. int indexTarget = GetAttribute("target"); int indexSource = GetAttribute("source"); - const char* sourceId = mReader->getAttributeValue(indexSource); + const char *sourceId = mReader->getAttributeValue(indexSource); if (sourceId[0] == '#') sourceId++; ChannelMap::iterator cit = channels.find(sourceId); @@ -737,15 +645,11 @@ void ColladaParser::ReadAnimation(Collada::Animation* pParent) if (!mReader->isEmptyElement()) SkipElement(); - } - else - { + } else { // ignore the rest SkipElement(); } - } - else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) - { + } else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { if (strcmp(mReader->getNodeName(), "animation") != 0) ThrowException("Expected end of element."); @@ -754,15 +658,14 @@ void ColladaParser::ReadAnimation(Collada::Animation* pParent) } // it turned out to have channels - add them - if (!channels.empty()) - { + if (!channels.empty()) { // FIXME: Is this essentially doing the same as "single-anim-node" codepath in // ColladaLoader::StoreAnimations? For now, this has been deferred to after // all animations and all clips have been read. Due to handling of // this cannot be done here, as the channel owner // is lost, and some exporters make up animations by referring to multiple // single-channel animations from an . -/* + /* // special filtering for stupid exporters packing each channel into a separate animation if( channels.size() == 1) { @@ -771,8 +674,7 @@ void ColladaParser::ReadAnimation(Collada::Animation* pParent) */ { // else create the animation, if not done yet, and store the channels - if (!anim) - { + if (!anim) { anim = new Animation; anim->mName = animName; pParent->mSubAnims.push_back(anim); @@ -780,8 +682,7 @@ void ColladaParser::ReadAnimation(Collada::Animation* pParent) for (ChannelMap::const_iterator it = channels.begin(); it != channels.end(); ++it) anim->mChannels.push_back(it->second); - if (indexID >= 0) - { + if (indexID >= 0) { mAnimationLibrary[animID] = anim; } } @@ -790,18 +691,14 @@ void ColladaParser::ReadAnimation(Collada::Animation* pParent) // ------------------------------------------------------------------------------------------------ // Reads an animation sampler into the given anim channel -void ColladaParser::ReadAnimationSampler(Collada::AnimationChannel& pChannel) -{ - while (mReader->read()) - { - if (mReader->getNodeType() == irr::io::EXN_ELEMENT) - { - if (IsElement("input")) - { +void ColladaParser::ReadAnimationSampler(Collada::AnimationChannel &pChannel) { + while (mReader->read()) { + if (mReader->getNodeType() == irr::io::EXN_ELEMENT) { + if (IsElement("input")) { int indexSemantic = GetAttribute("semantic"); - const char* semantic = mReader->getAttributeValue(indexSemantic); + const char *semantic = mReader->getAttributeValue(indexSemantic); int indexSource = GetAttribute("source"); - const char* source = mReader->getAttributeValue(indexSource); + const char *source = mReader->getAttributeValue(indexSource); if (source[0] != '#') ThrowException("Unsupported URL format"); source++; @@ -819,15 +716,11 @@ void ColladaParser::ReadAnimationSampler(Collada::AnimationChannel& pChannel) if (!mReader->isEmptyElement()) SkipElement(); - } - else - { + } else { // ignore the rest SkipElement(); } - } - else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) - { + } else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { if (strcmp(mReader->getNodeName(), "sampler") != 0) ThrowException("Expected end of element."); @@ -838,17 +731,13 @@ void ColladaParser::ReadAnimationSampler(Collada::AnimationChannel& pChannel) // ------------------------------------------------------------------------------------------------ // Reads the skeleton controller library -void ColladaParser::ReadControllerLibrary() -{ +void ColladaParser::ReadControllerLibrary() { if (mReader->isEmptyElement()) return; - while (mReader->read()) - { - if (mReader->getNodeType() == irr::io::EXN_ELEMENT) - { - if (IsElement("controller")) - { + while (mReader->read()) { + if (mReader->getNodeType() == irr::io::EXN_ELEMENT) { + if (IsElement("controller")) { // read ID. Ask the spec if it's necessary or optional... you might be surprised. int attrID = GetAttribute("id"); std::string id = mReader->getAttributeValue(attrID); @@ -858,15 +747,11 @@ void ColladaParser::ReadControllerLibrary() // read on from there ReadController(mControllerLibrary[id]); - } - else - { + } else { // ignore the rest SkipElement(); } - } - else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) - { + } else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { if (strcmp(mReader->getNodeName(), "library_controllers") != 0) ThrowException("Expected end of element."); @@ -877,18 +762,14 @@ void ColladaParser::ReadControllerLibrary() // ------------------------------------------------------------------------------------------------ // Reads a controller into the given mesh structure -void ColladaParser::ReadController(Collada::Controller& pController) -{ +void ColladaParser::ReadController(Collada::Controller &pController) { // initial values pController.mType = Skin; pController.mMethod = Normalized; - while (mReader->read()) - { - if (mReader->getNodeType() == irr::io::EXN_ELEMENT) - { + while (mReader->read()) { + if (mReader->getNodeType() == irr::io::EXN_ELEMENT) { // two types of controllers: "skin" and "morph". Only the first one is relevant, we skip the other - if (IsElement("morph")) - { + if (IsElement("morph")) { pController.mType = Morph; int baseIndex = GetAttribute("source"); pController.mMeshId = mReader->getAttributeValue(baseIndex) + 1; @@ -898,22 +779,17 @@ void ColladaParser::ReadController(Collada::Controller& pController) if (strcmp(method, "RELATIVE") == 0) pController.mMethod = Relative; } - } - else if (IsElement("skin")) - { + } else if (IsElement("skin")) { // read the mesh it refers to. According to the spec this could also be another // controller, but I refuse to implement every single idea they've come up with int sourceIndex = GetAttribute("source"); pController.mMeshId = mReader->getAttributeValue(sourceIndex) + 1; - } - else if (IsElement("bind_shape_matrix")) - { + } else if (IsElement("bind_shape_matrix")) { // content is 16 floats to define a matrix... it seems to be important for some models - const char* content = GetTextContent(); + const char *content = GetTextContent(); // read the 16 floats - for (unsigned int a = 0; a < 16; a++) - { + for (unsigned int a = 0; a < 16; a++) { // read a number content = fast_atoreal_move(content, pController.mBindShapeMatrix[a]); // skip whitespace after it @@ -921,22 +797,14 @@ void ColladaParser::ReadController(Collada::Controller& pController) } TestClosing("bind_shape_matrix"); - } - else if (IsElement("source")) - { + } else if (IsElement("source")) { // data array - we have specialists to handle this ReadSource(); - } - else if (IsElement("joints")) - { + } else if (IsElement("joints")) { ReadControllerJoints(pController); - } - else if (IsElement("vertex_weights")) - { + } else if (IsElement("vertex_weights")) { ReadControllerWeights(pController); - } - else if (IsElement("targets")) - { + } else if (IsElement("targets")) { while (mReader->read()) { if (mReader->getNodeType() == irr::io::EXN_ELEMENT) { if (IsElement("input")) { @@ -947,29 +815,22 @@ void ColladaParser::ReadController(Collada::Controller& pController) const char *source = mReader->getAttributeValue(sourceIndex); if (strcmp(semantics, "MORPH_TARGET") == 0) { pController.mMorphTarget = source + 1; - } - else if (strcmp(semantics, "MORPH_WEIGHT") == 0) - { + } else if (strcmp(semantics, "MORPH_WEIGHT") == 0) { pController.mMorphWeight = source + 1; } } - } - else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { + } else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { if (strcmp(mReader->getNodeName(), "targets") == 0) break; else ThrowException("Expected end of element."); } } - } - else - { + } else { // ignore the rest SkipElement(); } - } - else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) - { + } else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { if (strcmp(mReader->getNodeName(), "controller") == 0) break; else if (strcmp(mReader->getNodeName(), "skin") != 0 && strcmp(mReader->getNodeName(), "morph") != 0) @@ -980,19 +841,15 @@ void ColladaParser::ReadController(Collada::Controller& pController) // ------------------------------------------------------------------------------------------------ // Reads the joint definitions for the given controller -void ColladaParser::ReadControllerJoints(Collada::Controller& pController) -{ - while (mReader->read()) - { - if (mReader->getNodeType() == irr::io::EXN_ELEMENT) - { +void ColladaParser::ReadControllerJoints(Collada::Controller &pController) { + while (mReader->read()) { + if (mReader->getNodeType() == irr::io::EXN_ELEMENT) { // Input channels for joint data. Two possible semantics: "JOINT" and "INV_BIND_MATRIX" - if (IsElement("input")) - { + if (IsElement("input")) { int indexSemantic = GetAttribute("semantic"); - const char* attrSemantic = mReader->getAttributeValue(indexSemantic); + const char *attrSemantic = mReader->getAttributeValue(indexSemantic); int indexSource = GetAttribute("source"); - const char* attrSource = mReader->getAttributeValue(indexSource); + const char *attrSource = mReader->getAttributeValue(indexSource); // local URLS always start with a '#'. We don't support global URLs if (attrSource[0] != '#') @@ -1010,15 +867,11 @@ void ColladaParser::ReadControllerJoints(Collada::Controller& pController) // skip inner data, if present if (!mReader->isEmptyElement()) SkipElement(); - } - else - { + } else { // ignore the rest SkipElement(); } - } - else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) - { + } else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { if (strcmp(mReader->getNodeName(), "joints") != 0) ThrowException("Expected end of element."); @@ -1029,26 +882,22 @@ void ColladaParser::ReadControllerJoints(Collada::Controller& pController) // ------------------------------------------------------------------------------------------------ // Reads the joint weights for the given controller -void ColladaParser::ReadControllerWeights(Collada::Controller& pController) -{ +void ColladaParser::ReadControllerWeights(Collada::Controller &pController) { // read vertex count from attributes and resize the array accordingly int indexCount = GetAttribute("count"); size_t vertexCount = (size_t)mReader->getAttributeValueAsInt(indexCount); pController.mWeightCounts.resize(vertexCount); - while (mReader->read()) - { - if (mReader->getNodeType() == irr::io::EXN_ELEMENT) - { + while (mReader->read()) { + if (mReader->getNodeType() == irr::io::EXN_ELEMENT) { // Input channels for weight data. Two possible semantics: "JOINT" and "WEIGHT" - if (IsElement("input") && vertexCount > 0) - { + if (IsElement("input") && vertexCount > 0) { InputChannel channel; int indexSemantic = GetAttribute("semantic"); - const char* attrSemantic = mReader->getAttributeValue(indexSemantic); + const char *attrSemantic = mReader->getAttributeValue(indexSemantic); int indexSource = GetAttribute("source"); - const char* attrSource = mReader->getAttributeValue(indexSource); + const char *attrSource = mReader->getAttributeValue(indexSource); int indexOffset = TestAttribute("offset"); if (indexOffset >= 0) channel.mOffset = mReader->getAttributeValueAsInt(indexOffset); @@ -1069,14 +918,11 @@ void ColladaParser::ReadControllerWeights(Collada::Controller& pController) // skip inner data, if present if (!mReader->isEmptyElement()) SkipElement(); - } - else if (IsElement("vcount") && vertexCount > 0) - { + } else if (IsElement("vcount") && vertexCount > 0) { // read weight count per vertex - const char* text = GetTextContent(); + const char *text = GetTextContent(); size_t numWeights = 0; - for (std::vector::iterator it = pController.mWeightCounts.begin(); it != pController.mWeightCounts.end(); ++it) - { + for (std::vector::iterator it = pController.mWeightCounts.begin(); it != pController.mWeightCounts.end(); ++it) { if (*text == 0) ThrowException("Out of data while reading "); @@ -1089,14 +935,11 @@ void ColladaParser::ReadControllerWeights(Collada::Controller& pController) // reserve weight count pController.mWeights.resize(numWeights); - } - else if (IsElement("v") && vertexCount > 0) - { + } else if (IsElement("v") && vertexCount > 0) { // read JointIndex - WeightIndex pairs - const char* text = GetTextContent(); + const char *text = GetTextContent(); - for (std::vector< std::pair >::iterator it = pController.mWeights.begin(); it != pController.mWeights.end(); ++it) - { + for (std::vector>::iterator it = pController.mWeights.begin(); it != pController.mWeights.end(); ++it) { if (*text == 0) ThrowException("Out of data while reading "); it->first = strtoul10(text, &text); @@ -1108,15 +951,11 @@ void ColladaParser::ReadControllerWeights(Collada::Controller& pController) } TestClosing("v"); - } - else - { + } else { // ignore the rest SkipElement(); } - } - else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) - { + } else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { if (strcmp(mReader->getNodeName(), "vertex_weights") != 0) ThrowException("Expected end of element."); @@ -1127,16 +966,13 @@ void ColladaParser::ReadControllerWeights(Collada::Controller& pController) // ------------------------------------------------------------------------------------------------ // Reads the image library contents -void ColladaParser::ReadImageLibrary() -{ +void ColladaParser::ReadImageLibrary() { if (mReader->isEmptyElement()) return; - while (mReader->read()) - { + while (mReader->read()) { if (mReader->getNodeType() == irr::io::EXN_ELEMENT) { - if (IsElement("image")) - { + if (IsElement("image")) { // read ID. Another entry which is "optional" by design but obligatory in reality int attrID = GetAttribute("id"); std::string id = mReader->getAttributeValue(attrID); @@ -1146,14 +982,11 @@ void ColladaParser::ReadImageLibrary() // read on from there ReadImage(mImageLibrary[id]); - } - else - { + } else { // ignore the rest SkipElement(); } - } - else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { + } else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { if (strcmp(mReader->getNodeName(), "library_images") != 0) ThrowException("Expected end of element."); @@ -1164,25 +997,19 @@ void ColladaParser::ReadImageLibrary() // ------------------------------------------------------------------------------------------------ // Reads an image entry into the given image -void ColladaParser::ReadImage(Collada::Image& pImage) -{ - while (mReader->read()) - { +void ColladaParser::ReadImage(Collada::Image &pImage) { + while (mReader->read()) { if (mReader->getNodeType() == irr::io::EXN_ELEMENT) { // Need to run different code paths here, depending on the Collada XSD version if (IsElement("image")) { SkipElement(); - } - else if (IsElement("init_from")) - { - if (mFormat == FV_1_4_n) - { + } else if (IsElement("init_from")) { + if (mFormat == FV_1_4_n) { // FIX: C4D exporter writes empty tags if (!mReader->isEmptyElement()) { // element content is filename - hopefully - const char* sz = TestTextContent(); - if (sz) - { + const char *sz = TestTextContent(); + if (sz) { aiString filepath(sz); UriDecodePath(filepath); pImage.mFileName = filepath.C_Str(); @@ -1192,9 +1019,7 @@ void ColladaParser::ReadImage(Collada::Image& pImage) if (!pImage.mFileName.length()) { pImage.mFileName = "unknown_texture"; } - } - else if (mFormat == FV_1_5_n) - { + } else if (mFormat == FV_1_5_n) { // make sure we skip over mip and array initializations, which // we don't support, but which could confuse the loader if // they're not skipped. @@ -1212,35 +1037,31 @@ void ColladaParser::ReadImage(Collada::Image& pImage) // TODO: correctly jump over cube and volume maps? } - } - else if (mFormat == FV_1_5_n) - { - if (IsElement("ref")) - { + } else if (mFormat == FV_1_5_n) { + if (IsElement("ref")) { // element content is filename - hopefully - const char* sz = TestTextContent(); - if (sz) - { + const char *sz = TestTextContent(); + if (sz) { aiString filepath(sz); UriDecodePath(filepath); pImage.mFileName = filepath.C_Str(); } TestClosing("ref"); - } - else if (IsElement("hex") && !pImage.mFileName.length()) - { + } else if (IsElement("hex") && !pImage.mFileName.length()) { // embedded image. get format const int attrib = TestAttribute("format"); if (-1 == attrib) ASSIMP_LOG_WARN("Collada: Unknown image file format"); - else pImage.mEmbeddedFormat = mReader->getAttributeValue(attrib); + else + pImage.mEmbeddedFormat = mReader->getAttributeValue(attrib); - const char* data = GetTextContent(); + const char *data = GetTextContent(); // hexadecimal-encoded binary octets. First of all, find the // required buffer size to reserve enough storage. - const char* cur = data; - while (!IsSpaceOrNewLine(*cur)) cur++; + const char *cur = data; + while (!IsSpaceOrNewLine(*cur)) + cur++; const unsigned int size = (unsigned int)(cur - data) * 2; pImage.mImageData.resize(size); @@ -1249,14 +1070,11 @@ void ColladaParser::ReadImage(Collada::Image& pImage) TestClosing("hex"); } - } - else - { + } else { // ignore the rest SkipElement(); } - } - else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { + } else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { if (strcmp(mReader->getNodeName(), "image") == 0) break; } @@ -1265,18 +1083,14 @@ void ColladaParser::ReadImage(Collada::Image& pImage) // ------------------------------------------------------------------------------------------------ // Reads the material library -void ColladaParser::ReadMaterialLibrary() -{ +void ColladaParser::ReadMaterialLibrary() { if (mReader->isEmptyElement()) return; std::map names; - while (mReader->read()) - { - if (mReader->getNodeType() == irr::io::EXN_ELEMENT) - { - if (IsElement("material")) - { + while (mReader->read()) { + if (mReader->getNodeType() == irr::io::EXN_ELEMENT) { + if (IsElement("material")) { // read ID. By now you probably know my opinion about this "specification" int attrID = GetAttribute("id"); std::string id = mReader->getAttributeValue(attrID); @@ -1289,17 +1103,13 @@ void ColladaParser::ReadMaterialLibrary() // create an entry and store it in the library under its ID mMaterialLibrary[id] = Material(); - if (!name.empty()) - { + if (!name.empty()) { std::map::iterator it = names.find(name); - if (it != names.end()) - { + if (it != names.end()) { std::ostringstream strStream; strStream << ++it->second; name.append(" " + strStream.str()); - } - else - { + } else { names[name] = 0; } @@ -1307,15 +1117,11 @@ void ColladaParser::ReadMaterialLibrary() } ReadMaterial(mMaterialLibrary[id]); - } - else - { + } else { // ignore the rest SkipElement(); } - } - else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) - { + } else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { if (strcmp(mReader->getNodeName(), "library_materials") != 0) ThrowException("Expected end of element."); @@ -1326,16 +1132,13 @@ void ColladaParser::ReadMaterialLibrary() // ------------------------------------------------------------------------------------------------ // Reads the light library -void ColladaParser::ReadLightLibrary() -{ +void ColladaParser::ReadLightLibrary() { if (mReader->isEmptyElement()) return; - while (mReader->read()) - { + while (mReader->read()) { if (mReader->getNodeType() == irr::io::EXN_ELEMENT) { - if (IsElement("light")) - { + if (IsElement("light")) { // read ID. By now you probably know my opinion about this "specification" int attrID = GetAttribute("id"); std::string id = mReader->getAttributeValue(attrID); @@ -1343,14 +1146,11 @@ void ColladaParser::ReadLightLibrary() // create an entry and store it in the library under its ID ReadLight(mLightLibrary[id] = Light()); - } - else - { + } else { // ignore the rest SkipElement(); } - } - else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { + } else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { if (strcmp(mReader->getNodeName(), "library_lights") != 0) ThrowException("Expected end of element."); @@ -1361,36 +1161,30 @@ void ColladaParser::ReadLightLibrary() // ------------------------------------------------------------------------------------------------ // Reads the camera library -void ColladaParser::ReadCameraLibrary() -{ +void ColladaParser::ReadCameraLibrary() { if (mReader->isEmptyElement()) return; - while (mReader->read()) - { + while (mReader->read()) { if (mReader->getNodeType() == irr::io::EXN_ELEMENT) { - if (IsElement("camera")) - { + if (IsElement("camera")) { // read ID. By now you probably know my opinion about this "specification" int attrID = GetAttribute("id"); std::string id = mReader->getAttributeValue(attrID); // create an entry and store it in the library under its ID - Camera& cam = mCameraLibrary[id]; + Camera &cam = mCameraLibrary[id]; attrID = TestAttribute("name"); if (attrID != -1) cam.mName = mReader->getAttributeValue(attrID); ReadCamera(cam); - } - else - { + } else { // ignore the rest SkipElement(); } - } - else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { + } else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { if (strcmp(mReader->getNodeName(), "library_cameras") != 0) ThrowException("Expected end of element."); @@ -1401,33 +1195,26 @@ void ColladaParser::ReadCameraLibrary() // ------------------------------------------------------------------------------------------------ // Reads a material entry into the given material -void ColladaParser::ReadMaterial(Collada::Material& pMaterial) -{ - while (mReader->read()) - { +void ColladaParser::ReadMaterial(Collada::Material &pMaterial) { + while (mReader->read()) { if (mReader->getNodeType() == irr::io::EXN_ELEMENT) { if (IsElement("material")) { SkipElement(); - } - else if (IsElement("instance_effect")) - { + } else if (IsElement("instance_effect")) { // referred effect by URL int attrUrl = GetAttribute("url"); - const char* url = mReader->getAttributeValue(attrUrl); + const char *url = mReader->getAttributeValue(attrUrl); if (url[0] != '#') ThrowException("Unknown reference format"); pMaterial.mEffect = url + 1; SkipElement(); - } - else - { + } else { // ignore the rest SkipElement(); } - } - else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { + } else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { if (strcmp(mReader->getNodeName(), "material") != 0) ThrowException("Expected end of element."); @@ -1438,58 +1225,46 @@ void ColladaParser::ReadMaterial(Collada::Material& pMaterial) // ------------------------------------------------------------------------------------------------ // Reads a light entry into the given light -void ColladaParser::ReadLight(Collada::Light& pLight) -{ - while (mReader->read()) - { +void ColladaParser::ReadLight(Collada::Light &pLight) { + while (mReader->read()) { if (mReader->getNodeType() == irr::io::EXN_ELEMENT) { if (IsElement("light")) { SkipElement(); - } - else if (IsElement("spot")) { + } else if (IsElement("spot")) { pLight.mType = aiLightSource_SPOT; - } - else if (IsElement("ambient")) { + } else if (IsElement("ambient")) { pLight.mType = aiLightSource_AMBIENT; - } - else if (IsElement("directional")) { + } else if (IsElement("directional")) { pLight.mType = aiLightSource_DIRECTIONAL; - } - else if (IsElement("point")) { + } else if (IsElement("point")) { pLight.mType = aiLightSource_POINT; - } - else if (IsElement("color")) { + } else if (IsElement("color")) { // text content contains 3 floats - const char* content = GetTextContent(); + const char *content = GetTextContent(); - content = fast_atoreal_move(content, (ai_real&)pLight.mColor.r); + content = fast_atoreal_move(content, (ai_real &)pLight.mColor.r); SkipSpacesAndLineEnd(&content); - content = fast_atoreal_move(content, (ai_real&)pLight.mColor.g); + content = fast_atoreal_move(content, (ai_real &)pLight.mColor.g); SkipSpacesAndLineEnd(&content); - content = fast_atoreal_move(content, (ai_real&)pLight.mColor.b); + content = fast_atoreal_move(content, (ai_real &)pLight.mColor.b); SkipSpacesAndLineEnd(&content); TestClosing("color"); - } - else if (IsElement("constant_attenuation")) { + } else if (IsElement("constant_attenuation")) { pLight.mAttConstant = ReadFloatFromTextContent(); TestClosing("constant_attenuation"); - } - else if (IsElement("linear_attenuation")) { + } else if (IsElement("linear_attenuation")) { pLight.mAttLinear = ReadFloatFromTextContent(); TestClosing("linear_attenuation"); - } - else if (IsElement("quadratic_attenuation")) { + } else if (IsElement("quadratic_attenuation")) { pLight.mAttQuadratic = ReadFloatFromTextContent(); TestClosing("quadratic_attenuation"); - } - else if (IsElement("falloff_angle")) { + } else if (IsElement("falloff_angle")) { pLight.mFalloffAngle = ReadFloatFromTextContent(); TestClosing("falloff_angle"); - } - else if (IsElement("falloff_exponent")) { + } else if (IsElement("falloff_exponent")) { pLight.mFalloffExponent = ReadFloatFromTextContent(); TestClosing("falloff_exponent"); } @@ -1503,16 +1278,13 @@ void ColladaParser::ReadLight(Collada::Light& pLight) else if (IsElement("penumbra_angle")) { pLight.mPenumbraAngle = ReadFloatFromTextContent(); TestClosing("penumbra_angle"); - } - else if (IsElement("intensity")) { + } else if (IsElement("intensity")) { pLight.mIntensity = ReadFloatFromTextContent(); TestClosing("intensity"); - } - else if (IsElement("falloff")) { + } else if (IsElement("falloff")) { pLight.mOuterAngle = ReadFloatFromTextContent(); TestClosing("falloff"); - } - else if (IsElement("hotspot_beam")) { + } else if (IsElement("hotspot_beam")) { pLight.mFalloffAngle = ReadFloatFromTextContent(); TestClosing("hotspot_beam"); } @@ -1522,8 +1294,7 @@ void ColladaParser::ReadLight(Collada::Light& pLight) pLight.mOuterAngle = ReadFloatFromTextContent(); TestClosing("decay_falloff"); } - } - else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { + } else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { if (strcmp(mReader->getNodeName(), "light") == 0) break; } @@ -1532,39 +1303,30 @@ void ColladaParser::ReadLight(Collada::Light& pLight) // ------------------------------------------------------------------------------------------------ // Reads a camera entry into the given light -void ColladaParser::ReadCamera(Collada::Camera& pCamera) -{ - while (mReader->read()) - { +void ColladaParser::ReadCamera(Collada::Camera &pCamera) { + while (mReader->read()) { if (mReader->getNodeType() == irr::io::EXN_ELEMENT) { if (IsElement("camera")) { SkipElement(); - } - else if (IsElement("orthographic")) { + } else if (IsElement("orthographic")) { pCamera.mOrtho = true; - } - else if (IsElement("xfov") || IsElement("xmag")) { + } else if (IsElement("xfov") || IsElement("xmag")) { pCamera.mHorFov = ReadFloatFromTextContent(); TestClosing((pCamera.mOrtho ? "xmag" : "xfov")); - } - else if (IsElement("yfov") || IsElement("ymag")) { + } else if (IsElement("yfov") || IsElement("ymag")) { pCamera.mVerFov = ReadFloatFromTextContent(); TestClosing((pCamera.mOrtho ? "ymag" : "yfov")); - } - else if (IsElement("aspect_ratio")) { + } else if (IsElement("aspect_ratio")) { pCamera.mAspect = ReadFloatFromTextContent(); TestClosing("aspect_ratio"); - } - else if (IsElement("znear")) { + } else if (IsElement("znear")) { pCamera.mZNear = ReadFloatFromTextContent(); TestClosing("znear"); - } - else if (IsElement("zfar")) { + } else if (IsElement("zfar")) { pCamera.mZFar = ReadFloatFromTextContent(); TestClosing("zfar"); } - } - else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { + } else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { if (strcmp(mReader->getNodeName(), "camera") == 0) break; } @@ -1573,17 +1335,14 @@ void ColladaParser::ReadCamera(Collada::Camera& pCamera) // ------------------------------------------------------------------------------------------------ // Reads the effect library -void ColladaParser::ReadEffectLibrary() -{ +void ColladaParser::ReadEffectLibrary() { if (mReader->isEmptyElement()) { return; } - while (mReader->read()) - { + while (mReader->read()) { if (mReader->getNodeType() == irr::io::EXN_ELEMENT) { - if (IsElement("effect")) - { + if (IsElement("effect")) { // read ID. Do I have to repeat my ranting about "optional" attributes? int attrID = GetAttribute("id"); std::string id = mReader->getAttributeValue(attrID); @@ -1592,14 +1351,11 @@ void ColladaParser::ReadEffectLibrary() mEffectLibrary[id] = Effect(); // read on from there ReadEffect(mEffectLibrary[id]); - } - else - { + } else { // ignore the rest SkipElement(); } - } - else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { + } else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { if (strcmp(mReader->getNodeName(), "library_effects") != 0) ThrowException("Expected end of element."); @@ -1610,20 +1366,15 @@ void ColladaParser::ReadEffectLibrary() // ------------------------------------------------------------------------------------------------ // Reads an effect entry into the given effect -void ColladaParser::ReadEffect(Collada::Effect& pEffect) -{ +void ColladaParser::ReadEffect(Collada::Effect &pEffect) { // for the moment we don't support any other type of effect. - while (mReader->read()) - { - if (mReader->getNodeType() == irr::io::EXN_ELEMENT) - { + while (mReader->read()) { + if (mReader->getNodeType() == irr::io::EXN_ELEMENT) { if (IsElement("profile_COMMON")) ReadEffectProfileCommon(pEffect); else SkipElement(); - } - else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) - { + } else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { if (strcmp(mReader->getNodeName(), "effect") != 0) ThrowException("Expected end of element."); @@ -1634,26 +1385,20 @@ void ColladaParser::ReadEffect(Collada::Effect& pEffect) // ------------------------------------------------------------------------------------------------ // Reads an COMMON effect profile -void ColladaParser::ReadEffectProfileCommon(Collada::Effect& pEffect) -{ - while (mReader->read()) - { - if (mReader->getNodeType() == irr::io::EXN_ELEMENT) - { +void ColladaParser::ReadEffectProfileCommon(Collada::Effect &pEffect) { + while (mReader->read()) { + if (mReader->getNodeType() == irr::io::EXN_ELEMENT) { if (IsElement("newparam")) { // save ID int attrSID = GetAttribute("sid"); std::string sid = mReader->getAttributeValue(attrSID); pEffect.mParams[sid] = EffectParam(); ReadEffectParam(pEffect.mParams[sid]); - } - else if (IsElement("technique") || IsElement("extra")) - { + } else if (IsElement("technique") || IsElement("extra")) { // just syntactic sugar } - else if (mFormat == FV_1_4_n && IsElement("image")) - { + else if (mFormat == FV_1_4_n && IsElement("image")) { // read ID. Another entry which is "optional" by design but obligatory in reality int attrID = GetAttribute("id"); std::string id = mReader->getAttributeValue(attrID); @@ -1686,11 +1431,10 @@ void ColladaParser::ReadEffectProfileCommon(Collada::Effect& pEffect) ReadEffectColor(pEffect.mSpecular, pEffect.mTexSpecular); else if (IsElement("reflective")) { ReadEffectColor(pEffect.mReflective, pEffect.mTexReflective); - } - else if (IsElement("transparent")) { + } else if (IsElement("transparent")) { pEffect.mHasTransparency = true; - const char* opaque = mReader->getAttributeValueSafe("opaque"); + const char *opaque = mReader->getAttributeValueSafe("opaque"); if (::strcmp(opaque, "RGB_ZERO") == 0 || ::strcmp(opaque, "RGB_ONE") == 0) { pEffect.mRGBTransparency = true; @@ -1702,8 +1446,7 @@ void ColladaParser::ReadEffectProfileCommon(Collada::Effect& pEffect) } ReadEffectColor(pEffect.mTransparent, pEffect.mTexTransparent); - } - else if (IsElement("shininess")) + } else if (IsElement("shininess")) ReadEffectFloat(pEffect.mShininess); else if (IsElement("reflectivity")) ReadEffectFloat(pEffect.mReflectivity); @@ -1731,20 +1474,15 @@ void ColladaParser::ReadEffectProfileCommon(Collada::Effect& pEffect) else if (IsElement("wireframe")) { pEffect.mWireframe = ReadBoolFromTextContent(); TestClosing("wireframe"); - } - else if (IsElement("faceted")) { + } else if (IsElement("faceted")) { pEffect.mFaceted = ReadBoolFromTextContent(); TestClosing("faceted"); - } - else - { + } else { // ignore the rest SkipElement(); } - } - else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { - if (strcmp(mReader->getNodeName(), "profile_COMMON") == 0) - { + } else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { + if (strcmp(mReader->getNodeName(), "profile_COMMON") == 0) { break; } } @@ -1753,14 +1491,12 @@ void ColladaParser::ReadEffectProfileCommon(Collada::Effect& pEffect) // ------------------------------------------------------------------------------------------------ // Read texture wrapping + UV transform settings from a profile==Maya chunk -void ColladaParser::ReadSamplerProperties(Sampler& out) -{ +void ColladaParser::ReadSamplerProperties(Sampler &out) { if (mReader->isEmptyElement()) { return; } - while (mReader->read()) - { + while (mReader->read()) { if (mReader->getNodeType() == irr::io::EXN_ELEMENT) { // MAYA extensions @@ -1768,42 +1504,33 @@ void ColladaParser::ReadSamplerProperties(Sampler& out) if (IsElement("wrapU")) { out.mWrapU = ReadBoolFromTextContent(); TestClosing("wrapU"); - } - else if (IsElement("wrapV")) { + } else if (IsElement("wrapV")) { out.mWrapV = ReadBoolFromTextContent(); TestClosing("wrapV"); - } - else if (IsElement("mirrorU")) { + } else if (IsElement("mirrorU")) { out.mMirrorU = ReadBoolFromTextContent(); TestClosing("mirrorU"); - } - else if (IsElement("mirrorV")) { + } else if (IsElement("mirrorV")) { out.mMirrorV = ReadBoolFromTextContent(); TestClosing("mirrorV"); - } - else if (IsElement("repeatU")) { + } else if (IsElement("repeatU")) { out.mTransform.mScaling.x = ReadFloatFromTextContent(); TestClosing("repeatU"); - } - else if (IsElement("repeatV")) { + } else if (IsElement("repeatV")) { out.mTransform.mScaling.y = ReadFloatFromTextContent(); TestClosing("repeatV"); - } - else if (IsElement("offsetU")) { + } else if (IsElement("offsetU")) { out.mTransform.mTranslation.x = ReadFloatFromTextContent(); TestClosing("offsetU"); - } - else if (IsElement("offsetV")) { + } else if (IsElement("offsetV")) { out.mTransform.mTranslation.y = ReadFloatFromTextContent(); TestClosing("offsetV"); - } - else if (IsElement("rotateUV")) { + } else if (IsElement("rotateUV")) { out.mTransform.mRotation = ReadFloatFromTextContent(); TestClosing("rotateUV"); - } - else if (IsElement("blend_mode")) { + } else if (IsElement("blend_mode")) { - const char* sz = GetTextContent(); + const char *sz = GetTextContent(); // http://www.feelingsoftware.com/content/view/55/72/lang,en/ // NONE, OVER, IN, OUT, ADD, SUBTRACT, MULTIPLY, DIFFERENCE, LIGHTEN, DARKEN, SATURATE, DESATURATE and ILLUMINATE if (0 == ASSIMP_strincmp(sz, "ADD", 3)) @@ -1825,8 +1552,7 @@ void ColladaParser::ReadSamplerProperties(Sampler& out) else if (IsElement("weighting")) { out.mWeighting = ReadFloatFromTextContent(); TestClosing("weighting"); - } - else if (IsElement("mix_with_previous_layer")) { + } else if (IsElement("mix_with_previous_layer")) { out.mMixWithPrevious = ReadFloatFromTextContent(); TestClosing("mix_with_previous_layer"); } @@ -1836,8 +1562,7 @@ void ColladaParser::ReadSamplerProperties(Sampler& out) out.mWeighting = ReadFloatFromTextContent(); TestClosing("amount"); } - } - else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { + } else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { if (strcmp(mReader->getNodeName(), "technique") == 0) break; } @@ -1846,37 +1571,32 @@ void ColladaParser::ReadSamplerProperties(Sampler& out) // ------------------------------------------------------------------------------------------------ // Reads an effect entry containing a color or a texture defining that color -void ColladaParser::ReadEffectColor(aiColor4D& pColor, Sampler& pSampler) -{ +void ColladaParser::ReadEffectColor(aiColor4D &pColor, Sampler &pSampler) { if (mReader->isEmptyElement()) return; // Save current element name const std::string curElem = mReader->getNodeName(); - while (mReader->read()) - { + while (mReader->read()) { if (mReader->getNodeType() == irr::io::EXN_ELEMENT) { - if (IsElement("color")) - { + if (IsElement("color")) { // text content contains 4 floats - const char* content = GetTextContent(); + const char *content = GetTextContent(); - content = fast_atoreal_move(content, (ai_real&)pColor.r); + content = fast_atoreal_move(content, (ai_real &)pColor.r); SkipSpacesAndLineEnd(&content); - content = fast_atoreal_move(content, (ai_real&)pColor.g); + content = fast_atoreal_move(content, (ai_real &)pColor.g); SkipSpacesAndLineEnd(&content); - content = fast_atoreal_move(content, (ai_real&)pColor.b); + content = fast_atoreal_move(content, (ai_real &)pColor.b); SkipSpacesAndLineEnd(&content); - content = fast_atoreal_move(content, (ai_real&)pColor.a); + content = fast_atoreal_move(content, (ai_real &)pColor.a); SkipSpacesAndLineEnd(&content); TestClosing("color"); - } - else if (IsElement("texture")) - { + } else if (IsElement("texture")) { // get name of source texture/sampler int attrTex = GetAttribute("texture"); pSampler.mName = mReader->getAttributeValue(attrTex); @@ -1890,28 +1610,22 @@ void ColladaParser::ReadEffectColor(aiColor4D& pColor, Sampler& pSampler) // as we've read texture, the color needs to be 1,1,1,1 pColor = aiColor4D(1.f, 1.f, 1.f, 1.f); - } - else if (IsElement("technique")) - { + } else if (IsElement("technique")) { const int _profile = GetAttribute("profile"); - const char* profile = mReader->getAttributeValue(_profile); + const char *profile = mReader->getAttributeValue(_profile); // Some extensions are quite useful ... ReadSamplerProperties processes // several extensions in MAYA, OKINO and MAX3D profiles. - if (!::strcmp(profile, "MAYA") || !::strcmp(profile, "MAX3D") || !::strcmp(profile, "OKINO")) - { + if (!::strcmp(profile, "MAYA") || !::strcmp(profile, "MAX3D") || !::strcmp(profile, "OKINO")) { // get more information on this sampler ReadSamplerProperties(pSampler); - } - else SkipElement(); - } - else if (!IsElement("extra")) - { + } else + SkipElement(); + } else if (!IsElement("extra")) { // ignore the rest SkipElement(); } - } - else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { + } else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { if (mReader->getNodeName() == curElem) break; } @@ -1920,27 +1634,21 @@ void ColladaParser::ReadEffectColor(aiColor4D& pColor, Sampler& pSampler) // ------------------------------------------------------------------------------------------------ // Reads an effect entry containing a float -void ColladaParser::ReadEffectFloat(ai_real& pFloat) -{ - while (mReader->read()) - { +void ColladaParser::ReadEffectFloat(ai_real &pFloat) { + while (mReader->read()) { if (mReader->getNodeType() == irr::io::EXN_ELEMENT) { - if (IsElement("float")) - { + if (IsElement("float")) { // text content contains a single floats - const char* content = GetTextContent(); + const char *content = GetTextContent(); content = fast_atoreal_move(content, pFloat); SkipSpacesAndLineEnd(&content); TestClosing("float"); - } - else - { + } else { // ignore the rest SkipElement(); } - } - else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { + } else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { break; } } @@ -1948,55 +1656,45 @@ void ColladaParser::ReadEffectFloat(ai_real& pFloat) // ------------------------------------------------------------------------------------------------ // Reads an effect parameter specification of any kind -void ColladaParser::ReadEffectParam(Collada::EffectParam& pParam) -{ - while (mReader->read()) - { +void ColladaParser::ReadEffectParam(Collada::EffectParam &pParam) { + while (mReader->read()) { if (mReader->getNodeType() == irr::io::EXN_ELEMENT) { - if (IsElement("surface")) - { + if (IsElement("surface")) { // image ID given inside tags TestOpening("init_from"); - const char* content = GetTextContent(); + const char *content = GetTextContent(); pParam.mType = Param_Surface; pParam.mReference = content; TestClosing("init_from"); // don't care for remaining stuff SkipElement("surface"); - } - else if (IsElement("sampler2D") && (FV_1_4_n == mFormat || FV_1_3_n == mFormat)) - { + } else if (IsElement("sampler2D") && (FV_1_4_n == mFormat || FV_1_3_n == mFormat)) { // surface ID is given inside tags TestOpening("source"); - const char* content = GetTextContent(); + const char *content = GetTextContent(); pParam.mType = Param_Sampler; pParam.mReference = content; TestClosing("source"); // don't care for remaining stuff SkipElement("sampler2D"); - } - else if (IsElement("sampler2D")) - { + } else if (IsElement("sampler2D")) { // surface ID is given inside tags TestOpening("instance_image"); int attrURL = GetAttribute("url"); - const char* url = mReader->getAttributeValue(attrURL); + const char *url = mReader->getAttributeValue(attrURL); if (url[0] != '#') ThrowException("Unsupported URL format in instance_image"); url++; pParam.mType = Param_Sampler; pParam.mReference = url; SkipElement("sampler2D"); - } - else - { + } else { // ignore unknown element SkipElement(); } - } - else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { + } else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { break; } } @@ -2004,17 +1702,13 @@ void ColladaParser::ReadEffectParam(Collada::EffectParam& pParam) // ------------------------------------------------------------------------------------------------ // Reads the geometry library contents -void ColladaParser::ReadGeometryLibrary() -{ +void ColladaParser::ReadGeometryLibrary() { if (mReader->isEmptyElement()) return; - while (mReader->read()) - { - if (mReader->getNodeType() == irr::io::EXN_ELEMENT) - { - if (IsElement("geometry")) - { + while (mReader->read()) { + if (mReader->getNodeType() == irr::io::EXN_ELEMENT) { + if (IsElement("geometry")) { // read ID. Another entry which is "optional" by design but obligatory in reality int indexID = GetAttribute("id"); std::string id = mReader->getAttributeValue(indexID); @@ -2023,27 +1717,22 @@ void ColladaParser::ReadGeometryLibrary() // ai_assert( TestAttribute( "sid") == -1); // create a mesh and store it in the library under its ID - Mesh* mesh = new Mesh; + Mesh *mesh = new Mesh; mMeshLibrary[id] = mesh; // read the mesh name if it exists const int nameIndex = TestAttribute("name"); - if (nameIndex != -1) - { + if (nameIndex != -1) { mesh->mName = mReader->getAttributeValue(nameIndex); } // read on from there ReadGeometry(mesh); - } - else - { + } else { // ignore the rest SkipElement(); } - } - else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) - { + } else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { if (strcmp(mReader->getNodeName(), "library_geometries") != 0) ThrowException("Expected end of element."); @@ -2054,28 +1743,20 @@ void ColladaParser::ReadGeometryLibrary() // ------------------------------------------------------------------------------------------------ // Reads a geometry from the geometry library. -void ColladaParser::ReadGeometry(Collada::Mesh* pMesh) -{ +void ColladaParser::ReadGeometry(Collada::Mesh *pMesh) { if (mReader->isEmptyElement()) return; - while (mReader->read()) - { - if (mReader->getNodeType() == irr::io::EXN_ELEMENT) - { - if (IsElement("mesh")) - { + while (mReader->read()) { + if (mReader->getNodeType() == irr::io::EXN_ELEMENT) { + if (IsElement("mesh")) { // read on from there ReadMesh(pMesh); - } - else - { + } else { // ignore the rest SkipElement(); } - } - else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) - { + } else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { if (strcmp(mReader->getNodeName(), "geometry") != 0) ThrowException("Expected end of element."); @@ -2086,50 +1767,32 @@ void ColladaParser::ReadGeometry(Collada::Mesh* pMesh) // ------------------------------------------------------------------------------------------------ // Reads a mesh from the geometry library -void ColladaParser::ReadMesh(Mesh* pMesh) -{ +void ColladaParser::ReadMesh(Mesh *pMesh) { if (mReader->isEmptyElement()) return; - while (mReader->read()) - { - if (mReader->getNodeType() == irr::io::EXN_ELEMENT) - { - if (IsElement("source")) - { + while (mReader->read()) { + if (mReader->getNodeType() == irr::io::EXN_ELEMENT) { + if (IsElement("source")) { // we have professionals dealing with this ReadSource(); - } - else if (IsElement("vertices")) - { + } else if (IsElement("vertices")) { // read per-vertex mesh data ReadVertexData(pMesh); - } - else if (IsElement("triangles") || IsElement("lines") || IsElement("linestrips") - || IsElement("polygons") || IsElement("polylist") || IsElement("trifans") || IsElement("tristrips")) - { + } else if (IsElement("triangles") || IsElement("lines") || IsElement("linestrips") || IsElement("polygons") || IsElement("polylist") || IsElement("trifans") || IsElement("tristrips")) { // read per-index mesh data and faces setup ReadIndexData(pMesh); - } - else - { + } else { // ignore the restf SkipElement(); } - } - else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) - { - if (strcmp(mReader->getNodeName(), "technique_common") == 0) - { + } else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { + if (strcmp(mReader->getNodeName(), "technique_common") == 0) { // end of another meaningless element - read over it - } - else if (strcmp(mReader->getNodeName(), "mesh") == 0) - { + } else if (strcmp(mReader->getNodeName(), "mesh") == 0) { // end of element - we're done here break; - } - else - { + } else { // everything else should be punished ThrowException("Expected end of element."); } @@ -2139,46 +1802,29 @@ void ColladaParser::ReadMesh(Mesh* pMesh) // ------------------------------------------------------------------------------------------------ // Reads a source element -void ColladaParser::ReadSource() -{ +void ColladaParser::ReadSource() { int indexID = GetAttribute("id"); std::string sourceID = mReader->getAttributeValue(indexID); - while (mReader->read()) - { - if (mReader->getNodeType() == irr::io::EXN_ELEMENT) - { - if (IsElement("float_array") || IsElement("IDREF_array") || IsElement("Name_array")) - { + while (mReader->read()) { + if (mReader->getNodeType() == irr::io::EXN_ELEMENT) { + if (IsElement("float_array") || IsElement("IDREF_array") || IsElement("Name_array")) { ReadDataArray(); - } - else if (IsElement("technique_common")) - { + } else if (IsElement("technique_common")) { // I don't care for your profiles - } - else if (IsElement("accessor")) - { + } else if (IsElement("accessor")) { ReadAccessor(sourceID); - } - else - { + } else { // ignore the rest SkipElement(); } - } - else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) - { - if (strcmp(mReader->getNodeName(), "source") == 0) - { + } else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { + if (strcmp(mReader->getNodeName(), "source") == 0) { // end of - we're done break; - } - else if (strcmp(mReader->getNodeName(), "technique_common") == 0) - { + } else if (strcmp(mReader->getNodeName(), "technique_common") == 0) { // end of another meaningless element - read over it - } - else - { + } else { // everything else should be punished ThrowException("Expected end of element."); } @@ -2188,8 +1834,7 @@ void ColladaParser::ReadSource() // ------------------------------------------------------------------------------------------------ // Reads a data array holding a number of floats, and stores it in the global library -void ColladaParser::ReadDataArray() -{ +void ColladaParser::ReadDataArray() { std::string elmName = mReader->getNodeName(); bool isStringArray = (elmName == "IDREF_array" || elmName == "Name_array"); bool isEmptyElement = mReader->isEmptyElement(); @@ -2199,23 +1844,20 @@ void ColladaParser::ReadDataArray() std::string id = mReader->getAttributeValue(indexID); int indexCount = GetAttribute("count"); unsigned int count = (unsigned int)mReader->getAttributeValueAsInt(indexCount); - const char* content = TestTextContent(); + const char *content = TestTextContent(); // read values and store inside an array in the data library mDataLibrary[id] = Data(); - Data& data = mDataLibrary[id]; + Data &data = mDataLibrary[id]; data.mIsStringArray = isStringArray; // some exporters write empty data arrays, but we need to conserve them anyways because others might reference them - if (content) - { - if (isStringArray) - { + if (content) { + if (isStringArray) { data.mStrings.reserve(count); std::string s; - for (unsigned int a = 0; a < count; a++) - { + for (unsigned int a = 0; a < count; a++) { if (*content == 0) ThrowException("Expected more values while reading IDREF_array contents."); @@ -2226,13 +1868,10 @@ void ColladaParser::ReadDataArray() SkipSpacesAndLineEnd(&content); } - } - else - { + } else { data.mValues.reserve(count); - for (unsigned int a = 0; a < count; a++) - { + for (unsigned int a = 0; a < count; a++) { if (*content == 0) ThrowException("Expected more values while reading float_array contents."); @@ -2253,11 +1892,10 @@ void ColladaParser::ReadDataArray() // ------------------------------------------------------------------------------------------------ // Reads an accessor and stores it in the global library -void ColladaParser::ReadAccessor(const std::string& pID) -{ +void ColladaParser::ReadAccessor(const std::string &pID) { // read accessor attributes int attrSource = GetAttribute("source"); - const char* source = mReader->getAttributeValue(attrSource); + const char *source = mReader->getAttributeValue(attrSource); if (source[0] != '#') ThrowException(format() << "Unknown reference format in url \"" << source << "\" in source attribute of element."); int attrCount = GetAttribute("count"); @@ -2273,7 +1911,7 @@ void ColladaParser::ReadAccessor(const std::string& pID) // store in the library under the given ID mAccessorLibrary[pID] = Accessor(); - Accessor& acc = mAccessorLibrary[pID]; + Accessor &acc = mAccessorLibrary[pID]; acc.mCount = count; acc.mOffset = offset; acc.mStride = stride; @@ -2281,50 +1919,57 @@ void ColladaParser::ReadAccessor(const std::string& pID) acc.mSize = 0; // gets incremented with every param // and read the components - while (mReader->read()) - { - if (mReader->getNodeType() == irr::io::EXN_ELEMENT) - { - if (IsElement("param")) - { + while (mReader->read()) { + if (mReader->getNodeType() == irr::io::EXN_ELEMENT) { + if (IsElement("param")) { // read data param int attrName = TestAttribute("name"); std::string name; - if (attrName > -1) - { + if (attrName > -1) { name = mReader->getAttributeValue(attrName); // analyse for common type components and store it's sub-offset in the corresponding field /* Cartesian coordinates */ - if (name == "X") acc.mSubOffset[0] = acc.mParams.size(); - else if (name == "Y") acc.mSubOffset[1] = acc.mParams.size(); - else if (name == "Z") acc.mSubOffset[2] = acc.mParams.size(); + if (name == "X") + acc.mSubOffset[0] = acc.mParams.size(); + else if (name == "Y") + acc.mSubOffset[1] = acc.mParams.size(); + else if (name == "Z") + acc.mSubOffset[2] = acc.mParams.size(); /* RGBA colors */ - else if (name == "R") acc.mSubOffset[0] = acc.mParams.size(); - else if (name == "G") acc.mSubOffset[1] = acc.mParams.size(); - else if (name == "B") acc.mSubOffset[2] = acc.mParams.size(); - else if (name == "A") acc.mSubOffset[3] = acc.mParams.size(); + else if (name == "R") + acc.mSubOffset[0] = acc.mParams.size(); + else if (name == "G") + acc.mSubOffset[1] = acc.mParams.size(); + else if (name == "B") + acc.mSubOffset[2] = acc.mParams.size(); + else if (name == "A") + acc.mSubOffset[3] = acc.mParams.size(); /* UVWQ (STPQ) texture coordinates */ - else if (name == "S") acc.mSubOffset[0] = acc.mParams.size(); - else if (name == "T") acc.mSubOffset[1] = acc.mParams.size(); - else if (name == "P") acc.mSubOffset[2] = acc.mParams.size(); + else if (name == "S") + acc.mSubOffset[0] = acc.mParams.size(); + else if (name == "T") + acc.mSubOffset[1] = acc.mParams.size(); + else if (name == "P") + acc.mSubOffset[2] = acc.mParams.size(); // else if( name == "Q") acc.mSubOffset[3] = acc.mParams.size(); - /* 4D uv coordinates are not supported in Assimp */ + /* 4D uv coordinates are not supported in Assimp */ - /* Generic extra data, interpreted as UV data, too*/ - else if (name == "U") acc.mSubOffset[0] = acc.mParams.size(); - else if (name == "V") acc.mSubOffset[1] = acc.mParams.size(); + /* Generic extra data, interpreted as UV data, too*/ + else if (name == "U") + acc.mSubOffset[0] = acc.mParams.size(); + else if (name == "V") + acc.mSubOffset[1] = acc.mParams.size(); //else // DefaultLogger::get()->warn( format() << "Unknown accessor parameter \"" << name << "\". Ignoring data channel." ); } // read data type int attrType = TestAttribute("type"); - if (attrType > -1) - { + if (attrType > -1) { // for the moment we only distinguish between a 4x4 matrix and anything else. // TODO: (thom) I don't have a spec here at work. Check if there are other multi-value types // which should be tested for here. @@ -2339,14 +1984,10 @@ void ColladaParser::ReadAccessor(const std::string& pID) // skip remaining stuff of this element, if any SkipElement(); - } - else - { + } else { ThrowException(format() << "Unexpected sub element <" << mReader->getNodeName() << "> in tag "); } - } - else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) - { + } else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { if (strcmp(mReader->getNodeName(), "accessor") != 0) ThrowException("Expected end of element."); break; @@ -2356,28 +1997,20 @@ void ColladaParser::ReadAccessor(const std::string& pID) // ------------------------------------------------------------------------------------------------ // Reads input declarations of per-vertex mesh data into the given mesh -void ColladaParser::ReadVertexData(Mesh* pMesh) -{ +void ColladaParser::ReadVertexData(Mesh *pMesh) { // extract the ID of the element. Not that we care, but to catch strange referencing schemes we should warn about int attrID = GetAttribute("id"); pMesh->mVertexID = mReader->getAttributeValue(attrID); // a number of elements - while (mReader->read()) - { - if (mReader->getNodeType() == irr::io::EXN_ELEMENT) - { - if (IsElement("input")) - { + while (mReader->read()) { + if (mReader->getNodeType() == irr::io::EXN_ELEMENT) { + if (IsElement("input")) { ReadInputChannel(pMesh->mPerVertexData); - } - else - { + } else { ThrowException(format() << "Unexpected sub element <" << mReader->getNodeName() << "> in tag "); } - } - else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) - { + } else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { if (strcmp(mReader->getNodeName(), "vertices") != 0) ThrowException("Expected end of element."); @@ -2388,8 +2021,7 @@ void ColladaParser::ReadVertexData(Mesh* pMesh) // ------------------------------------------------------------------------------------------------ // Reads input declarations of per-index mesh data into the given mesh -void ColladaParser::ReadIndexData(Mesh* pMesh) -{ +void ColladaParser::ReadIndexData(Mesh *pMesh) { std::vector vcount; std::vector perIndexData; @@ -2427,25 +2059,18 @@ void ColladaParser::ReadIndexData(Mesh* pMesh) ai_assert(primType != Prim_Invalid); // also a number of elements, but in addition a

primitive collection and probably index counts for all primitives - while (mReader->read()) - { - if (mReader->getNodeType() == irr::io::EXN_ELEMENT) - { - if (IsElement("input")) - { + while (mReader->read()) { + if (mReader->getNodeType() == irr::io::EXN_ELEMENT) { + if (IsElement("input")) { ReadInputChannel(perIndexData); - } - else if (IsElement("vcount")) - { - if (!mReader->isEmptyElement()) - { - if (numPrimitives) // It is possible to define a mesh without any primitives + } else if (IsElement("vcount")) { + if (!mReader->isEmptyElement()) { + if (numPrimitives) // It is possible to define a mesh without any primitives { // case - specifies the number of indices for each polygon - const char* content = GetTextContent(); + const char *content = GetTextContent(); vcount.reserve(numPrimitives); - for (unsigned int a = 0; a < numPrimitives; a++) - { + for (unsigned int a = 0; a < numPrimitives; a++) { if (*content == 0) ThrowException("Expected more values while reading contents."); // read a number @@ -2457,28 +2082,19 @@ void ColladaParser::ReadIndexData(Mesh* pMesh) TestClosing("vcount"); } - } - else if (IsElement("p")) - { - if (!mReader->isEmptyElement()) - { + } else if (IsElement("p")) { + if (!mReader->isEmptyElement()) { // now here the actual fun starts - these are the indices to construct the mesh data from actualPrimitives += ReadPrimitives(pMesh, perIndexData, numPrimitives, vcount, primType); } - } - else if (IsElement("extra")) - { + } else if (IsElement("extra")) { SkipElement("extra"); - } - else if (IsElement("ph")) { + } else if (IsElement("ph")) { SkipElement("ph"); - } - else { + } else { ThrowException(format() << "Unexpected sub element <" << mReader->getNodeName() << "> in tag <" << elementName << ">"); } - } - else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) - { + } else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { if (mReader->getNodeName() != elementName) ThrowException(format() << "Expected end of <" << elementName << "> element."); @@ -2488,7 +2104,7 @@ void ColladaParser::ReadIndexData(Mesh* pMesh) #ifdef ASSIMP_BUILD_DEBUG if (primType != Prim_TriFans && primType != Prim_TriStrips && primType != Prim_LineStrip && - primType != Prim_Lines) { // this is ONLY to workaround a bug in SketchUp 15.3.331 where it writes the wrong 'count' when it writes out the 'lines'. + primType != Prim_Lines) { // this is ONLY to workaround a bug in SketchUp 15.3.331 where it writes the wrong 'count' when it writes out the 'lines'. ai_assert(actualPrimitives == numPrimitives); } #endif @@ -2500,8 +2116,7 @@ void ColladaParser::ReadIndexData(Mesh* pMesh) // ------------------------------------------------------------------------------------------------ // Reads a single input channel element and stores it in the given array, if valid -void ColladaParser::ReadInputChannel(std::vector& poChannels) -{ +void ColladaParser::ReadInputChannel(std::vector &poChannels) { InputChannel channel; // read semantic @@ -2511,7 +2126,7 @@ void ColladaParser::ReadInputChannel(std::vector& poChannels) // read source int attrSource = GetAttribute("source"); - const char* source = mReader->getAttributeValue(attrSource); + const char *source = mReader->getAttributeValue(attrSource); if (source[0] != '#') ThrowException(format() << "Unknown reference format in url \"" << source << "\" in source attribute of element."); channel.mAccessor = source + 1; // skipping the leading #, hopefully the remaining text is the accessor ID only @@ -2543,15 +2158,13 @@ void ColladaParser::ReadInputChannel(std::vector& poChannels) // ------------------------------------------------------------------------------------------------ // Reads a

primitive index list and assembles the mesh data into the given mesh -size_t ColladaParser::ReadPrimitives(Mesh* pMesh, std::vector& pPerIndexChannels, - size_t pNumPrimitives, const std::vector& pVCount, PrimitiveType pPrimType) -{ +size_t ColladaParser::ReadPrimitives(Mesh *pMesh, std::vector &pPerIndexChannels, + size_t pNumPrimitives, const std::vector &pVCount, PrimitiveType pPrimType) { // determine number of indices coming per vertex // find the offset index for all per-vertex channels size_t numOffsets = 1; size_t perVertexOffset = SIZE_MAX; // invalid value - for (const InputChannel& channel : pPerIndexChannels) - { + for (const InputChannel &channel : pPerIndexChannels) { numOffsets = std::max(numOffsets, channel.mOffset + 1); if (channel.mType == IT_Vertex) perVertexOffset = channel.mOffset; @@ -2559,10 +2172,8 @@ size_t ColladaParser::ReadPrimitives(Mesh* pMesh, std::vector& pPe // determine the expected number of indices size_t expectedPointCount = 0; - switch (pPrimType) - { - case Prim_Polylist: - { + switch (pPrimType) { + case Prim_Polylist: { for (size_t i : pVCount) expectedPointCount += i; break; @@ -2585,9 +2196,8 @@ size_t ColladaParser::ReadPrimitives(Mesh* pMesh, std::vector& pPe if (pNumPrimitives > 0) // It is possible to not contain any indices { - const char* content = GetTextContent(); - while (*content != 0) - { + const char *content = GetTextContent(); + while (*content != 0) { // read a value. // Hack: (thom) Some exporters put negative indices sometimes. We just try to carry on anyways. int value = std::max(0, strtol10(content, &content)); @@ -2603,38 +2213,33 @@ size_t ColladaParser::ReadPrimitives(Mesh* pMesh, std::vector& pPe // HACK: We just fix this number since SketchUp 15.3.331 writes the wrong 'count' for 'lines' ReportWarning("Expected different index count in

element, %zu instead of %zu.", indices.size(), expectedPointCount * numOffsets); pNumPrimitives = (indices.size() / numOffsets) / 2; - } - else + } else ThrowException("Expected different index count in

element."); - } - else if (expectedPointCount == 0 && (indices.size() % numOffsets) != 0) + } else if (expectedPointCount == 0 && (indices.size() % numOffsets) != 0) ThrowException("Expected different index count in

element."); // find the data for all sources - for (std::vector::iterator it = pMesh->mPerVertexData.begin(); it != pMesh->mPerVertexData.end(); ++it) - { - InputChannel& input = *it; + for (std::vector::iterator it = pMesh->mPerVertexData.begin(); it != pMesh->mPerVertexData.end(); ++it) { + InputChannel &input = *it; if (input.mResolved) continue; // find accessor input.mResolved = &ResolveLibraryReference(mAccessorLibrary, input.mAccessor); // resolve accessor's data pointer as well, if necessary - const Accessor* acc = input.mResolved; + const Accessor *acc = input.mResolved; if (!acc->mData) acc->mData = &ResolveLibraryReference(mDataLibrary, acc->mSource); } // and the same for the per-index channels - for (std::vector::iterator it = pPerIndexChannels.begin(); it != pPerIndexChannels.end(); ++it) - { - InputChannel& input = *it; + for (std::vector::iterator it = pPerIndexChannels.begin(); it != pPerIndexChannels.end(); ++it) { + InputChannel &input = *it; if (input.mResolved) continue; // ignore vertex pointer, it doesn't refer to an accessor - if (input.mType == IT_Vertex) - { + if (input.mType == IT_Vertex) { // warn if the vertex channel does not refer to the element in the same mesh if (input.mAccessor != pMesh->mVertexID) ThrowException("Unsupported vertex referencing scheme."); @@ -2644,7 +2249,7 @@ size_t ColladaParser::ReadPrimitives(Mesh* pMesh, std::vector& pPe // find accessor input.mResolved = &ResolveLibraryReference(mAccessorLibrary, input.mAccessor); // resolve accessor's data pointer as well, if necessary - const Accessor* acc = input.mResolved; + const Accessor *acc = input.mResolved; if (!acc->mData) acc->mData = &ResolveLibraryReference(mDataLibrary, acc->mSource); } @@ -2667,12 +2272,10 @@ size_t ColladaParser::ReadPrimitives(Mesh* pMesh, std::vector& pPe pMesh->mFacePosIndices.reserve(indices.size() / numOffsets); size_t polylistStartVertex = 0; - for (size_t currentPrimitive = 0; currentPrimitive < numPrimitives; currentPrimitive++) - { + for (size_t currentPrimitive = 0; currentPrimitive < numPrimitives; currentPrimitive++) { // determine number of points for this primitive size_t numPoints = 0; - switch (pPrimType) - { + switch (pPrimType) { case Prim_Lines: numPoints = 2; for (size_t currentVertex = 0; currentVertex < numPoints; currentVertex++) @@ -2722,7 +2325,7 @@ size_t ColladaParser::ReadPrimitives(Mesh* pMesh, std::vector& pPe ///@note This function willn't work correctly if both PerIndex and PerVertex channels have same channels. ///For example if TEXCOORD present in both and tags this function will create wrong uv coordinates. ///It's not clear from COLLADA documentation is this allowed or not. For now only exporter fixed to avoid such behavior -void ColladaParser::CopyVertex(size_t currentVertex, size_t numOffsets, size_t numPoints, size_t perVertexOffset, Mesh* pMesh, std::vector& pPerIndexChannels, size_t currentPrimitive, const std::vector& indices) { +void ColladaParser::CopyVertex(size_t currentVertex, size_t numOffsets, size_t numPoints, size_t perVertexOffset, Mesh *pMesh, std::vector &pPerIndexChannels, size_t currentPrimitive, const std::vector &indices) { // calculate the base offset of the vertex whose attributes we ant to copy size_t baseOffset = currentPrimitive * numOffsets * numPoints + currentVertex * numOffsets; @@ -2740,14 +2343,13 @@ void ColladaParser::CopyVertex(size_t currentVertex, size_t numOffsets, size_t n pMesh->mFacePosIndices.push_back(indices[baseOffset + perVertexOffset]); } -void ColladaParser::ReadPrimTriStrips(size_t numOffsets, size_t perVertexOffset, Mesh* pMesh, std::vector& pPerIndexChannels, size_t currentPrimitive, const std::vector& indices) { +void ColladaParser::ReadPrimTriStrips(size_t numOffsets, size_t perVertexOffset, Mesh *pMesh, std::vector &pPerIndexChannels, size_t currentPrimitive, const std::vector &indices) { if (currentPrimitive % 2 != 0) { //odd tristrip triangles need their indices mangled, to preserve winding direction CopyVertex(1, numOffsets, 1, perVertexOffset, pMesh, pPerIndexChannels, currentPrimitive, indices); CopyVertex(0, numOffsets, 1, perVertexOffset, pMesh, pPerIndexChannels, currentPrimitive, indices); CopyVertex(2, numOffsets, 1, perVertexOffset, pMesh, pPerIndexChannels, currentPrimitive, indices); - } - else {//for non tristrips or even tristrip triangles + } else { //for non tristrips or even tristrip triangles CopyVertex(0, numOffsets, 1, perVertexOffset, pMesh, pPerIndexChannels, currentPrimitive, indices); CopyVertex(1, numOffsets, 1, perVertexOffset, pMesh, pPerIndexChannels, currentPrimitive, indices); CopyVertex(2, numOffsets, 1, perVertexOffset, pMesh, pPerIndexChannels, currentPrimitive, indices); @@ -2756,18 +2358,17 @@ void ColladaParser::ReadPrimTriStrips(size_t numOffsets, size_t perVertexOffset, // ------------------------------------------------------------------------------------------------ // Extracts a single object from an input channel and stores it in the appropriate mesh data array -void ColladaParser::ExtractDataObjectFromChannel(const InputChannel& pInput, size_t pLocalIndex, Mesh* pMesh) -{ +void ColladaParser::ExtractDataObjectFromChannel(const InputChannel &pInput, size_t pLocalIndex, Mesh *pMesh) { // ignore vertex referrer - we handle them that separate if (pInput.mType == IT_Vertex) return; - const Accessor& acc = *pInput.mResolved; + const Accessor &acc = *pInput.mResolved; if (pLocalIndex >= acc.mCount) ThrowException(format() << "Invalid data index (" << pLocalIndex << "/" << acc.mCount << ") in primitive specification"); // get a pointer to the start of the data object referred to by the accessor and the local index - const ai_real* dataObject = &(acc.mData->mValues[0]) + acc.mOffset + pLocalIndex * acc.mStride; + const ai_real *dataObject = &(acc.mData->mValues[0]) + acc.mOffset + pLocalIndex * acc.mStride; // assemble according to the accessors component sub-offset list. We don't care, yet, // what kind of object exactly we're extracting here @@ -2776,8 +2377,7 @@ void ColladaParser::ExtractDataObjectFromChannel(const InputChannel& pInput, siz obj[c] = dataObject[acc.mSubOffset[c]]; // now we reinterpret it according to the type we're reading here - switch (pInput.mType) - { + switch (pInput.mType) { case IT_Position: // ignore all position streams except 0 - there can be only one position if (pInput.mIndex == 0) pMesh->mPositions.push_back(aiVector3D(obj[0], obj[1], obj[2])); @@ -2819,40 +2419,33 @@ void ColladaParser::ExtractDataObjectFromChannel(const InputChannel& pInput, siz break; case IT_Texcoord: // up to 4 texture coord sets are fine, ignore the others - if (pInput.mIndex < AI_MAX_NUMBER_OF_TEXTURECOORDS) - { + if (pInput.mIndex < AI_MAX_NUMBER_OF_TEXTURECOORDS) { // pad to current vertex count if necessary if (pMesh->mTexCoords[pInput.mIndex].size() < pMesh->mPositions.size() - 1) pMesh->mTexCoords[pInput.mIndex].insert(pMesh->mTexCoords[pInput.mIndex].end(), - pMesh->mPositions.size() - pMesh->mTexCoords[pInput.mIndex].size() - 1, aiVector3D(0, 0, 0)); + pMesh->mPositions.size() - pMesh->mTexCoords[pInput.mIndex].size() - 1, aiVector3D(0, 0, 0)); pMesh->mTexCoords[pInput.mIndex].push_back(aiVector3D(obj[0], obj[1], obj[2])); if (0 != acc.mSubOffset[2] || 0 != acc.mSubOffset[3]) /* hack ... consider cleaner solution */ pMesh->mNumUVComponents[pInput.mIndex] = 3; - } - else - { + } else { ASSIMP_LOG_ERROR("Collada: too many texture coordinate sets. Skipping."); } break; case IT_Color: // up to 4 color sets are fine, ignore the others - if (pInput.mIndex < AI_MAX_NUMBER_OF_COLOR_SETS) - { + if (pInput.mIndex < AI_MAX_NUMBER_OF_COLOR_SETS) { // pad to current vertex count if necessary if (pMesh->mColors[pInput.mIndex].size() < pMesh->mPositions.size() - 1) pMesh->mColors[pInput.mIndex].insert(pMesh->mColors[pInput.mIndex].end(), - pMesh->mPositions.size() - pMesh->mColors[pInput.mIndex].size() - 1, aiColor4D(0, 0, 0, 1)); + pMesh->mPositions.size() - pMesh->mColors[pInput.mIndex].size() - 1, aiColor4D(0, 0, 0, 1)); aiColor4D result(0, 0, 0, 1); - for (size_t i = 0; i < pInput.mResolved->mSize; ++i) - { + for (size_t i = 0; i < pInput.mResolved->mSize; ++i) { result[static_cast(i)] = obj[pInput.mResolved->mSubOffset[i]]; } pMesh->mColors[pInput.mIndex].push_back(result); - } - else - { + } else { ASSIMP_LOG_ERROR("Collada: too many vertex color sets. Skipping."); } @@ -2865,44 +2458,36 @@ void ColladaParser::ExtractDataObjectFromChannel(const InputChannel& pInput, siz // ------------------------------------------------------------------------------------------------ // Reads the library of node hierarchies and scene parts -void ColladaParser::ReadSceneLibrary() -{ +void ColladaParser::ReadSceneLibrary() { if (mReader->isEmptyElement()) return; - while (mReader->read()) - { - if (mReader->getNodeType() == irr::io::EXN_ELEMENT) - { + while (mReader->read()) { + if (mReader->getNodeType() == irr::io::EXN_ELEMENT) { // a visual scene - generate root node under its ID and let ReadNode() do the recursive work - if (IsElement("visual_scene")) - { + if (IsElement("visual_scene")) { // read ID. Is optional according to the spec, but how on earth should a scene_instance refer to it then? int indexID = GetAttribute("id"); - const char* attrID = mReader->getAttributeValue(indexID); + const char *attrID = mReader->getAttributeValue(indexID); // read name if given. int indexName = TestAttribute("name"); - const char* attrName = "unnamed"; + const char *attrName = "unnamed"; if (indexName > -1) attrName = mReader->getAttributeValue(indexName); // create a node and store it in the library under its ID - Node* node = new Node; + Node *node = new Node; node->mID = attrID; node->mName = attrName; mNodeLibrary[node->mID] = node; ReadSceneNode(node); - } - else - { + } else { // ignore the rest SkipElement(); } - } - else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) - { + } else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { if (strcmp(mReader->getNodeName(), "library_visual_scenes") == 0) //ThrowException( "Expected end of \"library_visual_scenes\" element."); @@ -2913,19 +2498,15 @@ void ColladaParser::ReadSceneLibrary() // ------------------------------------------------------------------------------------------------ // Reads a scene node's contents including children and stores it in the given node -void ColladaParser::ReadSceneNode(Node* pNode) -{ +void ColladaParser::ReadSceneNode(Node *pNode) { // quit immediately on elements if (mReader->isEmptyElement()) return; - while (mReader->read()) - { - if (mReader->getNodeType() == irr::io::EXN_ELEMENT) - { - if (IsElement("node")) - { - Node* child = new Node; + while (mReader->read()) { + if (mReader->getNodeType() == irr::io::EXN_ELEMENT) { + if (IsElement("node")) { + Node *child = new Node; int attrID = TestAttribute("id"); if (attrID > -1) child->mID = mReader->getAttributeValue(attrID); @@ -2940,13 +2521,10 @@ void ColladaParser::ReadSceneNode(Node* pNode) // TODO: (thom) support SIDs // ai_assert( TestAttribute( "sid") == -1); - if (pNode) - { + if (pNode) { pNode->mChildren.push_back(child); child->mParent = pNode; - } - else - { + } else { // no parent node given, probably called from element. // create new node in node library mNodeLibrary[child->mID] = child; @@ -2972,82 +2550,65 @@ void ColladaParser::ReadSceneNode(Node* pNode) ReadNodeTransformation(pNode, TF_SKEW); else if (IsElement("translate")) ReadNodeTransformation(pNode, TF_TRANSLATE); - else if (IsElement("render") && pNode->mParent == NULL && 0 == pNode->mPrimaryCamera.length()) - { + else if (IsElement("render") && pNode->mParent == NULL && 0 == pNode->mPrimaryCamera.length()) { // ... scene evaluation or, in other words, postprocessing pipeline, // or, again in other words, a turing-complete description how to // render a Collada scene. The only thing that is interesting for // us is the primary camera. int attrId = TestAttribute("camera_node"); - if (-1 != attrId) - { - const char* s = mReader->getAttributeValue(attrId); + if (-1 != attrId) { + const char *s = mReader->getAttributeValue(attrId); if (s[0] != '#') ASSIMP_LOG_ERROR("Collada: Unresolved reference format of camera"); else pNode->mPrimaryCamera = s + 1; } - } - else if (IsElement("instance_node")) - { + } else if (IsElement("instance_node")) { // find the node in the library int attrID = TestAttribute("url"); - if (attrID != -1) - { - const char* s = mReader->getAttributeValue(attrID); + if (attrID != -1) { + const char *s = mReader->getAttributeValue(attrID); if (s[0] != '#') ASSIMP_LOG_ERROR("Collada: Unresolved reference format of node"); - else - { + else { pNode->mNodeInstances.push_back(NodeInstance()); pNode->mNodeInstances.back().mNode = s + 1; } } - } - else if (IsElement("instance_geometry") || IsElement("instance_controller")) - { + } else if (IsElement("instance_geometry") || IsElement("instance_controller")) { // Reference to a mesh or controller, with possible material associations ReadNodeGeometry(pNode); - } - else if (IsElement("instance_light")) - { + } else if (IsElement("instance_light")) { // Reference to a light, name given in 'url' attribute int attrID = TestAttribute("url"); if (-1 == attrID) ASSIMP_LOG_WARN("Collada: Expected url attribute in element"); - else - { - const char* url = mReader->getAttributeValue(attrID); + else { + const char *url = mReader->getAttributeValue(attrID); if (url[0] != '#') ThrowException("Unknown reference format in element"); pNode->mLights.push_back(LightInstance()); pNode->mLights.back().mLight = url + 1; } - } - else if (IsElement("instance_camera")) - { + } else if (IsElement("instance_camera")) { // Reference to a camera, name given in 'url' attribute int attrID = TestAttribute("url"); if (-1 == attrID) ASSIMP_LOG_WARN("Collada: Expected url attribute in element"); - else - { - const char* url = mReader->getAttributeValue(attrID); + else { + const char *url = mReader->getAttributeValue(attrID); if (url[0] != '#') ThrowException("Unknown reference format in element"); pNode->mCameras.push_back(CameraInstance()); pNode->mCameras.back().mCamera = url + 1; } - } - else - { + } else { // skip everything else for the moment SkipElement(); } - } - else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { + } else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { break; } } @@ -3055,8 +2616,7 @@ void ColladaParser::ReadSceneNode(Node* pNode) // ------------------------------------------------------------------------------------------------ // Reads a node transformation entry of the given type and adds it to the given node's transformation list. -void ColladaParser::ReadNodeTransformation(Node* pNode, TransformType pType) -{ +void ColladaParser::ReadNodeTransformation(Node *pNode, TransformType pType) { if (mReader->isEmptyElement()) return; @@ -3072,11 +2632,10 @@ void ColladaParser::ReadNodeTransformation(Node* pNode, TransformType pType) // how many parameters to read per transformation type static const unsigned int sNumParameters[] = { 9, 4, 3, 3, 7, 16 }; - const char* content = GetTextContent(); + const char *content = GetTextContent(); // read as many parameters and store in the transformation - for (unsigned int a = 0; a < sNumParameters[pType]; a++) - { + for (unsigned int a = 0; a < sNumParameters[pType]; a++) { // read a number content = fast_atoreal_move(content, tf.f[a]); // skip whitespace after it @@ -3092,13 +2651,10 @@ void ColladaParser::ReadNodeTransformation(Node* pNode, TransformType pType) // ------------------------------------------------------------------------------------------------ // Processes bind_vertex_input and bind elements -void ColladaParser::ReadMaterialVertexInputBinding(Collada::SemanticMappingTable& tbl) -{ - while (mReader->read()) - { +void ColladaParser::ReadMaterialVertexInputBinding(Collada::SemanticMappingTable &tbl) { + while (mReader->read()) { if (mReader->getNodeType() == irr::io::EXN_ELEMENT) { - if (IsElement("bind_vertex_input")) - { + if (IsElement("bind_vertex_input")) { Collada::InputSemanticMapEntry vn; // effect semantic @@ -3115,20 +2671,17 @@ void ColladaParser::ReadMaterialVertexInputBinding(Collada::SemanticMappingTable vn.mSet = mReader->getAttributeValueAsInt(n); tbl.mMap[s] = vn; - } - else if (IsElement("bind")) { + } else if (IsElement("bind")) { ASSIMP_LOG_WARN("Collada: Found unsupported element"); } - } - else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { + } else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { if (strcmp(mReader->getNodeName(), "instance_material") == 0) break; } } } -void ColladaParser::ReadEmbeddedTextures(ZipArchiveIOSystem& zip_archive) -{ +void ColladaParser::ReadEmbeddedTextures(ZipArchiveIOSystem &zip_archive) { // Attempt to load any undefined Collada::Image in ImageLibrary for (ImageLibrary::iterator it = mImageLibrary.begin(); it != mImageLibrary.end(); ++it) { Collada::Image &image = (*it).second; @@ -3149,31 +2702,26 @@ void ColladaParser::ReadEmbeddedTextures(ZipArchiveIOSystem& zip_archive) // ------------------------------------------------------------------------------------------------ // Reads a mesh reference in a node and adds it to the node's mesh list -void ColladaParser::ReadNodeGeometry(Node* pNode) -{ +void ColladaParser::ReadNodeGeometry(Node *pNode) { // referred mesh is given as an attribute of the element int attrUrl = GetAttribute("url"); - const char* url = mReader->getAttributeValue(attrUrl); + const char *url = mReader->getAttributeValue(attrUrl); if (url[0] != '#') ThrowException("Unknown reference format"); Collada::MeshInstance instance; instance.mMeshOrController = url + 1; // skipping the leading # - if (!mReader->isEmptyElement()) - { + if (!mReader->isEmptyElement()) { // read material associations. Ignore additional elements in between - while (mReader->read()) - { - if (mReader->getNodeType() == irr::io::EXN_ELEMENT) - { - if (IsElement("instance_material")) - { + while (mReader->read()) { + if (mReader->getNodeType() == irr::io::EXN_ELEMENT) { + if (IsElement("instance_material")) { // read ID of the geometry subgroup and the target material int attrGroup = GetAttribute("symbol"); std::string group = mReader->getAttributeValue(attrGroup); int attrMaterial = GetAttribute("target"); - const char* urlMat = mReader->getAttributeValue(attrMaterial); + const char *urlMat = mReader->getAttributeValue(attrMaterial); Collada::SemanticMappingTable s; if (urlMat[0] == '#') urlMat++; @@ -3187,11 +2735,8 @@ void ColladaParser::ReadNodeGeometry(Node* pNode) // store the association instance.mMaterials[group] = s; } - } - else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) - { - if (strcmp(mReader->getNodeName(), "instance_geometry") == 0 - || strcmp(mReader->getNodeName(), "instance_controller") == 0) + } else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { + if (strcmp(mReader->getNodeName(), "instance_geometry") == 0 || strcmp(mReader->getNodeName(), "instance_controller") == 0) break; } } @@ -3203,23 +2748,20 @@ void ColladaParser::ReadNodeGeometry(Node* pNode) // ------------------------------------------------------------------------------------------------ // Reads the collada scene -void ColladaParser::ReadScene() -{ +void ColladaParser::ReadScene() { if (mReader->isEmptyElement()) return; - while (mReader->read()) - { + while (mReader->read()) { if (mReader->getNodeType() == irr::io::EXN_ELEMENT) { - if (IsElement("instance_visual_scene")) - { + if (IsElement("instance_visual_scene")) { // should be the first and only occurrence if (mRootNode) ThrowException("Invalid scene containing multiple root nodes in element"); // read the url of the scene to instance. Should be of format "#some_name" int urlIndex = GetAttribute("url"); - const char* url = mReader->getAttributeValue(urlIndex); + const char *url = mReader->getAttributeValue(urlIndex); if (url[0] != '#') ThrowException("Unknown reference format in element"); @@ -3228,12 +2770,10 @@ void ColladaParser::ReadScene() if (sit == mNodeLibrary.end()) ThrowException("Unable to resolve visual_scene reference \"" + std::string(url) + "\" in element."); mRootNode = sit->second; - } - else { + } else { SkipElement(); } - } - else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { + } else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { break; } } @@ -3241,11 +2781,11 @@ void ColladaParser::ReadScene() // ------------------------------------------------------------------------------------------------ // Aborts the file reading with an exception -AI_WONT_RETURN void ColladaParser::ThrowException(const std::string& pError) const { +AI_WONT_RETURN void ColladaParser::ThrowException(const std::string &pError) const { throw DeadlyImportError(format() << "Collada: " << mFileName << " - " << pError); } -void ColladaParser::ReportWarning(const char* msg, ...) { +void ColladaParser::ReportWarning(const char *msg, ...) { ai_assert(nullptr != msg); va_list args; @@ -3273,7 +2813,7 @@ void ColladaParser::SkipElement() { // ------------------------------------------------------------------------------------------------ // Skips all data until the end node of the given element -void ColladaParser::SkipElement(const char* pElement) { +void ColladaParser::SkipElement(const char *pElement) { // copy the current node's name because it'a pointer to the reader's internal buffer, // which is going to change with the upcoming parsing std::string element = pElement; @@ -3288,7 +2828,7 @@ void ColladaParser::SkipElement(const char* pElement) { // ------------------------------------------------------------------------------------------------ // Tests for an opening element of the given name, throws an exception if not found -void ColladaParser::TestOpening(const char* pName) { +void ColladaParser::TestOpening(const char *pName) { // read element start if (!mReader->read()) { ThrowException(format() << "Unexpected end of file while beginning of <" << pName << "> element."); @@ -3307,7 +2847,7 @@ void ColladaParser::TestOpening(const char* pName) { // ------------------------------------------------------------------------------------------------ // Tests for the closing tag of the given element, throws an exception if not found -void ColladaParser::TestClosing(const char* pName) { +void ColladaParser::TestClosing(const char *pName) { // check if we have an empty (self-closing) element if (mReader->isEmptyElement()) { return; @@ -3337,7 +2877,7 @@ void ColladaParser::TestClosing(const char* pName) { // ------------------------------------------------------------------------------------------------ // Returns the index of the named attribute or -1 if not found. Does not throw, therefore useful for optional attributes -int ColladaParser::GetAttribute(const char* pAttr) const { +int ColladaParser::GetAttribute(const char *pAttr) const { int index = TestAttribute(pAttr); if (index == -1) { ThrowException(format() << "Expected attribute \"" << pAttr << "\" for element <" << mReader->getNodeName() << ">."); @@ -3349,8 +2889,7 @@ int ColladaParser::GetAttribute(const char* pAttr) const { // ------------------------------------------------------------------------------------------------ // Tests the present element for the presence of one attribute, returns its index or throws an exception if not found -int ColladaParser::TestAttribute(const char* pAttr) const -{ +int ColladaParser::TestAttribute(const char *pAttr) const { for (int a = 0; a < mReader->getAttributeCount(); a++) if (strcmp(mReader->getAttributeName(a), pAttr) == 0) return a; @@ -3360,9 +2899,8 @@ int ColladaParser::TestAttribute(const char* pAttr) const // ------------------------------------------------------------------------------------------------ // Reads the text contents of an element, throws an exception if not given. Skips leading whitespace. -const char* ColladaParser::GetTextContent() -{ - const char* sz = TestTextContent(); +const char *ColladaParser::GetTextContent() { + const char *sz = TestTextContent(); if (!sz) { ThrowException("Invalid contents in element \"n\"."); } @@ -3371,8 +2909,7 @@ const char* ColladaParser::GetTextContent() // ------------------------------------------------------------------------------------------------ // Reads the text contents of an element, returns NULL if not given. Skips leading whitespace. -const char* ColladaParser::TestTextContent() -{ +const char *ColladaParser::TestTextContent() { // present node should be the beginning of an element if (mReader->getNodeType() != irr::io::EXN_ELEMENT || mReader->isEmptyElement()) return NULL; @@ -3384,7 +2921,7 @@ const char* ColladaParser::TestTextContent() return NULL; // skip leading whitespace - const char* text = mReader->getNodeData(); + const char *text = mReader->getNodeData(); SkipSpacesAndLineEnd(&text); return text; @@ -3392,17 +2929,13 @@ const char* ColladaParser::TestTextContent() // ------------------------------------------------------------------------------------------------ // Calculates the resulting transformation fromm all the given transform steps -aiMatrix4x4 ColladaParser::CalculateResultTransform(const std::vector& pTransforms) const -{ +aiMatrix4x4 ColladaParser::CalculateResultTransform(const std::vector &pTransforms) const { aiMatrix4x4 res; - for (std::vector::const_iterator it = pTransforms.begin(); it != pTransforms.end(); ++it) - { - const Transform& tf = *it; - switch (tf.mType) - { - case TF_LOOKAT: - { + for (std::vector::const_iterator it = pTransforms.begin(); it != pTransforms.end(); ++it) { + const Transform &tf = *it; + switch (tf.mType) { + case TF_LOOKAT: { aiVector3D pos(tf.f[0], tf.f[1], tf.f[2]); aiVector3D dstPos(tf.f[3], tf.f[4], tf.f[5]); aiVector3D up = aiVector3D(tf.f[6], tf.f[7], tf.f[8]).Normalize(); @@ -3410,14 +2943,13 @@ aiMatrix4x4 ColladaParser::CalculateResultTransform(const std::vector aiVector3D right = (dir ^ up).Normalize(); res *= aiMatrix4x4( - right.x, up.x, -dir.x, pos.x, - right.y, up.y, -dir.y, pos.y, - right.z, up.z, -dir.z, pos.z, - 0, 0, 0, 1); + right.x, up.x, -dir.x, pos.x, + right.y, up.y, -dir.y, pos.y, + right.z, up.z, -dir.z, pos.z, + 0, 0, 0, 1); break; } - case TF_ROTATE: - { + case TF_ROTATE: { aiMatrix4x4 rot; ai_real angle = tf.f[3] * ai_real(AI_MATH_PI) / ai_real(180.0); aiVector3D axis(tf.f[0], tf.f[1], tf.f[2]); @@ -3425,17 +2957,15 @@ aiMatrix4x4 ColladaParser::CalculateResultTransform(const std::vector res *= rot; break; } - case TF_TRANSLATE: - { + case TF_TRANSLATE: { aiMatrix4x4 trans; aiMatrix4x4::Translation(aiVector3D(tf.f[0], tf.f[1], tf.f[2]), trans); res *= trans; break; } - case TF_SCALE: - { + case TF_SCALE: { aiMatrix4x4 scale(tf.f[0], 0.0f, 0.0f, 0.0f, 0.0f, tf.f[1], 0.0f, 0.0f, 0.0f, 0.0f, tf.f[2], 0.0f, - 0.0f, 0.0f, 0.0f, 1.0f); + 0.0f, 0.0f, 0.0f, 1.0f); res *= scale; break; } @@ -3443,10 +2973,9 @@ aiMatrix4x4 ColladaParser::CalculateResultTransform(const std::vector // TODO: (thom) ai_assert(false); break; - case TF_MATRIX: - { + case TF_MATRIX: { aiMatrix4x4 mat(tf.f[0], tf.f[1], tf.f[2], tf.f[3], tf.f[4], tf.f[5], tf.f[6], tf.f[7], - tf.f[8], tf.f[9], tf.f[10], tf.f[11], tf.f[12], tf.f[13], tf.f[14], tf.f[15]); + tf.f[8], tf.f[9], tf.f[10], tf.f[11], tf.f[12], tf.f[13], tf.f[14], tf.f[15]); res *= mat; break; } @@ -3461,8 +2990,7 @@ aiMatrix4x4 ColladaParser::CalculateResultTransform(const std::vector // ------------------------------------------------------------------------------------------------ // Determines the input data type for the given semantic string -Collada::InputType ColladaParser::GetTypeForSemantic(const std::string& semantic) -{ +Collada::InputType ColladaParser::GetTypeForSemantic(const std::string &semantic) { if (semantic.empty()) { ASSIMP_LOG_WARN("Vertex input type is empty."); return IT_Invalid; diff --git a/code/Collada/ColladaParser.h b/code/Collada/ColladaParser.h index d1e812bd2..861a65256 100644 --- a/code/Collada/ColladaParser.h +++ b/code/Collada/ColladaParser.h @@ -47,346 +47,345 @@ #ifndef AI_COLLADAPARSER_H_INC #define AI_COLLADAPARSER_H_INC -#include #include "ColladaHelper.h" -#include #include +#include +#include -namespace Assimp -{ - class ZipArchiveIOSystem; +namespace Assimp { +class ZipArchiveIOSystem; - // ------------------------------------------------------------------------------------------ - /** Parser helper class for the Collada loader. +// ------------------------------------------------------------------------------------------ +/** Parser helper class for the Collada loader. * * Does all the XML reading and builds internal data structures from it, * but leaves the resolving of all the references to the loader. */ - class ColladaParser - { - friend class ColladaLoader; +class ColladaParser { + friend class ColladaLoader; - /** Converts a path read from a collada file to the usual representation */ - static void UriDecodePath(aiString& ss); + /** Converts a path read from a collada file to the usual representation */ + static void UriDecodePath(aiString &ss); - protected: - /** Map for generic metadata as aiString */ - typedef std::map StringMetaData; +protected: + /** Map for generic metadata as aiString */ + typedef std::map StringMetaData; - /** Constructor from XML file */ - ColladaParser(IOSystem* pIOHandler, const std::string& pFile); + /** Constructor from XML file */ + ColladaParser(IOSystem *pIOHandler, const std::string &pFile); - /** Destructor */ - ~ColladaParser(); + /** Destructor */ + ~ColladaParser(); - /** Attempts to read the ZAE manifest and returns the DAE to open */ - static std::string ReadZaeManifest(ZipArchiveIOSystem &zip_archive); + /** Attempts to read the ZAE manifest and returns the DAE to open */ + static std::string ReadZaeManifest(ZipArchiveIOSystem &zip_archive); - /** Reads the contents of the file */ - void ReadContents(); + /** Reads the contents of the file */ + void ReadContents(); - /** Reads the structure of the file */ - void ReadStructure(); + /** Reads the structure of the file */ + void ReadStructure(); - /** Reads asset information such as coordinate system information and legal blah */ - void ReadAssetInfo(); + /** Reads asset information such as coordinate system information and legal blah */ + void ReadAssetInfo(); - /** Reads contributor information such as author and legal blah */ - void ReadContributorInfo(); + /** Reads contributor information such as author and legal blah */ + void ReadContributorInfo(); - /** Reads generic metadata into provided map and renames keys for Assimp */ - void ReadMetaDataItem(StringMetaData &metadata); + /** Reads generic metadata into provided map and renames keys for Assimp */ + void ReadMetaDataItem(StringMetaData &metadata); - /** Reads the animation library */ - void ReadAnimationLibrary(); + /** Reads the animation library */ + void ReadAnimationLibrary(); - /** Reads the animation clip library */ - void ReadAnimationClipLibrary(); + /** Reads the animation clip library */ + void ReadAnimationClipLibrary(); - /** Unwrap controllers dependency hierarchy */ - void PostProcessControllers(); - - /** Re-build animations from animation clip library, if present, otherwise combine single-channel animations */ - void PostProcessRootAnimations(); + /** Unwrap controllers dependency hierarchy */ + void PostProcessControllers(); - /** Reads an animation into the given parent structure */ - void ReadAnimation( Collada::Animation* pParent); + /** Re-build animations from animation clip library, if present, otherwise combine single-channel animations */ + void PostProcessRootAnimations(); - /** Reads an animation sampler into the given anim channel */ - void ReadAnimationSampler( Collada::AnimationChannel& pChannel); + /** Reads an animation into the given parent structure */ + void ReadAnimation(Collada::Animation *pParent); - /** Reads the skeleton controller library */ - void ReadControllerLibrary(); + /** Reads an animation sampler into the given anim channel */ + void ReadAnimationSampler(Collada::AnimationChannel &pChannel); - /** Reads a controller into the given mesh structure */ - void ReadController( Collada::Controller& pController); + /** Reads the skeleton controller library */ + void ReadControllerLibrary(); - /** Reads the joint definitions for the given controller */ - void ReadControllerJoints( Collada::Controller& pController); + /** Reads a controller into the given mesh structure */ + void ReadController(Collada::Controller &pController); - /** Reads the joint weights for the given controller */ - void ReadControllerWeights( Collada::Controller& pController); + /** Reads the joint definitions for the given controller */ + void ReadControllerJoints(Collada::Controller &pController); - /** Reads the image library contents */ - void ReadImageLibrary(); + /** Reads the joint weights for the given controller */ + void ReadControllerWeights(Collada::Controller &pController); - /** Reads an image entry into the given image */ - void ReadImage( Collada::Image& pImage); + /** Reads the image library contents */ + void ReadImageLibrary(); - /** Reads the material library */ - void ReadMaterialLibrary(); + /** Reads an image entry into the given image */ + void ReadImage(Collada::Image &pImage); - /** Reads a material entry into the given material */ - void ReadMaterial( Collada::Material& pMaterial); + /** Reads the material library */ + void ReadMaterialLibrary(); - /** Reads the camera library */ - void ReadCameraLibrary(); + /** Reads a material entry into the given material */ + void ReadMaterial(Collada::Material &pMaterial); - /** Reads a camera entry into the given camera */ - void ReadCamera( Collada::Camera& pCamera); + /** Reads the camera library */ + void ReadCameraLibrary(); - /** Reads the light library */ - void ReadLightLibrary(); + /** Reads a camera entry into the given camera */ + void ReadCamera(Collada::Camera &pCamera); - /** Reads a light entry into the given light */ - void ReadLight( Collada::Light& pLight); + /** Reads the light library */ + void ReadLightLibrary(); - /** Reads the effect library */ - void ReadEffectLibrary(); + /** Reads a light entry into the given light */ + void ReadLight(Collada::Light &pLight); - /** Reads an effect entry into the given effect*/ - void ReadEffect( Collada::Effect& pEffect); + /** Reads the effect library */ + void ReadEffectLibrary(); - /** Reads an COMMON effect profile */ - void ReadEffectProfileCommon( Collada::Effect& pEffect); + /** Reads an effect entry into the given effect*/ + void ReadEffect(Collada::Effect &pEffect); - /** Read sampler properties */ - void ReadSamplerProperties( Collada::Sampler& pSampler); + /** Reads an COMMON effect profile */ + void ReadEffectProfileCommon(Collada::Effect &pEffect); - /** Reads an effect entry containing a color or a texture defining that color */ - void ReadEffectColor( aiColor4D& pColor, Collada::Sampler& pSampler); + /** Read sampler properties */ + void ReadSamplerProperties(Collada::Sampler &pSampler); - /** Reads an effect entry containing a float */ - void ReadEffectFloat( ai_real& pFloat); + /** Reads an effect entry containing a color or a texture defining that color */ + void ReadEffectColor(aiColor4D &pColor, Collada::Sampler &pSampler); - /** Reads an effect parameter specification of any kind */ - void ReadEffectParam( Collada::EffectParam& pParam); + /** Reads an effect entry containing a float */ + void ReadEffectFloat(ai_real &pFloat); - /** Reads the geometry library contents */ - void ReadGeometryLibrary(); + /** Reads an effect parameter specification of any kind */ + void ReadEffectParam(Collada::EffectParam &pParam); - /** Reads a geometry from the geometry library. */ - void ReadGeometry( Collada::Mesh* pMesh); + /** Reads the geometry library contents */ + void ReadGeometryLibrary(); - /** Reads a mesh from the geometry library */ - void ReadMesh( Collada::Mesh* pMesh); + /** Reads a geometry from the geometry library. */ + void ReadGeometry(Collada::Mesh *pMesh); - /** Reads a source element - a combination of raw data and an accessor defining + /** Reads a mesh from the geometry library */ + void ReadMesh(Collada::Mesh *pMesh); + + /** Reads a source element - a combination of raw data and an accessor defining * things that should not be redefinable. Yes, that's another rant. */ - void ReadSource(); + void ReadSource(); - /** Reads a data array holding a number of elements, and stores it in the global library. + /** Reads a data array holding a number of elements, and stores it in the global library. * Currently supported are array of floats and arrays of strings. */ - void ReadDataArray(); + void ReadDataArray(); - /** Reads an accessor and stores it in the global library under the given ID - + /** Reads an accessor and stores it in the global library under the given ID - * accessors use the ID of the parent element */ - void ReadAccessor( const std::string& pID); + void ReadAccessor(const std::string &pID); - /** Reads input declarations of per-vertex mesh data into the given mesh */ - void ReadVertexData( Collada::Mesh* pMesh); + /** Reads input declarations of per-vertex mesh data into the given mesh */ + void ReadVertexData(Collada::Mesh *pMesh); - /** Reads input declarations of per-index mesh data into the given mesh */ - void ReadIndexData( Collada::Mesh* pMesh); + /** Reads input declarations of per-index mesh data into the given mesh */ + void ReadIndexData(Collada::Mesh *pMesh); - /** Reads a single input channel element and stores it in the given array, if valid */ - void ReadInputChannel( std::vector& poChannels); + /** Reads a single input channel element and stores it in the given array, if valid */ + void ReadInputChannel(std::vector &poChannels); - /** Reads a

primitive index list and assembles the mesh data into the given mesh */ - size_t ReadPrimitives( Collada::Mesh* pMesh, std::vector& pPerIndexChannels, - size_t pNumPrimitives, const std::vector& pVCount, Collada::PrimitiveType pPrimType); + /** Reads a

primitive index list and assembles the mesh data into the given mesh */ + size_t ReadPrimitives(Collada::Mesh *pMesh, std::vector &pPerIndexChannels, + size_t pNumPrimitives, const std::vector &pVCount, Collada::PrimitiveType pPrimType); - /** Copies the data for a single primitive into the mesh, based on the InputChannels */ - void CopyVertex(size_t currentVertex, size_t numOffsets, size_t numPoints, size_t perVertexOffset, - Collada::Mesh* pMesh, std::vector& pPerIndexChannels, - size_t currentPrimitive, const std::vector& indices); + /** Copies the data for a single primitive into the mesh, based on the InputChannels */ + void CopyVertex(size_t currentVertex, size_t numOffsets, size_t numPoints, size_t perVertexOffset, + Collada::Mesh *pMesh, std::vector &pPerIndexChannels, + size_t currentPrimitive, const std::vector &indices); - /** Reads one triangle of a tristrip into the mesh */ - void ReadPrimTriStrips(size_t numOffsets, size_t perVertexOffset, Collada::Mesh* pMesh, - std::vector& pPerIndexChannels, size_t currentPrimitive, const std::vector& indices); + /** Reads one triangle of a tristrip into the mesh */ + void ReadPrimTriStrips(size_t numOffsets, size_t perVertexOffset, Collada::Mesh *pMesh, + std::vector &pPerIndexChannels, size_t currentPrimitive, const std::vector &indices); - /** Extracts a single object from an input channel and stores it in the appropriate mesh data array */ - void ExtractDataObjectFromChannel( const Collada::InputChannel& pInput, size_t pLocalIndex, Collada::Mesh* pMesh); + /** Extracts a single object from an input channel and stores it in the appropriate mesh data array */ + void ExtractDataObjectFromChannel(const Collada::InputChannel &pInput, size_t pLocalIndex, Collada::Mesh *pMesh); - /** Reads the library of node hierarchies and scene parts */ - void ReadSceneLibrary(); + /** Reads the library of node hierarchies and scene parts */ + void ReadSceneLibrary(); - /** Reads a scene node's contents including children and stores it in the given node */ - void ReadSceneNode( Collada::Node* pNode); + /** Reads a scene node's contents including children and stores it in the given node */ + void ReadSceneNode(Collada::Node *pNode); - /** Reads a node transformation entry of the given type and adds it to the given node's transformation list. */ - void ReadNodeTransformation( Collada::Node* pNode, Collada::TransformType pType); + /** Reads a node transformation entry of the given type and adds it to the given node's transformation list. */ + void ReadNodeTransformation(Collada::Node *pNode, Collada::TransformType pType); - /** Reads a mesh reference in a node and adds it to the node's mesh list */ - void ReadNodeGeometry( Collada::Node* pNode); + /** Reads a mesh reference in a node and adds it to the node's mesh list */ + void ReadNodeGeometry(Collada::Node *pNode); - /** Reads the collada scene */ - void ReadScene(); + /** Reads the collada scene */ + void ReadScene(); - // Processes bind_vertex_input and bind elements - void ReadMaterialVertexInputBinding( Collada::SemanticMappingTable& tbl); + // Processes bind_vertex_input and bind elements + void ReadMaterialVertexInputBinding(Collada::SemanticMappingTable &tbl); - /** Reads embedded textures from a ZAE archive*/ - void ReadEmbeddedTextures(ZipArchiveIOSystem &zip_archive); + /** Reads embedded textures from a ZAE archive*/ + void ReadEmbeddedTextures(ZipArchiveIOSystem &zip_archive); - protected: - /** Aborts the file reading with an exception */ - AI_WONT_RETURN void ThrowException( const std::string& pError) const AI_WONT_RETURN_SUFFIX; - void ReportWarning(const char* msg,...); +protected: + /** Aborts the file reading with an exception */ + AI_WONT_RETURN void ThrowException(const std::string &pError) const AI_WONT_RETURN_SUFFIX; + void ReportWarning(const char *msg, ...); - /** Skips all data until the end node of the current element */ - void SkipElement(); + /** Skips all data until the end node of the current element */ + void SkipElement(); - /** Skips all data until the end node of the given element */ - void SkipElement( const char* pElement); + /** Skips all data until the end node of the given element */ + void SkipElement(const char *pElement); - /** Compares the current xml element name to the given string and returns true if equal */ - bool IsElement( const char* pName) const; + /** Compares the current xml element name to the given string and returns true if equal */ + bool IsElement(const char *pName) const; - /** Tests for the opening tag of the given element, throws an exception if not found */ - void TestOpening( const char* pName); + /** Tests for the opening tag of the given element, throws an exception if not found */ + void TestOpening(const char *pName); - /** Tests for the closing tag of the given element, throws an exception if not found */ - void TestClosing( const char* pName); + /** Tests for the closing tag of the given element, throws an exception if not found */ + void TestClosing(const char *pName); - /** Checks the present element for the presence of the attribute, returns its index + /** Checks the present element for the presence of the attribute, returns its index or throws an exception if not found */ - int GetAttribute( const char* pAttr) const; + int GetAttribute(const char *pAttr) const; - /** Returns the index of the named attribute or -1 if not found. Does not throw, + /** Returns the index of the named attribute or -1 if not found. Does not throw, therefore useful for optional attributes */ - int TestAttribute( const char* pAttr) const; + int TestAttribute(const char *pAttr) const; - /** Reads the text contents of an element, throws an exception if not given. + /** Reads the text contents of an element, throws an exception if not given. Skips leading whitespace. */ - const char* GetTextContent(); + const char *GetTextContent(); - /** Reads the text contents of an element, returns NULL if not given. + /** Reads the text contents of an element, returns NULL if not given. Skips leading whitespace. */ - const char* TestTextContent(); + const char *TestTextContent(); - /** Reads a single bool from current text content */ - bool ReadBoolFromTextContent(); + /** Reads a single bool from current text content */ + bool ReadBoolFromTextContent(); - /** Reads a single float from current text content */ - ai_real ReadFloatFromTextContent(); + /** Reads a single float from current text content */ + ai_real ReadFloatFromTextContent(); - /** Calculates the resulting transformation from all the given transform steps */ - aiMatrix4x4 CalculateResultTransform( const std::vector& pTransforms) const; + /** Calculates the resulting transformation from all the given transform steps */ + aiMatrix4x4 CalculateResultTransform(const std::vector &pTransforms) const; - /** Determines the input data type for the given semantic string */ - Collada::InputType GetTypeForSemantic( const std::string& pSemantic); + /** Determines the input data type for the given semantic string */ + Collada::InputType GetTypeForSemantic(const std::string &pSemantic); - /** Finds the item in the given library by its reference, throws if not found */ - template const Type& ResolveLibraryReference( const std::map& pLibrary, const std::string& pURL) const; - - protected: - /** Filename, for a verbose error message */ - std::string mFileName; - - /** XML reader, member for everyday use */ - irr::io::IrrXMLReader* mReader; - - /** All data arrays found in the file by ID. Might be referred to by actually - everyone. Collada, you are a steaming pile of indirection. */ - typedef std::map DataLibrary; - DataLibrary mDataLibrary; - - /** Same for accessors which define how the data in a data array is accessed. */ - typedef std::map AccessorLibrary; - AccessorLibrary mAccessorLibrary; - - /** Mesh library: mesh by ID */ - typedef std::map MeshLibrary; - MeshLibrary mMeshLibrary; - - /** node library: root node of the hierarchy part by ID */ - typedef std::map NodeLibrary; - NodeLibrary mNodeLibrary; - - /** Image library: stores texture properties by ID */ - typedef std::map ImageLibrary; - ImageLibrary mImageLibrary; - - /** Effect library: surface attributes by ID */ - typedef std::map EffectLibrary; - EffectLibrary mEffectLibrary; - - /** Material library: surface material by ID */ - typedef std::map MaterialLibrary; - MaterialLibrary mMaterialLibrary; - - /** Light library: surface light by ID */ - typedef std::map LightLibrary; - LightLibrary mLightLibrary; - - /** Camera library: surface material by ID */ - typedef std::map CameraLibrary; - CameraLibrary mCameraLibrary; - - /** Controller library: joint controllers by ID */ - typedef std::map ControllerLibrary; - ControllerLibrary mControllerLibrary; - - /** Animation library: animation references by ID */ - typedef std::map AnimationLibrary; - AnimationLibrary mAnimationLibrary; - - /** Animation clip library: clip animation references by ID */ - typedef std::vector > > AnimationClipLibrary; - AnimationClipLibrary mAnimationClipLibrary; - - /** Pointer to the root node. Don't delete, it just points to one of - the nodes in the node library. */ - Collada::Node* mRootNode; - - /** Root animation container */ - Collada::Animation mAnims; - - /** Size unit: how large compared to a meter */ - ai_real mUnitSize; - - /** Which is the up vector */ - enum { UP_X, UP_Y, UP_Z } mUpDirection; - - /** Asset metadata (global for scene) */ - StringMetaData mAssetMetaData; - - /** Collada file format version */ - Collada::FormatVersion mFormat; - }; - - // ------------------------------------------------------------------------------------------------ - // Check for element match - inline bool ColladaParser::IsElement( const char* pName) const - { - ai_assert( mReader->getNodeType() == irr::io::EXN_ELEMENT); - return ::strcmp( mReader->getNodeName(), pName) == 0; - } - - // ------------------------------------------------------------------------------------------------ - // Finds the item in the given library by its reference, throws if not found + /** Finds the item in the given library by its reference, throws if not found */ template - const Type& ColladaParser::ResolveLibraryReference( const std::map& pLibrary, const std::string& pURL) const - { - typename std::map::const_iterator it = pLibrary.find( pURL); - if( it == pLibrary.end()) - ThrowException( Formatter::format() << "Unable to resolve library reference \"" << pURL << "\"." ); - return it->second; - } + const Type &ResolveLibraryReference(const std::map &pLibrary, const std::string &pURL) const; + +protected: + /** Filename, for a verbose error message */ + std::string mFileName; + + /** XML reader, member for everyday use */ + irr::io::IrrXMLReader *mReader; + + /** All data arrays found in the file by ID. Might be referred to by actually + everyone. Collada, you are a steaming pile of indirection. */ + typedef std::map DataLibrary; + DataLibrary mDataLibrary; + + /** Same for accessors which define how the data in a data array is accessed. */ + typedef std::map AccessorLibrary; + AccessorLibrary mAccessorLibrary; + + /** Mesh library: mesh by ID */ + typedef std::map MeshLibrary; + MeshLibrary mMeshLibrary; + + /** node library: root node of the hierarchy part by ID */ + typedef std::map NodeLibrary; + NodeLibrary mNodeLibrary; + + /** Image library: stores texture properties by ID */ + typedef std::map ImageLibrary; + ImageLibrary mImageLibrary; + + /** Effect library: surface attributes by ID */ + typedef std::map EffectLibrary; + EffectLibrary mEffectLibrary; + + /** Material library: surface material by ID */ + typedef std::map MaterialLibrary; + MaterialLibrary mMaterialLibrary; + + /** Light library: surface light by ID */ + typedef std::map LightLibrary; + LightLibrary mLightLibrary; + + /** Camera library: surface material by ID */ + typedef std::map CameraLibrary; + CameraLibrary mCameraLibrary; + + /** Controller library: joint controllers by ID */ + typedef std::map ControllerLibrary; + ControllerLibrary mControllerLibrary; + + /** Animation library: animation references by ID */ + typedef std::map AnimationLibrary; + AnimationLibrary mAnimationLibrary; + + /** Animation clip library: clip animation references by ID */ + typedef std::vector>> AnimationClipLibrary; + AnimationClipLibrary mAnimationClipLibrary; + + /** Pointer to the root node. Don't delete, it just points to one of + the nodes in the node library. */ + Collada::Node *mRootNode; + + /** Root animation container */ + Collada::Animation mAnims; + + /** Size unit: how large compared to a meter */ + ai_real mUnitSize; + + /** Which is the up vector */ + enum { UP_X, + UP_Y, + UP_Z } mUpDirection; + + /** Asset metadata (global for scene) */ + StringMetaData mAssetMetaData; + + /** Collada file format version */ + Collada::FormatVersion mFormat; +}; + +// ------------------------------------------------------------------------------------------------ +// Check for element match +inline bool ColladaParser::IsElement(const char *pName) const { + ai_assert(mReader->getNodeType() == irr::io::EXN_ELEMENT); + return ::strcmp(mReader->getNodeName(), pName) == 0; +} + +// ------------------------------------------------------------------------------------------------ +// Finds the item in the given library by its reference, throws if not found +template +const Type &ColladaParser::ResolveLibraryReference(const std::map &pLibrary, const std::string &pURL) const { + typename std::map::const_iterator it = pLibrary.find(pURL); + if (it == pLibrary.end()) + ThrowException(Formatter::format() << "Unable to resolve library reference \"" << pURL << "\"."); + return it->second; +} } // end of namespace Assimp From ff9f3b86084c3b502d9dd4fefe3d87275f4df57d Mon Sep 17 00:00:00 2001 From: RichardTea <31507749+RichardTea@users.noreply.github.com> Date: Wed, 29 Apr 2020 17:17:46 +0100 Subject: [PATCH 019/115] Collada: Ensure has unique id Use the "id" for mesh names by default. Set option AI_CONFIG_IMPORT_COLLADA_USE_COLLADA_NAMES to use the mesh "name" instead --- code/CMakeLists.txt | 1 + code/Collada/ColladaExporter.cpp | 104 +++++++++++++++++++++------- code/Collada/ColladaExporter.h | 12 ++-- code/Collada/ColladaHelper.h | 4 +- code/Collada/ColladaLoader.cpp | 18 ++++- code/Collada/ColladaParser.cpp | 101 ++++++++++++++------------- code/Collada/ColladaParser.h | 16 ++--- include/assimp/ColladaMetaData.h | 53 ++++++++++++++ include/assimp/config.h.in | 6 +- test/unit/utColladaImportExport.cpp | 53 +++++++++++++- 10 files changed, 274 insertions(+), 94 deletions(-) create mode 100644 include/assimp/ColladaMetaData.h diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index 6afed40f9..f626a51e3 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -66,6 +66,7 @@ SET( PUBLIC_HEADERS ${HEADER_PATH}/color4.h ${HEADER_PATH}/color4.inl ${CMAKE_CURRENT_BINARY_DIR}/../include/assimp/config.h + ${HEADER_PATH}/ColladaMetaData.h ${HEADER_PATH}/commonMetaData.h ${HEADER_PATH}/defs.h ${HEADER_PATH}/Defines.h diff --git a/code/Collada/ColladaExporter.cpp b/code/Collada/ColladaExporter.cpp index 0026fda26..a502e728c 100644 --- a/code/Collada/ColladaExporter.cpp +++ b/code/Collada/ColladaExporter.cpp @@ -45,6 +45,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "ColladaExporter.h" #include +#include #include #include #include @@ -115,7 +116,7 @@ static const std::string XMLIDEncode(const std::string &name) { if (strchr(XML_ID_CHARS, *it) != nullptr) { idEncoded << *it; } else { - // Select placeholder character based on invalid character to prevent name collisions + // Select placeholder character based on invalid character to reduce ID collisions idEncoded << XML_ID_CHARS[(*it) % XML_ID_CHARS_COUNT]; } } @@ -854,8 +855,8 @@ void ColladaExporter::WriteControllerLibrary() { // Writes a skin controller of the given mesh void ColladaExporter::WriteController(size_t pIndex) { const aiMesh *mesh = mScene->mMeshes[pIndex]; - const std::string idstr = mesh->mName.length == 0 ? GetMeshId(pIndex) : mesh->mName.C_Str(); - const std::string idstrEscaped = XMLIDEncode(idstr); + const std::string idstr = GetMeshUniqueId(pIndex); + const std::string namestr = GetMeshName(pIndex); if (mesh->mNumFaces == 0 || mesh->mNumVertices == 0) return; @@ -863,11 +864,11 @@ void ColladaExporter::WriteController(size_t pIndex) { if (mesh->mNumBones == 0) return; - mOutput << startstr << "" << endstr; PushTag(); - mOutput << startstr << "" << endstr; + mOutput << startstr << "" << endstr; PushTag(); // bind pose matrix @@ -884,10 +885,10 @@ void ColladaExporter::WriteController(size_t pIndex) { PopTag(); mOutput << startstr << "" << endstr; - mOutput << startstr << "" << endstr; + mOutput << startstr << "" << endstr; PushTag(); - mOutput << startstr << "mNumBones << "\">"; + mOutput << startstr << "mNumBones << "\">"; for (size_t i = 0; i < mesh->mNumBones; ++i) mOutput << XMLIDEncode(mesh->mBones[i]->mName.C_Str()) << " "; @@ -897,7 +898,7 @@ void ColladaExporter::WriteController(size_t pIndex) { mOutput << startstr << "" << endstr; PushTag(); - mOutput << startstr << "mNumBones << "\" stride=\"" << 1 << "\">" << endstr; + mOutput << startstr << "mNumBones << "\" stride=\"" << 1 << "\">" << endstr; PushTag(); mOutput << startstr << "" << endstr; @@ -934,8 +935,8 @@ void ColladaExporter::WriteController(size_t pIndex) { mOutput << startstr << "" << endstr; PushTag(); - mOutput << startstr << "" << endstr; - mOutput << startstr << "" << endstr; + mOutput << startstr << "" << endstr; + mOutput << startstr << "" << endstr; PopTag(); mOutput << startstr << "" << endstr; @@ -943,8 +944,8 @@ void ColladaExporter::WriteController(size_t pIndex) { mOutput << startstr << "mNumVertices << "\">" << endstr; PushTag(); - mOutput << startstr << "" << endstr; - mOutput << startstr << "" << endstr; + mOutput << startstr << "" << endstr; + mOutput << startstr << "" << endstr; mOutput << startstr << ""; @@ -1019,9 +1020,8 @@ void ColladaExporter::WriteGeometryLibrary() { // Writes the given mesh void ColladaExporter::WriteGeometry(size_t pIndex) { const aiMesh *mesh = mScene->mMeshes[pIndex]; - const std::string idstr = mesh->mName.length == 0 ? GetMeshId(pIndex) : mesh->mName.C_Str(); - const std::string geometryName = XMLEscape(idstr); - const std::string geometryId = XMLIDEncode(idstr); + const std::string geometryName = GetMeshName(pIndex); + const std::string geometryId = GetMeshUniqueId(pIndex); if (mesh->mNumFaces == 0 || mesh->mNumVertices == 0) return; @@ -1034,15 +1034,15 @@ void ColladaExporter::WriteGeometry(size_t pIndex) { PushTag(); // Positions - WriteFloatArray(idstr + "-positions", FloatType_Vector, (ai_real *)mesh->mVertices, mesh->mNumVertices); + WriteFloatArray(geometryId + "-positions", FloatType_Vector, (ai_real *)mesh->mVertices, mesh->mNumVertices); // Normals, if any if (mesh->HasNormals()) - WriteFloatArray(idstr + "-normals", FloatType_Vector, (ai_real *)mesh->mNormals, mesh->mNumVertices); + WriteFloatArray(geometryId + "-normals", FloatType_Vector, (ai_real *)mesh->mNormals, mesh->mNumVertices); // texture coords for (size_t a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++a) { if (mesh->HasTextureCoords(static_cast(a))) { - WriteFloatArray(idstr + "-tex" + to_string(a), mesh->mNumUVComponents[a] == 3 ? FloatType_TexCoord3 : FloatType_TexCoord2, + WriteFloatArray(geometryId + "-tex" + to_string(a), mesh->mNumUVComponents[a] == 3 ? FloatType_TexCoord3 : FloatType_TexCoord2, (ai_real *)mesh->mTextureCoords[a], mesh->mNumVertices); } } @@ -1050,7 +1050,7 @@ void ColladaExporter::WriteGeometry(size_t pIndex) { // vertex colors for (size_t a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++a) { if (mesh->HasVertexColors(static_cast(a))) - WriteFloatArray(idstr + "-color" + to_string(a), FloatType_Color, (ai_real *)mesh->mColors[a], mesh->mNumVertices); + WriteFloatArray(geometryId + "-color" + to_string(a), FloatType_Color, (ai_real *)mesh->mColors[a], mesh->mNumVertices); } // assemble vertex structure @@ -1530,13 +1530,13 @@ void ColladaExporter::WriteNode(const aiScene *pScene, aiNode *pNode) { const std::string node_name = XMLEscape(pNode->mName.data); mOutput << startstr << "" << endstr; PushTag(); @@ -1595,14 +1595,14 @@ void ColladaExporter::WriteNode(const aiScene *pScene, aiNode *pNode) { if (mesh->mNumFaces == 0 || mesh->mNumVertices == 0) continue; - const std::string meshName = mesh->mName.length == 0 ? GetMeshId(pNode->mMeshes[a]) : mesh->mName.C_Str(); + const std::string meshId = GetMeshUniqueId(pNode->mMeshes[a]); if (mesh->mNumBones == 0) { - mOutput << startstr << "" << endstr; + mOutput << startstr << "" << endstr; PushTag(); } else { mOutput << startstr - << "" + << "" << endstr; PushTag(); @@ -1649,5 +1649,59 @@ void ColladaExporter::WriteNode(const aiScene *pScene, aiNode *pNode) { mOutput << startstr << "" << endstr; } +/// Get or Create a unique mesh ID string for the given mesh index +std::string Assimp::ColladaExporter::GetMeshUniqueId(size_t pIndex) { + auto meshId = mMeshIdMap.find(pIndex); + if (meshId != mMeshIdMap.cend()) + return meshId->second; + + // Not seen this mesh before, create and add + return AddMeshIndexToMaps(pIndex, true); +} + +std::string Assimp::ColladaExporter::GetMeshName(size_t pIndex) { + auto meshName = mMeshNameMap.find(pIndex); + if (meshName != mMeshNameMap.cend()) + return meshName->second; + + // Not seen this mesh before, create and add + return AddMeshIndexToMaps(pIndex, false); +} + +inline bool ValueIsUnique(const std::map &map, const std::string &value) { + for (const auto &map_val : map) { + if (value == map_val.second) + return false; + } + return true; +} + +// Add the mesh index to both Id and Name maps and return either Id or Name +std::string Assimp::ColladaExporter::AddMeshIndexToMaps(size_t pIndex, bool meshId) { + const aiMesh *mesh = mScene->mMeshes[pIndex]; + std::string idStr = mesh->mName.length == 0 ? std::string("meshId_") + to_string(pIndex) : XMLIDEncode(mesh->mName.C_Str()); + // Ensure is unique. Relatively slow but will only happen once per mesh + if (!ValueIsUnique(mMeshIdMap, idStr)) { + // Select a number to append + size_t postfix = 1; + idStr.append("_"); + while (!ValueIsUnique(mMeshIdMap, idStr + to_string(postfix))) { + ++postfix; + } + idStr = idStr + to_string(postfix); + } + // Add to map + mMeshIdMap.insert(std::make_pair(pIndex, idStr)); + + // Add name to map + const std::string nameStr = mesh->mName.length == 0 ? idStr : XMLEscape(mesh->mName.C_Str()); + mMeshNameMap.insert(std::make_pair(pIndex, nameStr)); + + if (meshId) + return idStr; + else + return nameStr; +} + #endif #endif diff --git a/code/Collada/ColladaExporter.h b/code/Collada/ColladaExporter.h index fa7e6ee80..d75d2d355 100644 --- a/code/Collada/ColladaExporter.h +++ b/code/Collada/ColladaExporter.h @@ -145,10 +145,14 @@ protected: startstr.erase(startstr.length() - 2); } - /// Creates a mesh ID for the given mesh - std::string GetMeshId(size_t pIndex) const { - return std::string("meshId") + to_string(pIndex); - } + /// Get or Create a unique mesh ID string for the given mesh index + std::string GetMeshUniqueId(size_t pIndex); + std::string GetMeshName(size_t pIndex); + +private: + std::string AddMeshIndexToMaps(size_t pIndex, bool meshId); + mutable std::map mMeshIdMap; // Cache of encoded unique IDs + mutable std::map mMeshNameMap; // Cache of encoded mesh names public: /// Stringstream to write all output into diff --git a/code/Collada/ColladaHelper.h b/code/Collada/ColladaHelper.h index 3eb073cd9..f41691606 100644 --- a/code/Collada/ColladaHelper.h +++ b/code/Collada/ColladaHelper.h @@ -339,11 +339,13 @@ struct SubMesh { /** Contains data for a single mesh */ struct Mesh { - Mesh() { + Mesh(const std::string &id) : + mId(id) { for (unsigned int i = 0; i < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++i) mNumUVComponents[i] = 2; } + const std::string mId; std::string mName; // just to check if there's some sophisticated addressing involved... diff --git a/code/Collada/ColladaLoader.cpp b/code/Collada/ColladaLoader.cpp index 44d65e40d..c76954fdf 100644 --- a/code/Collada/ColladaLoader.cpp +++ b/code/Collada/ColladaLoader.cpp @@ -46,6 +46,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "ColladaLoader.h" #include "ColladaParser.h" +#include #include #include #include @@ -265,6 +266,13 @@ aiNode *ColladaLoader::BuildHierarchy(const ColladaParser &pParser, const Collad // find a name for the new node. It's more complicated than you might think node->mName.Set(FindNameForNode(pNode)); + // if we're not using the unique IDs, hold onto them for reference and export + if (useColladaName) { + if (!pNode->mID.empty()) + node->mMetaData->Add(AI_METADATA_COLLADA_ID, aiString(pNode->mID)); + if (!pNode->mSID.empty()) + node->mMetaData->Add(AI_METADATA_COLLADA_SID, aiString(pNode->mSID)); + } // calculate the transformation matrix for it node->mTransformation = pParser.CalculateResultTransform(pNode->mTransforms); @@ -603,7 +611,11 @@ aiMesh *ColladaLoader::CreateMesh(const ColladaParser &pParser, const Collada::M const Collada::Controller *pSrcController, size_t pStartVertex, size_t pStartFace) { std::unique_ptr dstMesh(new aiMesh); - dstMesh->mName = pSrcMesh->mName; + if (useColladaName) { + dstMesh->mName = pSrcMesh->mName; + } else { + dstMesh->mName = pSrcMesh->mId; + } // count the vertices addressed by its faces const size_t numVertices = std::accumulate(pSrcMesh->mFaceSize.begin() + pStartFace, @@ -700,10 +712,10 @@ aiMesh *ColladaLoader::CreateMesh(const ColladaParser &pParser, const Collada::M for (unsigned int i = 0; i < targetData.mStrings.size(); ++i) { const Collada::Mesh *targetMesh = pParser.ResolveLibraryReference(pParser.mMeshLibrary, targetData.mStrings.at(i)); - aiMesh *aimesh = findMesh(targetMesh->mName); + aiMesh *aimesh = findMesh(useColladaName ? targetMesh->mName : targetMesh->mId); if (!aimesh) { if (targetMesh->mSubMeshes.size() > 1) { - throw DeadlyImportError("Morhing target mesh must be a single"); + throw DeadlyImportError("Morphing target mesh must be a single"); } aimesh = CreateMesh(pParser, targetMesh, targetMesh->mSubMeshes.at(0), NULL, 0, 0); mTargetMeshes.push_back(aimesh); diff --git a/code/Collada/ColladaParser.cpp b/code/Collada/ColladaParser.cpp index 5080094c1..d83980929 100644 --- a/code/Collada/ColladaParser.cpp +++ b/code/Collada/ColladaParser.cpp @@ -1716,18 +1716,25 @@ void ColladaParser::ReadGeometryLibrary() { // TODO: (thom) support SIDs // ai_assert( TestAttribute( "sid") == -1); - // create a mesh and store it in the library under its ID - Mesh *mesh = new Mesh; - mMeshLibrary[id] = mesh; + // create a mesh and store it in the library under its (resolved) ID + // Skip and warn if ID is not unique + if (mMeshLibrary.find(id) == mMeshLibrary.cend()) { + std::unique_ptr mesh(new Mesh(id)); - // read the mesh name if it exists - const int nameIndex = TestAttribute("name"); - if (nameIndex != -1) { - mesh->mName = mReader->getAttributeValue(nameIndex); + // read the mesh name if it exists + const int nameIndex = TestAttribute("name"); + if (nameIndex != -1) { + mesh->mName = mReader->getAttributeValue(nameIndex); + } + + // read on from there + ReadGeometry(*mesh); + // Read successfully, add to library + mMeshLibrary.insert({ id, mesh.release() }); + } else { + ASSIMP_LOG_ERROR_F("Collada: Skipped duplicate geometry id: \"", id, "\""); + SkipElement(); } - - // read on from there - ReadGeometry(mesh); } else { // ignore the rest SkipElement(); @@ -1743,7 +1750,7 @@ void ColladaParser::ReadGeometryLibrary() { // ------------------------------------------------------------------------------------------------ // Reads a geometry from the geometry library. -void ColladaParser::ReadGeometry(Collada::Mesh *pMesh) { +void ColladaParser::ReadGeometry(Collada::Mesh &pMesh) { if (mReader->isEmptyElement()) return; @@ -1767,7 +1774,7 @@ void ColladaParser::ReadGeometry(Collada::Mesh *pMesh) { // ------------------------------------------------------------------------------------------------ // Reads a mesh from the geometry library -void ColladaParser::ReadMesh(Mesh *pMesh) { +void ColladaParser::ReadMesh(Mesh &pMesh) { if (mReader->isEmptyElement()) return; @@ -1997,16 +2004,16 @@ void ColladaParser::ReadAccessor(const std::string &pID) { // ------------------------------------------------------------------------------------------------ // Reads input declarations of per-vertex mesh data into the given mesh -void ColladaParser::ReadVertexData(Mesh *pMesh) { +void ColladaParser::ReadVertexData(Mesh &pMesh) { // extract the ID of the element. Not that we care, but to catch strange referencing schemes we should warn about int attrID = GetAttribute("id"); - pMesh->mVertexID = mReader->getAttributeValue(attrID); + pMesh.mVertexID = mReader->getAttributeValue(attrID); // a number of elements while (mReader->read()) { if (mReader->getNodeType() == irr::io::EXN_ELEMENT) { if (IsElement("input")) { - ReadInputChannel(pMesh->mPerVertexData); + ReadInputChannel(pMesh.mPerVertexData); } else { ThrowException(format() << "Unexpected sub element <" << mReader->getNodeName() << "> in tag "); } @@ -2021,7 +2028,7 @@ void ColladaParser::ReadVertexData(Mesh *pMesh) { // ------------------------------------------------------------------------------------------------ // Reads input declarations of per-index mesh data into the given mesh -void ColladaParser::ReadIndexData(Mesh *pMesh) { +void ColladaParser::ReadIndexData(Mesh &pMesh) { std::vector vcount; std::vector perIndexData; @@ -2111,7 +2118,7 @@ void ColladaParser::ReadIndexData(Mesh *pMesh) { // only when we're done reading all

tags (and thus know the final vertex count) can we commit the submesh subgroup.mNumFaces = actualPrimitives; - pMesh->mSubMeshes.push_back(subgroup); + pMesh.mSubMeshes.push_back(subgroup); } // ------------------------------------------------------------------------------------------------ @@ -2158,7 +2165,7 @@ void ColladaParser::ReadInputChannel(std::vector &poChannels) { // ------------------------------------------------------------------------------------------------ // Reads a

primitive index list and assembles the mesh data into the given mesh -size_t ColladaParser::ReadPrimitives(Mesh *pMesh, std::vector &pPerIndexChannels, +size_t ColladaParser::ReadPrimitives(Mesh &pMesh, std::vector &pPerIndexChannels, size_t pNumPrimitives, const std::vector &pVCount, PrimitiveType pPrimType) { // determine number of indices coming per vertex // find the offset index for all per-vertex channels @@ -2220,7 +2227,7 @@ size_t ColladaParser::ReadPrimitives(Mesh *pMesh, std::vector &pPe ThrowException("Expected different index count in

element."); // find the data for all sources - for (std::vector::iterator it = pMesh->mPerVertexData.begin(); it != pMesh->mPerVertexData.end(); ++it) { + for (std::vector::iterator it = pMesh.mPerVertexData.begin(); it != pMesh.mPerVertexData.end(); ++it) { InputChannel &input = *it; if (input.mResolved) continue; @@ -2241,7 +2248,7 @@ size_t ColladaParser::ReadPrimitives(Mesh *pMesh, std::vector &pPe // ignore vertex pointer, it doesn't refer to an accessor if (input.mType == IT_Vertex) { // warn if the vertex channel does not refer to the element in the same mesh - if (input.mAccessor != pMesh->mVertexID) + if (input.mAccessor != pMesh.mVertexID) ThrowException("Unsupported vertex referencing scheme."); continue; } @@ -2268,8 +2275,8 @@ size_t ColladaParser::ReadPrimitives(Mesh *pMesh, std::vector &pPe numPrimitives = numberOfVertices - 1; } - pMesh->mFaceSize.reserve(numPrimitives); - pMesh->mFacePosIndices.reserve(indices.size() / numOffsets); + pMesh.mFaceSize.reserve(numPrimitives); + pMesh.mFacePosIndices.reserve(indices.size() / numOffsets); size_t polylistStartVertex = 0; for (size_t currentPrimitive = 0; currentPrimitive < numPrimitives; currentPrimitive++) { @@ -2314,7 +2321,7 @@ size_t ColladaParser::ReadPrimitives(Mesh *pMesh, std::vector &pPe } // store the face size to later reconstruct the face from - pMesh->mFaceSize.push_back(numPoints); + pMesh.mFaceSize.push_back(numPoints); } // if I ever get my hands on that guy who invented this steaming pile of indirection... @@ -2325,7 +2332,7 @@ size_t ColladaParser::ReadPrimitives(Mesh *pMesh, std::vector &pPe ///@note This function willn't work correctly if both PerIndex and PerVertex channels have same channels. ///For example if TEXCOORD present in both and tags this function will create wrong uv coordinates. ///It's not clear from COLLADA documentation is this allowed or not. For now only exporter fixed to avoid such behavior -void ColladaParser::CopyVertex(size_t currentVertex, size_t numOffsets, size_t numPoints, size_t perVertexOffset, Mesh *pMesh, std::vector &pPerIndexChannels, size_t currentPrimitive, const std::vector &indices) { +void ColladaParser::CopyVertex(size_t currentVertex, size_t numOffsets, size_t numPoints, size_t perVertexOffset, Mesh &pMesh, std::vector &pPerIndexChannels, size_t currentPrimitive, const std::vector &indices) { // calculate the base offset of the vertex whose attributes we ant to copy size_t baseOffset = currentPrimitive * numOffsets * numPoints + currentVertex * numOffsets; @@ -2333,17 +2340,17 @@ void ColladaParser::CopyVertex(size_t currentVertex, size_t numOffsets, size_t n ai_assert((baseOffset + numOffsets - 1) < indices.size()); // extract per-vertex channels using the global per-vertex offset - for (std::vector::iterator it = pMesh->mPerVertexData.begin(); it != pMesh->mPerVertexData.end(); ++it) + for (std::vector::iterator it = pMesh.mPerVertexData.begin(); it != pMesh.mPerVertexData.end(); ++it) ExtractDataObjectFromChannel(*it, indices[baseOffset + perVertexOffset], pMesh); // and extract per-index channels using there specified offset for (std::vector::iterator it = pPerIndexChannels.begin(); it != pPerIndexChannels.end(); ++it) ExtractDataObjectFromChannel(*it, indices[baseOffset + it->mOffset], pMesh); // store the vertex-data index for later assignment of bone vertex weights - pMesh->mFacePosIndices.push_back(indices[baseOffset + perVertexOffset]); + pMesh.mFacePosIndices.push_back(indices[baseOffset + perVertexOffset]); } -void ColladaParser::ReadPrimTriStrips(size_t numOffsets, size_t perVertexOffset, Mesh *pMesh, std::vector &pPerIndexChannels, size_t currentPrimitive, const std::vector &indices) { +void ColladaParser::ReadPrimTriStrips(size_t numOffsets, size_t perVertexOffset, Mesh &pMesh, std::vector &pPerIndexChannels, size_t currentPrimitive, const std::vector &indices) { if (currentPrimitive % 2 != 0) { //odd tristrip triangles need their indices mangled, to preserve winding direction CopyVertex(1, numOffsets, 1, perVertexOffset, pMesh, pPerIndexChannels, currentPrimitive, indices); @@ -2358,7 +2365,7 @@ void ColladaParser::ReadPrimTriStrips(size_t numOffsets, size_t perVertexOffset, // ------------------------------------------------------------------------------------------------ // Extracts a single object from an input channel and stores it in the appropriate mesh data array -void ColladaParser::ExtractDataObjectFromChannel(const InputChannel &pInput, size_t pLocalIndex, Mesh *pMesh) { +void ColladaParser::ExtractDataObjectFromChannel(const InputChannel &pInput, size_t pLocalIndex, Mesh &pMesh) { // ignore vertex referrer - we handle them that separate if (pInput.mType == IT_Vertex) return; @@ -2380,40 +2387,40 @@ void ColladaParser::ExtractDataObjectFromChannel(const InputChannel &pInput, siz switch (pInput.mType) { case IT_Position: // ignore all position streams except 0 - there can be only one position if (pInput.mIndex == 0) - pMesh->mPositions.push_back(aiVector3D(obj[0], obj[1], obj[2])); + pMesh.mPositions.push_back(aiVector3D(obj[0], obj[1], obj[2])); else ASSIMP_LOG_ERROR("Collada: just one vertex position stream supported"); break; case IT_Normal: // pad to current vertex count if necessary - if (pMesh->mNormals.size() < pMesh->mPositions.size() - 1) - pMesh->mNormals.insert(pMesh->mNormals.end(), pMesh->mPositions.size() - pMesh->mNormals.size() - 1, aiVector3D(0, 1, 0)); + if (pMesh.mNormals.size() < pMesh.mPositions.size() - 1) + pMesh.mNormals.insert(pMesh.mNormals.end(), pMesh.mPositions.size() - pMesh.mNormals.size() - 1, aiVector3D(0, 1, 0)); // ignore all normal streams except 0 - there can be only one normal if (pInput.mIndex == 0) - pMesh->mNormals.push_back(aiVector3D(obj[0], obj[1], obj[2])); + pMesh.mNormals.push_back(aiVector3D(obj[0], obj[1], obj[2])); else ASSIMP_LOG_ERROR("Collada: just one vertex normal stream supported"); break; case IT_Tangent: // pad to current vertex count if necessary - if (pMesh->mTangents.size() < pMesh->mPositions.size() - 1) - pMesh->mTangents.insert(pMesh->mTangents.end(), pMesh->mPositions.size() - pMesh->mTangents.size() - 1, aiVector3D(1, 0, 0)); + if (pMesh.mTangents.size() < pMesh.mPositions.size() - 1) + pMesh.mTangents.insert(pMesh.mTangents.end(), pMesh.mPositions.size() - pMesh.mTangents.size() - 1, aiVector3D(1, 0, 0)); // ignore all tangent streams except 0 - there can be only one tangent if (pInput.mIndex == 0) - pMesh->mTangents.push_back(aiVector3D(obj[0], obj[1], obj[2])); + pMesh.mTangents.push_back(aiVector3D(obj[0], obj[1], obj[2])); else ASSIMP_LOG_ERROR("Collada: just one vertex tangent stream supported"); break; case IT_Bitangent: // pad to current vertex count if necessary - if (pMesh->mBitangents.size() < pMesh->mPositions.size() - 1) - pMesh->mBitangents.insert(pMesh->mBitangents.end(), pMesh->mPositions.size() - pMesh->mBitangents.size() - 1, aiVector3D(0, 0, 1)); + if (pMesh.mBitangents.size() < pMesh.mPositions.size() - 1) + pMesh.mBitangents.insert(pMesh.mBitangents.end(), pMesh.mPositions.size() - pMesh.mBitangents.size() - 1, aiVector3D(0, 0, 1)); // ignore all bitangent streams except 0 - there can be only one bitangent if (pInput.mIndex == 0) - pMesh->mBitangents.push_back(aiVector3D(obj[0], obj[1], obj[2])); + pMesh.mBitangents.push_back(aiVector3D(obj[0], obj[1], obj[2])); else ASSIMP_LOG_ERROR("Collada: just one vertex bitangent stream supported"); break; @@ -2421,13 +2428,13 @@ void ColladaParser::ExtractDataObjectFromChannel(const InputChannel &pInput, siz // up to 4 texture coord sets are fine, ignore the others if (pInput.mIndex < AI_MAX_NUMBER_OF_TEXTURECOORDS) { // pad to current vertex count if necessary - if (pMesh->mTexCoords[pInput.mIndex].size() < pMesh->mPositions.size() - 1) - pMesh->mTexCoords[pInput.mIndex].insert(pMesh->mTexCoords[pInput.mIndex].end(), - pMesh->mPositions.size() - pMesh->mTexCoords[pInput.mIndex].size() - 1, aiVector3D(0, 0, 0)); + if (pMesh.mTexCoords[pInput.mIndex].size() < pMesh.mPositions.size() - 1) + pMesh.mTexCoords[pInput.mIndex].insert(pMesh.mTexCoords[pInput.mIndex].end(), + pMesh.mPositions.size() - pMesh.mTexCoords[pInput.mIndex].size() - 1, aiVector3D(0, 0, 0)); - pMesh->mTexCoords[pInput.mIndex].push_back(aiVector3D(obj[0], obj[1], obj[2])); + pMesh.mTexCoords[pInput.mIndex].push_back(aiVector3D(obj[0], obj[1], obj[2])); if (0 != acc.mSubOffset[2] || 0 != acc.mSubOffset[3]) /* hack ... consider cleaner solution */ - pMesh->mNumUVComponents[pInput.mIndex] = 3; + pMesh.mNumUVComponents[pInput.mIndex] = 3; } else { ASSIMP_LOG_ERROR("Collada: too many texture coordinate sets. Skipping."); } @@ -2436,15 +2443,15 @@ void ColladaParser::ExtractDataObjectFromChannel(const InputChannel &pInput, siz // up to 4 color sets are fine, ignore the others if (pInput.mIndex < AI_MAX_NUMBER_OF_COLOR_SETS) { // pad to current vertex count if necessary - if (pMesh->mColors[pInput.mIndex].size() < pMesh->mPositions.size() - 1) - pMesh->mColors[pInput.mIndex].insert(pMesh->mColors[pInput.mIndex].end(), - pMesh->mPositions.size() - pMesh->mColors[pInput.mIndex].size() - 1, aiColor4D(0, 0, 0, 1)); + if (pMesh.mColors[pInput.mIndex].size() < pMesh.mPositions.size() - 1) + pMesh.mColors[pInput.mIndex].insert(pMesh.mColors[pInput.mIndex].end(), + pMesh.mPositions.size() - pMesh.mColors[pInput.mIndex].size() - 1, aiColor4D(0, 0, 0, 1)); aiColor4D result(0, 0, 0, 1); for (size_t i = 0; i < pInput.mResolved->mSize; ++i) { result[static_cast(i)] = obj[pInput.mResolved->mSubOffset[i]]; } - pMesh->mColors[pInput.mIndex].push_back(result); + pMesh.mColors[pInput.mIndex].push_back(result); } else { ASSIMP_LOG_ERROR("Collada: too many vertex color sets. Skipping."); } diff --git a/code/Collada/ColladaParser.h b/code/Collada/ColladaParser.h index 861a65256..a84a59354 100644 --- a/code/Collada/ColladaParser.h +++ b/code/Collada/ColladaParser.h @@ -174,10 +174,10 @@ protected: void ReadGeometryLibrary(); /** Reads a geometry from the geometry library. */ - void ReadGeometry(Collada::Mesh *pMesh); + void ReadGeometry(Collada::Mesh &pMesh); /** Reads a mesh from the geometry library */ - void ReadMesh(Collada::Mesh *pMesh); + void ReadMesh(Collada::Mesh &pMesh); /** Reads a source element - a combination of raw data and an accessor defining * things that should not be redefinable. Yes, that's another rant. @@ -195,29 +195,29 @@ protected: void ReadAccessor(const std::string &pID); /** Reads input declarations of per-vertex mesh data into the given mesh */ - void ReadVertexData(Collada::Mesh *pMesh); + void ReadVertexData(Collada::Mesh &pMesh); /** Reads input declarations of per-index mesh data into the given mesh */ - void ReadIndexData(Collada::Mesh *pMesh); + void ReadIndexData(Collada::Mesh &pMesh); /** Reads a single input channel element and stores it in the given array, if valid */ void ReadInputChannel(std::vector &poChannels); /** Reads a

primitive index list and assembles the mesh data into the given mesh */ - size_t ReadPrimitives(Collada::Mesh *pMesh, std::vector &pPerIndexChannels, + size_t ReadPrimitives(Collada::Mesh &pMesh, std::vector &pPerIndexChannels, size_t pNumPrimitives, const std::vector &pVCount, Collada::PrimitiveType pPrimType); /** Copies the data for a single primitive into the mesh, based on the InputChannels */ void CopyVertex(size_t currentVertex, size_t numOffsets, size_t numPoints, size_t perVertexOffset, - Collada::Mesh *pMesh, std::vector &pPerIndexChannels, + Collada::Mesh &pMesh, std::vector &pPerIndexChannels, size_t currentPrimitive, const std::vector &indices); /** Reads one triangle of a tristrip into the mesh */ - void ReadPrimTriStrips(size_t numOffsets, size_t perVertexOffset, Collada::Mesh *pMesh, + void ReadPrimTriStrips(size_t numOffsets, size_t perVertexOffset, Collada::Mesh &pMesh, std::vector &pPerIndexChannels, size_t currentPrimitive, const std::vector &indices); /** Extracts a single object from an input channel and stores it in the appropriate mesh data array */ - void ExtractDataObjectFromChannel(const Collada::InputChannel &pInput, size_t pLocalIndex, Collada::Mesh *pMesh); + void ExtractDataObjectFromChannel(const Collada::InputChannel &pInput, size_t pLocalIndex, Collada::Mesh &pMesh); /** Reads the library of node hierarchies and scene parts */ void ReadSceneLibrary(); diff --git a/include/assimp/ColladaMetaData.h b/include/assimp/ColladaMetaData.h new file mode 100644 index 000000000..4288692c6 --- /dev/null +++ b/include/assimp/ColladaMetaData.h @@ -0,0 +1,53 @@ +/* +Open Asset Import Library (assimp) +---------------------------------------------------------------------- + +Copyright (c) 2006-2020, 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 ColladaMetaData.h + * Declares common metadata constants used by Collada files + */ +#pragma once +#ifndef AI_COLLADAMETADATA_H_INC +#define AI_COLLADAMETADATA_H_INC + +#define AI_METADATA_COLLADA_ID "COLLADA_ID" +#define AI_METADATA_COLLADA_SID "COLLADA_SID" + +#endif diff --git a/include/assimp/config.h.in b/include/assimp/config.h.in index e2f2a3888..c26dcc77f 100644 --- a/include/assimp/config.h.in +++ b/include/assimp/config.h.in @@ -1030,10 +1030,10 @@ enum aiComponent #define AI_CONFIG_IMPORT_COLLADA_IGNORE_UP_DIRECTION "IMPORT_COLLADA_IGNORE_UP_DIRECTION" // --------------------------------------------------------------------------- -/** @brief Specifies whether the Collada loader should use Collada names as node names. +/** @brief Specifies whether the Collada loader should use Collada names. * - * If this property is set to true, the Collada names will be used as the - * node name. The default is to use the id tag (resp. sid tag, if no id tag is present) + * If this property is set to true, the Collada names will be used as the node and + * mesh names. The default is to use the id tag (resp. sid tag, if no id tag is present) * instead. * Property type: Bool. Default value: false. */ diff --git a/test/unit/utColladaImportExport.cpp b/test/unit/utColladaImportExport.cpp index 549ff68fb..5c2f801db 100644 --- a/test/unit/utColladaImportExport.cpp +++ b/test/unit/utColladaImportExport.cpp @@ -44,13 +44,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include +#include #include using namespace Assimp; class utColladaImportExport : public AbstractImportExportBase { public: - virtual bool importerTest() { + virtual bool importerTest() final { Assimp::Importer importer; const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/Collada/duck.dae", aiProcess_ValidateDataStructure); if (scene == nullptr) @@ -80,15 +81,61 @@ public: return true; } + + void ImportAndCheckIds(const char *file, size_t meshCount) { + // Import the Collada using the 'default' where mesh names are the ids + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(file, aiProcess_ValidateDataStructure); + ASSERT_TRUE(scene != nullptr) << "Fatal: could not re-import " << file; + EXPECT_EQ(meshCount, scene->mNumMeshes) << "in " << file; + + // Check the mesh ids are unique + std::map meshNameMap; + for (size_t idx = 0; idx < scene->mNumMeshes; ++idx) { + std::string meshName(scene->mMeshes[idx]->mName.C_Str()); + const auto result = meshNameMap.insert(std::make_pair(meshName, idx)); + EXPECT_TRUE(result.second) << "Duplicate name: " << meshName << " index " << result.first->second; + } + } }; -TEST_F(utColladaImportExport, importBlenFromFileTest) { +TEST_F(utColladaImportExport, importDaeFromFileTest) { EXPECT_TRUE(importerTest()); } +TEST_F(utColladaImportExport, exporterUniqueIdsTest) { + Assimp::Importer importer; + Assimp::Exporter exporter; + const char *outFileEmpty = "exportMeshIdTest_empty_out.dae"; + const char *outFileNamed = "exportMeshIdTest_named_out.dae"; + + // Load a sample file containing multiple meshes + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/Collada/teapots.DAE", aiProcess_ValidateDataStructure); + + ASSERT_TRUE(scene != nullptr) << "Fatal: could not import teapots.DAE!"; + ASSERT_EQ(3u, scene->mNumMeshes) << "Fatal: teapots.DAE initial load failed"; + + // Clear the mesh names + for (size_t idx = 0; idx < scene->mNumMeshes; ++idx) { + scene->mMeshes[idx]->mName.Clear(); + } + ASSERT_EQ(AI_SUCCESS, exporter.Export(scene, "collada", outFileEmpty)) << "Fatal: Could not export un-named meshes file"; + + ImportAndCheckIds(outFileEmpty, 3); + + // Force the meshes to have the same non-empty name + aiString testName("test_mesh"); + for (size_t idx = 0; idx < scene->mNumMeshes; ++idx) { + scene->mMeshes[idx]->mName = testName; + } + ASSERT_EQ(AI_SUCCESS, exporter.Export(scene, "collada", outFileNamed)) << "Fatal: Could not export named meshes file"; + + ImportAndCheckIds(outFileNamed, 3); +} + class utColladaZaeImportExport : public AbstractImportExportBase { public: - virtual bool importerTest() { + virtual bool importerTest() final { { Assimp::Importer importer; const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/Collada/duck.zae", aiProcess_ValidateDataStructure); From 083ebdbc2ece2f4dd071e5439ab848ffade8a3c2 Mon Sep 17 00:00:00 2001 From: RichardTea <31507749+RichardTea@users.noreply.github.com> Date: Thu, 30 Apr 2020 18:28:06 +0100 Subject: [PATCH 020/115] Collada Export: More unique Ids Nodes, Materials, Animations, Lights, Cameras, Bones --- code/Collada/ColladaExporter.cpp | 405 ++++++++++++++++------------ code/Collada/ColladaExporter.h | 57 ++-- test/unit/utColladaImportExport.cpp | 107 +++++++- 3 files changed, 369 insertions(+), 200 deletions(-) diff --git a/code/Collada/ColladaExporter.cpp b/code/Collada/ColladaExporter.cpp index a502e728c..b91e118ec 100644 --- a/code/Collada/ColladaExporter.cpp +++ b/code/Collada/ColladaExporter.cpp @@ -164,6 +164,9 @@ void ColladaExporter::WriteFile() { WriteTextures(); WriteHeader(); + // Add node names to the unique id database first so they are most likely to use their names as unique ids + CreateNodeIds(mScene->mRootNode); + WriteCamerasLibrary(); WriteLightsLibrary(); WriteMaterials(); @@ -178,7 +181,7 @@ void ColladaExporter::WriteFile() { // useless Collada fu at the end, just in case we haven't had enough indirections, yet. mOutput << startstr << "" << endstr; PushTag(); - mOutput << startstr << "mRootNode->mName.C_Str()) + "\" />" << endstr; + mOutput << startstr << "mRootNode) + "\" />" << endstr; PopTag(); mOutput << startstr << "" << endstr; PopTag(); @@ -391,8 +394,8 @@ void ColladaExporter::WriteCamerasLibrary() { void ColladaExporter::WriteCamera(size_t pIndex) { const aiCamera *cam = mScene->mCameras[pIndex]; - const std::string cameraName = XMLEscape(cam->mName.C_Str()); - const std::string cameraId = XMLIDEncode(cam->mName.C_Str()); + const std::string cameraId = GetObjectUniqueId(AiObjectType::Camera, pIndex); + const std::string cameraName = GetObjectName(AiObjectType::Camera, pIndex); mOutput << startstr << "" << endstr; PushTag(); @@ -444,8 +447,8 @@ void ColladaExporter::WriteLightsLibrary() { void ColladaExporter::WriteLight(size_t pIndex) { const aiLight *light = mScene->mLights[pIndex]; - const std::string lightName = XMLEscape(light->mName.C_Str()); - const std::string lightId = XMLIDEncode(light->mName.C_Str()); + const std::string lightId = GetObjectUniqueId(AiObjectType::Light, pIndex); + const std::string lightName = GetObjectName(AiObjectType::Light, pIndex); mOutput << startstr << "" << endstr; @@ -564,12 +567,11 @@ void ColladaExporter::WriteAmbienttLight(const aiLight *const light) { // ------------------------------------------------------------------------------------------------ // Reads a single surface entry from the given material keys -void ColladaExporter::ReadMaterialSurface(Surface &poSurface, const aiMaterial *pSrcMat, - aiTextureType pTexture, const char *pKey, size_t pType, size_t pIndex) { - if (pSrcMat->GetTextureCount(pTexture) > 0) { +bool ColladaExporter::ReadMaterialSurface(Surface &poSurface, const aiMaterial &pSrcMat, aiTextureType pTexture, const char *pKey, size_t pType, size_t pIndex) { + if (pSrcMat.GetTextureCount(pTexture) > 0) { aiString texfile; unsigned int uvChannel = 0; - pSrcMat->GetTexture(pTexture, 0, &texfile, NULL, &uvChannel); + pSrcMat.GetTexture(pTexture, 0, &texfile, NULL, &uvChannel); std::string index_str(texfile.C_Str()); @@ -599,8 +601,9 @@ void ColladaExporter::ReadMaterialSurface(Surface &poSurface, const aiMaterial * poSurface.exist = true; } else { if (pKey) - poSurface.exist = pSrcMat->Get(pKey, static_cast(pType), static_cast(pIndex), poSurface.color) == aiReturn_SUCCESS; + poSurface.exist = pSrcMat.Get(pKey, static_cast(pType), static_cast(pIndex), poSurface.color) == aiReturn_SUCCESS; } + return poSurface.exist; } // ------------------------------------------------------------------------------------------------ @@ -611,9 +614,9 @@ static bool isalnum_C(char c) { // ------------------------------------------------------------------------------------------------ // Writes an image entry for the given surface -void ColladaExporter::WriteImageEntry(const Surface &pSurface, const std::string &pNameAdd) { +void ColladaExporter::WriteImageEntry(const Surface &pSurface, const std::string &imageId) { if (!pSurface.texture.empty()) { - mOutput << startstr << "" << endstr; + mOutput << startstr << "" << endstr; PushTag(); mOutput << startstr << ""; @@ -634,14 +637,14 @@ void ColladaExporter::WriteImageEntry(const Surface &pSurface, const std::string // ------------------------------------------------------------------------------------------------ // Writes a color-or-texture entry into an effect definition -void ColladaExporter::WriteTextureColorEntry(const Surface &pSurface, const std::string &pTypeName, const std::string &pImageName) { +void ColladaExporter::WriteTextureColorEntry(const Surface &pSurface, const std::string &pTypeName, const std::string &imageId) { if (pSurface.exist) { mOutput << startstr << "<" << pTypeName << ">" << endstr; PushTag(); if (pSurface.texture.empty()) { mOutput << startstr << "" << pSurface.color.r << " " << pSurface.color.g << " " << pSurface.color.b << " " << pSurface.color.a << "" << endstr; } else { - mOutput << startstr << "" << endstr; + mOutput << startstr << "" << endstr; } PopTag(); mOutput << startstr << "" << endstr; @@ -650,24 +653,24 @@ void ColladaExporter::WriteTextureColorEntry(const Surface &pSurface, const std: // ------------------------------------------------------------------------------------------------ // Writes the two parameters necessary for referencing a texture in an effect entry -void ColladaExporter::WriteTextureParamEntry(const Surface &pSurface, const std::string &pTypeName, const std::string &pMatName) { +void ColladaExporter::WriteTextureParamEntry(const Surface &pSurface, const std::string &pTypeName, const std::string &materialId) { // if surface is a texture, write out the sampler and the surface parameters necessary to reference the texture if (!pSurface.texture.empty()) { - mOutput << startstr << "" << endstr; + mOutput << startstr << "" << endstr; PushTag(); mOutput << startstr << "" << endstr; PushTag(); - mOutput << startstr << "" << XMLIDEncode(pMatName) << "-" << pTypeName << "-image" << endstr; + mOutput << startstr << "" << materialId << "-" << pTypeName << "-image" << endstr; PopTag(); mOutput << startstr << "" << endstr; PopTag(); mOutput << startstr << "" << endstr; - mOutput << startstr << "" << endstr; + mOutput << startstr << "" << endstr; PushTag(); mOutput << startstr << "" << endstr; PushTag(); - mOutput << startstr << "" << XMLIDEncode(pMatName) << "-" << pTypeName << "-surface" << endstr; + mOutput << startstr << "" << materialId << "-" << pTypeName << "-surface" << endstr; PopTag(); mOutput << startstr << "" << endstr; PopTag(); @@ -690,80 +693,63 @@ void ColladaExporter::WriteFloatEntry(const Property &pProperty, const std::stri // ------------------------------------------------------------------------------------------------ // Writes the material setup void ColladaExporter::WriteMaterials() { + std::vector materials; materials.resize(mScene->mNumMaterials); /// collect all materials from the scene size_t numTextures = 0; for (size_t a = 0; a < mScene->mNumMaterials; ++a) { - const aiMaterial *mat = mScene->mMaterials[a]; - - aiString name; - if (mat->Get(AI_MATKEY_NAME, name) != aiReturn_SUCCESS) { - name = "mat"; - materials[a].name = std::string("m") + to_string(a) + name.C_Str(); - } else { - // try to use the material's name if no other material has already taken it, else append # - std::string testName = name.C_Str(); - size_t materialCountWithThisName = 0; - for (size_t i = 0; i < a; i++) { - if (materials[i].name == testName) { - materialCountWithThisName++; - } - } - if (materialCountWithThisName == 0) { - materials[a].name = name.C_Str(); - } else { - materials[a].name = std::string(name.C_Str()) + to_string(materialCountWithThisName); - } - } + Material &material = materials[a]; + material.id = GetObjectUniqueId(AiObjectType::Material, a); + material.name = GetObjectName(AiObjectType::Material, a); + const aiMaterial &mat = *(mScene->mMaterials[a]); aiShadingMode shading = aiShadingMode_Flat; - materials[a].shading_model = "phong"; - if (mat->Get(AI_MATKEY_SHADING_MODEL, shading) == aiReturn_SUCCESS) { + material.shading_model = "phong"; + if (mat.Get(AI_MATKEY_SHADING_MODEL, shading) == aiReturn_SUCCESS) { if (shading == aiShadingMode_Phong) { - materials[a].shading_model = "phong"; + material.shading_model = "phong"; } else if (shading == aiShadingMode_Blinn) { - materials[a].shading_model = "blinn"; + material.shading_model = "blinn"; } else if (shading == aiShadingMode_NoShading) { - materials[a].shading_model = "constant"; + material.shading_model = "constant"; } else if (shading == aiShadingMode_Gouraud) { - materials[a].shading_model = "lambert"; + material.shading_model = "lambert"; } } - ReadMaterialSurface(materials[a].ambient, mat, aiTextureType_AMBIENT, AI_MATKEY_COLOR_AMBIENT); - if (!materials[a].ambient.texture.empty()) numTextures++; - ReadMaterialSurface(materials[a].diffuse, mat, aiTextureType_DIFFUSE, AI_MATKEY_COLOR_DIFFUSE); - if (!materials[a].diffuse.texture.empty()) numTextures++; - ReadMaterialSurface(materials[a].specular, mat, aiTextureType_SPECULAR, AI_MATKEY_COLOR_SPECULAR); - if (!materials[a].specular.texture.empty()) numTextures++; - ReadMaterialSurface(materials[a].emissive, mat, aiTextureType_EMISSIVE, AI_MATKEY_COLOR_EMISSIVE); - if (!materials[a].emissive.texture.empty()) numTextures++; - ReadMaterialSurface(materials[a].reflective, mat, aiTextureType_REFLECTION, AI_MATKEY_COLOR_REFLECTIVE); - if (!materials[a].reflective.texture.empty()) numTextures++; - ReadMaterialSurface(materials[a].transparent, mat, aiTextureType_OPACITY, AI_MATKEY_COLOR_TRANSPARENT); - if (!materials[a].transparent.texture.empty()) numTextures++; - ReadMaterialSurface(materials[a].normal, mat, aiTextureType_NORMALS, NULL, 0, 0); - if (!materials[a].normal.texture.empty()) numTextures++; + if (ReadMaterialSurface(material.ambient, mat, aiTextureType_AMBIENT, AI_MATKEY_COLOR_AMBIENT)) + ++numTextures; + if (ReadMaterialSurface(material.diffuse, mat, aiTextureType_DIFFUSE, AI_MATKEY_COLOR_DIFFUSE)) + ++numTextures; + if (ReadMaterialSurface(material.specular, mat, aiTextureType_SPECULAR, AI_MATKEY_COLOR_SPECULAR)) + ++numTextures; + if (ReadMaterialSurface(material.emissive, mat, aiTextureType_EMISSIVE, AI_MATKEY_COLOR_EMISSIVE)) + ++numTextures; + if (ReadMaterialSurface(material.reflective, mat, aiTextureType_REFLECTION, AI_MATKEY_COLOR_REFLECTIVE)) + ++numTextures; + if (ReadMaterialSurface(material.transparent, mat, aiTextureType_OPACITY, AI_MATKEY_COLOR_TRANSPARENT)) + ++numTextures; + if (ReadMaterialSurface(material.normal, mat, aiTextureType_NORMALS, nullptr, 0, 0)) + ++numTextures; - materials[a].shininess.exist = mat->Get(AI_MATKEY_SHININESS, materials[a].shininess.value) == aiReturn_SUCCESS; - materials[a].transparency.exist = mat->Get(AI_MATKEY_OPACITY, materials[a].transparency.value) == aiReturn_SUCCESS; - materials[a].index_refraction.exist = mat->Get(AI_MATKEY_REFRACTI, materials[a].index_refraction.value) == aiReturn_SUCCESS; + material.shininess.exist = mat.Get(AI_MATKEY_SHININESS, material.shininess.value) == aiReturn_SUCCESS; + material.transparency.exist = mat.Get(AI_MATKEY_OPACITY, material.transparency.value) == aiReturn_SUCCESS; + material.index_refraction.exist = mat.Get(AI_MATKEY_REFRACTI, material.index_refraction.value) == aiReturn_SUCCESS; } // output textures if present if (numTextures > 0) { mOutput << startstr << "" << endstr; PushTag(); - for (std::vector::const_iterator it = materials.begin(); it != materials.end(); ++it) { - const Material &mat = *it; - WriteImageEntry(mat.ambient, mat.name + "-ambient-image"); - WriteImageEntry(mat.diffuse, mat.name + "-diffuse-image"); - WriteImageEntry(mat.specular, mat.name + "-specular-image"); - WriteImageEntry(mat.emissive, mat.name + "-emission-image"); - WriteImageEntry(mat.reflective, mat.name + "-reflective-image"); - WriteImageEntry(mat.transparent, mat.name + "-transparent-image"); - WriteImageEntry(mat.normal, mat.name + "-normal-image"); + for (const Material &mat : materials) { + WriteImageEntry(mat.ambient, mat.id + "-ambient-image"); + WriteImageEntry(mat.diffuse, mat.id + "-diffuse-image"); + WriteImageEntry(mat.specular, mat.id + "-specular-image"); + WriteImageEntry(mat.emissive, mat.id + "-emission-image"); + WriteImageEntry(mat.reflective, mat.id + "-reflective-image"); + WriteImageEntry(mat.transparent, mat.id + "-transparent-image"); + WriteImageEntry(mat.normal, mat.id + "-normal-image"); } PopTag(); mOutput << startstr << "" << endstr; @@ -773,40 +759,39 @@ void ColladaExporter::WriteMaterials() { if (!materials.empty()) { mOutput << startstr << "" << endstr; PushTag(); - for (std::vector::const_iterator it = materials.begin(); it != materials.end(); ++it) { - const Material &mat = *it; + for (const Material &mat : materials) { // this is so ridiculous it must be right - mOutput << startstr << "" << endstr; + mOutput << startstr << "" << endstr; PushTag(); mOutput << startstr << "" << endstr; PushTag(); // write sampler- and surface params for the texture entries - WriteTextureParamEntry(mat.emissive, "emission", mat.name); - WriteTextureParamEntry(mat.ambient, "ambient", mat.name); - WriteTextureParamEntry(mat.diffuse, "diffuse", mat.name); - WriteTextureParamEntry(mat.specular, "specular", mat.name); - WriteTextureParamEntry(mat.reflective, "reflective", mat.name); - WriteTextureParamEntry(mat.transparent, "transparent", mat.name); - WriteTextureParamEntry(mat.normal, "normal", mat.name); + WriteTextureParamEntry(mat.emissive, "emission", mat.id); + WriteTextureParamEntry(mat.ambient, "ambient", mat.id); + WriteTextureParamEntry(mat.diffuse, "diffuse", mat.id); + WriteTextureParamEntry(mat.specular, "specular", mat.id); + WriteTextureParamEntry(mat.reflective, "reflective", mat.id); + WriteTextureParamEntry(mat.transparent, "transparent", mat.id); + WriteTextureParamEntry(mat.normal, "normal", mat.id); mOutput << startstr << "" << endstr; PushTag(); mOutput << startstr << "<" << mat.shading_model << ">" << endstr; PushTag(); - WriteTextureColorEntry(mat.emissive, "emission", mat.name + "-emission-sampler"); - WriteTextureColorEntry(mat.ambient, "ambient", mat.name + "-ambient-sampler"); - WriteTextureColorEntry(mat.diffuse, "diffuse", mat.name + "-diffuse-sampler"); - WriteTextureColorEntry(mat.specular, "specular", mat.name + "-specular-sampler"); + WriteTextureColorEntry(mat.emissive, "emission", mat.id + "-emission-sampler"); + WriteTextureColorEntry(mat.ambient, "ambient", mat.id + "-ambient-sampler"); + WriteTextureColorEntry(mat.diffuse, "diffuse", mat.id + "-diffuse-sampler"); + WriteTextureColorEntry(mat.specular, "specular", mat.id + "-specular-sampler"); WriteFloatEntry(mat.shininess, "shininess"); - WriteTextureColorEntry(mat.reflective, "reflective", mat.name + "-reflective-sampler"); - WriteTextureColorEntry(mat.transparent, "transparent", mat.name + "-transparent-sampler"); + WriteTextureColorEntry(mat.reflective, "reflective", mat.id + "-reflective-sampler"); + WriteTextureColorEntry(mat.transparent, "transparent", mat.id + "-transparent-sampler"); WriteFloatEntry(mat.transparency, "transparency"); WriteFloatEntry(mat.index_refraction, "index_of_refraction"); if (!mat.normal.texture.empty()) { - WriteTextureColorEntry(mat.normal, "bump", mat.name + "-normal-sampler"); + WriteTextureColorEntry(mat.normal, "bump", mat.id + "-normal-sampler"); } PopTag(); @@ -826,9 +811,9 @@ void ColladaExporter::WriteMaterials() { PushTag(); for (std::vector::const_iterator it = materials.begin(); it != materials.end(); ++it) { const Material &mat = *it; - mOutput << startstr << "" << endstr; + mOutput << startstr << "" << endstr; PushTag(); - mOutput << startstr << "" << endstr; + mOutput << startstr << "" << endstr; PopTag(); mOutput << startstr << "" << endstr; } @@ -855,14 +840,12 @@ void ColladaExporter::WriteControllerLibrary() { // Writes a skin controller of the given mesh void ColladaExporter::WriteController(size_t pIndex) { const aiMesh *mesh = mScene->mMeshes[pIndex]; - const std::string idstr = GetMeshUniqueId(pIndex); - const std::string namestr = GetMeshName(pIndex); - - if (mesh->mNumFaces == 0 || mesh->mNumVertices == 0) + // Is there a skin controller? + if (mesh->mNumBones == 0 || mesh->mNumFaces == 0 || mesh->mNumVertices == 0) return; - if (mesh->mNumBones == 0) - return; + const std::string idstr = GetObjectUniqueId(AiObjectType::Mesh, pIndex); + const std::string namestr = GetObjectName(AiObjectType::Mesh, pIndex); mOutput << startstr << "" << endstr; @@ -891,7 +874,7 @@ void ColladaExporter::WriteController(size_t pIndex) { mOutput << startstr << "mNumBones << "\">"; for (size_t i = 0; i < mesh->mNumBones; ++i) - mOutput << XMLIDEncode(mesh->mBones[i]->mName.C_Str()) << " "; + mOutput << GetBoneUniqueId(mesh->mBones[i]) << " "; mOutput << "" << endstr; @@ -1020,8 +1003,8 @@ void ColladaExporter::WriteGeometryLibrary() { // Writes the given mesh void ColladaExporter::WriteGeometry(size_t pIndex) { const aiMesh *mesh = mScene->mMeshes[pIndex]; - const std::string geometryName = GetMeshName(pIndex); - const std::string geometryId = GetMeshUniqueId(pIndex); + const std::string geometryId = GetObjectUniqueId(AiObjectType::Mesh, pIndex); + const std::string geometryName = GetObjectName(AiObjectType::Mesh, pIndex); if (mesh->mNumFaces == 0 || mesh->mNumVertices == 0) return; @@ -1250,8 +1233,8 @@ void ColladaExporter::WriteFloatArray(const std::string &pIdString, FloatDataTyp // ------------------------------------------------------------------------------------------------ // Writes the scene library void ColladaExporter::WriteSceneLibrary() { - const std::string sceneName = XMLEscape(mScene->mRootNode->mName.C_Str()); - const std::string sceneId = XMLIDEncode(mScene->mRootNode->mName.C_Str()); + const std::string sceneName = GetNodeUniqueId(mScene->mRootNode); + const std::string sceneId = GetNodeName(mScene->mRootNode); mOutput << startstr << "" << endstr; PushTag(); @@ -1260,7 +1243,7 @@ void ColladaExporter::WriteSceneLibrary() { // start recursive write at the root node for (size_t a = 0; a < mScene->mRootNode->mNumChildren; ++a) - WriteNode(mScene, mScene->mRootNode->mChildren[a]); + WriteNode(mScene->mRootNode->mChildren[a]); PopTag(); mOutput << startstr << "" << endstr; @@ -1274,20 +1257,10 @@ void ColladaExporter::WriteAnimationLibrary(size_t pIndex) { if (anim->mNumChannels == 0 && anim->mNumMeshChannels == 0 && anim->mNumMorphMeshChannels == 0) return; - const std::string animation_name_escaped = XMLEscape(anim->mName.C_Str()); - std::string idstr = anim->mName.C_Str(); - std::string ending = std::string("AnimId") + to_string(pIndex); - if (idstr.length() >= ending.length()) { - if (0 != idstr.compare(idstr.length() - ending.length(), ending.length(), ending)) { - idstr = idstr + ending; - } - } else { - idstr = idstr + ending; - } + const std::string animationNameEscaped = GetObjectName(AiObjectType::Animation, pIndex); + const std::string idstrEscaped = GetObjectUniqueId(AiObjectType::Animation, pIndex); - const std::string idstrEscaped = XMLIDEncode(idstr); - - mOutput << startstr << "" << endstr; + mOutput << startstr << "" << endstr; PushTag(); std::string cur_node_idstr; @@ -1503,31 +1476,25 @@ const aiNode *findSkeletonRootNode(const aiScene *scene, const aiMesh *mesh) { // ------------------------------------------------------------------------------------------------ // Recursively writes the given node -void ColladaExporter::WriteNode(const aiScene *pScene, aiNode *pNode) { - // the node must have a name - if (pNode->mName.length == 0) { - std::stringstream ss; - ss << "Node_" << pNode; - pNode->mName.Set(ss.str()); - } - +void ColladaExporter::WriteNode(const aiNode *pNode) { // If the node is associated with a bone, it is a joint node (JOINT) // otherwise it is a normal node (NODE) + // Assimp-specific: nodes with no name cannot be associated with bones const char *node_type; bool is_joint, is_skeleton_root = false; - if (nullptr == findBone(pScene, pNode->mName.C_Str())) { + if (pNode->mName.length == 0 && nullptr == findBone(mScene, pNode->mName.C_Str())) { node_type = "NODE"; is_joint = false; } else { node_type = "JOINT"; is_joint = true; - if (!pNode->mParent || nullptr == findBone(pScene, pNode->mParent->mName.C_Str())) { + if (!pNode->mParent || nullptr == findBone(mScene, pNode->mParent->mName.C_Str())) { is_skeleton_root = true; } } - const std::string node_id = XMLIDEncode(pNode->mName.data); - const std::string node_name = XMLEscape(pNode->mName.data); + const std::string node_id = GetNodeUniqueId(pNode); + const std::string node_name = GetNodeName(pNode); mOutput << startstr << "mNumFaces == 0 || mesh->mNumVertices == 0) continue; - const std::string meshId = GetMeshUniqueId(pNode->mMeshes[a]); + const std::string meshId = GetObjectUniqueId(AiObjectType::Mesh, pNode->mMeshes[a]); if (mesh->mNumBones == 0) { mOutput << startstr << "" << endstr; @@ -1608,9 +1575,9 @@ void ColladaExporter::WriteNode(const aiScene *pScene, aiNode *pNode) { // note! this mFoundSkeletonRootNodeID some how affects animation, it makes the mesh attaches to armature skeleton root node. // use the first bone to find skeleton root - const aiNode *skeletonRootBoneNode = findSkeletonRootNode(pScene, mesh); + const aiNode *skeletonRootBoneNode = findSkeletonRootNode(mScene, mesh); if (skeletonRootBoneNode) { - mFoundSkeletonRootNodeID = XMLIDEncode(skeletonRootBoneNode->mName.C_Str()); + mFoundSkeletonRootNodeID = GetNodeUniqueId(skeletonRootBoneNode); } mOutput << startstr << "#" << mFoundSkeletonRootNodeID << "" << endstr; } @@ -1618,7 +1585,7 @@ void ColladaExporter::WriteNode(const aiScene *pScene, aiNode *pNode) { PushTag(); mOutput << startstr << "" << endstr; PushTag(); - mOutput << startstr << "mMaterialIndex].name) << "\">" << endstr; + mOutput << startstr << "mMaterialIndex) << "\">" << endstr; PushTag(); for (size_t aa = 0; aa < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++aa) { if (mesh->HasTextureCoords(static_cast(aa))) @@ -1643,64 +1610,154 @@ void ColladaExporter::WriteNode(const aiScene *pScene, aiNode *pNode) { // recurse into subnodes for (size_t a = 0; a < pNode->mNumChildren; ++a) - WriteNode(pScene, pNode->mChildren[a]); + WriteNode(pNode->mChildren[a]); PopTag(); mOutput << startstr << "" << endstr; } -/// Get or Create a unique mesh ID string for the given mesh index -std::string Assimp::ColladaExporter::GetMeshUniqueId(size_t pIndex) { - auto meshId = mMeshIdMap.find(pIndex); - if (meshId != mMeshIdMap.cend()) - return meshId->second; - - // Not seen this mesh before, create and add - return AddMeshIndexToMaps(pIndex, true); +inline bool IsUniqueId(const std::unordered_set &idSet, const std::string &idStr) { + return (idSet.find(idStr) == idSet.end()); } -std::string Assimp::ColladaExporter::GetMeshName(size_t pIndex) { - auto meshName = mMeshNameMap.find(pIndex); - if (meshName != mMeshNameMap.cend()) - return meshName->second; - - // Not seen this mesh before, create and add - return AddMeshIndexToMaps(pIndex, false); -} - -inline bool ValueIsUnique(const std::map &map, const std::string &value) { - for (const auto &map_val : map) { - if (value == map_val.second) - return false; - } - return true; -} - -// Add the mesh index to both Id and Name maps and return either Id or Name -std::string Assimp::ColladaExporter::AddMeshIndexToMaps(size_t pIndex, bool meshId) { - const aiMesh *mesh = mScene->mMeshes[pIndex]; - std::string idStr = mesh->mName.length == 0 ? std::string("meshId_") + to_string(pIndex) : XMLIDEncode(mesh->mName.C_Str()); - // Ensure is unique. Relatively slow but will only happen once per mesh - if (!ValueIsUnique(mMeshIdMap, idStr)) { +inline void MakeUniqueId(const std::unordered_set &idSet, std::string &idStr) { + if (!IsUniqueId(idSet, idStr)) { // Select a number to append size_t postfix = 1; idStr.append("_"); - while (!ValueIsUnique(mMeshIdMap, idStr + to_string(postfix))) { + while (!IsUniqueId(idSet, idStr + to_string(postfix))) { ++postfix; } - idStr = idStr + to_string(postfix); + idStr.append(to_string(postfix)); } - // Add to map - mMeshIdMap.insert(std::make_pair(pIndex, idStr)); +} - // Add name to map - const std::string nameStr = mesh->mName.length == 0 ? idStr : XMLEscape(mesh->mName.C_Str()); - mMeshNameMap.insert(std::make_pair(pIndex, nameStr)); +void Assimp::ColladaExporter::CreateNodeIds(const aiNode *node) { + GetNodeUniqueId(node); + for (size_t a = 0; a < node->mNumChildren; ++a) + CreateNodeIds(node->mChildren[a]); +} - if (meshId) - return idStr; +std::string Assimp::ColladaExporter::GetNodeUniqueId(const aiNode *node) { + // Use the pointer as the key. This is safe because the scene is immutable. + auto idIt = mNodeIdMap.find(node); + if (idIt != mNodeIdMap.cend()) + return idIt->second; + + // Prefer the requested Collada Id if extant + std::string idStr; + aiString origId; + if (node->mMetaData && node->mMetaData->Get(AI_METADATA_COLLADA_ID, origId)) { + idStr = origId.C_Str(); + } else { + idStr = node->mName.C_Str(); + } + // Make sure the requested id is valid + if (idStr.empty()) + idStr = "node"; else - return nameStr; + idStr = XMLIDEncode(idStr); + + // Ensure it's unique + MakeUniqueId(mUniqueIds, idStr); + mUniqueIds.insert(idStr); + mNodeIdMap.insert(std::make_pair(node, idStr)); + return idStr; +} + +std::string Assimp::ColladaExporter::GetNodeName(const aiNode *node) { + + return XMLEscape(node->mName.C_Str()); +} + +std::string Assimp::ColladaExporter::GetBoneUniqueId(const aiBone *bone) { + // Use the pointer as the key. This is safe because the scene is immutable. + auto idIt = mNodeIdMap.find(bone); + if (idIt != mNodeIdMap.cend()) + return idIt->second; + + // New, create an id + std::string idStr(bone->mName.C_Str()); + + // Make sure the requested id is valid + if (idStr.empty()) + idStr = "bone"; + else + idStr = XMLIDEncode(idStr); + + // Ensure it's unique + MakeUniqueId(mUniqueIds, idStr); + mUniqueIds.insert(idStr); + mNodeIdMap.insert(std::make_pair(bone, idStr)); + return idStr; +} + +std::string Assimp::ColladaExporter::GetObjectUniqueId(AiObjectType type, size_t pIndex) { + auto idIt = GetObjectIdMap(type).find(pIndex); + if (idIt != GetObjectIdMap(type).cend()) + return idIt->second; + + // Not seen this object before, create and add + NameIdPair result = AddObjectIndexToMaps(type, pIndex); + return result.second; +} + +std::string Assimp::ColladaExporter::GetObjectName(AiObjectType type, size_t pIndex) { + auto meshName = GetObjectNameMap(type).find(pIndex); + if (meshName != GetObjectNameMap(type).cend()) + return meshName->second; + + // Not seen this object before, create and add + NameIdPair result = AddObjectIndexToMaps(type, pIndex); + return result.first; +} + +// Determine unique id and add the name and id to the maps +// @param type object type +// @param index object index +// @param name in/out. Caller to set the original name if known. +// @param idStr in/out. Caller to set the preferred id if known. +Assimp::ColladaExporter::NameIdPair Assimp::ColladaExporter::AddObjectIndexToMaps(AiObjectType type, size_t index) { + + std::string idStr; + std::string name; + + // Get the name + switch (type) { + case AiObjectType::Mesh: name = mScene->mMeshes[index]->mName.C_Str(); break; + case AiObjectType::Material: name = mScene->mMaterials[index]->GetName().C_Str(); break; + case AiObjectType::Animation: name = mScene->mAnimations[index]->mName.C_Str(); break; + case AiObjectType::Light: name = mScene->mLights[index]->mName.C_Str(); break; + case AiObjectType::Camera: name = mScene->mCameras[index]->mName.C_Str(); break; + case AiObjectType::Count: throw std::logic_error("ColladaExporter::AiObjectType::Count is not an object type"); + } + + if (name.empty()) { + // Default ids if empty name + switch (type) { + case AiObjectType::Mesh: idStr = std::string("meshId_"); break; + case AiObjectType::Material: idStr = std::string("materialId_"); break; // This one should never happen + case AiObjectType::Animation: idStr = std::string("animationId_"); break; + case AiObjectType::Light: idStr = std::string("lightId_"); break; + case AiObjectType::Camera: idStr = std::string("cameraId_"); break; + case AiObjectType::Count: throw std::logic_error("ColladaExporter::AiObjectType::Count is not an object type"); + } + idStr.append(to_string(index)); + } else { + idStr = XMLIDEncode(name); + } + + if (!name.empty()) + name = XMLEscape(name); + + MakeUniqueId(mUniqueIds, idStr); + + // Add to maps + mUniqueIds.insert(idStr); + GetObjectIdMap(type).insert(std::make_pair(index, idStr)); + GetObjectNameMap(type).insert(std::make_pair(index, idStr)); + + return std::make_pair(name, idStr); } #endif diff --git a/code/Collada/ColladaExporter.h b/code/Collada/ColladaExporter.h index d75d2d355..c6801395b 100644 --- a/code/Collada/ColladaExporter.h +++ b/code/Collada/ColladaExporter.h @@ -46,17 +46,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_COLLADAEXPORTER_H_INC #define AI_COLLADAEXPORTER_H_INC +#include #include #include #include #include #include + +#include #include #include +#include #include -#include - struct aiScene; struct aiNode; @@ -135,7 +137,7 @@ protected: std::string mFoundSkeletonRootNodeID = "skeleton_root"; // will be replaced by found node id in the WriteNode call. /// Recursively writes the given node - void WriteNode(const aiScene *scene, aiNode *pNode); + void WriteNode(const aiNode *pNode); /// Enters a new xml element, which increases the indentation void PushTag() { startstr.append(" "); } @@ -145,14 +147,40 @@ protected: startstr.erase(startstr.length() - 2); } - /// Get or Create a unique mesh ID string for the given mesh index - std::string GetMeshUniqueId(size_t pIndex); - std::string GetMeshName(size_t pIndex); + void CreateNodeIds(const aiNode *node); + + /// Get or Create a unique Node ID string for the given Node + std::string GetNodeUniqueId(const aiNode *node); + std::string GetNodeName(const aiNode *node); + + std::string GetBoneUniqueId(const aiBone *bone); + + enum class AiObjectType { + Mesh, + Material, + Animation, + Light, + Camera, + Count, + }; + /// Get or Create a unique ID string for the given scene object index + std::string GetObjectUniqueId(AiObjectType type, size_t pIndex); + /// Get or Create a name string for the given scene object index + std::string GetObjectName(AiObjectType type, size_t pIndex); + + typedef std::map IndexIdMap; + typedef std::pair NameIdPair; + NameIdPair AddObjectIndexToMaps(AiObjectType type, size_t pIndex); + + // Helpers + inline IndexIdMap &GetObjectIdMap(AiObjectType type) { return mObjectIdMap[static_cast(type)]; } + inline IndexIdMap &GetObjectNameMap(AiObjectType type) { return mObjectNameMap[static_cast(type)]; } private: - std::string AddMeshIndexToMaps(size_t pIndex, bool meshId); - mutable std::map mMeshIdMap; // Cache of encoded unique IDs - mutable std::map mMeshNameMap; // Cache of encoded mesh names + std::unordered_set mUniqueIds; // Cache of used unique ids + std::map mNodeIdMap; // Cache of encoded node and bone ids + std::array(AiObjectType::Count)> mObjectIdMap; // Cache of encoded unique IDs + std::array(AiObjectType::Count)> mObjectNameMap; // Cache of encoded names public: /// Stringstream to write all output into @@ -198,6 +226,7 @@ public: // summarize a material in an convenient way. struct Material { + std::string id; std::string name; std::string shading_model; Surface ambient, diffuse, specular, emissive, reflective, transparent, normal; @@ -206,20 +235,18 @@ public: Material() {} }; - std::vector materials; - std::map textures; public: /// Dammit C++ - y u no compile two-pass? No I have to add all methods below the struct definitions /// Reads a single surface entry from the given material keys - void ReadMaterialSurface(Surface &poSurface, const aiMaterial *pSrcMat, aiTextureType pTexture, const char *pKey, size_t pType, size_t pIndex); + bool ReadMaterialSurface(Surface &poSurface, const aiMaterial &pSrcMat, aiTextureType pTexture, const char *pKey, size_t pType, size_t pIndex); /// Writes an image entry for the given surface - void WriteImageEntry(const Surface &pSurface, const std::string &pNameAdd); + void WriteImageEntry(const Surface &pSurface, const std::string &imageId); /// Writes the two parameters necessary for referencing a texture in an effect entry - void WriteTextureParamEntry(const Surface &pSurface, const std::string &pTypeName, const std::string &pMatName); + void WriteTextureParamEntry(const Surface &pSurface, const std::string &pTypeName, const std::string &materialId); /// Writes a color-or-texture entry into an effect definition - void WriteTextureColorEntry(const Surface &pSurface, const std::string &pTypeName, const std::string &pImageName); + void WriteTextureColorEntry(const Surface &pSurface, const std::string &pTypeName, const std::string &imageId); /// Writes a scalar property void WriteFloatEntry(const Property &pProperty, const std::string &pTypeName); }; diff --git a/test/unit/utColladaImportExport.cpp b/test/unit/utColladaImportExport.cpp index 5c2f801db..5b0c9f880 100644 --- a/test/unit/utColladaImportExport.cpp +++ b/test/unit/utColladaImportExport.cpp @@ -82,20 +82,75 @@ public: return true; } + typedef std::pair IdNameString; + typedef std::map IdNameMap; + + template + static inline IdNameString GetItemIdName(const T *item, size_t index) { + std::ostringstream stream; + stream << typeid(T).name() << "@" << index; + return std::make_pair(std::string(item->mName.C_Str()), stream.str()); + } + + // Specialisations + static inline IdNameString GetItemIdName(aiMaterial *item, size_t index) { + std::ostringstream stream; + stream << typeid(aiMaterial).name() << "@" << index; + return std::make_pair(std::string(item->GetName().C_Str()), stream.str()); + } + + static inline IdNameString GetItemIdName(aiTexture *item, size_t index) { + std::ostringstream stream; + stream << typeid(aiTexture).name() << "@" << index; + return std::make_pair(std::string(item->mFilename.C_Str()), stream.str()); + } + + static inline void ReportDuplicate(IdNameMap &itemIdMap, const IdNameString &namePair, const char *typeNameStr) { + const auto result = itemIdMap.insert(namePair); + EXPECT_TRUE(result.second) << "Duplicate '" << typeNameStr << "' name: '" << namePair.first << "'. " << namePair.second << " == " << result.first->second; + } + + template + static inline void CheckUniqueIds(IdNameMap &itemIdMap, unsigned int itemCount, T **itemArray) { + for (size_t idx = 0; idx < itemCount; ++idx) { + IdNameString namePair = GetItemIdName(itemArray[idx], idx); + ReportDuplicate(itemIdMap, namePair, typeid(T).name()); + } + } + + static inline void CheckUniqueIds(IdNameMap &itemIdMap, const aiNode *parent, size_t index) { + IdNameString namePair = GetItemIdName(parent, index); + ReportDuplicate(itemIdMap, namePair, typeid(aiNode).name()); + for (size_t idx = 0; idx < parent->mNumChildren; ++idx) { + CheckUniqueIds(itemIdMap, parent->mChildren[idx], idx); + } + } + + static inline void SetAllNodeNames(const aiString &newName, aiNode *node) { + node->mName = newName; + for (size_t idx = 0; idx < node->mNumChildren; ++idx) { + SetAllNodeNames(newName, node->mChildren[idx]); + } + } + void ImportAndCheckIds(const char *file, size_t meshCount) { - // Import the Collada using the 'default' where mesh names are the ids + // Import the Collada using the 'default' where aiMesh names are the Collada ids Assimp::Importer importer; const aiScene *scene = importer.ReadFile(file, aiProcess_ValidateDataStructure); ASSERT_TRUE(scene != nullptr) << "Fatal: could not re-import " << file; EXPECT_EQ(meshCount, scene->mNumMeshes) << "in " << file; - // Check the mesh ids are unique - std::map meshNameMap; - for (size_t idx = 0; idx < scene->mNumMeshes; ++idx) { - std::string meshName(scene->mMeshes[idx]->mName.C_Str()); - const auto result = meshNameMap.insert(std::make_pair(meshName, idx)); - EXPECT_TRUE(result.second) << "Duplicate name: " << meshName << " index " << result.first->second; - } + // Check the ids are unique + IdNameMap itemIdMap; + // Recurse the Nodes + CheckUniqueIds(itemIdMap, scene->mRootNode, 0); + // Check the lists + CheckUniqueIds(itemIdMap, scene->mNumMeshes, scene->mMeshes); + CheckUniqueIds(itemIdMap, scene->mNumAnimations, scene->mAnimations); + CheckUniqueIds(itemIdMap, scene->mNumMaterials, scene->mMaterials); + CheckUniqueIds(itemIdMap, scene->mNumTextures, scene->mTextures); + CheckUniqueIds(itemIdMap, scene->mNumLights, scene->mLights); + CheckUniqueIds(itemIdMap, scene->mNumCameras, scene->mCameras); } }; @@ -115,19 +170,49 @@ TEST_F(utColladaImportExport, exporterUniqueIdsTest) { ASSERT_TRUE(scene != nullptr) << "Fatal: could not import teapots.DAE!"; ASSERT_EQ(3u, scene->mNumMeshes) << "Fatal: teapots.DAE initial load failed"; - // Clear the mesh names + // Clear all the names for (size_t idx = 0; idx < scene->mNumMeshes; ++idx) { scene->mMeshes[idx]->mName.Clear(); } + for (size_t idx = 0; idx < scene->mNumMaterials; ++idx) { + scene->mMaterials[idx]->RemoveProperty(AI_MATKEY_NAME); + } + for (size_t idx = 0; idx < scene->mNumAnimations; ++idx) { + scene->mAnimations[idx]->mName.Clear(); + } + // Can't clear texture names + for (size_t idx = 0; idx < scene->mNumLights; ++idx) { + scene->mLights[idx]->mName.Clear(); + } + for (size_t idx = 0; idx < scene->mNumCameras; ++idx) { + scene->mCameras[idx]->mName.Clear(); + } + + SetAllNodeNames(aiString(), scene->mRootNode); + ASSERT_EQ(AI_SUCCESS, exporter.Export(scene, "collada", outFileEmpty)) << "Fatal: Could not export un-named meshes file"; ImportAndCheckIds(outFileEmpty, 3); - // Force the meshes to have the same non-empty name - aiString testName("test_mesh"); + // Force everything to have the same non-empty name + aiString testName("test_name"); for (size_t idx = 0; idx < scene->mNumMeshes; ++idx) { scene->mMeshes[idx]->mName = testName; } + for (size_t idx = 0; idx < scene->mNumMaterials; ++idx) { + scene->mMaterials[idx]->AddProperty(&testName, AI_MATKEY_NAME); + } + for (size_t idx = 0; idx < scene->mNumAnimations; ++idx) { + scene->mAnimations[idx]->mName = testName; + } + // Can't clear texture names + for (size_t idx = 0; idx < scene->mNumLights; ++idx) { + scene->mLights[idx]->mName = testName; + } + for (size_t idx = 0; idx < scene->mNumCameras; ++idx) { + scene->mCameras[idx]->mName = testName; + } + ASSERT_EQ(AI_SUCCESS, exporter.Export(scene, "collada", outFileNamed)) << "Fatal: Could not export named meshes file"; ImportAndCheckIds(outFileNamed, 3); From ee16d2c4c95319a403f9c21ce10141b20e9df2a0 Mon Sep 17 00:00:00 2001 From: RichardTea <31507749+RichardTea@users.noreply.github.com> Date: Fri, 1 May 2020 11:13:38 +0100 Subject: [PATCH 021/115] Fix camera, light and bone unique ids Bones don't have a unit test yet --- code/Collada/ColladaExporter.cpp | 106 +++++++++++++++---------------- 1 file changed, 52 insertions(+), 54 deletions(-) diff --git a/code/Collada/ColladaExporter.cpp b/code/Collada/ColladaExporter.cpp index b91e118ec..a9137b50b 100644 --- a/code/Collada/ColladaExporter.cpp +++ b/code/Collada/ColladaExporter.cpp @@ -397,7 +397,7 @@ void ColladaExporter::WriteCamera(size_t pIndex) { const std::string cameraId = GetObjectUniqueId(AiObjectType::Camera, pIndex); const std::string cameraName = GetObjectName(AiObjectType::Camera, pIndex); - mOutput << startstr << "" << endstr; + mOutput << startstr << "" << endstr; PushTag(); mOutput << startstr << "" << endstr; PushTag(); @@ -450,7 +450,7 @@ void ColladaExporter::WriteLight(size_t pIndex) { const std::string lightId = GetObjectUniqueId(AiObjectType::Light, pIndex); const std::string lightName = GetObjectName(AiObjectType::Light, pIndex); - mOutput << startstr << "" << endstr; PushTag(); mOutput << startstr << "" << endstr; @@ -874,7 +874,7 @@ void ColladaExporter::WriteController(size_t pIndex) { mOutput << startstr << "mNumBones << "\">"; for (size_t i = 0; i < mesh->mNumBones; ++i) - mOutput << GetBoneUniqueId(mesh->mBones[i]) << " "; + mOutput << GetBoneUniqueId(mesh->mBones[i]) << ' '; mOutput << "" << endstr; @@ -1410,12 +1410,12 @@ void ColladaExporter::WriteAnimationsLibrary() { } // ------------------------------------------------------------------------------------------------ // Helper to find a bone by name in the scene -aiBone *findBone(const aiScene *scene, const char *name) { +aiBone *findBone(const aiScene *scene, const aiString &name) { for (size_t m = 0; m < scene->mNumMeshes; m++) { aiMesh *mesh = scene->mMeshes[m]; for (size_t b = 0; b < mesh->mNumBones; b++) { aiBone *bone = mesh->mBones[b]; - if (0 == strcmp(name, bone->mName.C_Str())) { + if (name == bone->mName) { return bone; } } @@ -1424,6 +1424,7 @@ aiBone *findBone(const aiScene *scene, const char *name) { } // ------------------------------------------------------------------------------------------------ +// Helper to find the node associated with a bone in the scene const aiNode *findBoneNode(const aiNode *aNode, const aiBone *bone) { if (aNode && bone && aNode->mName == bone->mName) { return aNode; @@ -1432,15 +1433,17 @@ const aiNode *findBoneNode(const aiNode *aNode, const aiBone *bone) { if (aNode && bone) { for (unsigned int i = 0; i < aNode->mNumChildren; ++i) { aiNode *aChild = aNode->mChildren[i]; - const aiNode *foundFromChild = 0; + const aiNode *foundFromChild = nullptr; if (aChild) { foundFromChild = findBoneNode(aChild, bone); - if (foundFromChild) return foundFromChild; + if (foundFromChild) { + return foundFromChild; + } } } } - return NULL; + return nullptr; } const aiNode *findSkeletonRootNode(const aiScene *scene, const aiMesh *mesh) { @@ -1451,7 +1454,7 @@ const aiNode *findSkeletonRootNode(const aiScene *scene, const aiMesh *mesh) { const aiNode *node = findBoneNode(scene->mRootNode, bone); if (node) { - while (node->mParent && findBone(scene, node->mParent->mName.C_Str()) != 0) { + while (node->mParent && findBone(scene, node->mParent->mName) != nullptr) { node = node->mParent; } topParentBoneNodes.insert(node); @@ -1482,13 +1485,13 @@ void ColladaExporter::WriteNode(const aiNode *pNode) { // Assimp-specific: nodes with no name cannot be associated with bones const char *node_type; bool is_joint, is_skeleton_root = false; - if (pNode->mName.length == 0 && nullptr == findBone(mScene, pNode->mName.C_Str())) { + if (pNode->mName.length == 0 || nullptr == findBone(mScene, pNode->mName)) { node_type = "NODE"; is_joint = false; } else { node_type = "JOINT"; is_joint = true; - if (!pNode->mParent || nullptr == findBone(mScene, pNode->mParent->mName.C_Str())) { + if (!pNode->mParent || nullptr == findBone(mScene, pNode->mParent->mName)) { is_skeleton_root = true; } } @@ -1542,14 +1545,14 @@ void ColladaExporter::WriteNode(const aiNode *pNode) { //check if it is a camera node for (size_t i = 0; i < mScene->mNumCameras; i++) { if (mScene->mCameras[i]->mName == pNode->mName) { - mOutput << startstr << "" << endstr; + mOutput << startstr << "" << endstr; break; } } //check if it is a light node for (size_t i = 0; i < mScene->mNumLights; i++) { if (mScene->mLights[i]->mName == pNode->mName) { - mOutput << startstr << "" << endstr; + mOutput << startstr << "" << endstr; break; } } @@ -1620,16 +1623,17 @@ inline bool IsUniqueId(const std::unordered_set &idSet, const std:: return (idSet.find(idStr) == idSet.end()); } -inline void MakeUniqueId(const std::unordered_set &idSet, std::string &idStr) { - if (!IsUniqueId(idSet, idStr)) { +inline std::string MakeUniqueId(const std::unordered_set &idSet, const std::string &idPrefix, const std::string &postfix) { + std::string result(idPrefix + postfix); + if (!IsUniqueId(idSet, result)) { // Select a number to append - size_t postfix = 1; - idStr.append("_"); - while (!IsUniqueId(idSet, idStr + to_string(postfix))) { - ++postfix; - } - idStr.append(to_string(postfix)); + size_t idnum = 1; + do { + result = idPrefix + '_' + to_string(idnum) + postfix; + ++idnum; + } while (!IsUniqueId(idSet, result)); } + return result; } void Assimp::ColladaExporter::CreateNodeIds(const aiNode *node) { @@ -1659,7 +1663,7 @@ std::string Assimp::ColladaExporter::GetNodeUniqueId(const aiNode *node) { idStr = XMLIDEncode(idStr); // Ensure it's unique - MakeUniqueId(mUniqueIds, idStr); + idStr = MakeUniqueId(mUniqueIds, idStr, std::string()); mUniqueIds.insert(idStr); mNodeIdMap.insert(std::make_pair(node, idStr)); return idStr; @@ -1671,25 +1675,12 @@ std::string Assimp::ColladaExporter::GetNodeName(const aiNode *node) { } std::string Assimp::ColladaExporter::GetBoneUniqueId(const aiBone *bone) { - // Use the pointer as the key. This is safe because the scene is immutable. - auto idIt = mNodeIdMap.find(bone); - if (idIt != mNodeIdMap.cend()) - return idIt->second; + // Find the Node that is this Bone + const aiNode *boneNode = findBoneNode(mScene->mRootNode, bone); + if (boneNode == nullptr) + return std::string(); - // New, create an id - std::string idStr(bone->mName.C_Str()); - - // Make sure the requested id is valid - if (idStr.empty()) - idStr = "bone"; - else - idStr = XMLIDEncode(idStr); - - // Ensure it's unique - MakeUniqueId(mUniqueIds, idStr); - mUniqueIds.insert(idStr); - mNodeIdMap.insert(std::make_pair(bone, idStr)); - return idStr; + return GetNodeUniqueId(boneNode); } std::string Assimp::ColladaExporter::GetObjectUniqueId(AiObjectType type, size_t pIndex) { @@ -1703,9 +1694,9 @@ std::string Assimp::ColladaExporter::GetObjectUniqueId(AiObjectType type, size_t } std::string Assimp::ColladaExporter::GetObjectName(AiObjectType type, size_t pIndex) { - auto meshName = GetObjectNameMap(type).find(pIndex); - if (meshName != GetObjectNameMap(type).cend()) - return meshName->second; + auto objectName = GetObjectNameMap(type).find(pIndex); + if (objectName != GetObjectNameMap(type).cend()) + return objectName->second; // Not seen this object before, create and add NameIdPair result = AddObjectIndexToMaps(type, pIndex); @@ -1719,27 +1710,34 @@ std::string Assimp::ColladaExporter::GetObjectName(AiObjectType type, size_t pIn // @param idStr in/out. Caller to set the preferred id if known. Assimp::ColladaExporter::NameIdPair Assimp::ColladaExporter::AddObjectIndexToMaps(AiObjectType type, size_t index) { - std::string idStr; std::string name; + std::string idStr; + std::string idPostfix; - // Get the name + // Get the name and id postfix switch (type) { case AiObjectType::Mesh: name = mScene->mMeshes[index]->mName.C_Str(); break; case AiObjectType::Material: name = mScene->mMaterials[index]->GetName().C_Str(); break; case AiObjectType::Animation: name = mScene->mAnimations[index]->mName.C_Str(); break; - case AiObjectType::Light: name = mScene->mLights[index]->mName.C_Str(); break; - case AiObjectType::Camera: name = mScene->mCameras[index]->mName.C_Str(); break; + case AiObjectType::Light: + name = mScene->mLights[index]->mName.C_Str(); + idPostfix = "-light"; + break; + case AiObjectType::Camera: + name = mScene->mCameras[index]->mName.C_Str(); + idPostfix = "-camera"; + break; case AiObjectType::Count: throw std::logic_error("ColladaExporter::AiObjectType::Count is not an object type"); } if (name.empty()) { // Default ids if empty name switch (type) { - case AiObjectType::Mesh: idStr = std::string("meshId_"); break; - case AiObjectType::Material: idStr = std::string("materialId_"); break; // This one should never happen - case AiObjectType::Animation: idStr = std::string("animationId_"); break; - case AiObjectType::Light: idStr = std::string("lightId_"); break; - case AiObjectType::Camera: idStr = std::string("cameraId_"); break; + case AiObjectType::Mesh: idStr = std::string("mesh_"); break; + case AiObjectType::Material: idStr = std::string("material_"); break; // This one should never happen + case AiObjectType::Animation: idStr = std::string("animation_"); break; + case AiObjectType::Light: idStr = std::string("light_"); break; + case AiObjectType::Camera: idStr = std::string("camera_"); break; case AiObjectType::Count: throw std::logic_error("ColladaExporter::AiObjectType::Count is not an object type"); } idStr.append(to_string(index)); @@ -1750,12 +1748,12 @@ Assimp::ColladaExporter::NameIdPair Assimp::ColladaExporter::AddObjectIndexToMap if (!name.empty()) name = XMLEscape(name); - MakeUniqueId(mUniqueIds, idStr); + idStr = MakeUniqueId(mUniqueIds, idStr, idPostfix); // Add to maps mUniqueIds.insert(idStr); GetObjectIdMap(type).insert(std::make_pair(index, idStr)); - GetObjectNameMap(type).insert(std::make_pair(index, idStr)); + GetObjectNameMap(type).insert(std::make_pair(index, name)); return std::make_pair(name, idStr); } From e6c4175d8dff75d0a2a62ce15c4b4299130b40f8 Mon Sep 17 00:00:00 2001 From: RichardTea <31507749+RichardTea@users.noreply.github.com> Date: Fri, 1 May 2020 11:49:15 +0100 Subject: [PATCH 022/115] Rename Collada export tests Use existing naming convention. Brings all Collada tests together in Test Explorers --- test/CMakeLists.txt | 3 +- ...adaExportLight.cpp => utColladaExport.cpp} | 51 +++++++- test/unit/utColladaExportCamera.cpp | 115 ------------------ 3 files changed, 50 insertions(+), 119 deletions(-) rename test/unit/{utColladaExportLight.cpp => utColladaExport.cpp} (78%) delete mode 100644 test/unit/utColladaExportCamera.cpp diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index bf6694845..a5f8086e9 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -124,8 +124,7 @@ SET( IMPORTERS unit/utBlendImportMaterials.cpp unit/utBlenderWork.cpp unit/utBVHImportExport.cpp - unit/utColladaExportCamera.cpp - unit/utColladaExportLight.cpp + unit/utColladaExport.cpp unit/utColladaImportExport.cpp unit/utCSMImportExport.cpp unit/utB3DImportExport.cpp diff --git a/test/unit/utColladaExportLight.cpp b/test/unit/utColladaExport.cpp similarity index 78% rename from test/unit/utColladaExportLight.cpp rename to test/unit/utColladaExport.cpp index 0327b296e..efb2d7f17 100644 --- a/test/unit/utColladaExportLight.cpp +++ b/test/unit/utColladaExport.cpp @@ -49,7 +49,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef ASSIMP_BUILD_NO_EXPORT -class ColladaExportLight : public ::testing::Test { +class utColladaExport : public ::testing::Test { public: void SetUp() override { ex = new Assimp::Exporter(); @@ -58,7 +58,9 @@ public: void TearDown() override { delete ex; + ex = nullptr; delete im; + im = nullptr; } protected: @@ -66,8 +68,53 @@ protected: Assimp::Importer *im; }; +TEST_F(utColladaExport, testExportCamera) { + const char *file = "cameraExp.dae"; + + const aiScene *pTest = im->ReadFile(ASSIMP_TEST_MODELS_DIR "/Collada/cameras.dae", aiProcess_ValidateDataStructure); + ASSERT_NE(nullptr, pTest); + ASSERT_TRUE(pTest->HasCameras()); + + EXPECT_EQ(AI_SUCCESS, ex->Export(pTest, "collada", file)); + const unsigned int origNumCams(pTest->mNumCameras); + std::unique_ptr origFOV(new float[origNumCams]); + std::unique_ptr orifClipPlaneNear(new float[origNumCams]); + std::unique_ptr orifClipPlaneFar(new float[origNumCams]); + std::unique_ptr names(new aiString[origNumCams]); + std::unique_ptr pos(new aiVector3D[origNumCams]); + for (size_t i = 0; i < origNumCams; i++) { + const aiCamera *orig = pTest->mCameras[i]; + ASSERT_NE(nullptr, orig); + + origFOV[i] = orig->mHorizontalFOV; + orifClipPlaneNear[i] = orig->mClipPlaneNear; + orifClipPlaneFar[i] = orig->mClipPlaneFar; + names[i] = orig->mName; + pos[i] = orig->mPosition; + } + const aiScene *imported = im->ReadFile(file, aiProcess_ValidateDataStructure); + + ASSERT_NE(nullptr, imported); + + EXPECT_TRUE(imported->HasCameras()); + EXPECT_EQ(origNumCams, imported->mNumCameras); + + for (size_t i = 0; i < imported->mNumCameras; i++) { + const aiCamera *read = imported->mCameras[i]; + + EXPECT_TRUE(names[i] == read->mName); + EXPECT_NEAR(origFOV[i], read->mHorizontalFOV, 0.0001f); + EXPECT_FLOAT_EQ(orifClipPlaneNear[i], read->mClipPlaneNear); + EXPECT_FLOAT_EQ(orifClipPlaneFar[i], read->mClipPlaneFar); + + EXPECT_FLOAT_EQ(pos[i].x, read->mPosition.x); + EXPECT_FLOAT_EQ(pos[i].y, read->mPosition.y); + EXPECT_FLOAT_EQ(pos[i].z, read->mPosition.z); + } +} + // ------------------------------------------------------------------------------------------------ -TEST_F(ColladaExportLight, testExportLight) { +TEST_F(utColladaExport, testExportLight) { const char *file = "lightsExp.dae"; const aiScene *pTest = im->ReadFile(ASSIMP_TEST_MODELS_DIR "/Collada/lights.dae", aiProcess_ValidateDataStructure); diff --git a/test/unit/utColladaExportCamera.cpp b/test/unit/utColladaExportCamera.cpp deleted file mode 100644 index c2c704056..000000000 --- a/test/unit/utColladaExportCamera.cpp +++ /dev/null @@ -1,115 +0,0 @@ -/* ---------------------------------------------------------------------------- -Open Asset Import Library (assimp) ---------------------------------------------------------------------------- - -Copyright (c) 2006-2020, 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 -#include -#include -#include -#include - -#ifndef ASSIMP_BUILD_NO_EXPORT - -class ColladaExportCamera : public ::testing::Test { -public: - void SetUp() override { - ex = new Assimp::Exporter(); - im = new Assimp::Importer(); - } - - void TearDown() override { - delete ex; - ex = nullptr; - delete im; - im = nullptr; - } - -protected: - Assimp::Exporter *ex; - Assimp::Importer *im; -}; - -TEST_F(ColladaExportCamera, testExportCamera) { - const char *file = "cameraExp.dae"; - - const aiScene *pTest = im->ReadFile(ASSIMP_TEST_MODELS_DIR "/Collada/cameras.dae", aiProcess_ValidateDataStructure); - ASSERT_NE(nullptr, pTest); - ASSERT_TRUE(pTest->HasCameras()); - - EXPECT_EQ(AI_SUCCESS, ex->Export(pTest, "collada", file)); - const unsigned int origNumCams(pTest->mNumCameras); - std::unique_ptr origFOV(new float[origNumCams]); - std::unique_ptr orifClipPlaneNear(new float[origNumCams]); - std::unique_ptr orifClipPlaneFar(new float[origNumCams]); - std::unique_ptr names(new aiString[origNumCams]); - std::unique_ptr pos(new aiVector3D[origNumCams]); - for (size_t i = 0; i < origNumCams; i++) { - const aiCamera *orig = pTest->mCameras[i]; - ASSERT_NE(nullptr, orig); - - origFOV[i] = orig->mHorizontalFOV; - orifClipPlaneNear[i] = orig->mClipPlaneNear; - orifClipPlaneFar[i] = orig->mClipPlaneFar; - names[i] = orig->mName; - pos[i] = orig->mPosition; - } - const aiScene *imported = im->ReadFile(file, aiProcess_ValidateDataStructure); - - ASSERT_NE(nullptr, imported); - - EXPECT_TRUE(imported->HasCameras()); - EXPECT_EQ(origNumCams, imported->mNumCameras); - - for (size_t i = 0; i < imported->mNumCameras; i++) { - const aiCamera *read = imported->mCameras[i]; - - EXPECT_TRUE(names[i] == read->mName); - EXPECT_NEAR(origFOV[i], read->mHorizontalFOV, 0.0001f); - EXPECT_FLOAT_EQ(orifClipPlaneNear[i], read->mClipPlaneNear); - EXPECT_FLOAT_EQ(orifClipPlaneFar[i], read->mClipPlaneFar); - - EXPECT_FLOAT_EQ(pos[i].x, read->mPosition.x); - EXPECT_FLOAT_EQ(pos[i].y, read->mPosition.y); - EXPECT_FLOAT_EQ(pos[i].z, read->mPosition.z); - } -} - -#endif // ASSIMP_BUILD_NO_EXPORT From 5b9f207f1fd6bda7add462c77a5ab458111cb6f0 Mon Sep 17 00:00:00 2001 From: RichardTea <31507749+RichardTea@users.noreply.github.com> Date: Fri, 1 May 2020 11:39:43 +0100 Subject: [PATCH 023/115] ColladaExporter cleanup Namespace, NULL and includes --- code/Collada/ColladaExporter.cpp | 39 ++++++++++++++------------------ code/Collada/ColladaExporter.h | 8 +++---- include/assimp/ColladaMetaData.h | 4 ++-- 3 files changed, 23 insertions(+), 28 deletions(-) diff --git a/code/Collada/ColladaExporter.cpp b/code/Collada/ColladaExporter.cpp index a9137b50b..5e4cdda2d 100644 --- a/code/Collada/ColladaExporter.cpp +++ b/code/Collada/ColladaExporter.cpp @@ -44,9 +44,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef ASSIMP_BUILD_NO_COLLADA_EXPORTER #include "ColladaExporter.h" + #include #include #include +#include #include #include #include @@ -57,15 +59,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include -#include - #include -#include #include -#include -#include - -using namespace Assimp; namespace Assimp { @@ -84,7 +79,7 @@ void ExportSceneCollada(const char *pFile, IOSystem *pIOSystem, const aiScene *p // we're still here - export successfully completed. Write result to the given IOSYstem std::unique_ptr outfile(pIOSystem->Open(pFile, "wt")); - if (outfile == NULL) { + if (outfile == nullptr) { throw DeadlyExportError("could not open output .dae file: " + std::string(pFile)); } @@ -92,8 +87,6 @@ void ExportSceneCollada(const char *pFile, IOSystem *pIOSystem, const aiScene *p outfile->Write(iDoTheExportThing.mOutput.str().c_str(), static_cast(iDoTheExportThing.mOutput.tellp()), 1); } -} // end of namespace Assimp - // ------------------------------------------------------------------------------------------------ // Encodes a string into a valid XML ID using the xsd:ID schema qualifications. static const std::string XMLIDEncode(const std::string &name) { @@ -207,7 +200,7 @@ void ColladaExporter::WriteHeader() { static const unsigned int date_nb_chars = 20; char date_str[date_nb_chars]; - std::time_t date = std::time(NULL); + std::time_t date = std::time(nullptr); std::strftime(date_str, date_nb_chars, "%Y-%m-%dT%H:%M:%S", std::localtime(&date)); aiVector3D scaling; @@ -358,7 +351,7 @@ void ColladaExporter::WriteTextures() { std::string name = mFile + "_texture_" + (i < 1000 ? "0" : "") + (i < 100 ? "0" : "") + (i < 10 ? "0" : "") + str + "." + ((const char *)texture->achFormatHint); std::unique_ptr outfile(mIOSystem->Open(mPath + mIOSystem->getOsSeparator() + name, "wb")); - if (outfile == NULL) { + if (outfile == nullptr) { throw DeadlyExportError("could not open output texture file: " + mPath + name); } @@ -571,7 +564,7 @@ bool ColladaExporter::ReadMaterialSurface(Surface &poSurface, const aiMaterial & if (pSrcMat.GetTextureCount(pTexture) > 0) { aiString texfile; unsigned int uvChannel = 0; - pSrcMat.GetTexture(pTexture, 0, &texfile, NULL, &uvChannel); + pSrcMat.GetTexture(pTexture, 0, &texfile, nullptr, &uvChannel); std::string index_str(texfile.C_Str()); @@ -1420,7 +1413,7 @@ aiBone *findBone(const aiScene *scene, const aiString &name) { } } } - return NULL; + return nullptr; } // ------------------------------------------------------------------------------------------------ @@ -1474,7 +1467,7 @@ const aiNode *findSkeletonRootNode(const aiScene *scene, const aiMesh *mesh) { } } - return NULL; + return nullptr; } // ------------------------------------------------------------------------------------------------ @@ -1636,13 +1629,13 @@ inline std::string MakeUniqueId(const std::unordered_set &idSet, co return result; } -void Assimp::ColladaExporter::CreateNodeIds(const aiNode *node) { +void ColladaExporter::CreateNodeIds(const aiNode *node) { GetNodeUniqueId(node); for (size_t a = 0; a < node->mNumChildren; ++a) CreateNodeIds(node->mChildren[a]); } -std::string Assimp::ColladaExporter::GetNodeUniqueId(const aiNode *node) { +std::string ColladaExporter::GetNodeUniqueId(const aiNode *node) { // Use the pointer as the key. This is safe because the scene is immutable. auto idIt = mNodeIdMap.find(node); if (idIt != mNodeIdMap.cend()) @@ -1669,12 +1662,12 @@ std::string Assimp::ColladaExporter::GetNodeUniqueId(const aiNode *node) { return idStr; } -std::string Assimp::ColladaExporter::GetNodeName(const aiNode *node) { +std::string ColladaExporter::GetNodeName(const aiNode *node) { return XMLEscape(node->mName.C_Str()); } -std::string Assimp::ColladaExporter::GetBoneUniqueId(const aiBone *bone) { +std::string ColladaExporter::GetBoneUniqueId(const aiBone *bone) { // Find the Node that is this Bone const aiNode *boneNode = findBoneNode(mScene->mRootNode, bone); if (boneNode == nullptr) @@ -1683,7 +1676,7 @@ std::string Assimp::ColladaExporter::GetBoneUniqueId(const aiBone *bone) { return GetNodeUniqueId(boneNode); } -std::string Assimp::ColladaExporter::GetObjectUniqueId(AiObjectType type, size_t pIndex) { +std::string ColladaExporter::GetObjectUniqueId(AiObjectType type, size_t pIndex) { auto idIt = GetObjectIdMap(type).find(pIndex); if (idIt != GetObjectIdMap(type).cend()) return idIt->second; @@ -1693,7 +1686,7 @@ std::string Assimp::ColladaExporter::GetObjectUniqueId(AiObjectType type, size_t return result.second; } -std::string Assimp::ColladaExporter::GetObjectName(AiObjectType type, size_t pIndex) { +std::string ColladaExporter::GetObjectName(AiObjectType type, size_t pIndex) { auto objectName = GetObjectNameMap(type).find(pIndex); if (objectName != GetObjectNameMap(type).cend()) return objectName->second; @@ -1708,7 +1701,7 @@ std::string Assimp::ColladaExporter::GetObjectName(AiObjectType type, size_t pIn // @param index object index // @param name in/out. Caller to set the original name if known. // @param idStr in/out. Caller to set the preferred id if known. -Assimp::ColladaExporter::NameIdPair Assimp::ColladaExporter::AddObjectIndexToMaps(AiObjectType type, size_t index) { +ColladaExporter::NameIdPair ColladaExporter::AddObjectIndexToMaps(AiObjectType type, size_t index) { std::string name; std::string idStr; @@ -1758,5 +1751,7 @@ Assimp::ColladaExporter::NameIdPair Assimp::ColladaExporter::AddObjectIndexToMap return std::make_pair(name, idStr); } +} // end of namespace Assimp + #endif #endif diff --git a/code/Collada/ColladaExporter.h b/code/Collada/ColladaExporter.h index c6801395b..bea65bafc 100644 --- a/code/Collada/ColladaExporter.h +++ b/code/Collada/ColladaExporter.h @@ -46,12 +46,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_COLLADAEXPORTER_H_INC #define AI_COLLADAEXPORTER_H_INC -#include #include -#include #include -#include -#include #include #include @@ -61,9 +57,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. struct aiScene; struct aiNode; +struct aiLight; +struct aiBone; namespace Assimp { +class IOSystem; + /// Helper class to export a given scene to a Collada file. Just for my personal /// comfort when implementing it. class ColladaExporter { diff --git a/include/assimp/ColladaMetaData.h b/include/assimp/ColladaMetaData.h index 4288692c6..82aee78d0 100644 --- a/include/assimp/ColladaMetaData.h +++ b/include/assimp/ColladaMetaData.h @@ -47,7 +47,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_COLLADAMETADATA_H_INC #define AI_COLLADAMETADATA_H_INC -#define AI_METADATA_COLLADA_ID "COLLADA_ID" -#define AI_METADATA_COLLADA_SID "COLLADA_SID" +#define AI_METADATA_COLLADA_ID "Collada_id" +#define AI_METADATA_COLLADA_SID "Collada_sid" #endif From 1dabb1a0946168332f601bb46bfdfa7743c64d18 Mon Sep 17 00:00:00 2001 From: RichardTea <31507749+RichardTea@users.noreply.github.com> Date: Fri, 1 May 2020 14:59:09 +0100 Subject: [PATCH 024/115] Collada: Fix crash with AI_CONFIG_IMPORT_COLLADA_USE_COLLADA_NAMES Add unit test for this --- code/Collada/ColladaLoader.cpp | 13 ++++- test/unit/utColladaImportExport.cpp | 76 +++++++++++++++++++++++++---- 2 files changed, 77 insertions(+), 12 deletions(-) diff --git a/code/Collada/ColladaLoader.cpp b/code/Collada/ColladaLoader.cpp index c76954fdf..8ca0b130e 100644 --- a/code/Collada/ColladaLoader.cpp +++ b/code/Collada/ColladaLoader.cpp @@ -258,6 +258,15 @@ void ColladaLoader::InternReadFile(const std::string &pFile, aiScene *pScene, IO } } +// Add an item of metadata to a node +// Assumes the key is not already in the list +template +inline void AddNodeMetaData(aiNode *node, const std::string &key, const T &value) { + if (nullptr == node->mMetaData) + node->mMetaData = new aiMetadata(); + node->mMetaData->Add(key, value); +} + // ------------------------------------------------------------------------------------------------ // Recursively constructs a scene node for the given parser node and returns it. aiNode *ColladaLoader::BuildHierarchy(const ColladaParser &pParser, const Collada::Node *pNode) { @@ -269,9 +278,9 @@ aiNode *ColladaLoader::BuildHierarchy(const ColladaParser &pParser, const Collad // if we're not using the unique IDs, hold onto them for reference and export if (useColladaName) { if (!pNode->mID.empty()) - node->mMetaData->Add(AI_METADATA_COLLADA_ID, aiString(pNode->mID)); + AddNodeMetaData(node, AI_METADATA_COLLADA_ID, aiString(pNode->mID)); if (!pNode->mSID.empty()) - node->mMetaData->Add(AI_METADATA_COLLADA_SID, aiString(pNode->mSID)); + AddNodeMetaData(node, AI_METADATA_COLLADA_SID, aiString(pNode->mSID)); } // calculate the transformation matrix for it diff --git a/test/unit/utColladaImportExport.cpp b/test/unit/utColladaImportExport.cpp index 5b0c9f880..876f60c54 100644 --- a/test/unit/utColladaImportExport.cpp +++ b/test/unit/utColladaImportExport.cpp @@ -41,6 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "AbstractImportExportBase.h" #include "UnitTestPCH.h" +#include #include #include #include @@ -85,6 +86,18 @@ public: typedef std::pair IdNameString; typedef std::map IdNameMap; + template + static inline IdNameString GetColladaIdName(const T *item, size_t index) { + std::ostringstream stream; + stream << typeid(T).name() << "@" << index; + if (item->mMetaData) { + aiString aiStr; + if (item->mMetaData->Get(AI_METADATA_COLLADA_ID, aiStr)) + return std::make_pair(std::string(aiStr.C_Str()), stream.str()); + } + return std::make_pair(std::string(), stream.str()); + } + template static inline IdNameString GetItemIdName(const T *item, size_t index) { std::ostringstream stream; @@ -121,11 +134,23 @@ public: static inline void CheckUniqueIds(IdNameMap &itemIdMap, const aiNode *parent, size_t index) { IdNameString namePair = GetItemIdName(parent, index); ReportDuplicate(itemIdMap, namePair, typeid(aiNode).name()); + for (size_t idx = 0; idx < parent->mNumChildren; ++idx) { CheckUniqueIds(itemIdMap, parent->mChildren[idx], idx); } } + static inline void CheckNodeIdNames(IdNameMap &nodeIdMap, IdNameMap &nodeNameMap, const aiNode *parent, size_t index) { + IdNameString namePair = GetItemIdName(parent, index); + const auto result = nodeNameMap.insert(namePair); + IdNameString idPair = GetColladaIdName(parent, index); + ReportDuplicate(nodeIdMap, idPair, typeid(aiNode).name()); + + for (size_t idx = 0; idx < parent->mNumChildren; ++idx) { + CheckNodeIdNames(nodeIdMap, nodeNameMap, parent->mChildren[idx], idx); + } + } + static inline void SetAllNodeNames(const aiString &newName, aiNode *node) { node->mName = newName; for (size_t idx = 0; idx < node->mNumChildren; ++idx) { @@ -133,12 +158,12 @@ public: } } - void ImportAndCheckIds(const char *file, size_t meshCount) { - // Import the Collada using the 'default' where aiMesh names are the Collada ids + void ImportAndCheckIds(const char *file, const aiScene *origScene) { + // Import the Collada using the 'default' where aiNode and aiMesh names are the Collada ids Assimp::Importer importer; const aiScene *scene = importer.ReadFile(file, aiProcess_ValidateDataStructure); ASSERT_TRUE(scene != nullptr) << "Fatal: could not re-import " << file; - EXPECT_EQ(meshCount, scene->mNumMeshes) << "in " << file; + EXPECT_EQ(origScene->mNumMeshes, scene->mNumMeshes) << "in " << file; // Check the ids are unique IdNameMap itemIdMap; @@ -146,11 +171,39 @@ public: CheckUniqueIds(itemIdMap, scene->mRootNode, 0); // Check the lists CheckUniqueIds(itemIdMap, scene->mNumMeshes, scene->mMeshes); - CheckUniqueIds(itemIdMap, scene->mNumAnimations, scene->mAnimations); - CheckUniqueIds(itemIdMap, scene->mNumMaterials, scene->mMaterials); - CheckUniqueIds(itemIdMap, scene->mNumTextures, scene->mTextures); - CheckUniqueIds(itemIdMap, scene->mNumLights, scene->mLights); - CheckUniqueIds(itemIdMap, scene->mNumCameras, scene->mCameras); + // The remaining will come in using the name, which may not be unique + // Check we have the right number + EXPECT_EQ(origScene->mNumAnimations, scene->mNumAnimations); + EXPECT_EQ(origScene->mNumMaterials, scene->mNumMaterials); + EXPECT_EQ(origScene->mNumTextures, scene->mNumTextures); + EXPECT_EQ(origScene->mNumLights, scene->mNumLights); + EXPECT_EQ(origScene->mNumCameras, scene->mNumCameras); + } + + void ImportAsNames(const char *file, const aiScene *origScene) { + // Import the Collada but using the user-visible names for aiNode and aiMesh + // Note that this mode may not support bones or animations + Assimp::Importer importer; + importer.SetPropertyInteger(AI_CONFIG_IMPORT_COLLADA_USE_COLLADA_NAMES, 1); + + const aiScene *scene = importer.ReadFile(file, aiProcess_ValidateDataStructure); + ASSERT_TRUE(scene != nullptr) << "Fatal: could not re-import " << file; + EXPECT_EQ(origScene->mNumMeshes, scene->mNumMeshes) << "in " << file; + + // Check the node ids are unique but the node names are not + IdNameMap nodeIdMap; + IdNameMap nodeNameMap; + // Recurse the Nodes + CheckNodeIdNames(nodeIdMap, nodeNameMap, scene->mRootNode, 0); + + // nodeNameMap should have fewer than nodeIdMap + EXPECT_LT(nodeNameMap.size(), nodeIdMap.size()) << "Some nodes should have the same names"; + // Check the counts haven't changed + EXPECT_EQ(origScene->mNumAnimations, scene->mNumAnimations); + EXPECT_EQ(origScene->mNumMaterials, scene->mNumMaterials); + EXPECT_EQ(origScene->mNumTextures, scene->mNumTextures); + EXPECT_EQ(origScene->mNumLights, scene->mNumLights); + EXPECT_EQ(origScene->mNumCameras, scene->mNumCameras); } }; @@ -192,7 +245,7 @@ TEST_F(utColladaImportExport, exporterUniqueIdsTest) { ASSERT_EQ(AI_SUCCESS, exporter.Export(scene, "collada", outFileEmpty)) << "Fatal: Could not export un-named meshes file"; - ImportAndCheckIds(outFileEmpty, 3); + ImportAndCheckIds(outFileEmpty, scene); // Force everything to have the same non-empty name aiString testName("test_name"); @@ -213,9 +266,12 @@ TEST_F(utColladaImportExport, exporterUniqueIdsTest) { scene->mCameras[idx]->mName = testName; } + SetAllNodeNames(testName, scene->mRootNode); + ASSERT_EQ(AI_SUCCESS, exporter.Export(scene, "collada", outFileNamed)) << "Fatal: Could not export named meshes file"; - ImportAndCheckIds(outFileNamed, 3); + ImportAndCheckIds(outFileNamed, scene); + ImportAsNames(outFileNamed, scene); } class utColladaZaeImportExport : public AbstractImportExportBase { From c6f2196f60fb219c1de423c0e27e04eba05c6c90 Mon Sep 17 00:00:00 2001 From: David Golembiowski Date: Fri, 1 May 2020 16:32:25 -0400 Subject: [PATCH 025/115] vector definitions --- port/assimp_rs/src/structs/vec.rs | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/port/assimp_rs/src/structs/vec.rs b/port/assimp_rs/src/structs/vec.rs index e69de29bb..37e1c5150 100644 --- a/port/assimp_rs/src/structs/vec.rs +++ b/port/assimp_rs/src/structs/vec.rs @@ -0,0 +1,29 @@ +struct Vector2d { + x: f32, + y: f32 +} + +struct Vector3d { + x: f32, + y: f32, + z: f32 +} + +impl Vector2d { + pub fn new(x_f32: f32, y_f32: f32) -> Vector2d { + Vector2d { + x: x_f32, + y: y_f32 + } + } +} + +impl Vector3d { + pub fn new(x_f32: f32, y_f32: f32, z_f32: f32) -> Vector3d { + Vector3d { + x: x_f32, + y: y_f32, + z: z_f32 + } + } +} From c338c5ca02e4b05d50275844f8aa89895c69a1a1 Mon Sep 17 00:00:00 2001 From: David Golembiowski Date: Fri, 1 May 2020 16:47:35 -0400 Subject: [PATCH 026/115] Populating 3d and 4d matrix struct definitions --- port/assimp_rs/src/structs/matrix.rs | 64 ++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/port/assimp_rs/src/structs/matrix.rs b/port/assimp_rs/src/structs/matrix.rs index e69de29bb..4673b2d69 100644 --- a/port/assimp_rs/src/structs/matrix.rs +++ b/port/assimp_rs/src/structs/matrix.rs @@ -0,0 +1,64 @@ +#[derive(Clone, Debug, Copy)] +struct Matrix3x3 { + a1: f32, + a2: f32, + a3: f32, + b1: f32, + b2: f32, + b3: f32, + c1: f32, + c2: f32, + c3: f32 +} + +#[derive(Clone, Debug, Copy)] +struct Matrix4x4 { + a1: f32, + a2: f32, + a3: f32, + a4: f32, + b1: f32, + b2: f32, + b3: f32, + b4: f32, + c1: f32, + c2: f32, + c3: f32, + c4: f32, + d1: f32, + d2: f32, + d3: f32, + d4: f32 +} + +impl Matrix3x3 { + pub fn new( + a1_f32: f32, a2_f32: f32, a3_f32: f32, + b1_f32: f32, b2_f32: f32, b3_f32: f32, + c1_f32: f32, c2_f32: f32, c3_f32: f32 + ) -> Matrix3x3 { + Matrix3x3 { + a1: a1_f32, a2: a2_f32, a3: a3_f32, + b1: b1_f32, b2: b2_f32, b3: b3_f32, + c1: c1_f32, c2: c2_f32, c3: c3_f32 + } + } +} + +impl Matrix4x4 { + pub fn new( + a1_f32: f32, a2_f32: f32, a3_f32: f32, a4_f32: f32, + b1_f32: f32, b2_f32: f32, b3_f32: f32, b4_f32: f32, + c1_f32: f32, c2_f32: f32, c3_f32: f32, c4_f32: f32, + d1_f32: f32, d2_f32: f32, d3_f32: f32, d4_f32: f32 + ) -> Matrix4x4 { + Matrix4x4 { + a1: a1_f32, a2: a2_f32, a3: a3_f32, a4: a4_f32, + b1: b1_f32, b2: b2_f32, b3: b3_f32, b4: b4_f32, + c1: c1_f32, c2: c2_f32, c3: c3_f32, c4: c4_f32, + d1: d1_f32, d2: d2_f32, d3: d3_f32, d4: d4_f32 + } + } +} + + From 4f8eb0f79ca0c1d88fab2bd357527e1d40137ee8 Mon Sep 17 00:00:00 2001 From: David Golembiowski Date: Fri, 1 May 2020 16:50:31 -0400 Subject: [PATCH 027/115] populating Texel struct definition for textures --- port/assimp_rs/src/structs/texel.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/port/assimp_rs/src/structs/texel.rs b/port/assimp_rs/src/structs/texel.rs index e69de29bb..b2c72f30e 100644 --- a/port/assimp_rs/src/structs/texel.rs +++ b/port/assimp_rs/src/structs/texel.rs @@ -0,0 +1,19 @@ +#[derive(Clone, Debug, Copy)] +struct Texel { + b: u32, + g: u32, + r: u32, + a: u32 +} + +impl Texel { + pub fn new(b_u32: u32, g_u32: u32, + r_u32: u32, a_u32: u32) -> Texel { + Texel { + b: b_u32, + g: g_u32, + r: r_u32, + a: a_u32 + } + } +} From ba633f95bb1af4bbca82738a95bf569cef035a35 Mon Sep 17 00:00:00 2001 From: David Golembiowski Date: Fri, 1 May 2020 16:54:56 -0400 Subject: [PATCH 028/115] populating colors --- port/assimp_rs/src/structs/color.rs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/port/assimp_rs/src/structs/color.rs b/port/assimp_rs/src/structs/color.rs index e69de29bb..0b5fc6413 100644 --- a/port/assimp_rs/src/structs/color.rs +++ b/port/assimp_rs/src/structs/color.rs @@ -0,0 +1,27 @@ +#[derive(Clone, Debug, Copy)] +struct Color3D { + r: f32, + g: f32, + b: f32 +} + +impl Color3D { + pub fn new(r_f32: f32, g_f32: f32, b_f32: f32) -> Color3D { + Color3D {r: r_f32, g: g_f32, b: b_f32 } + } +} + +#[derive(Clone, Debug, Copy)] +struct Color4D { + r: f32, + g: f32, + b: f32, + a: f32 +} + +impl Color4D { + pub fn new(r_f32: f32, g_f32: f32, b_f32: f32, a_f32: f32) -> Color4D { + Color4D {r: r_f32, g: g_f32, b: b_f32, a: a_f32 } + } +} + From 38b80f6c6b7dd60b0366af8eaaeca9a179128f33 Mon Sep 17 00:00:00 2001 From: David Golembiowski Date: Fri, 1 May 2020 16:58:32 -0400 Subject: [PATCH 029/115] populating plane struct --- port/assimp_rs/src/structs/plane.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/port/assimp_rs/src/structs/plane.rs b/port/assimp_rs/src/structs/plane.rs index e69de29bb..2b0b74499 100644 --- a/port/assimp_rs/src/structs/plane.rs +++ b/port/assimp_rs/src/structs/plane.rs @@ -0,0 +1,23 @@ +#[derive(Clone, Debug, Copy)] +struct Plane { + a: f32, + b: f32, + c: f32, + d: f32 +} + +impl Plane { + pub fn new( + a_f32: f32, + b_f32: f32, + c_f32: f32, + d_f32: f32 + ) -> Plane { + Plane { + a: a_f32, + b: b_f32, + c: b_f32, + d: d_f32 + } + } +} From e6837f73949d1d797f71531d0d6ba08dfee6a5fb Mon Sep 17 00:00:00 2001 From: David Golembiowski Date: Fri, 1 May 2020 17:25:02 -0400 Subject: [PATCH 030/115] Need to consider different implementations of String kinds in Rust, and additionally how we may want to `impl Copy for Str`, i.e. `std::mem::swap` with placeholders to keep performance up. --- port/assimp_rs/src/structs/string.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/port/assimp_rs/src/structs/string.rs b/port/assimp_rs/src/structs/string.rs index e69de29bb..c99fabffb 100644 --- a/port/assimp_rs/src/structs/string.rs +++ b/port/assimp_rs/src/structs/string.rs @@ -0,0 +1,17 @@ +pub const MAXLEN: u32 = 1024; + +#[derive(Clone, Debug)] +struct Str { + length: u32, + data: Vec +} + +impl Str { + pub fn new(len_u32: u32, data_string: String) -> Str { + Str { + length: len_u32, + data: data_string.chars().collect() + } + } +} + From a286506c234068bbab212eb7de4c8ea5e853a934 Mon Sep 17 00:00:00 2001 From: David Golembiowski Date: Fri, 1 May 2020 17:32:55 -0400 Subject: [PATCH 031/115] fixed a couple of things. Adding MaterialPropertyString --- port/assimp_rs/src/structs/string.rs | 30 +++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/port/assimp_rs/src/structs/string.rs b/port/assimp_rs/src/structs/string.rs index c99fabffb..b88457df4 100644 --- a/port/assimp_rs/src/structs/string.rs +++ b/port/assimp_rs/src/structs/string.rs @@ -1,13 +1,16 @@ -pub const MAXLEN: u32 = 1024; +pub const MAXLEN: usize = 1024; +/// Want to consider replacing `Vec` +/// with a comparable definition at +/// https://doc.rust-lang.org/src/alloc/string.rs.html#415-417 #[derive(Clone, Debug)] struct Str { - length: u32, + length: usize, data: Vec } impl Str { - pub fn new(len_u32: u32, data_string: String) -> Str { + pub fn new(len_u32: usize, data_string: String) -> Str { Str { length: len_u32, data: data_string.chars().collect() @@ -15,3 +18,24 @@ impl Str { } } +/// MaterialPropertyStr +/// The size of length is truncated to 4 bytes on a 64-bit platform when used as a +/// material property (see MaterialSystem.cpp, as aiMaterial::AddProperty() ). +#[derive(Clone, Debug)] +struct MaterialPropertyStr { + length: usize, + data: Vec +} + + +impl MaterialPropertyStr { + pub fn new(len_u32: usize, data_string: String) -> MaterialPropertyStr { + MaterialPropertyStr { + length: len_u32, + data: data_string.chars().collect() + } + } +} + + + From 2d43a2447530fe2abe30f9aaeae558212734c231 Mon Sep 17 00:00:00 2001 From: David Golembiowski Date: Fri, 1 May 2020 17:41:16 -0400 Subject: [PATCH 032/115] memory info struct --- port/assimp_rs/src/structs/mem.rs | 0 port/assimp_rs/src/structs/memory.rs | 35 ++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) delete mode 100644 port/assimp_rs/src/structs/mem.rs create mode 100644 port/assimp_rs/src/structs/memory.rs diff --git a/port/assimp_rs/src/structs/mem.rs b/port/assimp_rs/src/structs/mem.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/port/assimp_rs/src/structs/memory.rs b/port/assimp_rs/src/structs/memory.rs new file mode 100644 index 000000000..c076f172a --- /dev/null +++ b/port/assimp_rs/src/structs/memory.rs @@ -0,0 +1,35 @@ +#[derive(Clone, Debug, Copy)] +struct MemoryInfo { + textures: u32, + materials: u32, + meshes: u32, + nodes: u32, + animations: u32, + cameras: u32, + lights: u32, + total: u32 +} + +impl MemoryInfo { + pub fn new( + textures_uint: u32, + materials_uint: u32, + meshes_uint: u32, + nodes_uint: u32, + animations_uint: u32, + cameras_uint: u32, + lights_uint: u32, + total_uint: u32) -> MemoryInfo { + + MemoryInfo { + textures: textures_uint, + materials: materials_uint, + meshes: meshes_uint, + nodes: nodes_uint, + animations: animations_uint, + cameras: cameras_uint, + lights: lights_uint, + total: total_uint + } + } +} From 778c3afbbb052bea25d6eaaccba1d663432b0b27 Mon Sep 17 00:00:00 2001 From: David Golembiowski Date: Fri, 1 May 2020 18:11:44 -0400 Subject: [PATCH 033/115] Rust's import system dictates that we must make directories rather than use individual files to provide a clean public interface --- port/PyAssimp/pyassimp/.structs.py.swp | Bin 0 -> 16384 bytes port/assimp_rs/src/camera/mod.rs | 1 + port/assimp_rs/src/structs/.mod.rs.swp | Bin 0 -> 12288 bytes port/assimp_rs/src/structs/{ => anim}/anim.rs | 0 port/assimp_rs/src/structs/anim/mod.rs | 2 ++ port/assimp_rs/src/structs/{ => blob}/blob.rs | 0 port/assimp_rs/src/structs/blob/mod.rs | 2 ++ port/assimp_rs/src/structs/{ => bone}/bone.rs | 0 port/assimp_rs/src/structs/bone/mod.rs | 2 ++ .../src/structs/{ => camera}/camera.rs | 0 port/assimp_rs/src/structs/camera/mod.rs | 2 ++ .../src/structs/{ => color}/color.rs | 0 port/assimp_rs/src/structs/color/mod.rs | 2 ++ port/assimp_rs/src/structs/{ => face}/face.rs | 0 port/assimp_rs/src/structs/face/mod.rs | 2 ++ port/assimp_rs/src/structs/{ => key}/key.rs | 0 port/assimp_rs/src/structs/key/mod.rs | 2 ++ .../src/structs/{ => light}/light.rs | 0 port/assimp_rs/src/structs/light/mod.rs | 2 ++ .../src/structs/{ => material}/material.rs | 0 port/assimp_rs/src/structs/material/mod.rs | 2 ++ .../src/structs/{ => matrix}/matrix.rs | 0 port/assimp_rs/src/structs/matrix/mod.rs | 2 ++ .../src/structs/{ => memory}/memory.rs | 0 port/assimp_rs/src/structs/memory/mod.rs | 2 ++ port/assimp_rs/src/structs/{ => mesh}/mesh.rs | 0 port/assimp_rs/src/structs/mesh/mod.rs | 2 ++ port/assimp_rs/src/structs/{ => meta}/meta.rs | 0 port/assimp_rs/src/structs/meta/mod.rs | 2 ++ port/assimp_rs/src/structs/node/mod.rs | 2 ++ port/assimp_rs/src/structs/{ => node}/node.rs | 0 port/assimp_rs/src/structs/plane/mod.rs | 2 ++ .../src/structs/{ => plane}/plane.rs | 0 port/assimp_rs/src/structs/quaternion/mod.rs | 2 ++ .../src/structs/quaternion/quaternion.rs | 7 +++++++ port/assimp_rs/src/structs/ray/mod.rs | 2 ++ port/assimp_rs/src/structs/{ => ray}/ray.rs | 0 port/assimp_rs/src/structs/scene/mod.rs | 2 ++ .../src/structs/{ => scene}/scene.rs | 0 port/assimp_rs/src/structs/string/mod.rs | 2 ++ .../src/structs/{ => string}/string.rs | 0 port/assimp_rs/src/structs/texel/mod.rs | 2 ++ .../src/structs/{ => texel}/texel.rs | 0 port/assimp_rs/src/structs/texture/mod.rs | 2 ++ .../src/structs/{ => texture}/texture.rs | 0 port/assimp_rs/src/structs/transform/mod.rs | 2 ++ .../src/structs/{ => transform}/transform.rs | 0 port/assimp_rs/src/structs/vec/mod.rs | 2 ++ port/assimp_rs/src/structs/{ => vec}/vec.rs | 19 ++++++++++++++++++ port/assimp_rs/src/structs/vertex/mod.rs | 2 ++ .../{quaternion.rs => vertex/vertex.rs} | 0 port/assimp_rs/src/structs/vertex_weight.rs | 0 52 files changed, 75 insertions(+) create mode 100644 port/PyAssimp/pyassimp/.structs.py.swp create mode 100644 port/assimp_rs/src/structs/.mod.rs.swp rename port/assimp_rs/src/structs/{ => anim}/anim.rs (100%) create mode 100644 port/assimp_rs/src/structs/anim/mod.rs rename port/assimp_rs/src/structs/{ => blob}/blob.rs (100%) create mode 100644 port/assimp_rs/src/structs/blob/mod.rs rename port/assimp_rs/src/structs/{ => bone}/bone.rs (100%) create mode 100644 port/assimp_rs/src/structs/bone/mod.rs rename port/assimp_rs/src/structs/{ => camera}/camera.rs (100%) create mode 100644 port/assimp_rs/src/structs/camera/mod.rs rename port/assimp_rs/src/structs/{ => color}/color.rs (100%) create mode 100644 port/assimp_rs/src/structs/color/mod.rs rename port/assimp_rs/src/structs/{ => face}/face.rs (100%) create mode 100644 port/assimp_rs/src/structs/face/mod.rs rename port/assimp_rs/src/structs/{ => key}/key.rs (100%) create mode 100644 port/assimp_rs/src/structs/key/mod.rs rename port/assimp_rs/src/structs/{ => light}/light.rs (100%) create mode 100644 port/assimp_rs/src/structs/light/mod.rs rename port/assimp_rs/src/structs/{ => material}/material.rs (100%) create mode 100644 port/assimp_rs/src/structs/material/mod.rs rename port/assimp_rs/src/structs/{ => matrix}/matrix.rs (100%) create mode 100644 port/assimp_rs/src/structs/matrix/mod.rs rename port/assimp_rs/src/structs/{ => memory}/memory.rs (100%) create mode 100644 port/assimp_rs/src/structs/memory/mod.rs rename port/assimp_rs/src/structs/{ => mesh}/mesh.rs (100%) create mode 100644 port/assimp_rs/src/structs/mesh/mod.rs rename port/assimp_rs/src/structs/{ => meta}/meta.rs (100%) create mode 100644 port/assimp_rs/src/structs/meta/mod.rs create mode 100644 port/assimp_rs/src/structs/node/mod.rs rename port/assimp_rs/src/structs/{ => node}/node.rs (100%) create mode 100644 port/assimp_rs/src/structs/plane/mod.rs rename port/assimp_rs/src/structs/{ => plane}/plane.rs (100%) create mode 100644 port/assimp_rs/src/structs/quaternion/mod.rs create mode 100644 port/assimp_rs/src/structs/quaternion/quaternion.rs create mode 100644 port/assimp_rs/src/structs/ray/mod.rs rename port/assimp_rs/src/structs/{ => ray}/ray.rs (100%) create mode 100644 port/assimp_rs/src/structs/scene/mod.rs rename port/assimp_rs/src/structs/{ => scene}/scene.rs (100%) create mode 100644 port/assimp_rs/src/structs/string/mod.rs rename port/assimp_rs/src/structs/{ => string}/string.rs (100%) create mode 100644 port/assimp_rs/src/structs/texel/mod.rs rename port/assimp_rs/src/structs/{ => texel}/texel.rs (100%) create mode 100644 port/assimp_rs/src/structs/texture/mod.rs rename port/assimp_rs/src/structs/{ => texture}/texture.rs (100%) create mode 100644 port/assimp_rs/src/structs/transform/mod.rs rename port/assimp_rs/src/structs/{ => transform}/transform.rs (100%) create mode 100644 port/assimp_rs/src/structs/vec/mod.rs rename port/assimp_rs/src/structs/{ => vec}/vec.rs (60%) create mode 100644 port/assimp_rs/src/structs/vertex/mod.rs rename port/assimp_rs/src/structs/{quaternion.rs => vertex/vertex.rs} (100%) delete mode 100644 port/assimp_rs/src/structs/vertex_weight.rs diff --git a/port/PyAssimp/pyassimp/.structs.py.swp b/port/PyAssimp/pyassimp/.structs.py.swp new file mode 100644 index 0000000000000000000000000000000000000000..1de72f0f8f12a4e35de38089723ca2b124ce4459 GIT binary patch literal 16384 zcmeI3%a0sK9mgB6iHYMl1TIK{RK^0&Mzga|k;Me0C3d7GyX&=g6Cwzi)O6R(R9xLX z>8_rgK@kuRJYvMdjs(Kt0$BV3Mu?Xp3oPIO7X$(h9EcRK5lARPfjkI&tGap~J>#7j zBo3fz`Qx7MU)8UxzV(={U(HtMA6VNUE9C_T$1RStx&HNsfAQV}PW4{L@o0;C>i(ER z(54KVV-msqQSETf4Lvs3VnHjOqjAjr=3Fz3;2<0Si4ogDqt0`3RnfK0#*U5fK|XM@PDL$Y~JL24E1@f zsnh4o`8B!ozs&Ktx&Qf`{Z(Us$lO0@9Atj}Y3wJBy`HnbV(i@5zn!zcZ0wI3`|YN{ zng5rJ{kXAzCTD-q*td=S=Q;a7jQxzUlh>smGXH-!_PVj3&Dmct_J@uA`JCNcI>gww z_N5;(|K_$mSp}>DRspMkRlq7>6|f3e1*`&A0jq#j;J=~(#RmT@JU^kqfUkisgD-&q)WF@~-Qd~{s53YVo&;^M3u@q2@XYIx2dsnpz+1rI_Cp774g3sT z0T;nn!PDR@_#jvTcY*!jS;QHB4=#c8;2iM432+>|5&Q+gi9drMfD7O&;0(AAydN9} ze?|ZJ19%Sn6kG;RgQviGa1N+G^l>oNL2y)RoCz$u|E8BZB)}5+0K@Prkzn7Sv^zIheYVA>lG6Eb!9NuS8PE5kf>* z=PpKU`e>Ce%@Y$h3@~A6Z};!qJG(;sL`bflNMiO_!UC7YcaSxCG<`pTkX?>V`>gVSaHrl`m`UZf|Qw zVUtC&Ly9qG!VS|2w>z<9e%Wm{3FX<%W5-rKZ_A`F&h*cdGpSTNN=4OlP{wG4LSmu} z(s>QiE}Lcu1M<%0*(w^iDX7Gh>&Ilb!2*)Rm;h-^%mk(9=d1+1V(mFgXUVg&rk%_7 z*8kbwsyo3XbJH{}9qFl~CPIoY=3=2fcvSaiq$wEUlf^XE za(lVdi}L38Qv9umw-BGyD=M{csWgWozH5Qn$3cu#1)WR83rP@4M069k(Q~Y%Ef)L@ zZ1I@bv{@q+vs*Jmj$Im%DocZth+?WO8*I-YYDwj6++;4VahLeUqY7W{G9mKu<0Rm6 z7Lno>i(<7cQX>7I0xyhWf*4YWh;BrDY*>h%Z&lJX?(6h-4eTMQP_VLQG3c1oMOcLf z-Qw&vxZ6PSMHti(jt$djx62UZ5&R4rQs$oSR!}BPc1|rb!}{o`wepy+GmRpO;4-ff z*5TpH{u2p)E)hMFm#B3q8INK#yOol@h#MYShf_(mF;+x_jtqwLTRnQhZio330 z!2@!BR%p(!wdQ&MbiqD6=pQVP>s~n(()k6Z5)<|H0+gA z_t%lzf9gSMi?2h%rrIZ?qNFP2hq@*)HY=oRTq+TPs3zD-*yX4Ly5W4TYN|-ReU5G= nwF)HG%|eW7Lj_&W_7Sr-&d%B}qN)3((b5kzPU^1PHqO5R$L{t! literal 0 HcmV?d00001 diff --git a/port/assimp_rs/src/camera/mod.rs b/port/assimp_rs/src/camera/mod.rs index e69de29bb..26ca1185b 100644 --- a/port/assimp_rs/src/camera/mod.rs +++ b/port/assimp_rs/src/camera/mod.rs @@ -0,0 +1 @@ +pub use self::structs::{Camera}; diff --git a/port/assimp_rs/src/structs/.mod.rs.swp b/port/assimp_rs/src/structs/.mod.rs.swp new file mode 100644 index 0000000000000000000000000000000000000000..a6b06ed631bd7b51b0450777a8e7c266e3c9b7eb GIT binary patch literal 12288 zcmeI2J!lj`6vrnP+L&mxwOBtO5HOqMt_U0iV-iKei7{SEh|Ig3(heX@lGo;^SfLz&vlmXl7!`TThI@)NcbI*c9hSRY9+a!XHvU( zMJiv(&{tZvL#_NIi^indy*6c#0Wz?Ifwo>fJvG>dqiZe1P4;q4v3hO}qQRUw1d88yO%2WPl8i0Wv@a$N(8217v^< zkO4BV2Muuiz&~@4vBn@akKg~x|Np-oV(c^c2;PC$;3aql9)k^VAKV4&K!O-t1DC-Z zI0LF+1RMjyU_aOgz7H|>1#E-&U<)qicSu_%17v^&eA{E}K&+q}Wr_7*c!yq#e5*o`_Bu~|9CX+HvmlH**%$qO04|6^L7FO zbjxF2s>BvW+;6=sLY>J4(KFo^u}2ryg=*F_nK#YY9oK}W@O1&h&e&`gXR;cZ6dP6| zn-ZF7`@&{{f$b)%LKXO3(*H*$SciunYOxj9J6Eji9=Fh{%sA%q7 Vector2d { Vector2d { @@ -27,3 +34,15 @@ impl Vector3d { } } } + +impl Vector4d { + pub fn new(x_f32: f32, y_f32: f32, z_f32: f32, w_f32: f32) -> Vector4d { + Vector4d { + x: x_f32, + y: y_f32, + z: z_f32, + w: w_f32 + } + } +} + diff --git a/port/assimp_rs/src/structs/vertex/mod.rs b/port/assimp_rs/src/structs/vertex/mod.rs new file mode 100644 index 000000000..d169246ce --- /dev/null +++ b/port/assimp_rs/src/structs/vertex/mod.rs @@ -0,0 +1,2 @@ +mod vertex; + diff --git a/port/assimp_rs/src/structs/quaternion.rs b/port/assimp_rs/src/structs/vertex/vertex.rs similarity index 100% rename from port/assimp_rs/src/structs/quaternion.rs rename to port/assimp_rs/src/structs/vertex/vertex.rs diff --git a/port/assimp_rs/src/structs/vertex_weight.rs b/port/assimp_rs/src/structs/vertex_weight.rs deleted file mode 100644 index e69de29bb..000000000 From 57e837092e6aaedf69912729b45568af30a20ffc Mon Sep 17 00:00:00 2001 From: David Golembiowski Date: Fri, 1 May 2020 18:23:14 -0400 Subject: [PATCH 034/115] populated module level files --- port/PyAssimp/pyassimp/.structs.py.swp | Bin 16384 -> 0 bytes port/assimp_rs/src/structs/.mod.rs.swp | Bin 12288 -> 0 bytes port/assimp_rs/src/structs/anim/mod.rs | 6 +++++- port/assimp_rs/src/structs/color/mod.rs | 5 ++++- port/assimp_rs/src/structs/matrix/mod.rs | 4 +++- port/assimp_rs/src/structs/memory/mod.rs | 2 +- port/assimp_rs/src/structs/mesh/mod.rs | 1 + port/assimp_rs/src/structs/quaternion/mod.rs | 1 + port/assimp_rs/src/structs/string/mod.rs | 3 ++- port/assimp_rs/src/structs/texel/mod.rs | 2 -- port/assimp_rs/src/structs/texel/texel.rs | 19 ------------------ port/assimp_rs/src/structs/texture/mod.rs | 1 + port/assimp_rs/src/structs/texture/texture.rs | 19 ++++++++++++++++++ port/assimp_rs/src/structs/vertex/mod.rs | 2 +- 14 files changed, 38 insertions(+), 27 deletions(-) delete mode 100644 port/PyAssimp/pyassimp/.structs.py.swp delete mode 100644 port/assimp_rs/src/structs/.mod.rs.swp delete mode 100644 port/assimp_rs/src/structs/texel/mod.rs delete mode 100644 port/assimp_rs/src/structs/texel/texel.rs diff --git a/port/PyAssimp/pyassimp/.structs.py.swp b/port/PyAssimp/pyassimp/.structs.py.swp deleted file mode 100644 index 1de72f0f8f12a4e35de38089723ca2b124ce4459..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 16384 zcmeI3%a0sK9mgB6iHYMl1TIK{RK^0&Mzga|k;Me0C3d7GyX&=g6Cwzi)O6R(R9xLX z>8_rgK@kuRJYvMdjs(Kt0$BV3Mu?Xp3oPIO7X$(h9EcRK5lARPfjkI&tGap~J>#7j zBo3fz`Qx7MU)8UxzV(={U(HtMA6VNUE9C_T$1RStx&HNsfAQV}PW4{L@o0;C>i(ER z(54KVV-msqQSETf4Lvs3VnHjOqjAjr=3Fz3;2<0Si4ogDqt0`3RnfK0#*U5fK|XM@PDL$Y~JL24E1@f zsnh4o`8B!ozs&Ktx&Qf`{Z(Us$lO0@9Atj}Y3wJBy`HnbV(i@5zn!zcZ0wI3`|YN{ zng5rJ{kXAzCTD-q*td=S=Q;a7jQxzUlh>smGXH-!_PVj3&Dmct_J@uA`JCNcI>gww z_N5;(|K_$mSp}>DRspMkRlq7>6|f3e1*`&A0jq#j;J=~(#RmT@JU^kqfUkisgD-&q)WF@~-Qd~{s53YVo&;^M3u@q2@XYIx2dsnpz+1rI_Cp774g3sT z0T;nn!PDR@_#jvTcY*!jS;QHB4=#c8;2iM432+>|5&Q+gi9drMfD7O&;0(AAydN9} ze?|ZJ19%Sn6kG;RgQviGa1N+G^l>oNL2y)RoCz$u|E8BZB)}5+0K@Prkzn7Sv^zIheYVA>lG6Eb!9NuS8PE5kf>* z=PpKU`e>Ce%@Y$h3@~A6Z};!qJG(;sL`bflNMiO_!UC7YcaSxCG<`pTkX?>V`>gVSaHrl`m`UZf|Qw zVUtC&Ly9qG!VS|2w>z<9e%Wm{3FX<%W5-rKZ_A`F&h*cdGpSTNN=4OlP{wG4LSmu} z(s>QiE}Lcu1M<%0*(w^iDX7Gh>&Ilb!2*)Rm;h-^%mk(9=d1+1V(mFgXUVg&rk%_7 z*8kbwsyo3XbJH{}9qFl~CPIoY=3=2fcvSaiq$wEUlf^XE za(lVdi}L38Qv9umw-BGyD=M{csWgWozH5Qn$3cu#1)WR83rP@4M069k(Q~Y%Ef)L@ zZ1I@bv{@q+vs*Jmj$Im%DocZth+?WO8*I-YYDwj6++;4VahLeUqY7W{G9mKu<0Rm6 z7Lno>i(<7cQX>7I0xyhWf*4YWh;BrDY*>h%Z&lJX?(6h-4eTMQP_VLQG3c1oMOcLf z-Qw&vxZ6PSMHti(jt$djx62UZ5&R4rQs$oSR!}BPc1|rb!}{o`wepy+GmRpO;4-ff z*5TpH{u2p)E)hMFm#B3q8INK#yOol@h#MYShf_(mF;+x_jtqwLTRnQhZio330 z!2@!BR%p(!wdQ&MbiqD6=pQVP>s~n(()k6Z5)<|H0+gA z_t%lzf9gSMi?2h%rrIZ?qNFP2hq@*)HY=oRTq+TPs3zD-*yX4Ly5W4TYN|-ReU5G= nwF)HG%|eW7Lj_&W_7Sr-&d%B}qN)3((b5kzPU^1PHqO5R$L{t! diff --git a/port/assimp_rs/src/structs/.mod.rs.swp b/port/assimp_rs/src/structs/.mod.rs.swp deleted file mode 100644 index a6b06ed631bd7b51b0450777a8e7c266e3c9b7eb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmeI2J!lj`6vrnP+L&mxwOBtO5HOqMt_U0iV-iKei7{SEh|Ig3(heX@lGo;^SfLz&vlmXl7!`TThI@)NcbI*c9hSRY9+a!XHvU( zMJiv(&{tZvL#_NIi^indy*6c#0Wz?Ifwo>fJvG>dqiZe1P4;q4v3hO}qQRUw1d88yO%2WPl8i0Wv@a$N(8217v^< zkO4BV2Muuiz&~@4vBn@akKg~x|Np-oV(c^c2;PC$;3aql9)k^VAKV4&K!O-t1DC-Z zI0LF+1RMjyU_aOgz7H|>1#E-&U<)qicSu_%17v^&eA{E}K&+q}Wr_7*c!yq#e5*o`_Bu~|9CX+HvmlH**%$qO04|6^L7FO zbjxF2s>BvW+;6=sLY>J4(KFo^u}2ryg=*F_nK#YY9oK}W@O1&h&e&`gXR;cZ6dP6| zn-ZF7`@&{{f$b)%LKXO3(*H*$SciunYOxj9J6Eji9=Fh{%sA%q7 Texel { - Texel { - b: b_u32, - g: g_u32, - r: r_u32, - a: a_u32 - } - } -} diff --git a/port/assimp_rs/src/structs/texture/mod.rs b/port/assimp_rs/src/structs/texture/mod.rs index a9d56e75b..1b5c9308d 100644 --- a/port/assimp_rs/src/structs/texture/mod.rs +++ b/port/assimp_rs/src/structs/texture/mod.rs @@ -1,2 +1,3 @@ mod texture; +pub use self::texture::Texel; diff --git a/port/assimp_rs/src/structs/texture/texture.rs b/port/assimp_rs/src/structs/texture/texture.rs index e69de29bb..b2c72f30e 100644 --- a/port/assimp_rs/src/structs/texture/texture.rs +++ b/port/assimp_rs/src/structs/texture/texture.rs @@ -0,0 +1,19 @@ +#[derive(Clone, Debug, Copy)] +struct Texel { + b: u32, + g: u32, + r: u32, + a: u32 +} + +impl Texel { + pub fn new(b_u32: u32, g_u32: u32, + r_u32: u32, a_u32: u32) -> Texel { + Texel { + b: b_u32, + g: g_u32, + r: r_u32, + a: a_u32 + } + } +} diff --git a/port/assimp_rs/src/structs/vertex/mod.rs b/port/assimp_rs/src/structs/vertex/mod.rs index d169246ce..97ae3eced 100644 --- a/port/assimp_rs/src/structs/vertex/mod.rs +++ b/port/assimp_rs/src/structs/vertex/mod.rs @@ -1,2 +1,2 @@ mod vertex; - +// pub use self::vertex:: From ea917bd4aeaae6c8e9249f3d3e6c74a8fae981aa Mon Sep 17 00:00:00 2001 From: RichardTea <31507749+RichardTea@users.noreply.github.com> Date: Mon, 4 May 2020 13:54:49 +0100 Subject: [PATCH 035/115] Move Collada into AssetLib folder Should make the merge easier --- code/{ => AssetLib}/Collada/ColladaExporter.cpp | 0 code/{ => AssetLib}/Collada/ColladaExporter.h | 0 code/{ => AssetLib}/Collada/ColladaHelper.cpp | 0 code/{ => AssetLib}/Collada/ColladaHelper.h | 0 code/{ => AssetLib}/Collada/ColladaLoader.cpp | 0 code/{ => AssetLib}/Collada/ColladaLoader.h | 0 code/{ => AssetLib}/Collada/ColladaParser.cpp | 0 code/{ => AssetLib}/Collada/ColladaParser.h | 0 8 files changed, 0 insertions(+), 0 deletions(-) rename code/{ => AssetLib}/Collada/ColladaExporter.cpp (100%) rename code/{ => AssetLib}/Collada/ColladaExporter.h (100%) rename code/{ => AssetLib}/Collada/ColladaHelper.cpp (100%) rename code/{ => AssetLib}/Collada/ColladaHelper.h (100%) rename code/{ => AssetLib}/Collada/ColladaLoader.cpp (100%) rename code/{ => AssetLib}/Collada/ColladaLoader.h (100%) rename code/{ => AssetLib}/Collada/ColladaParser.cpp (100%) rename code/{ => AssetLib}/Collada/ColladaParser.h (100%) diff --git a/code/Collada/ColladaExporter.cpp b/code/AssetLib/Collada/ColladaExporter.cpp similarity index 100% rename from code/Collada/ColladaExporter.cpp rename to code/AssetLib/Collada/ColladaExporter.cpp diff --git a/code/Collada/ColladaExporter.h b/code/AssetLib/Collada/ColladaExporter.h similarity index 100% rename from code/Collada/ColladaExporter.h rename to code/AssetLib/Collada/ColladaExporter.h diff --git a/code/Collada/ColladaHelper.cpp b/code/AssetLib/Collada/ColladaHelper.cpp similarity index 100% rename from code/Collada/ColladaHelper.cpp rename to code/AssetLib/Collada/ColladaHelper.cpp diff --git a/code/Collada/ColladaHelper.h b/code/AssetLib/Collada/ColladaHelper.h similarity index 100% rename from code/Collada/ColladaHelper.h rename to code/AssetLib/Collada/ColladaHelper.h diff --git a/code/Collada/ColladaLoader.cpp b/code/AssetLib/Collada/ColladaLoader.cpp similarity index 100% rename from code/Collada/ColladaLoader.cpp rename to code/AssetLib/Collada/ColladaLoader.cpp diff --git a/code/Collada/ColladaLoader.h b/code/AssetLib/Collada/ColladaLoader.h similarity index 100% rename from code/Collada/ColladaLoader.h rename to code/AssetLib/Collada/ColladaLoader.h diff --git a/code/Collada/ColladaParser.cpp b/code/AssetLib/Collada/ColladaParser.cpp similarity index 100% rename from code/Collada/ColladaParser.cpp rename to code/AssetLib/Collada/ColladaParser.cpp diff --git a/code/Collada/ColladaParser.h b/code/AssetLib/Collada/ColladaParser.h similarity index 100% rename from code/Collada/ColladaParser.h rename to code/AssetLib/Collada/ColladaParser.h From 8e73984a1105f6b713942fd8125e5bf9cd3e2f6e Mon Sep 17 00:00:00 2001 From: RichardTea <31507749+RichardTea@users.noreply.github.com> Date: Mon, 4 May 2020 17:47:09 +0100 Subject: [PATCH 036/115] Collada Root Nodes aren't allowed to have meshes Create a null parent node instead --- code/AssetLib/Collada/ColladaExporter.cpp | 12 +++-- code/AssetLib/Collada/ColladaParser.cpp | 2 +- test/unit/utColladaImportExport.cpp | 55 +++++++++++++++++++++++ 3 files changed, 61 insertions(+), 8 deletions(-) diff --git a/code/AssetLib/Collada/ColladaExporter.cpp b/code/AssetLib/Collada/ColladaExporter.cpp index 5e4cdda2d..e15e81985 100644 --- a/code/AssetLib/Collada/ColladaExporter.cpp +++ b/code/AssetLib/Collada/ColladaExporter.cpp @@ -233,12 +233,13 @@ void ColladaExporter::WriteHeader() { add_root_node = true; } - if (mScene->mRootNode->mNumChildren == 0) { + // Assimp root nodes can have meshes, Collada Scenes cannot + if (mScene->mRootNode->mNumChildren == 0 || mScene->mRootNode->mMeshes != 0) { add_root_node = true; } if (add_root_node) { - aiScene *scene; + aiScene *scene = nullptr; SceneCombiner::CopyScene(&scene, mScene); aiNode *root = new aiNode("Scene"); @@ -1493,12 +1494,9 @@ void ColladaExporter::WriteNode(const aiNode *pNode) { const std::string node_name = GetNodeName(pNode); mOutput << startstr << "" << endstr; diff --git a/code/AssetLib/Collada/ColladaParser.cpp b/code/AssetLib/Collada/ColladaParser.cpp index d83980929..04e6eb7d4 100644 --- a/code/AssetLib/Collada/ColladaParser.cpp +++ b/code/AssetLib/Collada/ColladaParser.cpp @@ -2479,7 +2479,7 @@ void ColladaParser::ReadSceneLibrary() { // read name if given. int indexName = TestAttribute("name"); - const char *attrName = "unnamed"; + const char *attrName = "Scene"; if (indexName > -1) attrName = mReader->getAttributeValue(indexName); diff --git a/test/unit/utColladaImportExport.cpp b/test/unit/utColladaImportExport.cpp index 876f60c54..3d6e0db23 100644 --- a/test/unit/utColladaImportExport.cpp +++ b/test/unit/utColladaImportExport.cpp @@ -42,6 +42,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "UnitTestPCH.h" #include +#include #include #include #include @@ -211,6 +212,60 @@ TEST_F(utColladaImportExport, importDaeFromFileTest) { EXPECT_TRUE(importerTest()); } +unsigned int GetMeshUseCount(const aiNode *rootNode) { + unsigned int result = rootNode->mNumMeshes; + for (unsigned int i = 0; i < rootNode->mNumChildren; ++i) { + result += GetMeshUseCount(rootNode->mChildren[i]); + } + return result; +} + +TEST_F(utColladaImportExport, exportRootNodeMeshTest) { + Assimp::Importer importer; + Assimp::Exporter exporter; + const char *outFile = "exportRootNodeMeshTest_out.dae"; + + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/Collada/duck.dae", aiProcess_ValidateDataStructure); + ASSERT_TRUE(scene != nullptr) << "Fatal: could not import duck.dae!"; + + ASSERT_EQ(0u, scene->mRootNode->mNumMeshes) << "Collada import should not give the root node a mesh"; + + { + // Clone the scene and give the root node a mesh and a transform + aiScene *rootMeshScene = nullptr; + SceneCombiner::CopyScene(&rootMeshScene, scene); + ASSERT_TRUE(rootMeshScene != nullptr) << "Fatal: could not copy scene!"; + // Do this by moving the meshes from the first child that has some + aiNode *rootNode = rootMeshScene->mRootNode; + ASSERT_TRUE(rootNode->mNumChildren > 0) << "Fatal: root has no children"; + aiNode *meshNode = rootNode->mChildren[0]; + ASSERT_EQ(1u, meshNode->mNumMeshes) << "Fatal: First child node has no duck mesh"; + + // Move the meshes to the parent + rootNode->mNumMeshes = meshNode->mNumMeshes; + rootNode->mMeshes = new unsigned int[rootNode->mNumMeshes]; + for (unsigned int i = 0; i < rootNode->mNumMeshes; ++i) { + rootNode->mMeshes[i] = meshNode->mMeshes[i]; + } + + meshNode->mNumMeshes = 0; + delete[] meshNode->mMeshes; + + ASSERT_EQ(AI_SUCCESS, exporter.Export(rootMeshScene, "collada", outFile)) << "Fatal: Could not export file"; + } + + // Reimport and look for meshes + scene = importer.ReadFile(outFile, aiProcess_ValidateDataStructure); + ASSERT_TRUE(scene != nullptr) << "Fatal: could not reimport!"; + + // A Collada root node is not allowed to have a mesh + ASSERT_EQ(0u, scene->mRootNode->mNumMeshes) << "Collada reimport should not give the root node a mesh"; + + // Walk nodes and counts used meshes + // Should be exactly one + EXPECT_EQ(1u, GetMeshUseCount(scene->mRootNode)) << "Nodes had unexpected number of meshes in use"; +} + TEST_F(utColladaImportExport, exporterUniqueIdsTest) { Assimp::Importer importer; Assimp::Exporter exporter; From d1ae6ac77a9380b3b915262d2f5682739c8e8ac1 Mon Sep 17 00:00:00 2001 From: RichardTea <31507749+RichardTea@users.noreply.github.com> Date: Tue, 5 May 2020 09:51:41 +0100 Subject: [PATCH 037/115] Fix typo in Swapped Id and Name --- code/AssetLib/Collada/ColladaExporter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/AssetLib/Collada/ColladaExporter.cpp b/code/AssetLib/Collada/ColladaExporter.cpp index 5e4cdda2d..3f4f53a3d 100644 --- a/code/AssetLib/Collada/ColladaExporter.cpp +++ b/code/AssetLib/Collada/ColladaExporter.cpp @@ -1226,8 +1226,8 @@ void ColladaExporter::WriteFloatArray(const std::string &pIdString, FloatDataTyp // ------------------------------------------------------------------------------------------------ // Writes the scene library void ColladaExporter::WriteSceneLibrary() { - const std::string sceneName = GetNodeUniqueId(mScene->mRootNode); - const std::string sceneId = GetNodeName(mScene->mRootNode); + const std::string sceneId = GetNodeUniqueId(mScene->mRootNode); + const std::string sceneName = GetNodeName(mScene->mRootNode); mOutput << startstr << "" << endstr; PushTag(); From 56a4e615336ea7410b25fe612b216340217adc0f Mon Sep 17 00:00:00 2001 From: RichardTea <31507749+RichardTea@users.noreply.github.com> Date: Tue, 5 May 2020 10:16:13 +0100 Subject: [PATCH 038/115] Collada: Don't copy the scene when exporting This was purely to add a virtual top-level node Use a flag instead. Also add more const --- code/AssetLib/Collada/ColladaExporter.cpp | 105 ++++++++++------------ code/AssetLib/Collada/ColladaExporter.h | 7 +- 2 files changed, 53 insertions(+), 59 deletions(-) diff --git a/code/AssetLib/Collada/ColladaExporter.cpp b/code/AssetLib/Collada/ColladaExporter.cpp index 480d6790b..567f7c8e7 100644 --- a/code/AssetLib/Collada/ColladaExporter.cpp +++ b/code/AssetLib/Collada/ColladaExporter.cpp @@ -117,22 +117,37 @@ static const std::string XMLIDEncode(const std::string &name) { return idEncoded.str(); } +// ------------------------------------------------------------------------------------------------ +// Helper functions to create unique ids +inline bool IsUniqueId(const std::unordered_set &idSet, const std::string &idStr) { + return (idSet.find(idStr) == idSet.end()); +} + +inline std::string MakeUniqueId(const std::unordered_set &idSet, const std::string &idPrefix, const std::string &postfix) { + std::string result(idPrefix + postfix); + if (!IsUniqueId(idSet, result)) { + // Select a number to append + size_t idnum = 1; + do { + result = idPrefix + '_' + to_string(idnum) + postfix; + ++idnum; + } while (!IsUniqueId(idSet, result)); + } + return result; +} + // ------------------------------------------------------------------------------------------------ // Constructor for a specific scene to export ColladaExporter::ColladaExporter(const aiScene *pScene, IOSystem *pIOSystem, const std::string &path, const std::string &file) : mIOSystem(pIOSystem), mPath(path), - mFile(file) { + mFile(file), + mScene(pScene), + endstr("\n") { // make sure that all formatting happens using the standard, C locale and not the user's current locale mOutput.imbue(std::locale("C")); mOutput.precision(ASSIMP_AI_REAL_TEXT_PRECISION); - mScene = pScene; - mSceneOwned = false; - - // set up strings - endstr = "\n"; - // start writing the file WriteFile(); } @@ -140,9 +155,6 @@ ColladaExporter::ColladaExporter(const aiScene *pScene, IOSystem *pIOSystem, con // ------------------------------------------------------------------------------------------------ // Destructor ColladaExporter::~ColladaExporter() { - if (mSceneOwned) { - delete mScene; - } } // ------------------------------------------------------------------------------------------------ @@ -171,10 +183,11 @@ void ColladaExporter::WriteFile() { // customized, Writes the animation library WriteAnimationsLibrary(); - // useless Collada fu at the end, just in case we haven't had enough indirections, yet. + // instantiate the scene(s) + // For Assimp there will only ever be one mOutput << startstr << "" << endstr; PushTag(); - mOutput << startstr << "mRootNode) + "\" />" << endstr; + mOutput << startstr << "" << endstr; PopTag(); mOutput << startstr << "" << endstr; PopTag(); @@ -209,13 +222,13 @@ void ColladaExporter::WriteHeader() { mScene->mRootNode->mTransformation.Decompose(scaling, rotation, position); rotation.Normalize(); - bool add_root_node = false; + mAdd_root_node = false; ai_real scale = 1.0; if (std::abs(scaling.x - scaling.y) <= epsilon && std::abs(scaling.x - scaling.z) <= epsilon && std::abs(scaling.y - scaling.z) <= epsilon) { scale = (ai_real)((((double)scaling.x) + ((double)scaling.y) + ((double)scaling.z)) / 3.0); } else { - add_root_node = true; + mAdd_root_node = true; } std::string up_axis = "Y_UP"; @@ -226,34 +239,19 @@ void ColladaExporter::WriteHeader() { } else if (rotation.Equal(z_rot, epsilon)) { up_axis = "Z_UP"; } else { - add_root_node = true; + mAdd_root_node = true; } if (!position.Equal(aiVector3D(0, 0, 0))) { - add_root_node = true; + mAdd_root_node = true; } // Assimp root nodes can have meshes, Collada Scenes cannot if (mScene->mRootNode->mNumChildren == 0 || mScene->mRootNode->mMeshes != 0) { - add_root_node = true; + mAdd_root_node = true; } - if (add_root_node) { - aiScene *scene = nullptr; - SceneCombiner::CopyScene(&scene, mScene); - - aiNode *root = new aiNode("Scene"); - - root->mNumChildren = 1; - root->mChildren = new aiNode *[root->mNumChildren]; - - root->mChildren[0] = scene->mRootNode; - scene->mRootNode->mParent = root; - scene->mRootNode = root; - - mScene = scene; - mSceneOwned = true; - + if (mAdd_root_node) { up_axis = "Y_UP"; scale = 1.0; } @@ -1227,17 +1225,29 @@ void ColladaExporter::WriteFloatArray(const std::string &pIdString, FloatDataTyp // ------------------------------------------------------------------------------------------------ // Writes the scene library void ColladaExporter::WriteSceneLibrary() { - const std::string sceneId = GetNodeUniqueId(mScene->mRootNode); - const std::string sceneName = GetNodeName(mScene->mRootNode); + // Determine if we are using the aiScene root or our own + std::string sceneName("Scene"); + if (mAdd_root_node) { + mSceneId = MakeUniqueId(mUniqueIds, sceneName, std::string()); + mUniqueIds.insert(mSceneId); + } else { + mSceneId = GetNodeUniqueId(mScene->mRootNode); + sceneName = GetNodeName(mScene->mRootNode); + } mOutput << startstr << "" << endstr; PushTag(); - mOutput << startstr << "" << endstr; + mOutput << startstr << "" << endstr; PushTag(); - // start recursive write at the root node - for (size_t a = 0; a < mScene->mRootNode->mNumChildren; ++a) - WriteNode(mScene->mRootNode->mChildren[a]); + if (mAdd_root_node) { + // Export the root node + WriteNode(mScene->mRootNode); + } else { + // Have already exported the root node + for (size_t a = 0; a < mScene->mRootNode->mNumChildren; ++a) + WriteNode(mScene->mRootNode->mChildren[a]); + } PopTag(); mOutput << startstr << "" << endstr; @@ -1610,23 +1620,6 @@ void ColladaExporter::WriteNode(const aiNode *pNode) { mOutput << startstr << "" << endstr; } -inline bool IsUniqueId(const std::unordered_set &idSet, const std::string &idStr) { - return (idSet.find(idStr) == idSet.end()); -} - -inline std::string MakeUniqueId(const std::unordered_set &idSet, const std::string &idPrefix, const std::string &postfix) { - std::string result(idPrefix + postfix); - if (!IsUniqueId(idSet, result)) { - // Select a number to append - size_t idnum = 1; - do { - result = idPrefix + '_' + to_string(idnum) + postfix; - ++idnum; - } while (!IsUniqueId(idSet, result)); - } - return result; -} - void ColladaExporter::CreateNodeIds(const aiNode *node) { GetNodeUniqueId(node); for (size_t a = 0; a < node->mNumChildren; ++a) diff --git a/code/AssetLib/Collada/ColladaExporter.h b/code/AssetLib/Collada/ColladaExporter.h index bea65bafc..e9a3530ae 100644 --- a/code/AssetLib/Collada/ColladaExporter.h +++ b/code/AssetLib/Collada/ColladaExporter.h @@ -196,13 +196,14 @@ public: const std::string mFile; /// The scene to be written - const aiScene *mScene; - bool mSceneOwned; + const aiScene *const mScene; + std::string mSceneId; + bool mAdd_root_node = false; /// current line start string, contains the current indentation for simple stream insertion std::string startstr; /// current line end string for simple stream insertion - std::string endstr; + const std::string endstr; // pair of color and texture - texture precedences color struct Surface { From dc8550290ef2ce2b9d26e98c4172cbb289b56f83 Mon Sep 17 00:00:00 2001 From: RichardTea <31507749+RichardTea@users.noreply.github.com> Date: Tue, 5 May 2020 10:53:26 +0100 Subject: [PATCH 039/115] Ensure to delete the scene copy after the test --- test/unit/utColladaImportExport.cpp | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/test/unit/utColladaImportExport.cpp b/test/unit/utColladaImportExport.cpp index 3d6e0db23..451c8e235 100644 --- a/test/unit/utColladaImportExport.cpp +++ b/test/unit/utColladaImportExport.cpp @@ -53,6 +53,20 @@ using namespace Assimp; class utColladaImportExport : public AbstractImportExportBase { public: + // Clones the scene in an exception-safe way + struct SceneCloner { + SceneCloner(const aiScene *scene) { + sceneCopy = nullptr; + SceneCombiner::CopyScene(&sceneCopy, scene); + } + + ~SceneCloner() { + delete sceneCopy; + sceneCopy = nullptr; + } + aiScene *sceneCopy; + }; + virtual bool importerTest() final { Assimp::Importer importer; const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/Collada/duck.dae", aiProcess_ValidateDataStructure); @@ -231,12 +245,10 @@ TEST_F(utColladaImportExport, exportRootNodeMeshTest) { ASSERT_EQ(0u, scene->mRootNode->mNumMeshes) << "Collada import should not give the root node a mesh"; { - // Clone the scene and give the root node a mesh and a transform - aiScene *rootMeshScene = nullptr; - SceneCombiner::CopyScene(&rootMeshScene, scene); - ASSERT_TRUE(rootMeshScene != nullptr) << "Fatal: could not copy scene!"; + SceneCloner clone(scene); + ASSERT_TRUE(clone.sceneCopy != nullptr) << "Fatal: could not copy scene!"; // Do this by moving the meshes from the first child that has some - aiNode *rootNode = rootMeshScene->mRootNode; + aiNode *rootNode = clone.sceneCopy->mRootNode; ASSERT_TRUE(rootNode->mNumChildren > 0) << "Fatal: root has no children"; aiNode *meshNode = rootNode->mChildren[0]; ASSERT_EQ(1u, meshNode->mNumMeshes) << "Fatal: First child node has no duck mesh"; @@ -248,10 +260,12 @@ TEST_F(utColladaImportExport, exportRootNodeMeshTest) { rootNode->mMeshes[i] = meshNode->mMeshes[i]; } + // Remove the meshes from the original node meshNode->mNumMeshes = 0; delete[] meshNode->mMeshes; + meshNode->mMeshes = nullptr; - ASSERT_EQ(AI_SUCCESS, exporter.Export(rootMeshScene, "collada", outFile)) << "Fatal: Could not export file"; + ASSERT_EQ(AI_SUCCESS, exporter.Export(clone.sceneCopy, "collada", outFile)) << "Fatal: Could not export file"; } // Reimport and look for meshes From 60e8146b9fa5e1322b1a2b8e1368c91c5cacb62c Mon Sep 17 00:00:00 2001 From: Yingying Wang Date: Tue, 5 May 2020 12:51:40 -0700 Subject: [PATCH 040/115] fix wrong target idx when importing --- code/AssetLib/glTF2/glTF2Asset.inl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/AssetLib/glTF2/glTF2Asset.inl b/code/AssetLib/glTF2/glTF2Asset.inl index 0c99d059b..881fd4efc 100644 --- a/code/AssetLib/glTF2/glTF2Asset.inl +++ b/code/AssetLib/glTF2/glTF2Asset.inl @@ -1002,7 +1002,7 @@ inline void Mesh::Read(Value &pJSON_Object, Asset &pAsset_Root) { // Valid attribute semantics include POSITION, NORMAL, TANGENT int undPos = 0; Mesh::AccessorList *vec = 0; - if (GetAttribTargetVector(prim, i, attr, vec, undPos)) { + if (GetAttribTargetVector(prim, j, attr, vec, undPos)) { size_t idx = (attr[undPos] == '_') ? atoi(attr + undPos + 1) : 0; if ((*vec).size() <= idx) { (*vec).resize(idx + 1); From 4c75857f501ab16d20a2699d64f823f8de269c78 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Wed, 6 May 2020 13:46:26 +0200 Subject: [PATCH 041/115] Remove duplicate flag --- test/unit/utTriangulate.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/unit/utTriangulate.cpp b/test/unit/utTriangulate.cpp index 7c5ba738c..a95331250 100644 --- a/test/unit/utTriangulate.cpp +++ b/test/unit/utTriangulate.cpp @@ -65,8 +65,7 @@ void TriangulateProcessTest::SetUp() { pcMesh->mFaces = new aiFace[1000]; pcMesh->mVertices = new aiVector3D[10000]; - pcMesh->mPrimitiveTypes = aiPrimitiveType_POINT | aiPrimitiveType_LINE | - aiPrimitiveType_LINE | aiPrimitiveType_POLYGON; + pcMesh->mPrimitiveTypes = aiPrimitiveType_POINT | aiPrimitiveType_LINE | aiPrimitiveType_POLYGON; for (unsigned int m = 0, t = 0, q = 4; m < 1000; ++m) { ++t; From 201347700f7b688081976210c7ba68120e905216 Mon Sep 17 00:00:00 2001 From: Sercan Degirmenci Date: Wed, 6 May 2020 16:15:23 +0300 Subject: [PATCH 042/115] fix incorrect header path on framework build --- code/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index e6ed3fa88..9f347f0a5 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -1232,7 +1232,7 @@ if (APPLE) # add ./Compiler/*.h to assimp.framework via copy command ADD_CUSTOM_COMMAND(TARGET assimp POST_BUILD COMMAND "${CMAKE_COMMAND}" -E copy_directory - "../${HEADER_PATH}/Compiler" + "${HEADER_PATH}/Compiler" assimp.framework/Headers/Compiler COMMENT "Copying public ./Compiler/ header files to framework bundle's Headers/Compiler/") ENDIF() From 927488ee5d8b26c1ce324f2231b9b8ea82fb7700 Mon Sep 17 00:00:00 2001 From: kimkulling Date: Thu, 7 May 2020 13:59:18 +0200 Subject: [PATCH 043/115] integrate first fuzzer target. --- fuzz/assimp_fuzzer.cc | 56 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 fuzz/assimp_fuzzer.cc diff --git a/fuzz/assimp_fuzzer.cc b/fuzz/assimp_fuzzer.cc new file mode 100644 index 000000000..c113fefdf --- /dev/null +++ b/fuzz/assimp_fuzzer.cc @@ -0,0 +1,56 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library (assimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2020, 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 +#include +#include + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t dataSize) { + aiLogStream stream = aiGetPredefinedLogStream(aiDefaultLogStream_STDOUT,NULL); + aiAttachLogStream(&stream); + + Importer importer; + const aiScene *sc = importer.ReadFileFromMemory(data, dataSize, + aiProcessPreset_TargetRealtime_Quality, "3ds"); + + aiDetachLogStream(&stream); + + return 0; +} From a1bcca2c99bd08e108cf6e87ed3148bdcb5de2c7 Mon Sep 17 00:00:00 2001 From: kimkulling Date: Thu, 7 May 2020 14:00:40 +0200 Subject: [PATCH 044/115] remove step prototype: does not work this way. --- code/AssetLib/StepFile/StepFileGen1.cpp | 2194 ------ code/AssetLib/StepFile/StepFileGen2.cpp | 3068 -------- code/AssetLib/StepFile/StepFileGen3.cpp | 5746 --------------- code/AssetLib/StepFile/StepFileImporter.cpp | 114 - code/AssetLib/StepFile/StepFileImporter.h | 69 - code/AssetLib/StepFile/StepReaderGen.h | 7291 ------------------- code/CApi/CInterfaceIOWrapper.cpp | 46 +- code/CApi/CInterfaceIOWrapper.h | 45 +- tools/assimp_view/AnimEvaluator.cpp | 71 +- tools/assimp_view/AnimEvaluator.h | 10 +- tools/assimp_view/AssetHelper.h | 324 +- tools/assimp_view/Background.cpp | 3 +- tools/assimp_view/MaterialManager.h | 282 +- tools/assimp_view/SceneAnimator.h | 60 +- tools/assimp_view/assimp_view.cpp | 913 ++- tools/assimp_view/assimp_view.h | 214 +- 16 files changed, 916 insertions(+), 19534 deletions(-) delete mode 100644 code/AssetLib/StepFile/StepFileGen1.cpp delete mode 100644 code/AssetLib/StepFile/StepFileGen2.cpp delete mode 100644 code/AssetLib/StepFile/StepFileGen3.cpp delete mode 100644 code/AssetLib/StepFile/StepFileImporter.cpp delete mode 100644 code/AssetLib/StepFile/StepFileImporter.h delete mode 100644 code/AssetLib/StepFile/StepReaderGen.h diff --git a/code/AssetLib/StepFile/StepFileGen1.cpp b/code/AssetLib/StepFile/StepFileGen1.cpp deleted file mode 100644 index 077b2d4c5..000000000 --- a/code/AssetLib/StepFile/StepFileGen1.cpp +++ /dev/null @@ -1,2194 +0,0 @@ -/* -Open Asset Import Library (ASSIMP) ----------------------------------------------------------------------- - -Copyright (c) 2006-2020, ASSIMP Development 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 Development 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. - ----------------------------------------------------------------------- -*/ - -/** MACHINE-GENERATED by scripts/ICFImporter/CppGenerator.py */ - -#ifndef ASSIMP_BUILD_NO_STEP_IMPORTER - -#include "code/Importer/StepFile/StepReaderGen.h" - -namespace Assimp { -using namespace StepFile; - -namespace { - - typedef EXPRESS::ConversionSchema::SchemaEntry SchemaEntry; - - const SchemaEntry schema_raw[] = { - SchemaEntry("absorbed_dose_measure",NULL ) -, SchemaEntry("acceleration_measure",NULL ) -, SchemaEntry("action_items",NULL ) -, SchemaEntry("action_method_items",NULL ) -, SchemaEntry("action_request_item",NULL ) -, SchemaEntry("ahead_or_behind",NULL ) -, SchemaEntry("amount_of_substance_measure",NULL ) -, SchemaEntry("angle_direction_reference_select",NULL ) -, SchemaEntry("angle_direction_reference_with_a2p3d_select",NULL ) -, SchemaEntry("angle_relator",NULL ) -, SchemaEntry("annotation_plane_element",NULL ) -, SchemaEntry("annotation_representation_select",NULL ) -, SchemaEntry("annotation_symbol_occurrence_item",NULL ) -, SchemaEntry("annotation_text_occurrence_item",NULL ) -, SchemaEntry("approval_item",NULL ) -, SchemaEntry("approved_item",NULL ) -, SchemaEntry("area_measure",NULL ) -, SchemaEntry("area_or_view",NULL ) -, SchemaEntry("attribute_classification_item",NULL ) -, SchemaEntry("attribute_language_item",NULL ) -, SchemaEntry("attribute_type",NULL ) -, SchemaEntry("axis2_placement",NULL ) -, SchemaEntry("b_spline_curve_form",NULL ) -, SchemaEntry("b_spline_surface_form",NULL ) -, SchemaEntry("base_solid_select",NULL ) -, SchemaEntry("blend_end_condition_select",NULL ) -, SchemaEntry("blend_radius_variation_type",NULL ) -, SchemaEntry("boolean_operand",NULL ) -, SchemaEntry("boolean_operator",NULL ) -, SchemaEntry("box_characteristic_select",NULL ) -, SchemaEntry("box_height",NULL ) -, SchemaEntry("box_rotate_angle",NULL ) -, SchemaEntry("box_slant_angle",NULL ) -, SchemaEntry("box_width",NULL ) -, SchemaEntry("camera_model_d3_multi_clipping_interection_select",NULL ) -, SchemaEntry("camera_model_d3_multi_clipping_union_select",NULL ) -, SchemaEntry("capacitance_measure",NULL ) -, SchemaEntry("category_usage_item",NULL ) -, SchemaEntry("cc_classified_item",NULL ) -, SchemaEntry("cc_person_organization_item",NULL ) -, SchemaEntry("cc_specified_item",NULL ) -, SchemaEntry("celsius_temperature_measure",NULL ) -, SchemaEntry("central_or_parallel",NULL ) -, SchemaEntry("certification_item",NULL ) -, SchemaEntry("certified_item",NULL ) -, SchemaEntry("change_request_item",NULL ) -, SchemaEntry("character_spacing_select",NULL ) -, SchemaEntry("character_style_select",NULL ) -, SchemaEntry("characterized_action_definition",NULL ) -, SchemaEntry("characterized_definition",NULL ) -, SchemaEntry("characterized_material_property",NULL ) -, SchemaEntry("characterized_product_composition_value",NULL ) -, SchemaEntry("characterized_product_definition",NULL ) -, SchemaEntry("class_usage_effectivity_context_item",NULL ) -, SchemaEntry("classification_item",NULL ) -, SchemaEntry("classified_item",NULL ) -, SchemaEntry("compound_item_definition",NULL ) -, SchemaEntry("conductance_measure",NULL ) -, SchemaEntry("configuration_design_item",NULL ) -, SchemaEntry("configured_effectivity_context_item",NULL ) -, SchemaEntry("configured_effectivity_item",NULL ) -, SchemaEntry("constructive_geometry_representation_or_shape_represenation",NULL ) -, SchemaEntry("context_dependent_measure",NULL ) -, SchemaEntry("contract_item",NULL ) -, SchemaEntry("contracted_item",NULL ) -, SchemaEntry("count_measure",NULL ) -, SchemaEntry("csg_primitive",NULL ) -, SchemaEntry("csg_select",NULL ) -, SchemaEntry("curve_font_or_scaled_curve_font_select",NULL ) -, SchemaEntry("curve_on_surface",NULL ) -, SchemaEntry("curve_or_annotation_curve_occurrence",NULL ) -, SchemaEntry("curve_or_render",NULL ) -, SchemaEntry("curve_style_font_select",NULL ) -, SchemaEntry("date_and_time_item",NULL ) -, SchemaEntry("date_item",NULL ) -, SchemaEntry("date_time_item",NULL ) -, SchemaEntry("date_time_or_event_occurrence",NULL ) -, SchemaEntry("date_time_select",NULL ) -, SchemaEntry("day_in_month_number",NULL ) -, SchemaEntry("day_in_week_number",NULL ) -, SchemaEntry("day_in_year_number",NULL ) -, SchemaEntry("defined_symbol_select",NULL ) -, SchemaEntry("derived_property_select",NULL ) -, SchemaEntry("description_attribute_select",NULL ) -, SchemaEntry("descriptive_measure",NULL ) -, SchemaEntry("dimension_count",NULL ) -, SchemaEntry("dimension_extent_usage",NULL ) -, SchemaEntry("dimensional_characteristic",NULL ) -, SchemaEntry("direction_count_select",NULL ) -, SchemaEntry("document_identifier_assigned_item",NULL ) -, SchemaEntry("document_reference_item",NULL ) -, SchemaEntry("dose_equivalent_measure",NULL ) -, SchemaEntry("draughting_callout_element",NULL ) -, SchemaEntry("draughting_model_item_association_select",NULL ) -, SchemaEntry("draughting_model_item_select",NULL ) -, SchemaEntry("draughting_titled_item",NULL ) -, SchemaEntry("effectivity_item",NULL ) -, SchemaEntry("electric_charge_measure",NULL ) -, SchemaEntry("electric_current_measure",NULL ) -, SchemaEntry("electric_potential_measure",NULL ) -, SchemaEntry("energy_measure",NULL ) -, SchemaEntry("event_occurrence_item",NULL ) -, SchemaEntry("external_identification_item",NULL ) -, SchemaEntry("fill_area_style_tile_shape_select",NULL ) -, SchemaEntry("fill_style_select",NULL ) -, SchemaEntry("font_select",NULL ) -, SchemaEntry("force_measure",NULL ) -, SchemaEntry("founded_item_select",NULL ) -, SchemaEntry("frequency_measure",NULL ) -, SchemaEntry("generalized_surface_select",NULL ) -, SchemaEntry("geometric_item_specific_usage_select",NULL ) -, SchemaEntry("geometric_set_select",NULL ) -, SchemaEntry("groupable_item",NULL ) -, SchemaEntry("hour_in_day",NULL ) -, SchemaEntry("id_attribute_select",NULL ) -, SchemaEntry("identification_item",NULL ) -, SchemaEntry("identifier",NULL ) -, SchemaEntry("illuminance_measure",NULL ) -, SchemaEntry("inductance_measure",NULL ) -, SchemaEntry("instance_usage_context_select",NULL ) -, SchemaEntry("invisibility_context",NULL ) -, SchemaEntry("invisible_item",NULL ) -, SchemaEntry("ir_usage_item",NULL ) -, SchemaEntry("knot_type",NULL ) -, SchemaEntry("label",NULL ) -, SchemaEntry("layered_item",NULL ) -, SchemaEntry("length_measure",NULL ) -, SchemaEntry("limit_condition",NULL ) -, SchemaEntry("list_of_reversible_topology_item",NULL ) -, SchemaEntry("list_representation_item",NULL ) -, SchemaEntry("luminous_flux_measure",NULL ) -, SchemaEntry("luminous_intensity_measure",NULL ) -, SchemaEntry("magnetic_flux_density_measure",NULL ) -, SchemaEntry("magnetic_flux_measure",NULL ) -, SchemaEntry("marker_select",NULL ) -, SchemaEntry("marker_type",NULL ) -, SchemaEntry("mass_measure",NULL ) -, SchemaEntry("measure_value",NULL ) -, SchemaEntry("mechanical_design_and_draughting_relationship_select",NULL ) -, SchemaEntry("mechanical_design_geometric_presentation_area_items",NULL ) -, SchemaEntry("mechanical_design_geometric_presentation_representation_items",NULL ) -, SchemaEntry("message",NULL ) -, SchemaEntry("minute_in_hour",NULL ) -, SchemaEntry("month_in_year_number",NULL ) -, SchemaEntry("multi_language_attribute_item",NULL ) -, SchemaEntry("name_attribute_select",NULL ) -, SchemaEntry("name_item",NULL ) -, SchemaEntry("non_negative_length_measure",NULL ) -, SchemaEntry("nonnegative_integer",NULL ) -, SchemaEntry("null_style",NULL ) -, SchemaEntry("numeric_measure",NULL ) -, SchemaEntry("organization_item",NULL ) -, SchemaEntry("orientation_basis_select",NULL ) -, SchemaEntry("parameter_value",NULL ) -, SchemaEntry("pcurve_or_surface",NULL ) -, SchemaEntry("person_and_organization_item",NULL ) -, SchemaEntry("person_organization_select",NULL ) -, SchemaEntry("picture_representation_item_select",NULL ) -, SchemaEntry("plane_angle_measure",NULL ) -, SchemaEntry("plane_or_planar_box",NULL ) -, SchemaEntry("point_and_vector_member",NULL ) -, SchemaEntry("point_and_vector_members",NULL ) -, SchemaEntry("point_path_members",NULL ) -, SchemaEntry("positive_integer",NULL ) -, SchemaEntry("positive_length_measure",NULL ) -, SchemaEntry("positive_plane_angle_measure",NULL ) -, SchemaEntry("positive_ratio_measure",NULL ) -, SchemaEntry("power_measure",NULL ) -, SchemaEntry("preferred_surface_curve_representation",NULL ) -, SchemaEntry("presentable_text",NULL ) -, SchemaEntry("presentation_representation_select",NULL ) -, SchemaEntry("presentation_size_assignment_select",NULL ) -, SchemaEntry("presentation_style_select",NULL ) -//, SchemaEntry("presented_item_select",NULL ) -, SchemaEntry("pressure_measure",NULL ) -, SchemaEntry("product_definition_or_assembly_relationship",NULL ) -, SchemaEntry("product_definition_or_breakdown_element_usage",NULL ) -, SchemaEntry("product_definition_or_product_definition_relationship",NULL ) -, SchemaEntry("product_or_formation_or_definition",NULL ) -, SchemaEntry("project_item",NULL ) -, SchemaEntry("radioactivity_measure",NULL ) -, SchemaEntry("ratio_measure",NULL ) -, SchemaEntry("rendering_properties_select",NULL ) -, SchemaEntry("represented_definition",NULL ) -, SchemaEntry("requirement_assigned_item",NULL ) -, SchemaEntry("requirement_satisfaction_item",NULL ) -, SchemaEntry("requirement_source_item",NULL ) -, SchemaEntry("resistance_measure",NULL ) -, SchemaEntry("reversible_topology",NULL ) -, SchemaEntry("reversible_topology_item",NULL ) -, SchemaEntry("role_select",NULL ) -, SchemaEntry("rule_superseded_item",NULL ) -, SchemaEntry("second_in_minute",NULL ) -, SchemaEntry("security_classification_item",NULL ) -, SchemaEntry("set_of_reversible_topology_item",NULL ) -, SchemaEntry("set_representation_item",NULL ) -, SchemaEntry("shading_curve_method",NULL ) -, SchemaEntry("shading_surface_method",NULL ) -, SchemaEntry("shape_definition",NULL ) -, SchemaEntry("shell",NULL ) -, SchemaEntry("si_prefix",NULL ) -, SchemaEntry("si_unit_name",NULL ) -, SchemaEntry("size_select",NULL ) -, SchemaEntry("sketch_basis_select",NULL ) -, SchemaEntry("solid_angle_measure",NULL ) -, SchemaEntry("source",NULL ) -, SchemaEntry("source_item",NULL ) -, SchemaEntry("start_request_item",NULL ) -, SchemaEntry("string_representation_item_select",NULL ) -, SchemaEntry("style_context_select",NULL ) -, SchemaEntry("surface_side",NULL ) -, SchemaEntry("surface_side_style_select",NULL ) -, SchemaEntry("surface_style_element_select",NULL ) -, SchemaEntry("symbol_style_select",NULL ) -, SchemaEntry("text",NULL ) -, SchemaEntry("text_alignment",NULL ) -, SchemaEntry("text_delineation",NULL ) -, SchemaEntry("text_or_character",NULL ) -, SchemaEntry("text_path",NULL ) -, SchemaEntry("text_string_representation_item",NULL ) -, SchemaEntry("thermodynamic_temperature_measure",NULL ) -, SchemaEntry("time_interval_item",NULL ) -, SchemaEntry("time_measure",NULL ) -, SchemaEntry("tolerance_method_definition",NULL ) -, SchemaEntry("transformation",NULL ) -, SchemaEntry("transition_code",NULL ) -, SchemaEntry("trim_condition_select",NULL ) -, SchemaEntry("trim_intent",NULL ) -, SchemaEntry("trimming_preference",NULL ) -, SchemaEntry("trimming_select",NULL ) -, SchemaEntry("u_direction_count",NULL ) -, SchemaEntry("unit",NULL ) -, SchemaEntry("v_direction_count",NULL ) -, SchemaEntry("value_qualifier",NULL ) -, SchemaEntry("vector_or_direction",NULL ) -, SchemaEntry("velocity_measure",NULL ) -, SchemaEntry("volume_measure",NULL ) -, SchemaEntry("week_in_year_number",NULL ) -, SchemaEntry("work_item",NULL ) -, SchemaEntry("year_number",NULL ) -, SchemaEntry("measure_with_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("absorbed_dose_measure_with_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("derived_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("absorbed_dose_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("abstract_variable",&STEP::ObjectHelper::Construct ) -, SchemaEntry("acceleration_measure_with_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("acceleration_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("action",&STEP::ObjectHelper::Construct ) -, SchemaEntry("action_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("action_directive",&STEP::ObjectHelper::Construct ) -, SchemaEntry("action_method",&STEP::ObjectHelper::Construct ) -, SchemaEntry("action_method_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("action_method_relationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("action_method_role",&STEP::ObjectHelper::Construct ) -, SchemaEntry("action_property",&STEP::ObjectHelper::Construct ) -, SchemaEntry("action_property_representation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("action_relationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("action_request_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("action_request_solution",&STEP::ObjectHelper::Construct ) -, SchemaEntry("action_request_status",&STEP::ObjectHelper::Construct ) -, SchemaEntry("action_status",&STEP::ObjectHelper::Construct ) -, SchemaEntry("address",&STEP::ObjectHelper::Construct ) -, SchemaEntry("representation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("shape_representation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("advanced_brep_shape_representation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("face_surface",&STEP::ObjectHelper::Construct ) -, SchemaEntry("advanced_face",&STEP::ObjectHelper::Construct ) -, SchemaEntry("alternate_product_relationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("amount_of_substance_measure_with_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("named_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("amount_of_substance_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("angle_direction_reference",&STEP::ObjectHelper::Construct ) -, SchemaEntry("representation_item",&STEP::ObjectHelper::Construct ) -, SchemaEntry("geometric_representation_item",&STEP::ObjectHelper::Construct ) -, SchemaEntry("draughting_callout",&STEP::ObjectHelper::Construct ) -, SchemaEntry("dimension_curve_directed_callout",&STEP::ObjectHelper::Construct ) -, SchemaEntry("angular_dimension",&STEP::ObjectHelper::Construct ) -, SchemaEntry("shape_aspect_relationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("dimensional_location",&STEP::ObjectHelper::Construct ) -, SchemaEntry("angular_location",&STEP::ObjectHelper::Construct ) -, SchemaEntry("dimensional_size",&STEP::ObjectHelper::Construct ) -, SchemaEntry("angular_size",&STEP::ObjectHelper::Construct ) -, SchemaEntry("geometric_tolerance",&STEP::ObjectHelper::Construct ) -, SchemaEntry("geometric_tolerance_with_datum_reference",&STEP::ObjectHelper::Construct ) -, SchemaEntry("angularity_tolerance",&STEP::ObjectHelper::Construct ) -, SchemaEntry("styled_item",&STEP::ObjectHelper::Construct ) -, SchemaEntry("annotation_occurrence",&STEP::ObjectHelper::Construct ) -, SchemaEntry("annotation_curve_occurrence",&STEP::ObjectHelper::Construct ) -, SchemaEntry("annotation_fill_area",&STEP::ObjectHelper::Construct ) -, SchemaEntry("annotation_fill_area_occurrence",&STEP::ObjectHelper::Construct ) -, SchemaEntry("annotation_occurrence_relationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("annotation_occurrence_associativity",&STEP::ObjectHelper::Construct ) -, SchemaEntry("annotation_plane",&STEP::ObjectHelper::Construct ) -, SchemaEntry("annotation_symbol_occurrence",&STEP::ObjectHelper::Construct ) -, SchemaEntry("annotation_subfigure_occurrence",&STEP::ObjectHelper::Construct ) -, SchemaEntry("mapped_item",&STEP::ObjectHelper::Construct ) -, SchemaEntry("annotation_symbol",&STEP::ObjectHelper::Construct ) -, SchemaEntry("annotation_text",&STEP::ObjectHelper::Construct ) -, SchemaEntry("annotation_text_character",&STEP::ObjectHelper::Construct ) -, SchemaEntry("annotation_text_occurrence",&STEP::ObjectHelper::Construct ) -, SchemaEntry("shape_aspect",&STEP::ObjectHelper::Construct ) -, SchemaEntry("derived_shape_aspect",&STEP::ObjectHelper::Construct ) -, SchemaEntry("apex",&STEP::ObjectHelper::Construct ) -, SchemaEntry("application_context",&STEP::ObjectHelper::Construct ) -, SchemaEntry("application_context_element",&STEP::ObjectHelper::Construct ) -, SchemaEntry("application_protocol_definition",&STEP::ObjectHelper::Construct ) -, SchemaEntry("applied_action_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("applied_action_method_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("applied_action_request_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("approval_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("applied_approval_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("attribute_classification_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("applied_attribute_classification_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("certification_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("applied_certification_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("classification_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("applied_classification_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("contract_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("applied_contract_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("date_and_time_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("applied_date_and_time_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("date_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("applied_date_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("document_reference",&STEP::ObjectHelper::Construct ) -, SchemaEntry("applied_document_reference",&STEP::ObjectHelper::Construct ) -, SchemaEntry("document_usage_constraint_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("applied_document_usage_constraint_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("effectivity_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("applied_effectivity_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("event_occurrence_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("applied_event_occurrence_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("identification_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("external_identification_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("applied_external_identification_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("group_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("applied_group_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("applied_identification_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("name_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("applied_name_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("organization_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("applied_organization_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("organizational_project_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("applied_organizational_project_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("person_and_organization_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("applied_person_and_organization_assignment",&STEP::ObjectHelper::Construct ) -//, SchemaEntry("presented_item",&STEP::ObjectHelper::Construct ) -, SchemaEntry("applied_presented_item",&STEP::ObjectHelper::Construct ) -, SchemaEntry("security_classification_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("applied_security_classification_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("time_interval_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("applied_time_interval_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("applied_usage_right",&STEP::ObjectHelper::Construct ) -, SchemaEntry("approval",&STEP::ObjectHelper::Construct ) -, SchemaEntry("approval_date_time",&STEP::ObjectHelper::Construct ) -, SchemaEntry("approval_person_organization",&STEP::ObjectHelper::Construct ) -, SchemaEntry("approval_relationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("approval_role",&STEP::ObjectHelper::Construct ) -, SchemaEntry("approval_status",&STEP::ObjectHelper::Construct ) -, SchemaEntry("area_in_set",&STEP::ObjectHelper::Construct ) -, SchemaEntry("area_measure_with_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("area_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("product_definition_relationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("product_definition_usage",&STEP::ObjectHelper::Construct ) -, SchemaEntry("assembly_component_usage",&STEP::ObjectHelper::Construct ) -, SchemaEntry("assembly_component_usage_substitute",&STEP::ObjectHelper::Construct ) -, SchemaEntry("assigned_requirement",&STEP::ObjectHelper::Construct ) -, SchemaEntry("compound_representation_item",&STEP::ObjectHelper::Construct ) -, SchemaEntry("atomic_formula",&STEP::ObjectHelper::Construct ) -, SchemaEntry("attribute_assertion",&STEP::ObjectHelper::Construct ) -, SchemaEntry("attribute_language_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("attribute_value_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("attribute_value_role",&STEP::ObjectHelper::Construct ) -, SchemaEntry("auxiliary_geometric_representation_item",&STEP::ObjectHelper::Construct ) -, SchemaEntry("placement",&STEP::ObjectHelper::Construct ) -, SchemaEntry("axis1_placement",&STEP::ObjectHelper::Construct ) -, SchemaEntry("axis2_placement_2d",&STEP::ObjectHelper::Construct ) -, SchemaEntry("axis2_placement_3d",&STEP::ObjectHelper::Construct ) -, SchemaEntry("curve",&STEP::ObjectHelper::Construct ) -, SchemaEntry("bounded_curve",&STEP::ObjectHelper::Construct ) -, SchemaEntry("b_spline_curve",&STEP::ObjectHelper::Construct ) -, SchemaEntry("b_spline_curve_with_knots",&STEP::ObjectHelper::Construct ) -, SchemaEntry("surface",&STEP::ObjectHelper::Construct ) -, SchemaEntry("bounded_surface",&STEP::ObjectHelper::Construct ) -, SchemaEntry("b_spline_surface",&STEP::ObjectHelper::Construct ) -, SchemaEntry("b_spline_surface_with_knots",&STEP::ObjectHelper::Construct ) -, SchemaEntry("product_definition",&STEP::ObjectHelper::Construct ) -, SchemaEntry("rule_software_definition",&STEP::ObjectHelper::Construct ) -, SchemaEntry("rule_definition",&STEP::ObjectHelper::Construct ) -, SchemaEntry("back_chaining_rule",&STEP::ObjectHelper::Construct ) -, SchemaEntry("back_chaining_rule_body",&STEP::ObjectHelper::Construct ) -, SchemaEntry("colour",&STEP::ObjectHelper::Construct ) -, SchemaEntry("background_colour",&STEP::ObjectHelper::Construct ) -, SchemaEntry("beveled_sheet_representation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("bezier_curve",&STEP::ObjectHelper::Construct ) -, SchemaEntry("bezier_surface",&STEP::ObjectHelper::Construct ) -, SchemaEntry("generic_expression",&STEP::ObjectHelper::Construct ) -, SchemaEntry("binary_generic_expression",&STEP::ObjectHelper::Construct ) -, SchemaEntry("binary_numeric_expression",&STEP::ObjectHelper::Construct ) -, SchemaEntry("binary_representation_item",&STEP::ObjectHelper::Construct ) -, SchemaEntry("block",&STEP::ObjectHelper::Construct ) -, SchemaEntry("expression",&STEP::ObjectHelper::Construct ) -, SchemaEntry("boolean_expression",&STEP::ObjectHelper::Construct ) -, SchemaEntry("boolean_literal",&STEP::ObjectHelper::Construct ) -, SchemaEntry("boolean_representation_item",&STEP::ObjectHelper::Construct ) -, SchemaEntry("boolean_result",&STEP::ObjectHelper::Construct ) -, SchemaEntry("composite_curve",&STEP::ObjectHelper::Construct ) -, SchemaEntry("composite_curve_on_surface",&STEP::ObjectHelper::Construct ) -, SchemaEntry("boundary_curve",&STEP::ObjectHelper::Construct ) -, SchemaEntry("bounded_pcurve",&STEP::ObjectHelper::Construct ) -, SchemaEntry("bounded_surface_curve",&STEP::ObjectHelper::Construct ) -, SchemaEntry("founded_item",&STEP::ObjectHelper::Construct ) -, SchemaEntry("box_domain",&STEP::ObjectHelper::Construct ) -, SchemaEntry("half_space_solid",&STEP::ObjectHelper::Construct ) -, SchemaEntry("boxed_half_space",&STEP::ObjectHelper::Construct ) -, SchemaEntry("breakdown_context",&STEP::ObjectHelper::Construct ) -, SchemaEntry("breakdown_element_group_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("breakdown_element_realization",&STEP::ObjectHelper::Construct ) -, SchemaEntry("breakdown_element_usage",&STEP::ObjectHelper::Construct ) -, SchemaEntry("breakdown_of",&STEP::ObjectHelper::Construct ) -, SchemaEntry("solid_model",&STEP::ObjectHelper::Construct ) -, SchemaEntry("manifold_solid_brep",&STEP::ObjectHelper::Construct ) -, SchemaEntry("brep_with_voids",&STEP::ObjectHelper::Construct ) -, SchemaEntry("bytes_representation_item",&STEP::ObjectHelper::Construct ) -, SchemaEntry("date",&STEP::ObjectHelper::Construct ) -, SchemaEntry("calendar_date",&STEP::ObjectHelper::Construct ) -, SchemaEntry("camera_image",&STEP::ObjectHelper::Construct ) -, SchemaEntry("camera_image_3d_with_scale",&STEP::ObjectHelper::Construct ) -, SchemaEntry("camera_model",&STEP::ObjectHelper::Construct ) -, SchemaEntry("camera_model_d3",&STEP::ObjectHelper::Construct ) -, SchemaEntry("camera_model_d3_multi_clipping",&STEP::ObjectHelper::Construct ) -, SchemaEntry("camera_model_d3_multi_clipping_intersection",&STEP::ObjectHelper::Construct ) -, SchemaEntry("camera_model_d3_multi_clipping_union",&STEP::ObjectHelper::Construct ) -, SchemaEntry("camera_model_d3_with_hlhsr",&STEP::ObjectHelper::Construct ) -, SchemaEntry("camera_model_with_light_sources",&STEP::ObjectHelper::Construct ) -, SchemaEntry("representation_map",&STEP::ObjectHelper::Construct ) -, SchemaEntry("camera_usage",&STEP::ObjectHelper::Construct ) -, SchemaEntry("capacitance_measure_with_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("capacitance_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("point",&STEP::ObjectHelper::Construct ) -, SchemaEntry("cartesian_point",&STEP::ObjectHelper::Construct ) -, SchemaEntry("cartesian_transformation_operator",&STEP::ObjectHelper::Construct ) -, SchemaEntry("cartesian_transformation_operator_2d",&STEP::ObjectHelper::Construct ) -, SchemaEntry("cartesian_transformation_operator_3d",&STEP::ObjectHelper::Construct ) -, SchemaEntry("cc_design_approval",&STEP::ObjectHelper::Construct ) -, SchemaEntry("cc_design_certification",&STEP::ObjectHelper::Construct ) -, SchemaEntry("cc_design_contract",&STEP::ObjectHelper::Construct ) -, SchemaEntry("cc_design_date_and_time_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("cc_design_person_and_organization_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("cc_design_security_classification",&STEP::ObjectHelper::Construct ) -, SchemaEntry("cc_design_specification_reference",&STEP::ObjectHelper::Construct ) -, SchemaEntry("celsius_temperature_measure_with_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("centre_of_symmetry",&STEP::ObjectHelper::Construct ) -, SchemaEntry("certification",&STEP::ObjectHelper::Construct ) -, SchemaEntry("certification_type",&STEP::ObjectHelper::Construct ) -, SchemaEntry("change",&STEP::ObjectHelper::Construct ) -, SchemaEntry("change_request",&STEP::ObjectHelper::Construct ) -, SchemaEntry("character_glyph_font_usage",&STEP::ObjectHelper::Construct ) -, SchemaEntry("character_glyph_style_outline",&STEP::ObjectHelper::Construct ) -, SchemaEntry("character_glyph_style_stroke",&STEP::ObjectHelper::Construct ) -, SchemaEntry("symbol_representation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("generic_character_glyph_symbol",&STEP::ObjectHelper::Construct ) -, SchemaEntry("character_glyph_symbol",&STEP::ObjectHelper::Construct ) -, SchemaEntry("character_glyph_symbol_outline",&STEP::ObjectHelper::Construct ) -, SchemaEntry("character_glyph_symbol_stroke",&STEP::ObjectHelper::Construct ) -, SchemaEntry("general_property",&STEP::ObjectHelper::Construct ) -, SchemaEntry("characteristic_data_column_header",&STEP::ObjectHelper::Construct ) -, SchemaEntry("general_property_relationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("characteristic_data_column_header_link",&STEP::ObjectHelper::Construct ) -, SchemaEntry("characteristic_data_table_header",&STEP::ObjectHelper::Construct ) -, SchemaEntry("characteristic_data_table_header_decomposition",&STEP::ObjectHelper::Construct ) -, SchemaEntry("group",&STEP::ObjectHelper::Construct ) -, SchemaEntry("characteristic_type",&STEP::ObjectHelper::Construct ) -, SchemaEntry("characterized_class",&STEP::ObjectHelper::Construct ) -, SchemaEntry("characterized_object",&STEP::ObjectHelper::Construct ) -, SchemaEntry("conic",&STEP::ObjectHelper::Construct ) -, SchemaEntry("circle",&STEP::ObjectHelper::Construct ) -, SchemaEntry("circular_runout_tolerance",&STEP::ObjectHelper::Construct ) -, SchemaEntry("class_t",&STEP::ObjectHelper::Construct ) -, SchemaEntry("class_by_extension",&STEP::ObjectHelper::Construct ) -, SchemaEntry("class_by_intension",&STEP::ObjectHelper::Construct ) -, SchemaEntry("class_system",&STEP::ObjectHelper::Construct ) -, SchemaEntry("effectivity_context_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("class_usage_effectivity_context_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("classification_role",&STEP::ObjectHelper::Construct ) -, SchemaEntry("topological_representation_item",&STEP::ObjectHelper::Construct ) -, SchemaEntry("connected_face_set",&STEP::ObjectHelper::Construct ) -, SchemaEntry("closed_shell",&STEP::ObjectHelper::Construct ) -, SchemaEntry("coaxiality_tolerance",&STEP::ObjectHelper::Construct ) -, SchemaEntry("colour_specification",&STEP::ObjectHelper::Construct ) -, SchemaEntry("colour_rgb",&STEP::ObjectHelper::Construct ) -, SchemaEntry("common_datum",&STEP::ObjectHelper::Construct ) -, SchemaEntry("comparison_expression",&STEP::ObjectHelper::Construct ) -, SchemaEntry("complex_clause",&STEP::ObjectHelper::Construct ) -, SchemaEntry("complex_conjunctive_clause",&STEP::ObjectHelper::Construct ) -, SchemaEntry("complex_disjunctive_clause",&STEP::ObjectHelper::Construct ) -, SchemaEntry("modified_solid",&STEP::ObjectHelper::Construct ) -, SchemaEntry("shelled_solid",&STEP::ObjectHelper::Construct ) -, SchemaEntry("complex_shelled_solid",&STEP::ObjectHelper::Construct ) -, SchemaEntry("composite_assembly_definition",&STEP::ObjectHelper::Construct ) -, SchemaEntry("composite_assembly_sequence_definition",&STEP::ObjectHelper::Construct ) -, SchemaEntry("laminate_table",&STEP::ObjectHelper::Construct ) -, SchemaEntry("part_laminate_table",&STEP::ObjectHelper::Construct ) -, SchemaEntry("composite_assembly_table",&STEP::ObjectHelper::Construct ) -, SchemaEntry("composite_curve_segment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("material_designation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("composite_material_designation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("composite_shape_aspect",&STEP::ObjectHelper::Construct ) -, SchemaEntry("composite_sheet_representation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("composite_text",&STEP::ObjectHelper::Construct ) -, SchemaEntry("composite_text_with_associated_curves",&STEP::ObjectHelper::Construct ) -, SchemaEntry("composite_text_with_blanking_box",&STEP::ObjectHelper::Construct ) -, SchemaEntry("composite_text_with_delineation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("composite_text_with_extent",&STEP::ObjectHelper::Construct ) -, SchemaEntry("compound_shape_representation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("concentricity_tolerance",&STEP::ObjectHelper::Construct ) -, SchemaEntry("concept_feature_operator",&STEP::ObjectHelper::Construct ) -, SchemaEntry("concept_feature_relationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("concept_feature_relationship_with_condition",&STEP::ObjectHelper::Construct ) -, SchemaEntry("product_concept_feature",&STEP::ObjectHelper::Construct ) -, SchemaEntry("conditional_concept_feature",&STEP::ObjectHelper::Construct ) -, SchemaEntry("conductance_measure_with_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("conductance_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("configuration_item",&STEP::ObjectHelper::Construct ) -, SchemaEntry("configurable_item",&STEP::ObjectHelper::Construct ) -, SchemaEntry("configuration_design",&STEP::ObjectHelper::Construct ) -, SchemaEntry("effectivity",&STEP::ObjectHelper::Construct ) -, SchemaEntry("product_definition_effectivity",&STEP::ObjectHelper::Construct ) -, SchemaEntry("configuration_effectivity",&STEP::ObjectHelper::Construct ) -, SchemaEntry("configuration_item_relationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("configuration_item_hierarchical_relationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("configuration_item_revision_sequence",&STEP::ObjectHelper::Construct ) -, SchemaEntry("configured_effectivity_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("configured_effectivity_context_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("conical_stepped_hole_transition",&STEP::ObjectHelper::Construct ) -, SchemaEntry("elementary_surface",&STEP::ObjectHelper::Construct ) -, SchemaEntry("conical_surface",&STEP::ObjectHelper::Construct ) -, SchemaEntry("connected_edge_set",&STEP::ObjectHelper::Construct ) -, SchemaEntry("connected_face_sub_set",&STEP::ObjectHelper::Construct ) -, SchemaEntry("constructive_geometry_representation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("representation_relationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("constructive_geometry_representation_relationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("contact_ratio_representation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("invisibility",&STEP::ObjectHelper::Construct ) -, SchemaEntry("context_dependent_invisibility",&STEP::ObjectHelper::Construct ) -, SchemaEntry("over_riding_styled_item",&STEP::ObjectHelper::Construct ) -, SchemaEntry("context_dependent_over_riding_styled_item",&STEP::ObjectHelper::Construct ) -, SchemaEntry("context_dependent_shape_representation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("context_dependent_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("contract",&STEP::ObjectHelper::Construct ) -, SchemaEntry("contract_relationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("contract_type",&STEP::ObjectHelper::Construct ) -, SchemaEntry("conversion_based_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("coordinated_universal_time_offset",&STEP::ObjectHelper::Construct ) -, SchemaEntry("csg_shape_representation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("csg_solid",&STEP::ObjectHelper::Construct ) -, SchemaEntry("currency",&STEP::ObjectHelper::Construct ) -, SchemaEntry("currency_measure_with_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("curve_bounded_surface",&STEP::ObjectHelper::Construct ) -, SchemaEntry("curve_dimension",&STEP::ObjectHelper::Construct ) -, SchemaEntry("curve_replica",&STEP::ObjectHelper::Construct ) -, SchemaEntry("curve_style",&STEP::ObjectHelper::Construct ) -, SchemaEntry("curve_style_font",&STEP::ObjectHelper::Construct ) -, SchemaEntry("curve_style_font_and_scaling",&STEP::ObjectHelper::Construct ) -, SchemaEntry("curve_style_font_pattern",&STEP::ObjectHelper::Construct ) -, SchemaEntry("curve_style_rendering",&STEP::ObjectHelper::Construct ) -, SchemaEntry("curve_swept_solid_shape_representation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("cylindrical_surface",&STEP::ObjectHelper::Construct ) -, SchemaEntry("cylindricity_tolerance",&STEP::ObjectHelper::Construct ) -, SchemaEntry("data_environment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("date_and_time",&STEP::ObjectHelper::Construct ) -, SchemaEntry("date_representation_item",&STEP::ObjectHelper::Construct ) -, SchemaEntry("date_role",&STEP::ObjectHelper::Construct ) -, SchemaEntry("date_time_representation_item",&STEP::ObjectHelper::Construct ) -, SchemaEntry("date_time_role",&STEP::ObjectHelper::Construct ) -, SchemaEntry("dated_effectivity",&STEP::ObjectHelper::Construct ) -, SchemaEntry("datum",&STEP::ObjectHelper::Construct ) -, SchemaEntry("datum_feature",&STEP::ObjectHelper::Construct ) -, SchemaEntry("datum_feature_callout",&STEP::ObjectHelper::Construct ) -, SchemaEntry("datum_reference",&STEP::ObjectHelper::Construct ) -, SchemaEntry("datum_target",&STEP::ObjectHelper::Construct ) -, SchemaEntry("datum_target_callout",&STEP::ObjectHelper::Construct ) -, SchemaEntry("default_tolerance_table",&STEP::ObjectHelper::Construct ) -, SchemaEntry("default_tolerance_table_cell",&STEP::ObjectHelper::Construct ) -, SchemaEntry("defined_symbol",&STEP::ObjectHelper::Construct ) -, SchemaEntry("definitional_representation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("definitional_representation_relationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("definitional_representation_relationship_with_same_context",&STEP::ObjectHelper::Construct ) -, SchemaEntry("degenerate_pcurve",&STEP::ObjectHelper::Construct ) -, SchemaEntry("toroidal_surface",&STEP::ObjectHelper::Construct ) -, SchemaEntry("degenerate_toroidal_surface",&STEP::ObjectHelper::Construct ) -, SchemaEntry("derived_unit_element",&STEP::ObjectHelper::Construct ) -, SchemaEntry("description_attribute",&STEP::ObjectHelper::Construct ) -, SchemaEntry("descriptive_representation_item",&STEP::ObjectHelper::Construct ) -, SchemaEntry("product_definition_context",&STEP::ObjectHelper::Construct ) -, SchemaEntry("design_context",&STEP::ObjectHelper::Construct ) -, SchemaEntry("design_make_from_relationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("diameter_dimension",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ratio_measure_with_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("dielectric_constant_measure_with_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("dimension_callout",&STEP::ObjectHelper::Construct ) -, SchemaEntry("draughting_callout_relationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("dimension_callout_component_relationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("dimension_callout_relationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("dimension_curve",&STEP::ObjectHelper::Construct ) -, SchemaEntry("terminator_symbol",&STEP::ObjectHelper::Construct ) -, SchemaEntry("dimension_curve_terminator",&STEP::ObjectHelper::Construct ) -, SchemaEntry("dimension_curve_terminator_to_projection_curve_associativity",&STEP::ObjectHelper::Construct ) -, SchemaEntry("dimension_pair",&STEP::ObjectHelper::Construct ) -, SchemaEntry("dimension_related_tolerance_zone_element",&STEP::ObjectHelper::Construct ) -, SchemaEntry("dimension_text_associativity",&STEP::ObjectHelper::Construct ) -, SchemaEntry("dimensional_characteristic_representation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("dimensional_exponents",&STEP::ObjectHelper::Construct ) -, SchemaEntry("dimensional_location_with_path",&STEP::ObjectHelper::Construct ) -, SchemaEntry("dimensional_size_with_path",&STEP::ObjectHelper::Construct ) -, SchemaEntry("executed_action",&STEP::ObjectHelper::Construct ) -, SchemaEntry("directed_action",&STEP::ObjectHelper::Construct ) -, SchemaEntry("directed_dimensional_location",&STEP::ObjectHelper::Construct ) -, SchemaEntry("direction",&STEP::ObjectHelper::Construct ) -, SchemaEntry("document",&STEP::ObjectHelper::Construct ) -, SchemaEntry("document_file",&STEP::ObjectHelper::Construct ) -, SchemaEntry("document_identifier",&STEP::ObjectHelper::Construct ) -, SchemaEntry("document_identifier_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("document_product_association",&STEP::ObjectHelper::Construct ) -, SchemaEntry("document_product_equivalence",&STEP::ObjectHelper::Construct ) -, SchemaEntry("document_relationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("document_representation_type",&STEP::ObjectHelper::Construct ) -, SchemaEntry("document_type",&STEP::ObjectHelper::Construct ) -, SchemaEntry("document_usage_constraint",&STEP::ObjectHelper::Construct ) -, SchemaEntry("document_usage_role",&STEP::ObjectHelper::Construct ) -, SchemaEntry("dose_equivalent_measure_with_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("dose_equivalent_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("double_offset_shelled_solid",&STEP::ObjectHelper::Construct ) -, SchemaEntry("item_defined_transformation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("transformation_with_derived_angle",&STEP::ObjectHelper::Construct ) -, SchemaEntry("draped_defined_transformation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("draughting_annotation_occurrence",&STEP::ObjectHelper::Construct ) -, SchemaEntry("draughting_elements",&STEP::ObjectHelper::Construct ) -, SchemaEntry("draughting_model",&STEP::ObjectHelper::Construct ) -, SchemaEntry("item_identified_representation_usage",&STEP::ObjectHelper::Construct ) -, SchemaEntry("draughting_model_item_association",&STEP::ObjectHelper::Construct ) -, SchemaEntry("pre_defined_colour",&STEP::ObjectHelper::Construct ) -, SchemaEntry("draughting_pre_defined_colour",&STEP::ObjectHelper::Construct ) -, SchemaEntry("pre_defined_item",&STEP::ObjectHelper::Construct ) -, SchemaEntry("pre_defined_curve_font",&STEP::ObjectHelper::Construct ) -, SchemaEntry("draughting_pre_defined_curve_font",&STEP::ObjectHelper::Construct ) -, SchemaEntry("pre_defined_text_font",&STEP::ObjectHelper::Construct ) -, SchemaEntry("draughting_pre_defined_text_font",&STEP::ObjectHelper::Construct ) -, SchemaEntry("draughting_subfigure_representation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("draughting_symbol_representation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("text_literal",&STEP::ObjectHelper::Construct ) -, SchemaEntry("text_literal_with_delineation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("draughting_text_literal_with_delineation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("draughting_title",&STEP::ObjectHelper::Construct ) -, SchemaEntry("drawing_definition",&STEP::ObjectHelper::Construct ) -, SchemaEntry("presentation_set",&STEP::ObjectHelper::Construct ) -, SchemaEntry("drawing_revision",&STEP::ObjectHelper::Construct ) -, SchemaEntry("drawing_revision_sequence",&STEP::ObjectHelper::Construct ) -, SchemaEntry("presentation_representation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("presentation_area",&STEP::ObjectHelper::Construct ) -, SchemaEntry("drawing_sheet_revision",&STEP::ObjectHelper::Construct ) -, SchemaEntry("drawing_sheet_revision_sequence",&STEP::ObjectHelper::Construct ) -, SchemaEntry("drawing_sheet_revision_usage",&STEP::ObjectHelper::Construct ) -, SchemaEntry("edge",&STEP::ObjectHelper::Construct ) -, SchemaEntry("edge_based_wireframe_model",&STEP::ObjectHelper::Construct ) -, SchemaEntry("edge_based_wireframe_shape_representation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("edge_blended_solid",&STEP::ObjectHelper::Construct ) -, SchemaEntry("edge_curve",&STEP::ObjectHelper::Construct ) -, SchemaEntry("edge_loop",&STEP::ObjectHelper::Construct ) -, SchemaEntry("effectivity_context_role",&STEP::ObjectHelper::Construct ) -, SchemaEntry("effectivity_relationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("electric_charge_measure_with_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("electric_charge_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("electric_current_measure_with_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("electric_current_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("electric_potential_measure_with_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("electric_potential_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("elementary_brep_shape_representation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ellipse",&STEP::ObjectHelper::Construct ) -, SchemaEntry("energy_measure_with_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("energy_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("property_definition",&STEP::ObjectHelper::Construct ) -, SchemaEntry("fact_type",&STEP::ObjectHelper::Construct ) -, SchemaEntry("entity_assertion",&STEP::ObjectHelper::Construct ) -, SchemaEntry("enum_reference_prefix",&STEP::ObjectHelper::Construct ) -, SchemaEntry("environment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("evaluated_characteristic",&STEP::ObjectHelper::Construct ) -, SchemaEntry("evaluated_degenerate_pcurve",&STEP::ObjectHelper::Construct ) -, SchemaEntry("evaluation_product_definition",&STEP::ObjectHelper::Construct ) -, SchemaEntry("event_occurrence",&STEP::ObjectHelper::Construct ) -, SchemaEntry("event_occurrence_relationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("event_occurrence_role",&STEP::ObjectHelper::Construct ) -, SchemaEntry("product_concept_feature_category",&STEP::ObjectHelper::Construct ) -, SchemaEntry("exclusive_product_concept_feature_category",&STEP::ObjectHelper::Construct ) -, SchemaEntry("uncertainty_qualifier",&STEP::ObjectHelper::Construct ) -, SchemaEntry("standard_uncertainty",&STEP::ObjectHelper::Construct ) -, SchemaEntry("expanded_uncertainty",&STEP::ObjectHelper::Construct ) -, SchemaEntry("representation_item_relationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("explicit_procedural_representation_item_relationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("explicit_procedural_geometric_representation_item_relationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("explicit_procedural_representation_relationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("explicit_procedural_shape_representation_relationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("expression_conversion_based_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("extension",&STEP::ObjectHelper::Construct ) -, SchemaEntry("extent",&STEP::ObjectHelper::Construct ) -, SchemaEntry("external_source",&STEP::ObjectHelper::Construct ) -, SchemaEntry("external_class_library",&STEP::ObjectHelper::Construct ) -, SchemaEntry("external_source_relationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("externally_defined_class",&STEP::ObjectHelper::Construct ) -, SchemaEntry("externally_defined_colour",&STEP::ObjectHelper::Construct ) -, SchemaEntry("externally_defined_context_dependent_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("externally_defined_conversion_based_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("externally_defined_currency",&STEP::ObjectHelper::Construct ) -, SchemaEntry("externally_defined_item",&STEP::ObjectHelper::Construct ) -, SchemaEntry("externally_defined_curve_font",&STEP::ObjectHelper::Construct ) -, SchemaEntry("externally_defined_dimension_definition",&STEP::ObjectHelper::Construct ) -, SchemaEntry("externally_defined_general_property",&STEP::ObjectHelper::Construct ) -, SchemaEntry("externally_defined_hatch_style",&STEP::ObjectHelper::Construct ) -, SchemaEntry("externally_defined_item_relationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("externally_defined_marker",&STEP::ObjectHelper::Construct ) -, SchemaEntry("picture_representation_item",&STEP::ObjectHelper::Construct ) -, SchemaEntry("externally_defined_picture_representation_item",&STEP::ObjectHelper::Construct ) -, SchemaEntry("externally_defined_representation_item",&STEP::ObjectHelper::Construct ) -, SchemaEntry("externally_defined_string",&STEP::ObjectHelper::Construct ) -, SchemaEntry("externally_defined_symbol",&STEP::ObjectHelper::Construct ) -, SchemaEntry("externally_defined_terminator_symbol",&STEP::ObjectHelper::Construct ) -, SchemaEntry("externally_defined_text_font",&STEP::ObjectHelper::Construct ) -, SchemaEntry("externally_defined_tile",&STEP::ObjectHelper::Construct ) -, SchemaEntry("externally_defined_tile_style",&STEP::ObjectHelper::Construct ) -, SchemaEntry("swept_area_solid",&STEP::ObjectHelper::Construct ) -, SchemaEntry("extruded_area_solid",&STEP::ObjectHelper::Construct ) -, SchemaEntry("swept_face_solid",&STEP::ObjectHelper::Construct ) -, SchemaEntry("extruded_face_solid",&STEP::ObjectHelper::Construct ) -, SchemaEntry("extruded_face_solid_with_trim_conditions",&STEP::ObjectHelper::Construct ) -, SchemaEntry("extruded_face_solid_with_draft_angle",&STEP::ObjectHelper::Construct ) -, SchemaEntry("extruded_face_solid_with_multiple_draft_angles",&STEP::ObjectHelper::Construct ) -, SchemaEntry("face",&STEP::ObjectHelper::Construct ) -, SchemaEntry("face_based_surface_model",&STEP::ObjectHelper::Construct ) -, SchemaEntry("face_bound",&STEP::ObjectHelper::Construct ) -, SchemaEntry("face_outer_bound",&STEP::ObjectHelper::Construct ) -, SchemaEntry("faceted_brep",&STEP::ObjectHelper::Construct ) -, SchemaEntry("faceted_brep_shape_representation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("fill_area_style",&STEP::ObjectHelper::Construct ) -, SchemaEntry("fill_area_style_colour",&STEP::ObjectHelper::Construct ) -, SchemaEntry("fill_area_style_hatching",&STEP::ObjectHelper::Construct ) -, SchemaEntry("fill_area_style_tile_coloured_region",&STEP::ObjectHelper::Construct ) -, SchemaEntry("fill_area_style_tile_curve_with_style",&STEP::ObjectHelper::Construct ) -, SchemaEntry("fill_area_style_tile_symbol_with_style",&STEP::ObjectHelper::Construct ) -, SchemaEntry("fill_area_style_tiles",&STEP::ObjectHelper::Construct ) -, SchemaEntry("shape_representation_relationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("flat_pattern_ply_representation_relationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("flatness_tolerance",&STEP::ObjectHelper::Construct ) -, SchemaEntry("force_measure_with_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("force_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("forward_chaining_rule",&STEP::ObjectHelper::Construct ) -, SchemaEntry("forward_chaining_rule_premise",&STEP::ObjectHelper::Construct ) -, SchemaEntry("frequency_measure_with_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("frequency_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("func",&STEP::ObjectHelper::Construct ) -, SchemaEntry("functional_breakdown_context",&STEP::ObjectHelper::Construct ) -, SchemaEntry("functional_element_usage",&STEP::ObjectHelper::Construct ) -, SchemaEntry("functionally_defined_transformation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("general_material_property",&STEP::ObjectHelper::Construct ) -, SchemaEntry("general_property_association",&STEP::ObjectHelper::Construct ) -, SchemaEntry("simple_generic_expression",&STEP::ObjectHelper::Construct ) -, SchemaEntry("generic_literal",&STEP::ObjectHelper::Construct ) -, SchemaEntry("generic_variable",&STEP::ObjectHelper::Construct ) -, SchemaEntry("geometric_alignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("geometric_set",&STEP::ObjectHelper::Construct ) -, SchemaEntry("geometric_curve_set",&STEP::ObjectHelper::Construct ) -, SchemaEntry("geometric_intersection",&STEP::ObjectHelper::Construct ) -, SchemaEntry("geometric_item_specific_usage",&STEP::ObjectHelper::Construct ) -, SchemaEntry("geometric_model_element_relationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("representation_context",&STEP::ObjectHelper::Construct ) -, SchemaEntry("geometric_representation_context",&STEP::ObjectHelper::Construct ) -, SchemaEntry("geometric_tolerance_relationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("geometric_tolerance_with_defined_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("geometrical_tolerance_callout",&STEP::ObjectHelper::Construct ) -, SchemaEntry("geometrically_bounded_2d_wireframe_representation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("geometrically_bounded_surface_shape_representation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("geometrically_bounded_wireframe_shape_representation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("global_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("global_uncertainty_assigned_context",&STEP::ObjectHelper::Construct ) -, SchemaEntry("global_unit_assigned_context",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ground_fact",&STEP::ObjectHelper::Construct ) -, SchemaEntry("group_relationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("hardness_representation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("hidden_element_over_riding_styled_item",&STEP::ObjectHelper::Construct ) -, SchemaEntry("hyperbola",&STEP::ObjectHelper::Construct ) -, SchemaEntry("id_attribute",&STEP::ObjectHelper::Construct ) -, SchemaEntry("identification_role",&STEP::ObjectHelper::Construct ) -, SchemaEntry("illuminance_measure_with_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("illuminance_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("included_text_block",&STEP::ObjectHelper::Construct ) -, SchemaEntry("inclusion_product_concept_feature",&STEP::ObjectHelper::Construct ) -, SchemaEntry("user_selected_elements",&STEP::ObjectHelper::Construct ) -, SchemaEntry("indirectly_selected_elements",&STEP::ObjectHelper::Construct ) -, SchemaEntry("indirectly_selected_shape_elements",&STEP::ObjectHelper::Construct ) -, SchemaEntry("inductance_measure_with_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("inductance_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("information_right",&STEP::ObjectHelper::Construct ) -, SchemaEntry("information_usage_right",&STEP::ObjectHelper::Construct ) -, SchemaEntry("instance_usage_context_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("instanced_feature",&STEP::ObjectHelper::Construct ) -, SchemaEntry("literal_number",&STEP::ObjectHelper::Construct ) -, SchemaEntry("int_literal",&STEP::ObjectHelper::Construct ) -, SchemaEntry("integer_representation_item",&STEP::ObjectHelper::Construct ) -, SchemaEntry("surface_curve",&STEP::ObjectHelper::Construct ) -, SchemaEntry("intersection_curve",&STEP::ObjectHelper::Construct ) -, SchemaEntry("interval_expression",&STEP::ObjectHelper::Construct ) -, SchemaEntry("iso4217_currency",&STEP::ObjectHelper::Construct ) -, SchemaEntry("known_source",&STEP::ObjectHelper::Construct ) -, SchemaEntry("laid_defined_transformation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("language",&STEP::ObjectHelper::Construct ) -, SchemaEntry("leader_curve",&STEP::ObjectHelper::Construct ) -, SchemaEntry("leader_directed_callout",&STEP::ObjectHelper::Construct ) -, SchemaEntry("leader_directed_dimension",&STEP::ObjectHelper::Construct ) -, SchemaEntry("leader_terminator",&STEP::ObjectHelper::Construct ) -, SchemaEntry("length_measure_with_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("length_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("light_source",&STEP::ObjectHelper::Construct ) -, SchemaEntry("light_source_ambient",&STEP::ObjectHelper::Construct ) -, SchemaEntry("light_source_directional",&STEP::ObjectHelper::Construct ) -, SchemaEntry("light_source_positional",&STEP::ObjectHelper::Construct ) -, SchemaEntry("light_source_spot",&STEP::ObjectHelper::Construct ) -, SchemaEntry("limits_and_fits",&STEP::ObjectHelper::Construct ) -, SchemaEntry("line",&STEP::ObjectHelper::Construct ) -, SchemaEntry("line_profile_tolerance",&STEP::ObjectHelper::Construct ) -, SchemaEntry("linear_dimension",&STEP::ObjectHelper::Construct ) -, SchemaEntry("simple_clause",&STEP::ObjectHelper::Construct ) -, SchemaEntry("literal_conjunction",&STEP::ObjectHelper::Construct ) -, SchemaEntry("literal_disjunction",&STEP::ObjectHelper::Construct ) -, SchemaEntry("local_time",&STEP::ObjectHelper::Construct ) -, SchemaEntry("logical_literal",&STEP::ObjectHelper::Construct ) -, SchemaEntry("logical_representation_item",&STEP::ObjectHelper::Construct ) -, SchemaEntry("loop",&STEP::ObjectHelper::Construct ) -, SchemaEntry("loss_tangent_measure_with_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("lot_effectivity",&STEP::ObjectHelper::Construct ) -, SchemaEntry("luminous_flux_measure_with_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("luminous_flux_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("luminous_intensity_measure_with_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("luminous_intensity_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("magnetic_flux_density_measure_with_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("magnetic_flux_density_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("magnetic_flux_measure_with_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("magnetic_flux_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("make_from_usage_option",&STEP::ObjectHelper::Construct ) -, SchemaEntry("manifold_subsurface_shape_representation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("manifold_surface_shape_representation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("mass_measure_with_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("mass_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("material_designation_characterization",&STEP::ObjectHelper::Construct ) -, SchemaEntry("material_property",&STEP::ObjectHelper::Construct ) -, SchemaEntry("property_definition_representation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("material_property_representation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("measure_qualification",&STEP::ObjectHelper::Construct ) -, SchemaEntry("measure_representation_item",&STEP::ObjectHelper::Construct ) -, SchemaEntry("product_context",&STEP::ObjectHelper::Construct ) -, SchemaEntry("mechanical_context",&STEP::ObjectHelper::Construct ) -, SchemaEntry("mechanical_design_and_draughting_relationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("mechanical_design_geometric_presentation_area",&STEP::ObjectHelper::Construct ) -, SchemaEntry("mechanical_design_geometric_presentation_representation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("mechanical_design_presentation_representation_with_draughting",&STEP::ObjectHelper::Construct ) -, SchemaEntry("mechanical_design_shaded_presentation_area",&STEP::ObjectHelper::Construct ) -, SchemaEntry("mechanical_design_shaded_presentation_representation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("min_and_major_ply_orientation_basis",&STEP::ObjectHelper::Construct ) -, SchemaEntry("modified_geometric_tolerance",&STEP::ObjectHelper::Construct ) -, SchemaEntry("modified_solid_with_placed_configuration",&STEP::ObjectHelper::Construct ) -, SchemaEntry("moments_of_inertia_representation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("multi_language_attribute_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("multiple_arity_boolean_expression",&STEP::ObjectHelper::Construct ) -, SchemaEntry("multiple_arity_generic_expression",&STEP::ObjectHelper::Construct ) -, SchemaEntry("multiple_arity_numeric_expression",&STEP::ObjectHelper::Construct ) -, SchemaEntry("name_attribute",&STEP::ObjectHelper::Construct ) -, SchemaEntry("next_assembly_usage_occurrence",&STEP::ObjectHelper::Construct ) -, SchemaEntry("non_manifold_surface_shape_representation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("null_representation_item",&STEP::ObjectHelper::Construct ) -, SchemaEntry("numeric_expression",&STEP::ObjectHelper::Construct ) -, SchemaEntry("object_role",&STEP::ObjectHelper::Construct ) -, SchemaEntry("offset_curve_2d",&STEP::ObjectHelper::Construct ) -, SchemaEntry("offset_curve_3d",&STEP::ObjectHelper::Construct ) -, SchemaEntry("offset_surface",&STEP::ObjectHelper::Construct ) -, SchemaEntry("one_direction_repeat_factor",&STEP::ObjectHelper::Construct ) -, SchemaEntry("open_shell",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ordinal_date",&STEP::ObjectHelper::Construct ) -, SchemaEntry("projection_directed_callout",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ordinate_dimension",&STEP::ObjectHelper::Construct ) -, SchemaEntry("organization",&STEP::ObjectHelper::Construct ) -, SchemaEntry("organization_relationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("organization_role",&STEP::ObjectHelper::Construct ) -, SchemaEntry("organizational_address",&STEP::ObjectHelper::Construct ) -, SchemaEntry("organizational_project",&STEP::ObjectHelper::Construct ) -, SchemaEntry("organizational_project_relationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("organizational_project_role",&STEP::ObjectHelper::Construct ) -, SchemaEntry("oriented_closed_shell",&STEP::ObjectHelper::Construct ) -, SchemaEntry("oriented_edge",&STEP::ObjectHelper::Construct ) -, SchemaEntry("oriented_face",&STEP::ObjectHelper::Construct ) -, SchemaEntry("oriented_open_shell",&STEP::ObjectHelper::Construct ) -, SchemaEntry("path",&STEP::ObjectHelper::Construct ) -, SchemaEntry("oriented_path",&STEP::ObjectHelper::Construct ) -, SchemaEntry("oriented_surface",&STEP::ObjectHelper::Construct ) -, SchemaEntry("outer_boundary_curve",&STEP::ObjectHelper::Construct ) -, SchemaEntry("package_product_concept_feature",&STEP::ObjectHelper::Construct ) -, SchemaEntry("parabola",&STEP::ObjectHelper::Construct ) -, SchemaEntry("parallel_offset",&STEP::ObjectHelper::Construct ) -, SchemaEntry("parallelism_tolerance",&STEP::ObjectHelper::Construct ) -, SchemaEntry("parametric_representation_context",&STEP::ObjectHelper::Construct ) -, SchemaEntry("partial_document_with_structured_text_representation_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("pcurve",&STEP::ObjectHelper::Construct ) -, SchemaEntry("percentage_laminate_definition",&STEP::ObjectHelper::Construct ) -, SchemaEntry("zone_structural_makeup",&STEP::ObjectHelper::Construct ) -, SchemaEntry("percentage_laminate_table",&STEP::ObjectHelper::Construct ) -, SchemaEntry("percentage_ply_definition",&STEP::ObjectHelper::Construct ) -, SchemaEntry("perpendicular_to",&STEP::ObjectHelper::Construct ) -, SchemaEntry("perpendicularity_tolerance",&STEP::ObjectHelper::Construct ) -, SchemaEntry("person",&STEP::ObjectHelper::Construct ) -, SchemaEntry("person_and_organization",&STEP::ObjectHelper::Construct ) -, SchemaEntry("person_and_organization_address",&STEP::ObjectHelper::Construct ) -, SchemaEntry("person_and_organization_role",&STEP::ObjectHelper::Construct ) -, SchemaEntry("personal_address",&STEP::ObjectHelper::Construct ) -, SchemaEntry("physical_breakdown_context",&STEP::ObjectHelper::Construct ) -, SchemaEntry("physical_element_usage",&STEP::ObjectHelper::Construct ) -, SchemaEntry("presentation_view",&STEP::ObjectHelper::Construct ) -, SchemaEntry("picture_representation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("placed_datum_target_feature",&STEP::ObjectHelper::Construct ) -, SchemaEntry("placed_feature",&STEP::ObjectHelper::Construct ) -, SchemaEntry("planar_extent",&STEP::ObjectHelper::Construct ) -, SchemaEntry("planar_box",&STEP::ObjectHelper::Construct ) -, SchemaEntry("plane",&STEP::ObjectHelper::Construct ) -, SchemaEntry("plane_angle_measure_with_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("plane_angle_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("plus_minus_tolerance",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ply_laminate_definition",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ply_laminate_sequence_definition",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ply_laminate_table",&STEP::ObjectHelper::Construct ) -, SchemaEntry("point_and_vector",&STEP::ObjectHelper::Construct ) -, SchemaEntry("point_on_curve",&STEP::ObjectHelper::Construct ) -, SchemaEntry("point_on_surface",&STEP::ObjectHelper::Construct ) -, SchemaEntry("point_path",&STEP::ObjectHelper::Construct ) -, SchemaEntry("point_replica",&STEP::ObjectHelper::Construct ) -, SchemaEntry("point_style",&STEP::ObjectHelper::Construct ) -, SchemaEntry("polar_complex_number_literal",&STEP::ObjectHelper::Construct ) -, SchemaEntry("poly_loop",&STEP::ObjectHelper::Construct ) -, SchemaEntry("polyline",&STEP::ObjectHelper::Construct ) -, SchemaEntry("position_tolerance",&STEP::ObjectHelper::Construct ) -, SchemaEntry("positioned_sketch",&STEP::ObjectHelper::Construct ) -, SchemaEntry("power_measure_with_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("power_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("pre_defined_symbol",&STEP::ObjectHelper::Construct ) -, SchemaEntry("pre_defined_dimension_symbol",&STEP::ObjectHelper::Construct ) -, SchemaEntry("pre_defined_geometrical_tolerance_symbol",&STEP::ObjectHelper::Construct ) -, SchemaEntry("pre_defined_marker",&STEP::ObjectHelper::Construct ) -, SchemaEntry("pre_defined_point_marker_symbol",&STEP::ObjectHelper::Construct ) -, SchemaEntry("pre_defined_surface_condition_symbol",&STEP::ObjectHelper::Construct ) -, SchemaEntry("pre_defined_surface_side_style",&STEP::ObjectHelper::Construct ) -, SchemaEntry("pre_defined_terminator_symbol",&STEP::ObjectHelper::Construct ) -, SchemaEntry("pre_defined_tile",&STEP::ObjectHelper::Construct ) -, SchemaEntry("precision_qualifier",&STEP::ObjectHelper::Construct ) -, SchemaEntry("predefined_picture_representation_item",&STEP::ObjectHelper::Construct ) -, SchemaEntry("presentation_layer_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("presentation_size",&STEP::ObjectHelper::Construct ) -, SchemaEntry("presentation_style_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("presentation_style_by_context",&STEP::ObjectHelper::Construct ) -//, SchemaEntry("presented_item_representation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("pressure_measure_with_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("pressure_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("procedural_representation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("procedural_representation_sequence",&STEP::ObjectHelper::Construct ) -, SchemaEntry("procedural_shape_representation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("procedural_shape_representation_sequence",&STEP::ObjectHelper::Construct ) -, SchemaEntry("product",&STEP::ObjectHelper::Construct ) -, SchemaEntry("product_category",&STEP::ObjectHelper::Construct ) -, SchemaEntry("product_class",&STEP::ObjectHelper::Construct ) -, SchemaEntry("product_concept",&STEP::ObjectHelper::Construct ) -, SchemaEntry("product_concept_context",&STEP::ObjectHelper::Construct ) -, SchemaEntry("product_concept_feature_association",&STEP::ObjectHelper::Construct ) -, SchemaEntry("product_concept_feature_category_usage",&STEP::ObjectHelper::Construct ) -, SchemaEntry("product_concept_relationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("product_definition_context_association",&STEP::ObjectHelper::Construct ) -, SchemaEntry("product_definition_context_role",&STEP::ObjectHelper::Construct ) -, SchemaEntry("product_definition_element_relationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("product_definition_formation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("product_definition_formation_relationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("product_definition_formation_with_specified_source",&STEP::ObjectHelper::Construct ) -, SchemaEntry("product_definition_group_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("product_definition_occurrence_relationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("product_definition_shape",&STEP::ObjectHelper::Construct ) -, SchemaEntry("product_definition_substitute",&STEP::ObjectHelper::Construct ) -, SchemaEntry("product_definition_with_associated_documents",&STEP::ObjectHelper::Construct ) -, SchemaEntry("product_identification",&STEP::ObjectHelper::Construct ) -, SchemaEntry("product_material_composition_relationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("product_related_product_category",&STEP::ObjectHelper::Construct ) -, SchemaEntry("product_specification",&STEP::ObjectHelper::Construct ) -, SchemaEntry("tolerance_zone_definition",&STEP::ObjectHelper::Construct ) -, SchemaEntry("projected_zone_definition",&STEP::ObjectHelper::Construct ) -, SchemaEntry("projection_curve",&STEP::ObjectHelper::Construct ) -, SchemaEntry("promissory_usage_occurrence",&STEP::ObjectHelper::Construct ) -, SchemaEntry("property_definition_relationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("qualified_representation_item",&STEP::ObjectHelper::Construct ) -, SchemaEntry("qualitative_uncertainty",&STEP::ObjectHelper::Construct ) -, SchemaEntry("quantified_assembly_component_usage",&STEP::ObjectHelper::Construct ) -, SchemaEntry("quasi_uniform_curve",&STEP::ObjectHelper::Construct ) -, SchemaEntry("quasi_uniform_surface",&STEP::ObjectHelper::Construct ) -, SchemaEntry("radioactivity_measure_with_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("radioactivity_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("radius_dimension",&STEP::ObjectHelper::Construct ) -, SchemaEntry("range_characteristic",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ratio_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("rational_b_spline_curve",&STEP::ObjectHelper::Construct ) -, SchemaEntry("rational_b_spline_surface",&STEP::ObjectHelper::Construct ) -, SchemaEntry("rational_representation_item",&STEP::ObjectHelper::Construct ) -, SchemaEntry("real_literal",&STEP::ObjectHelper::Construct ) -, SchemaEntry("real_representation_item",&STEP::ObjectHelper::Construct ) -, SchemaEntry("rectangular_composite_surface",&STEP::ObjectHelper::Construct ) -, SchemaEntry("rectangular_trimmed_surface",&STEP::ObjectHelper::Construct ) -, SchemaEntry("referenced_modified_datum",&STEP::ObjectHelper::Construct ) -, SchemaEntry("relative_event_occurrence",&STEP::ObjectHelper::Construct ) -, SchemaEntry("rep_item_group",&STEP::ObjectHelper::Construct ) -, SchemaEntry("reparametrised_composite_curve_segment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("representation_relationship_with_transformation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("requirement_assigned_object",&STEP::ObjectHelper::Construct ) -, SchemaEntry("requirement_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("requirement_source",&STEP::ObjectHelper::Construct ) -, SchemaEntry("requirement_view_definition_relationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("resistance_measure_with_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("resistance_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("revolved_area_solid",&STEP::ObjectHelper::Construct ) -, SchemaEntry("revolved_face_solid",&STEP::ObjectHelper::Construct ) -, SchemaEntry("revolved_face_solid_with_trim_conditions",&STEP::ObjectHelper::Construct ) -, SchemaEntry("right_angular_wedge",&STEP::ObjectHelper::Construct ) -, SchemaEntry("right_circular_cone",&STEP::ObjectHelper::Construct ) -, SchemaEntry("right_circular_cylinder",&STEP::ObjectHelper::Construct ) -, SchemaEntry("right_to_usage_association",&STEP::ObjectHelper::Construct ) -, SchemaEntry("role_association",&STEP::ObjectHelper::Construct ) -, SchemaEntry("roundness_tolerance",&STEP::ObjectHelper::Construct ) -, SchemaEntry("row_representation_item",&STEP::ObjectHelper::Construct ) -, SchemaEntry("row_value",&STEP::ObjectHelper::Construct ) -, SchemaEntry("row_variable",&STEP::ObjectHelper::Construct ) -, SchemaEntry("rule_action",&STEP::ObjectHelper::Construct ) -, SchemaEntry("rule_condition",&STEP::ObjectHelper::Construct ) -, SchemaEntry("rule_set",&STEP::ObjectHelper::Construct ) -, SchemaEntry("rule_set_group",&STEP::ObjectHelper::Construct ) -, SchemaEntry("rule_superseded_assignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("rule_supersedence",&STEP::ObjectHelper::Construct ) -, SchemaEntry("surface_curve_swept_area_solid",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ruled_surface_swept_area_solid",&STEP::ObjectHelper::Construct ) -, SchemaEntry("runout_zone_definition",&STEP::ObjectHelper::Construct ) -, SchemaEntry("runout_zone_orientation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("runout_zone_orientation_reference_direction",&STEP::ObjectHelper::Construct ) -, SchemaEntry("satisfied_requirement",&STEP::ObjectHelper::Construct ) -, SchemaEntry("satisfies_requirement",&STEP::ObjectHelper::Construct ) -, SchemaEntry("satisfying_item",&STEP::ObjectHelper::Construct ) -, SchemaEntry("scalar_variable",&STEP::ObjectHelper::Construct ) -, SchemaEntry("scattering_parameter",&STEP::ObjectHelper::Construct ) -, SchemaEntry("sculptured_solid",&STEP::ObjectHelper::Construct ) -, SchemaEntry("seam_curve",&STEP::ObjectHelper::Construct ) -, SchemaEntry("security_classification",&STEP::ObjectHelper::Construct ) -, SchemaEntry("security_classification_level",&STEP::ObjectHelper::Construct ) -, SchemaEntry("serial_numbered_effectivity",&STEP::ObjectHelper::Construct ) -, SchemaEntry("shape_aspect_associativity",&STEP::ObjectHelper::Construct ) -, SchemaEntry("shape_aspect_deriving_relationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("shape_definition_representation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("shape_dimension_representation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("shape_feature_definition",&STEP::ObjectHelper::Construct ) -, SchemaEntry("shape_representation_with_parameters",&STEP::ObjectHelper::Construct ) -, SchemaEntry("shell_based_surface_model",&STEP::ObjectHelper::Construct ) -, SchemaEntry("shell_based_wireframe_model",&STEP::ObjectHelper::Construct ) -, SchemaEntry("shell_based_wireframe_shape_representation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("si_absorbed_dose_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("si_capacitance_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("si_conductance_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("si_dose_equivalent_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("si_electric_charge_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("si_electric_potential_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("si_energy_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("si_force_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("si_frequency_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("si_illuminance_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("si_inductance_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("si_magnetic_flux_density_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("si_magnetic_flux_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("si_power_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("si_pressure_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("si_radioactivity_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("si_resistance_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("si_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("simple_boolean_expression",&STEP::ObjectHelper::Construct ) -, SchemaEntry("simple_numeric_expression",&STEP::ObjectHelper::Construct ) -, SchemaEntry("slash_expression",&STEP::ObjectHelper::Construct ) -, SchemaEntry("smeared_material_definition",&STEP::ObjectHelper::Construct ) -, SchemaEntry("solid_angle_measure_with_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("solid_angle_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("solid_curve_font",&STEP::ObjectHelper::Construct ) -, SchemaEntry("solid_replica",&STEP::ObjectHelper::Construct ) -, SchemaEntry("solid_with_chamfered_edges",&STEP::ObjectHelper::Construct ) -, SchemaEntry("solid_with_angle_based_chamfer",&STEP::ObjectHelper::Construct ) -, SchemaEntry("solid_with_shape_element_pattern",&STEP::ObjectHelper::Construct ) -, SchemaEntry("solid_with_circular_pattern",&STEP::ObjectHelper::Construct ) -, SchemaEntry("solid_with_depression",&STEP::ObjectHelper::Construct ) -, SchemaEntry("solid_with_pocket",&STEP::ObjectHelper::Construct ) -, SchemaEntry("solid_with_circular_pocket",&STEP::ObjectHelper::Construct ) -, SchemaEntry("solid_with_protrusion",&STEP::ObjectHelper::Construct ) -, SchemaEntry("solid_with_circular_protrusion",&STEP::ObjectHelper::Construct ) -, SchemaEntry("solid_with_hole",&STEP::ObjectHelper::Construct ) -, SchemaEntry("solid_with_stepped_round_hole",&STEP::ObjectHelper::Construct ) -, SchemaEntry("solid_with_conical_bottom_round_hole",&STEP::ObjectHelper::Construct ) -, SchemaEntry("solid_with_constant_radius_edge_blend",&STEP::ObjectHelper::Construct ) -, SchemaEntry("solid_with_slot",&STEP::ObjectHelper::Construct ) -, SchemaEntry("solid_with_curved_slot",&STEP::ObjectHelper::Construct ) -, SchemaEntry("solid_with_double_offset_chamfer",&STEP::ObjectHelper::Construct ) -, SchemaEntry("solid_with_flat_bottom_round_hole",&STEP::ObjectHelper::Construct ) -, SchemaEntry("solid_with_general_pocket",&STEP::ObjectHelper::Construct ) -, SchemaEntry("solid_with_general_protrusion",&STEP::ObjectHelper::Construct ) -, SchemaEntry("solid_with_groove",&STEP::ObjectHelper::Construct ) -, SchemaEntry("solid_with_incomplete_circular_pattern",&STEP::ObjectHelper::Construct ) -, SchemaEntry("solid_with_rectangular_pattern",&STEP::ObjectHelper::Construct ) -, SchemaEntry("solid_with_incomplete_rectangular_pattern",&STEP::ObjectHelper::Construct ) -, SchemaEntry("solid_with_rectangular_pocket",&STEP::ObjectHelper::Construct ) -, SchemaEntry("solid_with_rectangular_protrusion",&STEP::ObjectHelper::Construct ) -, SchemaEntry("solid_with_single_offset_chamfer",&STEP::ObjectHelper::Construct ) -, SchemaEntry("solid_with_spherical_bottom_round_hole",&STEP::ObjectHelper::Construct ) -, SchemaEntry("solid_with_stepped_round_hole_and_conical_transitions",&STEP::ObjectHelper::Construct ) -, SchemaEntry("solid_with_straight_slot",&STEP::ObjectHelper::Construct ) -, SchemaEntry("solid_with_tee_section_slot",&STEP::ObjectHelper::Construct ) -, SchemaEntry("solid_with_through_depression",&STEP::ObjectHelper::Construct ) -, SchemaEntry("solid_with_trapezoidal_section_slot",&STEP::ObjectHelper::Construct ) -, SchemaEntry("solid_with_variable_radius_edge_blend",&STEP::ObjectHelper::Construct ) -, SchemaEntry("source_for_requirement",&STEP::ObjectHelper::Construct ) -, SchemaEntry("sourced_requirement",&STEP::ObjectHelper::Construct ) -, SchemaEntry("specification_definition",&STEP::ObjectHelper::Construct ) -, SchemaEntry("specified_higher_usage_occurrence",&STEP::ObjectHelper::Construct ) -, SchemaEntry("sphere",&STEP::ObjectHelper::Construct ) -, SchemaEntry("spherical_surface",&STEP::ObjectHelper::Construct ) -, SchemaEntry("start_request",&STEP::ObjectHelper::Construct ) -, SchemaEntry("start_work",&STEP::ObjectHelper::Construct ) -, SchemaEntry("straightness_tolerance",&STEP::ObjectHelper::Construct ) -, SchemaEntry("structured_dimension_callout",&STEP::ObjectHelper::Construct ) -, SchemaEntry("structured_text_composition",&STEP::ObjectHelper::Construct ) -, SchemaEntry("structured_text_representation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("subedge",&STEP::ObjectHelper::Construct ) -, SchemaEntry("subface",&STEP::ObjectHelper::Construct ) -, SchemaEntry("supplied_part_relationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("surface_condition_callout",&STEP::ObjectHelper::Construct ) -, SchemaEntry("swept_surface",&STEP::ObjectHelper::Construct ) -, SchemaEntry("surface_of_linear_extrusion",&STEP::ObjectHelper::Construct ) -, SchemaEntry("surface_of_revolution",&STEP::ObjectHelper::Construct ) -, SchemaEntry("surface_patch",&STEP::ObjectHelper::Construct ) -, SchemaEntry("surface_profile_tolerance",&STEP::ObjectHelper::Construct ) -, SchemaEntry("surface_rendering_properties",&STEP::ObjectHelper::Construct ) -, SchemaEntry("surface_replica",&STEP::ObjectHelper::Construct ) -, SchemaEntry("surface_side_style",&STEP::ObjectHelper::Construct ) -, SchemaEntry("surface_style_boundary",&STEP::ObjectHelper::Construct ) -, SchemaEntry("surface_style_control_grid",&STEP::ObjectHelper::Construct ) -, SchemaEntry("surface_style_fill_area",&STEP::ObjectHelper::Construct ) -, SchemaEntry("surface_style_parameter_line",&STEP::ObjectHelper::Construct ) -, SchemaEntry("surface_style_reflectance_ambient",&STEP::ObjectHelper::Construct ) -, SchemaEntry("surface_style_reflectance_ambient_diffuse",&STEP::ObjectHelper::Construct ) -, SchemaEntry("surface_style_reflectance_ambient_diffuse_specular",&STEP::ObjectHelper::Construct ) -, SchemaEntry("surface_style_rendering",&STEP::ObjectHelper::Construct ) -, SchemaEntry("surface_style_rendering_with_properties",&STEP::ObjectHelper::Construct ) -, SchemaEntry("surface_style_segmentation_curve",&STEP::ObjectHelper::Construct ) -, SchemaEntry("surface_style_silhouette",&STEP::ObjectHelper::Construct ) -, SchemaEntry("surface_style_transparent",&STEP::ObjectHelper::Construct ) -, SchemaEntry("surface_style_usage",&STEP::ObjectHelper::Construct ) -, SchemaEntry("surface_texture_representation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("surfaced_open_shell",&STEP::ObjectHelper::Construct ) -, SchemaEntry("swept_disk_solid",&STEP::ObjectHelper::Construct ) -, SchemaEntry("symbol",&STEP::ObjectHelper::Construct ) -, SchemaEntry("symbol_colour",&STEP::ObjectHelper::Construct ) -, SchemaEntry("symbol_representation_map",&STEP::ObjectHelper::Construct ) -, SchemaEntry("symbol_style",&STEP::ObjectHelper::Construct ) -, SchemaEntry("symbol_target",&STEP::ObjectHelper::Construct ) -, SchemaEntry("symmetric_shape_aspect",&STEP::ObjectHelper::Construct ) -, SchemaEntry("symmetry_tolerance",&STEP::ObjectHelper::Construct ) -, SchemaEntry("table_representation_item",&STEP::ObjectHelper::Construct ) -, SchemaEntry("tactile_appearance_representation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("tagged_text_format",&STEP::ObjectHelper::Construct ) -, SchemaEntry("tagged_text_item",&STEP::ObjectHelper::Construct ) -, SchemaEntry("tangent",&STEP::ObjectHelper::Construct ) -, SchemaEntry("text_font",&STEP::ObjectHelper::Construct ) -, SchemaEntry("text_font_family",&STEP::ObjectHelper::Construct ) -, SchemaEntry("text_font_in_family",&STEP::ObjectHelper::Construct ) -, SchemaEntry("text_literal_with_associated_curves",&STEP::ObjectHelper::Construct ) -, SchemaEntry("text_literal_with_blanking_box",&STEP::ObjectHelper::Construct ) -, SchemaEntry("text_literal_with_extent",&STEP::ObjectHelper::Construct ) -, SchemaEntry("text_string_representation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("text_style",&STEP::ObjectHelper::Construct ) -, SchemaEntry("text_style_for_defined_font",&STEP::ObjectHelper::Construct ) -, SchemaEntry("text_style_with_box_characteristics",&STEP::ObjectHelper::Construct ) -, SchemaEntry("text_style_with_mirror",&STEP::ObjectHelper::Construct ) -, SchemaEntry("text_style_with_spacing",&STEP::ObjectHelper::Construct ) -, SchemaEntry("thermal_resistance_measure_with_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("thermal_resistance_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("thermodynamic_temperature_measure_with_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("thermodynamic_temperature_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("thickened_face_solid",&STEP::ObjectHelper::Construct ) -, SchemaEntry("thickness_laminate_definition",&STEP::ObjectHelper::Construct ) -, SchemaEntry("thickness_laminate_table",&STEP::ObjectHelper::Construct ) -, SchemaEntry("time_interval",&STEP::ObjectHelper::Construct ) -, SchemaEntry("time_interval_based_effectivity",&STEP::ObjectHelper::Construct ) -, SchemaEntry("time_interval_relationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("time_interval_role",&STEP::ObjectHelper::Construct ) -, SchemaEntry("time_interval_with_bounds",&STEP::ObjectHelper::Construct ) -, SchemaEntry("time_measure_with_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("time_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("tolerance_value",&STEP::ObjectHelper::Construct ) -, SchemaEntry("tolerance_zone",&STEP::ObjectHelper::Construct ) -, SchemaEntry("tolerance_zone_form",&STEP::ObjectHelper::Construct ) -, SchemaEntry("torus",&STEP::ObjectHelper::Construct ) -, SchemaEntry("total_runout_tolerance",&STEP::ObjectHelper::Construct ) -, SchemaEntry("track_blended_solid",&STEP::ObjectHelper::Construct ) -, SchemaEntry("track_blended_solid_with_end_conditions",&STEP::ObjectHelper::Construct ) -, SchemaEntry("trimmed_curve",&STEP::ObjectHelper::Construct ) -, SchemaEntry("two_direction_repeat_factor",&STEP::ObjectHelper::Construct ) -, SchemaEntry("type_qualifier",&STEP::ObjectHelper::Construct ) -, SchemaEntry("unary_generic_expression",&STEP::ObjectHelper::Construct ) -, SchemaEntry("unary_numeric_expression",&STEP::ObjectHelper::Construct ) -, SchemaEntry("uncertainty_assigned_representation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("uncertainty_measure_with_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("uniform_curve",&STEP::ObjectHelper::Construct ) -, SchemaEntry("uniform_resource_identifier",&STEP::ObjectHelper::Construct ) -, SchemaEntry("uniform_surface",&STEP::ObjectHelper::Construct ) -, SchemaEntry("usage_association",&STEP::ObjectHelper::Construct ) -, SchemaEntry("user_defined_curve_font",&STEP::ObjectHelper::Construct ) -, SchemaEntry("user_defined_marker",&STEP::ObjectHelper::Construct ) -, SchemaEntry("user_defined_terminator_symbol",&STEP::ObjectHelper::Construct ) -, SchemaEntry("user_selected_shape_elements",&STEP::ObjectHelper::Construct ) -, SchemaEntry("value_range",&STEP::ObjectHelper::Construct ) -, SchemaEntry("value_representation_item",&STEP::ObjectHelper::Construct ) -, SchemaEntry("variable_semantics",&STEP::ObjectHelper::Construct ) -, SchemaEntry("variational_representation_item",&STEP::ObjectHelper::Construct ) -, SchemaEntry("vector",&STEP::ObjectHelper::Construct ) -, SchemaEntry("vector_style",&STEP::ObjectHelper::Construct ) -, SchemaEntry("velocity_measure_with_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("velocity_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("versioned_action_request",&STEP::ObjectHelper::Construct ) -, SchemaEntry("vertex",&STEP::ObjectHelper::Construct ) -, SchemaEntry("vertex_loop",&STEP::ObjectHelper::Construct ) -, SchemaEntry("vertex_point",&STEP::ObjectHelper::Construct ) -, SchemaEntry("vertex_shell",&STEP::ObjectHelper::Construct ) -, SchemaEntry("view_volume",&STEP::ObjectHelper::Construct ) -, SchemaEntry("visual_appearance_representation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("volume_measure_with_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("volume_unit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("week_of_year_and_day_date",&STEP::ObjectHelper::Construct ) -, SchemaEntry("wire_shell",&STEP::ObjectHelper::Construct ) -, SchemaEntry("year_month",&STEP::ObjectHelper::Construct ) - - }; -} - -// ----------------------------------------------------------------------------------------------------------- -void StepFile::GetSchema(EXPRESS::ConversionSchema& out) -{ - out = EXPRESS::ConversionSchema(schema_raw); -} - -namespace STEP { - - // ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const STEP::DB& db, const LIST& params, NotImplemented* in) -{ - return 0; -} -*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, measure_with_unit* in) -{ - size_t base = 0; - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to measure_with_unit"); } do { // convert the 'value_component' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - try { GenericConvert( in->value_component, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to measure_with_unit to be a `measure_value`")); } - } while(0); - do { // convert the 'unit_component' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } - try { GenericConvert( in->unit_component, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to measure_with_unit to be a `unit`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, absorbed_dose_measure_with_unit* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to absorbed_dose_measure_with_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, derived_unit* in) -{ - size_t base = 0; - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to derived_unit"); } do { // convert the 'elements' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - try { GenericConvert( in->elements, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to derived_unit to be a `SET [1:?] OF derived_unit_element`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, absorbed_dose_unit* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to absorbed_dose_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB&, const LIST&, abstract_variable*) { - size_t base = 0; - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, acceleration_measure_with_unit* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to acceleration_measure_with_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, acceleration_unit* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to acceleration_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, action* in) -{ - size_t base = 0; - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to action"); } do { // convert the 'name' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - try { GenericConvert( in->name, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to action to be a `label`")); } - } while(0); - do { // convert the 'description' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->description, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to action to be a `text`")); } - } while(0); - do { // convert the 'chosen_method' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2]=true; break; } - try { GenericConvert( in->chosen_method, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to action to be a `action_method`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, action_assignment* in) -{ - size_t base = 0; - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to action_assignment"); } do { // convert the 'assigned_action' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - try { GenericConvert( in->assigned_action, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to action_assignment to be a `action`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, action_method* in) -{ - size_t base = 0; - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to action_method"); } do { // convert the 'name' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - try { GenericConvert( in->name, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to action_method to be a `label`")); } - } while(0); - do { // convert the 'description' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->description, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to action_method to be a `text`")); } - } while(0); - do { // convert the 'consequence' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2]=true; break; } - try { GenericConvert( in->consequence, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to action_method to be a `text`")); } - } while(0); - do { // convert the 'purpose' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[3]=true; break; } - try { GenericConvert( in->purpose, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to action_method to be a `text`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, action_method_assignment* in) -{ - size_t base = 0; - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to action_method_assignment"); } do { // convert the 'assigned_action_method' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - try { GenericConvert( in->assigned_action_method, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to action_method_assignment to be a `action_method`")); } - } while(0); - do { // convert the 'role' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } - try { GenericConvert( in->role, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to action_method_assignment to be a `action_method_role`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, action_method_relationship* in) -{ - size_t base = 0; - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to action_method_relationship"); } do { // convert the 'name' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - try { GenericConvert( in->name, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to action_method_relationship to be a `label`")); } - } while(0); - do { // convert the 'description' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->description, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to action_method_relationship to be a `text`")); } - } while(0); - do { // convert the 'relating_method' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2]=true; break; } - try { GenericConvert( in->relating_method, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to action_method_relationship to be a `action_method`")); } - } while(0); - do { // convert the 'related_method' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[3]=true; break; } - try { GenericConvert( in->related_method, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to action_method_relationship to be a `action_method`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, action_request_assignment* in) -{ - size_t base = 0; - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to action_request_assignment"); } do { // convert the 'assigned_action_request' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - try { GenericConvert( in->assigned_action_request, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to action_request_assignment to be a `versioned_action_request`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill

(const DB& db, const LIST& params, address* in) -{ - size_t base = 0; - if (params.GetSize() < 12) { throw STEP::TypeError("expected 12 arguments to address"); } do { // convert the 'internal_location' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->internal_location, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to address to be a `label`")); } - } while(0); - do { // convert the 'street_number' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->street_number, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to address to be a `label`")); } - } while(0); - do { // convert the 'street' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2]=true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->street, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to address to be a `label`")); } - } while(0); - do { // convert the 'postal_box' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[3]=true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->postal_box, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to address to be a `label`")); } - } while(0); - do { // convert the 'town' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[4]=true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->town, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to address to be a `label`")); } - } while(0); - do { // convert the 'region' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[5]=true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->region, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to address to be a `label`")); } - } while(0); - do { // convert the 'postal_code' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[6]=true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->postal_code, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to address to be a `label`")); } - } while(0); - do { // convert the 'country' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[7]=true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->country, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 7 to address to be a `label`")); } - } while(0); - do { // convert the 'facsimile_number' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[8]=true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->facsimile_number, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 8 to address to be a `label`")); } - } while(0); - do { // convert the 'telephone_number' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[9]=true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->telephone_number, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 9 to address to be a `label`")); } - } while(0); - do { // convert the 'electronic_mail_address' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[10]=true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->electronic_mail_address, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 10 to address to be a `label`")); } - } while(0); - do { // convert the 'telex_number' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[11]=true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->telex_number, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 11 to address to be a `label`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, representation* in) -{ - size_t base = 0; - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to representation"); } do { // convert the 'name' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - try { GenericConvert( in->name, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to representation to be a `label`")); } - } while(0); - do { // convert the 'items' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } - try { GenericConvert( in->items, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to representation to be a `SET [1:?] OF representation_item`")); } - } while(0); - do { // convert the 'context_of_items' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2]=true; break; } - try { GenericConvert( in->context_of_items, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to representation to be a `representation_context`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, shape_representation* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to shape_representation"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, advanced_brep_shape_representation* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to advanced_brep_shape_representation"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, face_surface* in) -{ - size_t base = 0; - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to face_surface"); } do { // convert the 'face_geometry' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - try { GenericConvert( in->face_geometry, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to face_surface to be a `surface`")); } - } while(0); - do { // convert the 'same_sense' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } - try { GenericConvert( in->same_sense, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to face_surface to be a `BOOLEAN`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, advanced_face* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to advanced_face"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, amount_of_substance_measure_with_unit* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to amount_of_substance_measure_with_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, named_unit* in) -{ - size_t base = 0; - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to named_unit"); } do { // convert the 'dimensions' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - try { GenericConvert( in->dimensions, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to named_unit to be a `dimensional_exponents`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, amount_of_substance_unit* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to amount_of_substance_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB&, const LIST&, angle_direction_reference*) -{ - size_t base = 0; - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, representation_item* in) -{ - size_t base = 0; - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to representation_item"); } do { // convert the 'name' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - try { GenericConvert( in->name, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to representation_item to be a `label`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, geometric_representation_item* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to geometric_representation_item"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, draughting_callout* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to draughting_callout"); } do { // convert the 'contents' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - try { GenericConvert( in->contents, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to draughting_callout to be a `SET [1:?] OF draughting_callout_element`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, dimension_curve_directed_callout* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to dimension_curve_directed_callout"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, angular_dimension* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to angular_dimension"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, shape_aspect_relationship* in) -{ - size_t base = 0; - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to shape_aspect_relationship"); } do { // convert the 'name' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - try { GenericConvert( in->name, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to shape_aspect_relationship to be a `label`")); } - } while(0); - do { // convert the 'description' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->description, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to shape_aspect_relationship to be a `text`")); } - } while(0); - do { // convert the 'relating_shape_aspect' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2]=true; break; } - try { GenericConvert( in->relating_shape_aspect, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to shape_aspect_relationship to be a `shape_aspect`")); } - } while(0); - do { // convert the 'related_shape_aspect' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[3]=true; break; } - try { GenericConvert( in->related_shape_aspect, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to shape_aspect_relationship to be a `shape_aspect`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, dimensional_location* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to dimensional_location"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, angular_location* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to angular_location"); } do { // convert the 'angle_selection' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->angle_selection, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to angular_location to be a `angle_relator`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, dimensional_size* in) -{ - size_t base = 0; - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to dimensional_size"); } do { // convert the 'applies_to' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - try { GenericConvert( in->applies_to, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to dimensional_size to be a `shape_aspect`")); } - } while(0); - do { // convert the 'name' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } - try { GenericConvert( in->name, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to dimensional_size to be a `label`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, angular_size* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to angular_size"); } do { // convert the 'angle_selection' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->angle_selection, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to angular_size to be a `angle_relator`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, geometric_tolerance* in) -{ - size_t base = 0; - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to geometric_tolerance"); } do { // convert the 'name' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - try { GenericConvert( in->name, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to geometric_tolerance to be a `label`")); } - } while(0); - do { // convert the 'description' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } - try { GenericConvert( in->description, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to geometric_tolerance to be a `text`")); } - } while(0); - do { // convert the 'magnitude' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2]=true; break; } - try { GenericConvert( in->magnitude, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to geometric_tolerance to be a `measure_with_unit`")); } - } while(0); - do { // convert the 'toleranced_shape_aspect' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[3]=true; break; } - try { GenericConvert( in->toleranced_shape_aspect, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to geometric_tolerance to be a `shape_aspect`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, geometric_tolerance_with_datum_reference* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to geometric_tolerance_with_datum_reference"); } do { // convert the 'datum_system' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - try { GenericConvert( in->datum_system, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to geometric_tolerance_with_datum_reference to be a `SET [1:?] OF datum_reference`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, angularity_tolerance* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to angularity_tolerance"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, styled_item* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to styled_item"); } do { // convert the 'styles' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - try { GenericConvert( in->styles, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to styled_item to be a `SET [1:?] OF presentation_style_assignment`")); } - } while(0); - do { // convert the 'item' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } - try { GenericConvert( in->item, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to styled_item to be a `representation_item`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, annotation_occurrence* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to annotation_occurrence"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, annotation_curve_occurrence* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to annotation_curve_occurrence"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, annotation_fill_area* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to annotation_fill_area"); } do { // convert the 'boundaries' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->boundaries, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to annotation_fill_area to be a `SET [1:?] OF curve`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, annotation_fill_area_occurrence* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to annotation_fill_area_occurrence"); } do { // convert the 'fill_style_target' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->fill_style_target, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to annotation_fill_area_occurrence to be a `point`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, annotation_occurrence_relationship* in) -{ - size_t base = 0; - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to annotation_occurrence_relationship"); } do { // convert the 'name' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - try { GenericConvert( in->name, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to annotation_occurrence_relationship to be a `label`")); } - } while(0); - do { // convert the 'description' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } - try { GenericConvert( in->description, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to annotation_occurrence_relationship to be a `text`")); } - } while(0); - do { // convert the 'relating_annotation_occurrence' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2]=true; break; } - try { GenericConvert( in->relating_annotation_occurrence, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to annotation_occurrence_relationship to be a `annotation_occurrence`")); } - } while(0); - do { // convert the 'related_annotation_occurrence' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[3]=true; break; } - try { GenericConvert( in->related_annotation_occurrence, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to annotation_occurrence_relationship to be a `annotation_occurrence`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, annotation_occurrence_associativity* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to annotation_occurrence_associativity"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, annotation_plane* in) -{ - size_t base = 0; - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to annotation_plane"); } do { // convert the 'elements' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->elements, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to annotation_plane to be a `SET [1:?] OF annotation_plane_element`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, annotation_symbol_occurrence* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to annotation_symbol_occurrence"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, annotation_subfigure_occurrence* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to annotation_subfigure_occurrence"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, mapped_item* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to mapped_item"); } do { // convert the 'mapping_source' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - try { GenericConvert( in->mapping_source, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to mapped_item to be a `representation_map`")); } - } while(0); - do { // convert the 'mapping_target' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } - try { GenericConvert( in->mapping_target, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to mapped_item to be a `representation_item`")); } - } while(0); - return base; -} - -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, annotation_symbol* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to annotation_symbol"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, annotation_text* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to annotation_text"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, annotation_text_character* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to annotation_text_character"); } do { // convert the 'alignment' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->alignment, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to annotation_text_character to be a `text_alignment`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, annotation_text_occurrence* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to annotation_text_occurrence"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, shape_aspect* in) -{ - size_t base = 0; - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to shape_aspect"); } do { // convert the 'name' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->name, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to shape_aspect to be a `label`")); } - } while (0); - do { // convert the 'description' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert(in->description, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to shape_aspect to be a `text`")); } - } while (0); - do { // convert the 'of_shape' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2] = true; break; } - try { GenericConvert(in->of_shape, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to shape_aspect to be a `product_definition_shape`")); } - } while (0); - do { // convert the 'product_definitional' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[3] = true; break; } - try { GenericConvert(in->product_definitional, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to shape_aspect to be a `LOGICAL`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, derived_shape_aspect* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to derived_shape_aspect"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, apex* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to apex"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, application_context_element* in) -{ - size_t base = 0; - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to application_context_element"); } do { // convert the 'name' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->name, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to application_context_element to be a `label`")); } - } while (0); - do { // convert the 'frame_of_reference' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->frame_of_reference, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to application_context_element to be a `application_context`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, applied_action_assignment* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to applied_action_assignment"); } do { // convert the 'items' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->items, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to applied_action_assignment to be a `SET [1:?] OF action_items`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, applied_action_method_assignment* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to applied_action_method_assignment"); } do { // convert the 'items' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->items, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to applied_action_method_assignment to be a `SET [1:?] OF action_method_items`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, applied_action_request_assignment* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to applied_action_request_assignment"); } do { // convert the 'items' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->items, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to applied_action_request_assignment to be a `SET [1:?] OF action_request_item`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, approval_assignment* in) -{ - size_t base = 0; - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to approval_assignment"); } do { // convert the 'assigned_approval' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->assigned_approval, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to approval_assignment to be a `approval`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, applied_approval_assignment* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to applied_approval_assignment"); } do { // convert the 'items' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->items, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to applied_approval_assignment to be a `SET [1:?] OF approval_item`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, attribute_classification_assignment* in) -{ - size_t base = 0; - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to attribute_classification_assignment"); } do { // convert the 'assigned_class' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->assigned_class, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to attribute_classification_assignment to be a `group`")); } - } while (0); - do { // convert the 'attribute_name' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->attribute_name, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to attribute_classification_assignment to be a `label`")); } - } while (0); - do { // convert the 'role' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2] = true; break; } - try { GenericConvert(in->role, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to attribute_classification_assignment to be a `classification_role`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, applied_attribute_classification_assignment* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to applied_attribute_classification_assignment"); } do { // convert the 'items' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->items, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to applied_attribute_classification_assignment to be a `SET [1:?] OF attribute_classification_item`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, certification_assignment* in) -{ - size_t base = 0; - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to certification_assignment"); } do { // convert the 'assigned_certification' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->assigned_certification, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to certification_assignment to be a `certification`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, applied_certification_assignment* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to applied_certification_assignment"); } do { // convert the 'items' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->items, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to applied_certification_assignment to be a `SET [1:?] OF certification_item`")); } - } while (0); - return base; -} - -} // ! STEP -} // ! Assimp - -#endif diff --git a/code/AssetLib/StepFile/StepFileGen2.cpp b/code/AssetLib/StepFile/StepFileGen2.cpp deleted file mode 100644 index ea12cd7ba..000000000 --- a/code/AssetLib/StepFile/StepFileGen2.cpp +++ /dev/null @@ -1,3068 +0,0 @@ -/* -Open Asset Import Library (ASSIMP) ----------------------------------------------------------------------- - -Copyright (c) 2006-2020, ASSIMP Development 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 Development 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 "code/Importer/StepFile/StepReaderGen.h" - -namespace Assimp { -using namespace StepFile; -namespace STEP { - - // ----------------------------------------------------------------------------------------------------------- - template <> size_t GenericFill(const DB& db, const LIST& params, classification_assignment* in) - { - size_t base = 0; - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to classification_assignment"); } do { // convert the 'assigned_class' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->assigned_class, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to classification_assignment to be a `group`")); } - } while (0); - do { // convert the 'role' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->role, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to classification_assignment to be a `classification_role`")); } - } while (0); - return base; - } - // ----------------------------------------------------------------------------------------------------------- - template <> size_t GenericFill(const DB& db, const LIST& params, applied_classification_assignment* in) - { - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to applied_classification_assignment"); } do { // convert the 'items' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->items, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to applied_classification_assignment to be a `SET [1:?] OF classification_item`")); } - } while (0); - return base; - } - // ----------------------------------------------------------------------------------------------------------- - template <> size_t GenericFill(const DB& db, const LIST& params, contract_assignment* in) - { - size_t base = 0; - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to contract_assignment"); } do { // convert the 'assigned_contract' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->assigned_contract, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to contract_assignment to be a `contract`")); } - } while (0); - return base; - } - // ----------------------------------------------------------------------------------------------------------- - template <> size_t GenericFill(const DB& db, const LIST& params, applied_contract_assignment* in) - { - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to applied_contract_assignment"); } do { // convert the 'items' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->items, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to applied_contract_assignment to be a `SET [1:?] OF contract_item`")); } - } while (0); - return base; - } - // ----------------------------------------------------------------------------------------------------------- - template <> size_t GenericFill(const DB& db, const LIST& params, date_and_time_assignment* in) - { - size_t base = 0; - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to date_and_time_assignment"); } do { // convert the 'assigned_date_and_time' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->assigned_date_and_time, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to date_and_time_assignment to be a `date_and_time`")); } - } while (0); - do { // convert the 'role' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->role, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to date_and_time_assignment to be a `date_time_role`")); } - } while (0); - return base; - } - // ----------------------------------------------------------------------------------------------------------- - template <> size_t GenericFill(const DB& db, const LIST& params, applied_date_and_time_assignment* in) - { - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to applied_date_and_time_assignment"); } do { // convert the 'items' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->items, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to applied_date_and_time_assignment to be a `SET [1:?] OF date_and_time_item`")); } - } while (0); - return base; - } - // ----------------------------------------------------------------------------------------------------------- - template <> size_t GenericFill(const DB& db, const LIST& params, date_assignment* in) - { - size_t base = 0; - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to date_assignment"); } do { // convert the 'assigned_date' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->assigned_date, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to date_assignment to be a `date`")); } - } while (0); - do { // convert the 'role' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->role, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to date_assignment to be a `date_role`")); } - } while (0); - return base; - } - // ----------------------------------------------------------------------------------------------------------- - template <> size_t GenericFill(const DB& db, const LIST& params, applied_date_assignment* in) - { - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to applied_date_assignment"); } do { // convert the 'items' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->items, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to applied_date_assignment to be a `SET [1:?] OF date_item`")); } - } while (0); - return base; - } - // ----------------------------------------------------------------------------------------------------------- - template <> size_t GenericFill(const DB& db, const LIST& params, document_reference* in) - { - size_t base = 0; - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to document_reference"); } do { // convert the 'assigned_document' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->assigned_document, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to document_reference to be a `document`")); } - } while (0); - do { // convert the 'source' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->source, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to document_reference to be a `label`")); } - } while (0); - return base; - } - // ----------------------------------------------------------------------------------------------------------- - template <> size_t GenericFill(const DB& db, const LIST& params, applied_document_reference* in) - { - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to applied_document_reference"); } do { // convert the 'items' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->items, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to applied_document_reference to be a `SET [1:?] OF document_reference_item`")); } - } while (0); - return base; - } - // ----------------------------------------------------------------------------------------------------------- - template <> size_t GenericFill(const DB& db, const LIST& params, document_usage_constraint_assignment* in) - { - size_t base = 0; - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to document_usage_constraint_assignment"); } do { // convert the 'assigned_document_usage' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->assigned_document_usage, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to document_usage_constraint_assignment to be a `document_usage_constraint`")); } - } while (0); - do { // convert the 'role' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->role, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to document_usage_constraint_assignment to be a `document_usage_role`")); } - } while (0); - return base; - } - // ----------------------------------------------------------------------------------------------------------- - template <> size_t GenericFill(const DB& db, const LIST& params, applied_document_usage_constraint_assignment* in) - { - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to applied_document_usage_constraint_assignment"); } do { // convert the 'items' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->items, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to applied_document_usage_constraint_assignment to be a `SET [1:?] OF document_reference_item`")); } - } while (0); - return base; - } - // ----------------------------------------------------------------------------------------------------------- - template <> size_t GenericFill(const DB& db, const LIST& params, effectivity_assignment* in) - { - size_t base = 0; - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to effectivity_assignment"); } do { // convert the 'assigned_effectivity' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->assigned_effectivity, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to effectivity_assignment to be a `effectivity`")); } - } while (0); - return base; - } - // ----------------------------------------------------------------------------------------------------------- - template <> size_t GenericFill(const DB& db, const LIST& params, applied_effectivity_assignment* in) - { - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to applied_effectivity_assignment"); } do { // convert the 'items' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->items, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to applied_effectivity_assignment to be a `SET [1:?] OF effectivity_item`")); } - } while (0); - return base; - } - // ----------------------------------------------------------------------------------------------------------- - template <> size_t GenericFill(const DB& db, const LIST& params, event_occurrence_assignment* in) - { - size_t base = 0; - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to event_occurrence_assignment"); } do { // convert the 'assigned_event_occurrence' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->assigned_event_occurrence, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to event_occurrence_assignment to be a `event_occurrence`")); } - } while (0); - do { // convert the 'role' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->role, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to event_occurrence_assignment to be a `event_occurrence_role`")); } - } while (0); - return base; - } - // ----------------------------------------------------------------------------------------------------------- - template <> size_t GenericFill(const DB& db, const LIST& params, applied_event_occurrence_assignment* in) - { - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to applied_event_occurrence_assignment"); } do { // convert the 'items' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->items, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to applied_event_occurrence_assignment to be a `SET [1:?] OF event_occurrence_item`")); } - } while (0); - return base; - } - // ----------------------------------------------------------------------------------------------------------- - template <> size_t GenericFill(const DB& db, const LIST& params, identification_assignment* in) - { - size_t base = 0; - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to identification_assignment"); } do { // convert the 'assigned_id' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->assigned_id, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to identification_assignment to be a `identifier`")); } - } while (0); - do { // convert the 'role' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->role, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to identification_assignment to be a `identification_role`")); } - } while (0); - return base; - } -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, external_identification_assignment* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to external_identification_assignment"); } do { // convert the 'source' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->source, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to external_identification_assignment to be a `external_source`")); } - } while (0); - return base; -} - -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, applied_external_identification_assignment* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to applied_external_identification_assignment"); } do { // convert the 'items' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->items, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to applied_external_identification_assignment to be a `SET [1:?] OF external_identification_item`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, group_assignment* in) -{ - size_t base = 0; - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to group_assignment"); } do { // convert the 'assigned_group' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->assigned_group, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to group_assignment to be a `group`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, applied_group_assignment* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to applied_group_assignment"); } do { // convert the 'items' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->items, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to applied_group_assignment to be a `SET [1:?] OF groupable_item`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, applied_identification_assignment* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to applied_identification_assignment"); } do { // convert the 'items' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->items, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to applied_identification_assignment to be a `SET [1:?] OF identification_item`")); } - } while (0); - return base; -} - -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, name_assignment* in) -{ - size_t base = 0; - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to name_assignment"); } do { // convert the 'assigned_name' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->assigned_name, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to name_assignment to be a `label`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, applied_name_assignment* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to applied_name_assignment"); } do { // convert the 'item' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->item, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to applied_name_assignment to be a `name_item`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, organization_assignment* in) -{ - size_t base = 0; - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to organization_assignment"); } do { // convert the 'assigned_organization' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->assigned_organization, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to organization_assignment to be a `organization`")); } - } while (0); - do { // convert the 'role' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->role, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to organization_assignment to be a `organization_role`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, applied_organization_assignment* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to applied_organization_assignment"); } do { // convert the 'items' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->items, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to applied_organization_assignment to be a `SET [1:?] OF organization_item`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, organizational_project_assignment* in) -{ - size_t base = 0; - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to organizational_project_assignment"); } do { // convert the 'assigned_organizational_project' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->assigned_organizational_project, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to organizational_project_assignment to be a `organizational_project`")); } - } while (0); - do { // convert the 'role' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->role, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to organizational_project_assignment to be a `organizational_project_role`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, applied_organizational_project_assignment* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to applied_organizational_project_assignment"); } do { // convert the 'items' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->items, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to applied_organizational_project_assignment to be a `SET [1:?] OF project_item`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, person_and_organization_assignment* in) -{ - size_t base = 0; - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to person_and_organization_assignment"); } do { // convert the 'assigned_person_and_organization' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->assigned_person_and_organization, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to person_and_organization_assignment to be a `person_and_organization`")); } - } while (0); - do { // convert the 'role' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->role, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to person_and_organization_assignment to be a `person_and_organization_role`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, applied_person_and_organization_assignment* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to applied_person_and_organization_assignment"); } do { // convert the 'items' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->items, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to applied_person_and_organization_assignment to be a `SET [1:?] OF person_and_organization_item`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, presented_item* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, applied_presented_item* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to applied_presented_item"); } do { // convert the 'items' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->items, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to applied_presented_item to be a `SET [1:?] OF presented_item_select`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, security_classification_assignment* in) -{ - size_t base = 0; - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to security_classification_assignment"); } do { // convert the 'assigned_security_classification' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->assigned_security_classification, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to security_classification_assignment to be a `security_classification`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, applied_security_classification_assignment* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to applied_security_classification_assignment"); } do { // convert the 'items' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->items, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to applied_security_classification_assignment to be a `SET [1:?] OF security_classification_item`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, time_interval_assignment* in) -{ - size_t base = 0; - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to time_interval_assignment"); } do { // convert the 'assigned_time_interval' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->assigned_time_interval, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to time_interval_assignment to be a `time_interval`")); } - } while (0); - do { // convert the 'role' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->role, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to time_interval_assignment to be a `time_interval_role`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, applied_time_interval_assignment* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to applied_time_interval_assignment"); } do { // convert the 'items' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->items, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to applied_time_interval_assignment to be a `SET [0:?] OF time_interval_item`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, applied_usage_right* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to applied_usage_right"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, area_in_set* in) -{ - size_t base = 0; - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to area_in_set"); } do { // convert the 'area' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->area, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to area_in_set to be a `presentation_area`")); } - } while (0); - do { // convert the 'in_set' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->in_set, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to area_in_set to be a `presentation_set`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, area_measure_with_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to area_measure_with_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, area_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to area_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, product_definition_relationship* in) -{ - size_t base = 0; - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to product_definition_relationship"); } do { // convert the 'id' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->id, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to product_definition_relationship to be a `identifier`")); } - } while (0); - do { // convert the 'name' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->name, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to product_definition_relationship to be a `label`")); } - } while (0); - do { // convert the 'description' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2] = true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert(in->description, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to product_definition_relationship to be a `text`")); } - } while (0); - do { // convert the 'relating_product_definition' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[3] = true; break; } - try { GenericConvert(in->relating_product_definition, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to product_definition_relationship to be a `product_definition`")); } - } while (0); - do { // convert the 'related_product_definition' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[4] = true; break; } - try { GenericConvert(in->related_product_definition, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to product_definition_relationship to be a `product_definition`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, product_definition_usage* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to product_definition_usage"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, assembly_component_usage* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to assembly_component_usage"); } do { // convert the 'reference_designator' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert(in->reference_designator, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to assembly_component_usage to be a `identifier`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, assigned_requirement* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to assigned_requirement"); } do { // convert the 'items' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->items, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to assigned_requirement to be a `SET [1:1] OF product_definition`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, compound_representation_item* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to compound_representation_item"); } do { // convert the 'item_element' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->item_element, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to compound_representation_item to be a `compound_item_definition`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, atomic_formula* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to atomic_formula"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, attribute_assertion* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, attribute_language_assignment* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to attribute_language_assignment"); } do { // convert the 'items' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->items, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to attribute_language_assignment to be a `SET [1:?] OF attribute_language_item`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, attribute_value_assignment* in) -{ - size_t base = 0; - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to attribute_value_assignment"); } do { // convert the 'attribute_name' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->attribute_name, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to attribute_value_assignment to be a `label`")); } - } while (0); - do { // convert the 'attribute_value' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->attribute_value, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to attribute_value_assignment to be a `attribute_type`")); } - } while (0); - do { // convert the 'role' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2] = true; break; } - try { GenericConvert(in->role, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to attribute_value_assignment to be a `attribute_value_role`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, auxiliary_geometric_representation_item* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, placement* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to placement"); } do { // convert the 'location' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->location, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to placement to be a `cartesian_point`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, axis1_placement* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to axis1_placement"); } do { // convert the 'axis' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) break; - try { GenericConvert(in->axis, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to axis1_placement to be a `direction`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, axis2_placement_2d* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to axis2_placement_2d"); } do { // convert the 'ref_direction' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) break; - try { GenericConvert(in->ref_direction, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to axis2_placement_2d to be a `direction`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, axis2_placement_3d* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to axis2_placement_3d"); } do { // convert the 'axis' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) break; - try { GenericConvert(in->axis, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to axis2_placement_3d to be a `direction`")); } - } while (0); - do { // convert the 'ref_direction' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) break; - try { GenericConvert(in->ref_direction, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to axis2_placement_3d to be a `direction`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, curve* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to curve"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, bounded_curve* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to bounded_curve"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, b_spline_curve* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to b_spline_curve"); } do { // convert the 'degree' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->degree, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to b_spline_curve to be a `INTEGER`")); } - } while (0); - do { // convert the 'control_points_list' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->control_points_list, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to b_spline_curve to be a `LIST [2:?] OF cartesian_point`")); } - } while (0); - do { // convert the 'curve_form' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2] = true; break; } - try { GenericConvert(in->curve_form, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to b_spline_curve to be a `b_spline_curve_form`")); } - } while (0); - do { // convert the 'closed_curve' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[3] = true; break; } - try { GenericConvert(in->closed_curve, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to b_spline_curve to be a `LOGICAL`")); } - } while (0); - do { // convert the 'self_intersect' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[4] = true; break; } - try { GenericConvert(in->self_intersect, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to b_spline_curve to be a `LOGICAL`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, b_spline_curve_with_knots* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 9) { throw STEP::TypeError("expected 9 arguments to b_spline_curve_with_knots"); } do { // convert the 'knot_multiplicities' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->knot_multiplicities, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to b_spline_curve_with_knots to be a `LIST [2:?] OF INTEGER`")); } - } while (0); - do { // convert the 'knots' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->knots, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 7 to b_spline_curve_with_knots to be a `LIST [2:?] OF parameter_value`")); } - } while (0); - do { // convert the 'knot_spec' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->knot_spec, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 8 to b_spline_curve_with_knots to be a `knot_type`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, surface* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to surface"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, bounded_surface* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to bounded_surface"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, b_spline_surface* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 7) { throw STEP::TypeError("expected 7 arguments to b_spline_surface"); } do { // convert the 'u_degree' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->u_degree, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to b_spline_surface to be a `INTEGER`")); } - } while (0); - do { // convert the 'v_degree' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->v_degree, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to b_spline_surface to be a `INTEGER`")); } - } while (0); - do { // convert the 'surface_form' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2] = true; break; } - try { GenericConvert(in->surface_form, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to b_spline_surface to be a `b_spline_surface_form`")); } - } while (0); - do { // convert the 'u_closed' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[3] = true; break; } - try { GenericConvert(in->u_closed, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to b_spline_surface to be a `LOGICAL`")); } - } while (0); - do { // convert the 'v_closed' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[4] = true; break; } - try { GenericConvert(in->v_closed, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to b_spline_surface to be a `LOGICAL`")); } - } while (0); - do { // convert the 'self_intersect' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[5] = true; break; } - try { GenericConvert(in->self_intersect, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to b_spline_surface to be a `LOGICAL`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, b_spline_surface_with_knots* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 12) { throw STEP::TypeError("expected 12 arguments to b_spline_surface_with_knots"); } do { // convert the 'u_multiplicities' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->u_multiplicities, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 7 to b_spline_surface_with_knots to be a `LIST [2:?] OF INTEGER`")); } - } while (0); - do { // convert the 'v_multiplicities' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->v_multiplicities, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 8 to b_spline_surface_with_knots to be a `LIST [2:?] OF INTEGER`")); } - } while (0); - do { // convert the 'u_knots' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->u_knots, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 9 to b_spline_surface_with_knots to be a `LIST [2:?] OF parameter_value`")); } - } while (0); - do { // convert the 'v_knots' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->v_knots, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 10 to b_spline_surface_with_knots to be a `LIST [2:?] OF parameter_value`")); } - } while (0); - do { // convert the 'knot_spec' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->knot_spec, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 11 to b_spline_surface_with_knots to be a `knot_type`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, product_definition* in) -{ - size_t base = 0; - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to product_definition"); } do { // convert the 'id' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->id, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to product_definition to be a `identifier`")); } - } while (0); - do { // convert the 'description' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert(in->description, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to product_definition to be a `text`")); } - } while (0); - do { // convert the 'formation' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2] = true; break; } - try { GenericConvert(in->formation, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to product_definition to be a `product_definition_formation`")); } - } while (0); - do { // convert the 'frame_of_reference' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[3] = true; break; } - try { GenericConvert(in->frame_of_reference, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to product_definition to be a `product_definition_context`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, rule_software_definition* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to rule_software_definition"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, rule_definition* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to rule_definition"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, back_chaining_rule* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to back_chaining_rule"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, back_chaining_rule_body* in) -{ - size_t base = 0; - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, colour* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, background_colour* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to background_colour"); } do { // convert the 'presentation' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->presentation, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to background_colour to be a `area_or_view`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, beveled_sheet_representation* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to beveled_sheet_representation"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, bezier_curve* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to bezier_curve"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, bezier_surface* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 7) { throw STEP::TypeError("expected 7 arguments to bezier_surface"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, generic_expression* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, binary_generic_expression* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to binary_generic_expression"); } do { // convert the 'operands' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->operands, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to binary_generic_expression to be a `LIST [2:2] OF generic_expression`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, binary_numeric_expression* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, binary_representation_item* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to binary_representation_item"); } do { // convert the 'binary_value' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->binary_value, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to binary_representation_item to be a `BINARY`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, block* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to block"); } do { // convert the 'position' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->position, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to block to be a `axis2_placement_3d`")); } - } while (0); - do { // convert the 'x' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->x, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to block to be a `positive_length_measure`")); } - } while (0); - do { // convert the 'y' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->y, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to block to be a `positive_length_measure`")); } - } while (0); - do { // convert the 'z' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->z, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to block to be a `positive_length_measure`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, expression* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, boolean_expression* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, boolean_literal* in) -{ - size_t base = 0; - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to boolean_literal"); } do { // convert the 'the_value' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->the_value, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to boolean_literal to be a `BOOLEAN`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, boolean_representation_item* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, boolean_result* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to boolean_result"); } do { // convert the 'operator' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->operator_, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to boolean_result to be a `boolean_operator`")); } - } while (0); - do { // convert the 'first_operand' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->first_operand, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to boolean_result to be a `boolean_operand`")); } - } while (0); - do { // convert the 'second_operand' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->second_operand, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to boolean_result to be a `boolean_operand`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, composite_curve* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to composite_curve"); } do { // convert the 'segments' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->segments, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to composite_curve to be a `LIST [1:?] OF composite_curve_segment`")); } - } while (0); - do { // convert the 'self_intersect' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->self_intersect, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to composite_curve to be a `LOGICAL`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, composite_curve_on_surface* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to composite_curve_on_surface"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, boundary_curve* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to boundary_curve"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, bounded_pcurve* in) -{ - size_t base = 0; - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, bounded_surface_curve* in) -{ - size_t base = 0; - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, founded_item* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, box_domain* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to box_domain"); } do { // convert the 'corner' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->corner, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to box_domain to be a `cartesian_point`")); } - } while (0); - do { // convert the 'xlength' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->xlength, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to box_domain to be a `positive_length_measure`")); } - } while (0); - do { // convert the 'ylength' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->ylength, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to box_domain to be a `positive_length_measure`")); } - } while (0); - do { // convert the 'zlength' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->zlength, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to box_domain to be a `positive_length_measure`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, half_space_solid* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to half_space_solid"); } do { // convert the 'base_surface' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->base_surface, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to half_space_solid to be a `surface`")); } - } while (0); - do { // convert the 'agreement_flag' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->agreement_flag, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to half_space_solid to be a `BOOLEAN`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, boxed_half_space* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to boxed_half_space"); } do { // convert the 'enclosure' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->enclosure, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to boxed_half_space to be a `box_domain`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, breakdown_context* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to breakdown_context"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, breakdown_element_group_assignment* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to breakdown_element_group_assignment"); } do { // convert the 'items' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->items, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to breakdown_element_group_assignment to be a `SET [1:1] OF product_definition_or_breakdown_element_usage`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, breakdown_element_realization* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, breakdown_element_usage* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to breakdown_element_usage"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, breakdown_of* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to breakdown_of"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, solid_model* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to solid_model"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, manifold_solid_brep* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to manifold_solid_brep"); } do { // convert the 'outer' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->outer, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to manifold_solid_brep to be a `closed_shell`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, brep_with_voids* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to brep_with_voids"); } do { // convert the 'voids' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->voids, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to brep_with_voids to be a `SET [1:?] OF oriented_closed_shell`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, bytes_representation_item* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to bytes_representation_item"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, date* in) -{ - size_t base = 0; - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to date"); } do { // convert the 'year_component' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->year_component, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to date to be a `year_number`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, calendar_date* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to calendar_date"); } do { // convert the 'day_component' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->day_component, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to calendar_date to be a `day_in_month_number`")); } - } while (0); - do { // convert the 'month_component' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->month_component, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to calendar_date to be a `month_in_year_number`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, camera_image* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to camera_image"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, camera_image_3d_with_scale* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to camera_image_3d_with_scale"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, camera_model* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to camera_model"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, camera_model_d3* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to camera_model_d3"); } do { // convert the 'view_reference_system' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->view_reference_system, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to camera_model_d3 to be a `axis2_placement_3d`")); } - } while (0); - do { // convert the 'perspective_of_volume' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->perspective_of_volume, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to camera_model_d3 to be a `view_volume`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, camera_model_d3_multi_clipping* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to camera_model_d3_multi_clipping"); } do { // convert the 'shape_clipping' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->shape_clipping, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to camera_model_d3_multi_clipping to be a `SET [1:?] OF camera_model_d3_multi_clipping_interection_select`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, camera_model_d3_multi_clipping_intersection* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to camera_model_d3_multi_clipping_intersection"); } do { // convert the 'shape_clipping' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->shape_clipping, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to camera_model_d3_multi_clipping_intersection to be a `SET [2:?] OF camera_model_d3_multi_clipping_interection_select`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, camera_model_d3_multi_clipping_union* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to camera_model_d3_multi_clipping_union"); } do { // convert the 'shape_clipping' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->shape_clipping, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to camera_model_d3_multi_clipping_union to be a `SET [2:?] OF camera_model_d3_multi_clipping_union_select`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, camera_model_d3_with_hlhsr* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to camera_model_d3_with_hlhsr"); } do { // convert the 'hidden_line_surface_removal' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->hidden_line_surface_removal, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to camera_model_d3_with_hlhsr to be a `BOOLEAN`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, camera_model_with_light_sources* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to camera_model_with_light_sources"); } do { // convert the 'sources' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->sources, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to camera_model_with_light_sources to be a `SET [1:?] OF light_source`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, representation_map* in) -{ - size_t base = 0; - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to representation_map"); } do { // convert the 'mapping_origin' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->mapping_origin, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to representation_map to be a `representation_item`")); } - } while (0); - do { // convert the 'mapped_representation' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->mapped_representation, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to representation_map to be a `representation`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, camera_usage* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to camera_usage"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, capacitance_measure_with_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to capacitance_measure_with_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, capacitance_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to capacitance_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, point* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to point"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, cartesian_point* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to cartesian_point"); } do { // convert the 'coordinates' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->coordinates, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to cartesian_point to be a `LIST [1:3] OF length_measure`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, cartesian_transformation_operator* in) -{ - size_t base = 0; - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to cartesian_transformation_operator"); } do { // convert the 'axis1' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert(in->axis1, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to cartesian_transformation_operator to be a `direction`")); } - } while (0); - do { // convert the 'axis2' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert(in->axis2, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to cartesian_transformation_operator to be a `direction`")); } - } while (0); - do { // convert the 'local_origin' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2] = true; break; } - try { GenericConvert(in->local_origin, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to cartesian_transformation_operator to be a `cartesian_point`")); } - } while (0); - do { // convert the 'scale' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[3] = true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert(in->scale, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to cartesian_transformation_operator to be a `REAL`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, cartesian_transformation_operator_2d* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to cartesian_transformation_operator_2d"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, cartesian_transformation_operator_3d* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to cartesian_transformation_operator_3d"); } do { // convert the 'axis3' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) break; - try { GenericConvert(in->axis3, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to cartesian_transformation_operator_3d to be a `direction`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, cc_design_approval* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to cc_design_approval"); } do { // convert the 'items' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->items, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to cc_design_approval to be a `SET [1:?] OF approved_item`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, cc_design_certification* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to cc_design_certification"); } do { // convert the 'items' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->items, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to cc_design_certification to be a `SET [1:?] OF certified_item`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, cc_design_contract* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to cc_design_contract"); } do { // convert the 'items' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->items, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to cc_design_contract to be a `SET [1:?] OF contracted_item`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, cc_design_date_and_time_assignment* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to cc_design_date_and_time_assignment"); } do { // convert the 'items' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->items, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to cc_design_date_and_time_assignment to be a `SET [1:?] OF date_time_item`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, cc_design_person_and_organization_assignment* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to cc_design_person_and_organization_assignment"); } do { // convert the 'items' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->items, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to cc_design_person_and_organization_assignment to be a `SET [1:?] OF cc_person_organization_item`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, cc_design_security_classification* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to cc_design_security_classification"); } do { // convert the 'items' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->items, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to cc_design_security_classification to be a `SET [1:?] OF cc_classified_item`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, cc_design_specification_reference* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to cc_design_specification_reference"); } do { // convert the 'items' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->items, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to cc_design_specification_reference to be a `SET [1:?] OF cc_specified_item`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, celsius_temperature_measure_with_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to celsius_temperature_measure_with_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, centre_of_symmetry* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to centre_of_symmetry"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, change* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to change"); } do { // convert the 'items' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->items, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to change to be a `SET [1:?] OF work_item`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, change_request* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to change_request"); } do { // convert the 'items' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->items, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to change_request to be a `SET [1:?] OF change_request_item`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, character_glyph_style_outline* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to character_glyph_style_outline"); } do { // convert the 'outline_style' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->outline_style, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to character_glyph_style_outline to be a `curve_style`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, character_glyph_style_stroke* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to character_glyph_style_stroke"); } do { // convert the 'stroke_style' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->stroke_style, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to character_glyph_style_stroke to be a `curve_style`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, symbol_representation* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to symbol_representation"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, generic_character_glyph_symbol* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to generic_character_glyph_symbol"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, character_glyph_symbol* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to character_glyph_symbol"); } do { // convert the 'character_box' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->character_box, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to character_glyph_symbol to be a `planar_extent`")); } - } while (0); - do { // convert the 'baseline_ratio' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->baseline_ratio, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to character_glyph_symbol to be a `ratio_measure`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, character_glyph_symbol_outline* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to character_glyph_symbol_outline"); } do { // convert the 'outlines' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->outlines, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to character_glyph_symbol_outline to be a `SET [1:?] OF annotation_fill_area`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, character_glyph_symbol_stroke* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to character_glyph_symbol_stroke"); } do { // convert the 'strokes' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->strokes, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to character_glyph_symbol_stroke to be a `SET [1:?] OF curve`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, general_property* in) -{ - size_t base = 0; - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to general_property"); } do { // convert the 'id' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->id, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to general_property to be a `identifier`")); } - } while (0); - do { // convert the 'name' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->name, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to general_property to be a `label`")); } - } while (0); - do { // convert the 'description' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2] = true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert(in->description, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to general_property to be a `text`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, characteristic_data_column_header* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to characteristic_data_column_header"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, general_property_relationship* in) -{ - size_t base = 0; - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to general_property_relationship"); } do { // convert the 'name' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->name, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to general_property_relationship to be a `label`")); } - } while (0); - do { // convert the 'description' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert(in->description, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to general_property_relationship to be a `text`")); } - } while (0); - do { // convert the 'relating_property' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2] = true; break; } - try { GenericConvert(in->relating_property, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to general_property_relationship to be a `general_property`")); } - } while (0); - do { // convert the 'related_property' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[3] = true; break; } - try { GenericConvert(in->related_property, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to general_property_relationship to be a `general_property`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, characteristic_data_column_header_link* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to characteristic_data_column_header_link"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, characteristic_data_table_header* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to characteristic_data_table_header"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, characteristic_data_table_header_decomposition* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to characteristic_data_table_header_decomposition"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, group* in) -{ - size_t base = 0; - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to group"); } do { // convert the 'name' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->name, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to group to be a `label`")); } - } while (0); - do { // convert the 'description' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert(in->description, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to group to be a `text`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, characteristic_type* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to characteristic_type"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, characterized_class* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, characterized_object* in) -{ - size_t base = 0; - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to characterized_object"); } do { // convert the 'name' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->name, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to characterized_object to be a `label`")); } - } while (0); - do { // convert the 'description' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert(in->description, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to characterized_object to be a `text`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, conic* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to conic"); } do { // convert the 'position' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->position, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to conic to be a `axis2_placement`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, circle* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to circle"); } do { // convert the 'radius' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->radius, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to circle to be a `positive_length_measure`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, circular_runout_tolerance* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to circular_runout_tolerance"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, class_by_extension* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to class_by_extension"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, class_by_intension* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to class_by_intension"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, class_system* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to class_system"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, effectivity_context_assignment* in) -{ - size_t base = 0; - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to effectivity_context_assignment"); } do { // convert the 'assigned_effectivity_assignment' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->assigned_effectivity_assignment, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to effectivity_context_assignment to be a `effectivity_assignment`")); } - } while (0); - do { // convert the 'role' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->role, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to effectivity_context_assignment to be a `effectivity_context_role`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, class_usage_effectivity_context_assignment* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to class_usage_effectivity_context_assignment"); } do { // convert the 'items' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->items, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to class_usage_effectivity_context_assignment to be a `SET [1:?] OF class_usage_effectivity_context_item`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, topological_representation_item* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to topological_representation_item"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, connected_face_set* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to connected_face_set"); } do { // convert the 'cfs_faces' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->cfs_faces, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to connected_face_set to be a `SET [1:?] OF face`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, closed_shell* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to closed_shell"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, coaxiality_tolerance* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to coaxiality_tolerance"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, colour_specification* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to colour_specification"); } do { // convert the 'name' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->name, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to colour_specification to be a `label`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, colour_rgb* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to colour_rgb"); } do { // convert the 'red' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->red, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to colour_rgb to be a `REAL`")); } - } while (0); - do { // convert the 'green' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->green, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to colour_rgb to be a `REAL`")); } - } while (0); - do { // convert the 'blue' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->blue, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to colour_rgb to be a `REAL`")); } - } while (0); - return base; -} -/* -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, common_datum* in) -{ - size_t base = 0; - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, comparison_expression* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, complex_clause* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to complex_clause"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, complex_conjunctive_clause* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to complex_conjunctive_clause"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, complex_disjunctive_clause* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to complex_disjunctive_clause"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, modified_solid* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to modified_solid"); } do { // convert the 'rationale' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->rationale, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to modified_solid to be a `text`")); } - } while (0); - do { // convert the 'base_solid' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->base_solid, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to modified_solid to be a `base_solid_select`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, shelled_solid* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to shelled_solid"); } do { // convert the 'deleted_face_set' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->deleted_face_set, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to shelled_solid to be a `SET [1:?] OF face_surface`")); } - } while (0); - do { // convert the 'thickness' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->thickness, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to shelled_solid to be a `length_measure`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, complex_shelled_solid* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to complex_shelled_solid"); } do { // convert the 'thickness_list' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->thickness_list, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to complex_shelled_solid to be a `LIST [1:?] OF length_measure`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, composite_assembly_definition* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to composite_assembly_definition"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, composite_assembly_sequence_definition* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to composite_assembly_sequence_definition"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, laminate_table* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to laminate_table"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, part_laminate_table* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to part_laminate_table"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, composite_assembly_table* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to composite_assembly_table"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, composite_curve_segment* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to composite_curve_segment"); } do { // convert the 'transition' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->transition, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to composite_curve_segment to be a `transition_code`")); } - } while (0); - do { // convert the 'same_sense' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->same_sense, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to composite_curve_segment to be a `BOOLEAN`")); } - } while (0); - do { // convert the 'parent_curve' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2] = true; break; } - try { GenericConvert(in->parent_curve, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to composite_curve_segment to be a `curve`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, material_designation* in) -{ - size_t base = 0; - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to material_designation"); } do { // convert the 'name' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->name, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to material_designation to be a `label`")); } - } while (0); - do { // convert the 'definitions' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->definitions, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to material_designation to be a `SET [1:?] OF characterized_definition`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, composite_material_designation* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to composite_material_designation"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, composite_shape_aspect* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to composite_shape_aspect"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, composite_sheet_representation* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to composite_sheet_representation"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, composite_text* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to composite_text"); } do { // convert the 'collected_text' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->collected_text, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to composite_text to be a `SET [2:?] OF text_or_character`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, composite_text_with_associated_curves* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to composite_text_with_associated_curves"); } do { // convert the 'associated_curves' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->associated_curves, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to composite_text_with_associated_curves to be a `SET [1:?] OF curve`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, composite_text_with_blanking_box* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to composite_text_with_blanking_box"); } do { // convert the 'blanking' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->blanking, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to composite_text_with_blanking_box to be a `planar_box`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, composite_text_with_delineation* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to composite_text_with_delineation"); } do { // convert the 'delineation' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->delineation, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to composite_text_with_delineation to be a `text_delineation`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, composite_text_with_extent* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to composite_text_with_extent"); } do { // convert the 'extent' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->extent, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to composite_text_with_extent to be a `planar_extent`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, compound_shape_representation* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to compound_shape_representation"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, concentricity_tolerance* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to concentricity_tolerance"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, concept_feature_relationship* in) -{ - size_t base = 0; - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to concept_feature_relationship"); } do { // convert the 'name' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->name, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to concept_feature_relationship to be a `label`")); } - } while (0); - do { // convert the 'description' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert(in->description, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to concept_feature_relationship to be a `text`")); } - } while (0); - do { // convert the 'relating_product_concept_feature' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2] = true; break; } - try { GenericConvert(in->relating_product_concept_feature, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to concept_feature_relationship to be a `product_concept_feature`")); } - } while (0); - do { // convert the 'related_product_concept_feature' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[3] = true; break; } - try { GenericConvert(in->related_product_concept_feature, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to concept_feature_relationship to be a `product_concept_feature`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, concept_feature_relationship_with_condition* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to concept_feature_relationship_with_condition"); } do { // convert the 'conditional_operator' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->conditional_operator, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to concept_feature_relationship_with_condition to be a `concept_feature_operator`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, product_concept_feature* in) -{ - size_t base = 0; - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to product_concept_feature"); } do { // convert the 'id' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->id, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to product_concept_feature to be a `identifier`")); } - } while (0); - do { // convert the 'name' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->name, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to product_concept_feature to be a `label`")); } - } while (0); - do { // convert the 'description' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2] = true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert(in->description, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to product_concept_feature to be a `text`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, conditional_concept_feature* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to conditional_concept_feature"); } do { // convert the 'condition' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->condition, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to conditional_concept_feature to be a `concept_feature_relationship_with_condition`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, conductance_measure_with_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to conductance_measure_with_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, conductance_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to conductance_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, configuration_item* in) -{ - size_t base = 0; - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to configuration_item"); } do { // convert the 'id' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->id, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to configuration_item to be a `identifier`")); } - } while (0); - do { // convert the 'name' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->name, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to configuration_item to be a `label`")); } - } while (0); - do { // convert the 'description' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2] = true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert(in->description, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to configuration_item to be a `text`")); } - } while (0); - do { // convert the 'item_concept' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[3] = true; break; } - try { GenericConvert(in->item_concept, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to configuration_item to be a `product_concept`")); } - } while (0); - do { // convert the 'purpose' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[4] = true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert(in->purpose, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to configuration_item to be a `label`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, configurable_item* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to configurable_item"); } do { // convert the 'item_concept_feature' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->item_concept_feature, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to configurable_item to be a `SET [1:?] OF product_concept_feature_association`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, effectivity* in) -{ - size_t base = 0; - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to effectivity"); } do { // convert the 'id' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->id, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to effectivity to be a `identifier`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, product_definition_effectivity* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to product_definition_effectivity"); } do { // convert the 'usage' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->usage, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to product_definition_effectivity to be a `product_definition_relationship`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, configuration_effectivity* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to configuration_effectivity"); } do { // convert the 'configuration' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->configuration, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to configuration_effectivity to be a `configuration_design`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, configuration_item_relationship* in) -{ - size_t base = 0; - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to configuration_item_relationship"); } do { // convert the 'name' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->name, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to configuration_item_relationship to be a `label`")); } - } while (0); - do { // convert the 'description' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert(in->description, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to configuration_item_relationship to be a `text`")); } - } while (0); - do { // convert the 'relating_configuration_item' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2] = true; break; } - try { GenericConvert(in->relating_configuration_item, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to configuration_item_relationship to be a `configuration_item`")); } - } while (0); - do { // convert the 'related_configuration_item' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[3] = true; break; } - try { GenericConvert(in->related_configuration_item, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to configuration_item_relationship to be a `configuration_item`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, configuration_item_hierarchical_relationship* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to configuration_item_hierarchical_relationship"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, configuration_item_revision_sequence* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to configuration_item_revision_sequence"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, configured_effectivity_assignment* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to configured_effectivity_assignment"); } do { // convert the 'items' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->items, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to configured_effectivity_assignment to be a `SET [1:?] OF configured_effectivity_item`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, configured_effectivity_context_assignment* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to configured_effectivity_context_assignment"); } do { // convert the 'items' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->items, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to configured_effectivity_context_assignment to be a `SET [1:?] OF configured_effectivity_context_item`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, conical_stepped_hole_transition* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to conical_stepped_hole_transition"); } do { // convert the 'transition_number' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->transition_number, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to conical_stepped_hole_transition to be a `positive_integer`")); } - } while (0); - do { // convert the 'cone_apex_angle' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->cone_apex_angle, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to conical_stepped_hole_transition to be a `plane_angle_measure`")); } - } while (0); - do { // convert the 'cone_base_radius' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->cone_base_radius, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to conical_stepped_hole_transition to be a `positive_length_measure`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, elementary_surface* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to elementary_surface"); } do { // convert the 'position' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->position, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to elementary_surface to be a `axis2_placement_3d`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, conical_surface* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to conical_surface"); } do { // convert the 'radius' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->radius, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to conical_surface to be a `length_measure`")); } - } while (0); - do { // convert the 'semi_angle' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->semi_angle, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to conical_surface to be a `plane_angle_measure`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, connected_edge_set* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to connected_edge_set"); } do { // convert the 'ces_edges' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->ces_edges, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to connected_edge_set to be a `SET [1:?] OF edge`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, connected_face_sub_set* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to connected_face_sub_set"); } do { // convert the 'parent_face_set' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->parent_face_set, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to connected_face_sub_set to be a `connected_face_set`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, constructive_geometry_representation* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to constructive_geometry_representation"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, representation_relationship* in) -{ - size_t base = 0; - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to representation_relationship"); } do { // convert the 'name' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->name, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to representation_relationship to be a `label`")); } - } while (0); - do { // convert the 'description' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert(in->description, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to representation_relationship to be a `text`")); } - } while (0); - do { // convert the 'rep_1' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2] = true; break; } - try { GenericConvert(in->rep_1, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to representation_relationship to be a `representation`")); } - } while (0); - do { // convert the 'rep_2' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[3] = true; break; } - try { GenericConvert(in->rep_2, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to representation_relationship to be a `representation`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, constructive_geometry_representation_relationship* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to constructive_geometry_representation_relationship"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, contact_ratio_representation* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to contact_ratio_representation"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, invisibility* in) -{ - size_t base = 0; - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to invisibility"); } do { // convert the 'invisible_items' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->invisible_items, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to invisibility to be a `SET [1:?] OF invisible_item`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, context_dependent_invisibility* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to context_dependent_invisibility"); } do { // convert the 'presentation_context' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->presentation_context, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to context_dependent_invisibility to be a `invisibility_context`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, over_riding_styled_item* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to over_riding_styled_item"); } do { // convert the 'over_ridden_style' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->over_ridden_style, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to over_riding_styled_item to be a `styled_item`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, context_dependent_over_riding_styled_item* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to context_dependent_over_riding_styled_item"); } do { // convert the 'style_context' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->style_context, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to context_dependent_over_riding_styled_item to be a `LIST [1:?] OF style_context_select`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, context_dependent_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to context_dependent_unit"); } do { // convert the 'name' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->name, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to context_dependent_unit to be a `label`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, conversion_based_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to conversion_based_unit"); } do { // convert the 'name' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->name, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to conversion_based_unit to be a `label`")); } - } while (0); - do { // convert the 'conversion_factor' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->conversion_factor, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to conversion_based_unit to be a `measure_with_unit`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, csg_shape_representation* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to csg_shape_representation"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, csg_solid* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to csg_solid"); } do { // convert the 'tree_root_expression' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->tree_root_expression, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to csg_solid to be a `csg_select`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, currency* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to currency"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, currency_measure_with_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to currency_measure_with_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, curve_bounded_surface* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to curve_bounded_surface"); } do { // convert the 'basis_surface' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->basis_surface, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to curve_bounded_surface to be a `surface`")); } - } while (0); - do { // convert the 'boundaries' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->boundaries, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to curve_bounded_surface to be a `SET [1:?] OF boundary_curve`")); } - } while (0); - do { // convert the 'implicit_outer' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->implicit_outer, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to curve_bounded_surface to be a `BOOLEAN`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, curve_dimension* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to curve_dimension"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, curve_replica* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to curve_replica"); } do { // convert the 'parent_curve' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->parent_curve, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to curve_replica to be a `curve`")); } - } while (0); - do { // convert the 'transformation' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->transformation, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to curve_replica to be a `cartesian_transformation_operator`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, curve_style* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to curve_style"); } do { // convert the 'name' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->name, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to curve_style to be a `label`")); } - } while (0); - do { // convert the 'curve_font' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->curve_font, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to curve_style to be a `curve_font_or_scaled_curve_font_select`")); } - } while (0); - do { // convert the 'curve_width' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->curve_width, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to curve_style to be a `size_select`")); } - } while (0); - do { // convert the 'curve_colour' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->curve_colour, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to curve_style to be a `colour`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, curve_style_font* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to curve_style_font"); } do { // convert the 'name' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->name, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to curve_style_font to be a `label`")); } - } while (0); - do { // convert the 'pattern_list' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->pattern_list, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to curve_style_font to be a `LIST [1:?] OF curve_style_font_pattern`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, curve_style_font_and_scaling* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to curve_style_font_and_scaling"); } do { // convert the 'name' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->name, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to curve_style_font_and_scaling to be a `label`")); } - } while (0); - do { // convert the 'curve_font' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->curve_font, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to curve_style_font_and_scaling to be a `curve_style_font_select`")); } - } while (0); - do { // convert the 'curve_font_scaling' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->curve_font_scaling, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to curve_style_font_and_scaling to be a `REAL`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, curve_style_font_pattern* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to curve_style_font_pattern"); } do { // convert the 'visible_segment_length' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->visible_segment_length, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to curve_style_font_pattern to be a `positive_length_measure`")); } - } while (0); - do { // convert the 'invisible_segment_length' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->invisible_segment_length, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to curve_style_font_pattern to be a `positive_length_measure`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, curve_swept_solid_shape_representation* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to curve_swept_solid_shape_representation"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, cylindrical_surface* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to cylindrical_surface"); } do { // convert the 'radius' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->radius, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to cylindrical_surface to be a `positive_length_measure`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, cylindricity_tolerance* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to cylindricity_tolerance"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, date_representation_item* in) -{ - size_t base = 0; - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, date_time_representation_item* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, dated_effectivity* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to dated_effectivity"); } do { // convert the 'effectivity_end_date' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) break; - try { GenericConvert(in->effectivity_end_date, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to dated_effectivity to be a `date_time_or_event_occurrence`")); } - } while (0); - do { // convert the 'effectivity_start_date' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->effectivity_start_date, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to dated_effectivity to be a `date_time_or_event_occurrence`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, datum* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to datum"); } do { // convert the 'identification' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->identification, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to datum to be a `identifier`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, datum_feature* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to datum_feature"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, datum_feature_callout* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to datum_feature_callout"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, datum_reference* in) -{ - size_t base = 0; - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to datum_reference"); } do { // convert the 'precedence' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->precedence, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to datum_reference to be a `INTEGER`")); } - } while (0); - do { // convert the 'referenced_datum' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->referenced_datum, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to datum_reference to be a `datum`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, datum_target* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to datum_target"); } do { // convert the 'target_id' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->target_id, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to datum_target to be a `identifier`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, datum_target_callout* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to datum_target_callout"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, default_tolerance_table* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to default_tolerance_table"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, default_tolerance_table_cell* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to default_tolerance_table_cell"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, defined_symbol* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to defined_symbol"); } do { // convert the 'definition' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->definition, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to defined_symbol to be a `defined_symbol_select`")); } - } while (0); - do { // convert the 'target' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->target, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to defined_symbol to be a `symbol_target`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, definitional_representation* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to definitional_representation"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, definitional_representation_relationship* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to definitional_representation_relationship"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, definitional_representation_relationship_with_same_context* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to definitional_representation_relationship_with_same_context"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, degenerate_pcurve* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to degenerate_pcurve"); } do { // convert the 'basis_surface' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->basis_surface, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to degenerate_pcurve to be a `surface`")); } - } while (0); - do { // convert the 'reference_to_curve' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->reference_to_curve, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to degenerate_pcurve to be a `definitional_representation`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, toroidal_surface* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to toroidal_surface"); } do { // convert the 'major_radius' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->major_radius, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to toroidal_surface to be a `positive_length_measure`")); } - } while (0); - do { // convert the 'minor_radius' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->minor_radius, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to toroidal_surface to be a `positive_length_measure`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, degenerate_toroidal_surface* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to degenerate_toroidal_surface"); } do { // convert the 'select_outer' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->select_outer, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to degenerate_toroidal_surface to be a `BOOLEAN`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, descriptive_representation_item* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to descriptive_representation_item"); } do { // convert the 'description' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->description, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to descriptive_representation_item to be a `text`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, product_definition_context* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to product_definition_context"); } do { // convert the 'life_cycle_stage' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->life_cycle_stage, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to product_definition_context to be a `label`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, design_context* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to design_context"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, design_make_from_relationship* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to design_make_from_relationship"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, diameter_dimension* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to diameter_dimension"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, ratio_measure_with_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to ratio_measure_with_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, dielectric_constant_measure_with_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to dielectric_constant_measure_with_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, dimension_callout* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to dimension_callout"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, draughting_callout_relationship* in) -{ - size_t base = 0; - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to draughting_callout_relationship"); } do { // convert the 'name' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->name, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to draughting_callout_relationship to be a `label`")); } - } while (0); - do { // convert the 'description' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->description, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to draughting_callout_relationship to be a `text`")); } - } while (0); - do { // convert the 'relating_draughting_callout' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2] = true; break; } - try { GenericConvert(in->relating_draughting_callout, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to draughting_callout_relationship to be a `draughting_callout`")); } - } while (0); - do { // convert the 'related_draughting_callout' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[3] = true; break; } - try { GenericConvert(in->related_draughting_callout, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to draughting_callout_relationship to be a `draughting_callout`")); } - } while (0); - return base; -} - -} -} diff --git a/code/AssetLib/StepFile/StepFileGen3.cpp b/code/AssetLib/StepFile/StepFileGen3.cpp deleted file mode 100644 index b3e34027e..000000000 --- a/code/AssetLib/StepFile/StepFileGen3.cpp +++ /dev/null @@ -1,5746 +0,0 @@ -/* -Open Asset Import Library (ASSIMP) ----------------------------------------------------------------------- - -Copyright (c) 2006-2020, ASSIMP Development 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 Development 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 "code/Importer/StepFile/StepReaderGen.h" - -namespace Assimp { -using namespace StepFile; -namespace STEP { - -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, dimension_callout_component_relationship* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to dimension_callout_component_relationship"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, dimension_callout_relationship* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to dimension_callout_relationship"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, dimension_curve* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to dimension_curve"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, terminator_symbol* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to terminator_symbol"); } do { // convert the 'annotated_curve' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->annotated_curve, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to terminator_symbol to be a `annotation_curve_occurrence`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, dimension_curve_terminator* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to dimension_curve_terminator"); } do { // convert the 'role' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->role, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to dimension_curve_terminator to be a `dimension_extent_usage`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, dimension_curve_terminator_to_projection_curve_associativity* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to dimension_curve_terminator_to_projection_curve_associativity"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, dimension_pair* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to dimension_pair"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, dimension_text_associativity* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, dimensional_location_with_path* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to dimensional_location_with_path"); } do { // convert the 'path' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->path, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to dimensional_location_with_path to be a `shape_aspect`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, dimensional_size_with_path* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to dimensional_size_with_path"); } do { // convert the 'path' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->path, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to dimensional_size_with_path to be a `shape_aspect`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, executed_action* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to executed_action"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, directed_action* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to directed_action"); } do { // convert the 'directive' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->directive, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to directed_action to be a `action_directive`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, directed_dimensional_location* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to directed_dimensional_location"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, direction* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to direction"); } do { // convert the 'direction_ratios' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->direction_ratios, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to direction to be a `LIST [2:3] OF REAL`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, document_file* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, document_identifier* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to document_identifier"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, document_identifier_assignment* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to document_identifier_assignment"); } do { // convert the 'items' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->items, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to document_identifier_assignment to be a `SET [1:?] OF document_identifier_assigned_item`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, document_product_association* in) -{ - size_t base = 0; - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to document_product_association"); } do { // convert the 'name' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->name, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to document_product_association to be a `label`")); } - } while (0); - do { // convert the 'description' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert(in->description, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to document_product_association to be a `text`")); } - } while (0); - do { // convert the 'relating_document' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2] = true; break; } - try { GenericConvert(in->relating_document, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to document_product_association to be a `document`")); } - } while (0); - do { // convert the 'related_product' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[3] = true; break; } - try { GenericConvert(in->related_product, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to document_product_association to be a `product_or_formation_or_definition`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, document_product_equivalence* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to document_product_equivalence"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, dose_equivalent_measure_with_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to dose_equivalent_measure_with_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, dose_equivalent_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to dose_equivalent_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, double_offset_shelled_solid* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to double_offset_shelled_solid"); } do { // convert the 'thickness2' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->thickness2, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to double_offset_shelled_solid to be a `length_measure`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, item_defined_transformation* in) -{ - size_t base = 0; - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to item_defined_transformation"); } do { // convert the 'name' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->name, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to item_defined_transformation to be a `label`")); } - } while (0); - do { // convert the 'description' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert(in->description, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to item_defined_transformation to be a `text`")); } - } while (0); - do { // convert the 'transform_item_1' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2] = true; break; } - try { GenericConvert(in->transform_item_1, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to item_defined_transformation to be a `representation_item`")); } - } while (0); - do { // convert the 'transform_item_2' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[3] = true; break; } - try { GenericConvert(in->transform_item_2, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to item_defined_transformation to be a `representation_item`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, transformation_with_derived_angle* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to transformation_with_derived_angle"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, draped_defined_transformation* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to draped_defined_transformation"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, draughting_annotation_occurrence* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to draughting_annotation_occurrence"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, draughting_elements* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to draughting_elements"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, draughting_model* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to draughting_model"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, item_identified_representation_usage* in) -{ - size_t base = 0; - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to item_identified_representation_usage"); } do { // convert the 'name' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->name, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to item_identified_representation_usage to be a `label`")); } - } while (0); - do { // convert the 'description' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert(in->description, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to item_identified_representation_usage to be a `text`")); } - } while (0); - do { // convert the 'definition' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2] = true; break; } - try { GenericConvert(in->definition, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to item_identified_representation_usage to be a `represented_definition`")); } - } while (0); - do { // convert the 'used_representation' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[3] = true; break; } - try { GenericConvert(in->used_representation, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to item_identified_representation_usage to be a `representation`")); } - } while (0); - do { // convert the 'identified_item' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[4] = true; break; } - try { GenericConvert(in->identified_item, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to item_identified_representation_usage to be a `representation_item`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, draughting_model_item_association* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to draughting_model_item_association"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, pre_defined_colour* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, draughting_pre_defined_colour* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, pre_defined_item* in) -{ - size_t base = 0; - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to pre_defined_item"); } do { // convert the 'name' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->name, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to pre_defined_item to be a `label`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, pre_defined_curve_font* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to pre_defined_curve_font"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, draughting_pre_defined_curve_font* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to draughting_pre_defined_curve_font"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, pre_defined_text_font* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to pre_defined_text_font"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, draughting_pre_defined_text_font* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to draughting_pre_defined_text_font"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, draughting_subfigure_representation* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to draughting_subfigure_representation"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, draughting_symbol_representation* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to draughting_symbol_representation"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, text_literal* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to text_literal"); } do { // convert the 'literal' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->literal, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to text_literal to be a `presentable_text`")); } - } while (0); - do { // convert the 'placement' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->placement, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to text_literal to be a `axis2_placement`")); } - } while (0); - do { // convert the 'alignment' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2] = true; break; } - try { GenericConvert(in->alignment, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to text_literal to be a `text_alignment`")); } - } while (0); - do { // convert the 'path' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[3] = true; break; } - try { GenericConvert(in->path, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to text_literal to be a `text_path`")); } - } while (0); - do { // convert the 'font' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[4] = true; break; } - try { GenericConvert(in->font, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to text_literal to be a `font_select`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, text_literal_with_delineation* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 7) { throw STEP::TypeError("expected 7 arguments to text_literal_with_delineation"); } do { // convert the 'delineation' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->delineation, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to text_literal_with_delineation to be a `text_delineation`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, draughting_text_literal_with_delineation* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 7) { throw STEP::TypeError("expected 7 arguments to draughting_text_literal_with_delineation"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, presentation_set* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, drawing_revision* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to drawing_revision"); } do { // convert the 'revision_identifier' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->revision_identifier, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to drawing_revision to be a `identifier`")); } - } while (0); - do { // convert the 'drawing_identifier' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->drawing_identifier, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to drawing_revision to be a `drawing_definition`")); } - } while (0); - do { // convert the 'intended_scale' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) break; - try { GenericConvert(in->intended_scale, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to drawing_revision to be a `text`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, presentation_representation* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to presentation_representation"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, presentation_area* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to presentation_area"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, drawing_sheet_revision* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to drawing_sheet_revision"); } do { // convert the 'revision_identifier' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->revision_identifier, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to drawing_sheet_revision to be a `identifier`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, drawing_sheet_revision_sequence* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to drawing_sheet_revision_sequence"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, drawing_sheet_revision_usage* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to drawing_sheet_revision_usage"); } do { // convert the 'sheet_number' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->sheet_number, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to drawing_sheet_revision_usage to be a `identifier`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, edge* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to edge"); } do { // convert the 'edge_start' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->edge_start, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to edge to be a `vertex`")); } - } while (0); - do { // convert the 'edge_end' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->edge_end, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to edge to be a `vertex`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, edge_based_wireframe_model* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to edge_based_wireframe_model"); } do { // convert the 'ebwm_boundary' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->ebwm_boundary, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to edge_based_wireframe_model to be a `SET [1:?] OF connected_edge_set`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, edge_based_wireframe_shape_representation* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to edge_based_wireframe_shape_representation"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, edge_blended_solid* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to edge_blended_solid"); } do { // convert the 'blended_edges' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->blended_edges, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to edge_blended_solid to be a `LIST [1:?] OF edge_curve`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, edge_curve* in) -{ - size_t base = 0; - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to edge_curve"); } do { // convert the 'edge_geometry' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->edge_geometry, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to edge_curve to be a `curve`")); } - } while (0); - do { // convert the 'same_sense' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->same_sense, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to edge_curve to be a `BOOLEAN`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, edge_loop* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, electric_charge_measure_with_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to electric_charge_measure_with_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, electric_charge_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to electric_charge_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, electric_current_measure_with_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to electric_current_measure_with_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, electric_current_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to electric_current_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, electric_potential_measure_with_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to electric_potential_measure_with_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, electric_potential_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to electric_potential_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, elementary_brep_shape_representation* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to elementary_brep_shape_representation"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, ellipse* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to ellipse"); } do { // convert the 'semi_axis_1' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->semi_axis_1, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to ellipse to be a `positive_length_measure`")); } - } while (0); - do { // convert the 'semi_axis_2' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->semi_axis_2, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to ellipse to be a `positive_length_measure`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, energy_measure_with_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to energy_measure_with_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, energy_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to energy_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, property_definition* in) -{ - size_t base = 0; - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to property_definition"); } do { // convert the 'name' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->name, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to property_definition to be a `label`")); } - } while (0); - do { // convert the 'description' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert(in->description, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to property_definition to be a `text`")); } - } while (0); - do { // convert the 'definition' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2] = true; break; } - try { GenericConvert(in->definition, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to property_definition to be a `characterized_definition`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, fact_type* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to fact_type"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, entity_assertion* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to entity_assertion"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, enum_reference_prefix* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to enum_reference_prefix"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, evaluated_characteristic* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, evaluated_degenerate_pcurve* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to evaluated_degenerate_pcurve"); } do { // convert the 'equivalent_point' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->equivalent_point, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to evaluated_degenerate_pcurve to be a `cartesian_point`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, evaluation_product_definition* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to evaluation_product_definition"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, event_occurrence* in) -{ - size_t base = 0; - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to event_occurrence"); } do { // convert the 'id' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->id, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to event_occurrence to be a `identifier`")); } - } while (0); - do { // convert the 'name' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->name, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to event_occurrence to be a `label`")); } - } while (0); - do { // convert the 'description' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2] = true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert(in->description, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to event_occurrence to be a `text`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, product_concept_feature_category* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to product_concept_feature_category"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, exclusive_product_concept_feature_category* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to exclusive_product_concept_feature_category"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, uncertainty_qualifier* in) -{ - size_t base = 0; - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to uncertainty_qualifier"); } do { // convert the 'measure_name' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->measure_name, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to uncertainty_qualifier to be a `label`")); } - } while (0); - do { // convert the 'description' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->description, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to uncertainty_qualifier to be a `text`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, standard_uncertainty* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to standard_uncertainty"); } do { // convert the 'uncertainty_value' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->uncertainty_value, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to standard_uncertainty to be a `REAL`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, expanded_uncertainty* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to expanded_uncertainty"); } do { // convert the 'coverage_factor' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->coverage_factor, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to expanded_uncertainty to be a `REAL`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, representation_item_relationship* in) -{ - size_t base = 0; - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to representation_item_relationship"); } do { // convert the 'name' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->name, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to representation_item_relationship to be a `label`")); } - } while (0); - do { // convert the 'description' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert(in->description, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to representation_item_relationship to be a `text`")); } - } while (0); - do { // convert the 'relating_representation_item' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2] = true; break; } - try { GenericConvert(in->relating_representation_item, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to representation_item_relationship to be a `representation_item`")); } - } while (0); - do { // convert the 'related_representation_item' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[3] = true; break; } - try { GenericConvert(in->related_representation_item, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to representation_item_relationship to be a `representation_item`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, explicit_procedural_representation_item_relationship* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to explicit_procedural_representation_item_relationship"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, explicit_procedural_geometric_representation_item_relationship* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to explicit_procedural_geometric_representation_item_relationship"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, explicit_procedural_representation_relationship* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to explicit_procedural_representation_relationship"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, explicit_procedural_shape_representation_relationship* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to explicit_procedural_shape_representation_relationship"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, expression_conversion_based_unit* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, extension* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to extension"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, extent* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to extent"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, external_source* in) -{ - size_t base = 0; - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to external_source"); } do { // convert the 'source_id' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->source_id, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to external_source to be a `source_item`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, external_class_library* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to external_class_library"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, externally_defined_class* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, externally_defined_colour* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, externally_defined_context_dependent_unit* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, externally_defined_conversion_based_unit* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, externally_defined_currency* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, externally_defined_item* in) -{ - size_t base = 0; - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to externally_defined_item"); } do { // convert the 'item_id' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->item_id, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to externally_defined_item to be a `source_item`")); } - } while (0); - do { // convert the 'source' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->source, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to externally_defined_item to be a `external_source`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, externally_defined_curve_font* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to externally_defined_curve_font"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, externally_defined_dimension_definition* in) -{ - size_t base = 0; - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, externally_defined_general_property* in) -{ - size_t base = 0; - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, externally_defined_hatch_style* in) -{ - size_t base = 0; - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, externally_defined_marker* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, picture_representation_item* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to picture_representation_item"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, externally_defined_picture_representation_item* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to externally_defined_picture_representation_item"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, externally_defined_representation_item* in) -{ - size_t base = 0; - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, externally_defined_string* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, externally_defined_symbol* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to externally_defined_symbol"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, externally_defined_terminator_symbol* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to externally_defined_terminator_symbol"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, externally_defined_text_font* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to externally_defined_text_font"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, externally_defined_tile* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to externally_defined_tile"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, externally_defined_tile_style* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, swept_area_solid* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to swept_area_solid"); } do { // convert the 'swept_area' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->swept_area, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to swept_area_solid to be a `curve_bounded_surface`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, extruded_area_solid* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to extruded_area_solid"); } do { // convert the 'extruded_direction' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->extruded_direction, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to extruded_area_solid to be a `direction`")); } - } while (0); - do { // convert the 'depth' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->depth, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to extruded_area_solid to be a `positive_length_measure`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, swept_face_solid* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to swept_face_solid"); } do { // convert the 'swept_face' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->swept_face, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to swept_face_solid to be a `face_surface`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, extruded_face_solid* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to extruded_face_solid"); } do { // convert the 'extruded_direction' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->extruded_direction, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to extruded_face_solid to be a `direction`")); } - } while (0); - do { // convert the 'depth' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->depth, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to extruded_face_solid to be a `positive_length_measure`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, extruded_face_solid_with_trim_conditions* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 10) { throw STEP::TypeError("expected 10 arguments to extruded_face_solid_with_trim_conditions"); } do { // convert the 'first_trim_condition' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->first_trim_condition, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to extruded_face_solid_with_trim_conditions to be a `trim_condition_select`")); } - } while (0); - do { // convert the 'second_trim_condition' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->second_trim_condition, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to extruded_face_solid_with_trim_conditions to be a `trim_condition_select`")); } - } while (0); - do { // convert the 'first_trim_intent' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2] = true; break; } - try { GenericConvert(in->first_trim_intent, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to extruded_face_solid_with_trim_conditions to be a `trim_intent`")); } - } while (0); - do { // convert the 'second_trim_intent' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[3] = true; break; } - try { GenericConvert(in->second_trim_intent, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 7 to extruded_face_solid_with_trim_conditions to be a `trim_intent`")); } - } while (0); - do { // convert the 'first_offset' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[4] = true; break; } - try { GenericConvert(in->first_offset, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 8 to extruded_face_solid_with_trim_conditions to be a `non_negative_length_measure`")); } - } while (0); - do { // convert the 'second_offset' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[5] = true; break; } - try { GenericConvert(in->second_offset, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 9 to extruded_face_solid_with_trim_conditions to be a `non_negative_length_measure`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, extruded_face_solid_with_draft_angle* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 11) { throw STEP::TypeError("expected 11 arguments to extruded_face_solid_with_draft_angle"); } do { // convert the 'draft_angle' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->draft_angle, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 10 to extruded_face_solid_with_draft_angle to be a `plane_angle_measure`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, extruded_face_solid_with_multiple_draft_angles* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 11) { throw STEP::TypeError("expected 11 arguments to extruded_face_solid_with_multiple_draft_angles"); } do { // convert the 'draft_angles' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->draft_angles, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 10 to extruded_face_solid_with_multiple_draft_angles to be a `LIST [2:?] OF plane_angle_measure`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, face* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to face"); } do { // convert the 'bounds' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->bounds, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to face to be a `SET [1:?] OF face_bound`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, face_based_surface_model* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to face_based_surface_model"); } do { // convert the 'fbsm_faces' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->fbsm_faces, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to face_based_surface_model to be a `SET [1:?] OF connected_face_set`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, face_bound* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to face_bound"); } do { // convert the 'bound' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->bound, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to face_bound to be a `loop`")); } - } while (0); - do { // convert the 'orientation' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->orientation, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to face_bound to be a `BOOLEAN`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, face_outer_bound* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to face_outer_bound"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, faceted_brep* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to faceted_brep"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, faceted_brep_shape_representation* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to faceted_brep_shape_representation"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, fill_area_style* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to fill_area_style"); } do { // convert the 'name' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->name, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to fill_area_style to be a `label`")); } - } while (0); - do { // convert the 'fill_styles' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->fill_styles, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to fill_area_style to be a `SET [1:?] OF fill_style_select`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, fill_area_style_hatching* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to fill_area_style_hatching"); } do { // convert the 'hatch_line_appearance' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->hatch_line_appearance, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to fill_area_style_hatching to be a `curve_style`")); } - } while (0); - do { // convert the 'start_of_next_hatch_line' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->start_of_next_hatch_line, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to fill_area_style_hatching to be a `one_direction_repeat_factor`")); } - } while (0); - do { // convert the 'point_of_reference_hatch_line' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->point_of_reference_hatch_line, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to fill_area_style_hatching to be a `cartesian_point`")); } - } while (0); - do { // convert the 'pattern_start' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->pattern_start, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to fill_area_style_hatching to be a `cartesian_point`")); } - } while (0); - do { // convert the 'hatch_line_angle' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->hatch_line_angle, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to fill_area_style_hatching to be a `plane_angle_measure`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, fill_area_style_tile_coloured_region* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to fill_area_style_tile_coloured_region"); } do { // convert the 'closed_curve' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->closed_curve, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to fill_area_style_tile_coloured_region to be a `curve_or_annotation_curve_occurrence`")); } - } while (0); - do { // convert the 'region_colour' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->region_colour, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to fill_area_style_tile_coloured_region to be a `colour`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, fill_area_style_tile_curve_with_style* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to fill_area_style_tile_curve_with_style"); } do { // convert the 'styled_curve' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->styled_curve, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to fill_area_style_tile_curve_with_style to be a `annotation_curve_occurrence`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, fill_area_style_tile_symbol_with_style* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to fill_area_style_tile_symbol_with_style"); } do { // convert the 'symbol' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->symbol, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to fill_area_style_tile_symbol_with_style to be a `annotation_symbol_occurrence`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, fill_area_style_tiles* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to fill_area_style_tiles"); } do { // convert the 'tiling_pattern' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->tiling_pattern, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to fill_area_style_tiles to be a `two_direction_repeat_factor`")); } - } while (0); - do { // convert the 'tiles' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->tiles, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to fill_area_style_tiles to be a `SET [1:?] OF fill_area_style_tile_shape_select`")); } - } while (0); - do { // convert the 'tiling_scale' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->tiling_scale, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to fill_area_style_tiles to be a `positive_ratio_measure`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, shape_representation_relationship* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to shape_representation_relationship"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, flat_pattern_ply_representation_relationship* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to flat_pattern_ply_representation_relationship"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, flatness_tolerance* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to flatness_tolerance"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, force_measure_with_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to force_measure_with_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, force_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to force_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, forward_chaining_rule* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to forward_chaining_rule"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, forward_chaining_rule_premise* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, frequency_measure_with_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to frequency_measure_with_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, frequency_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to frequency_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, func* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to func"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, functional_breakdown_context* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to functional_breakdown_context"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, functional_element_usage* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to functional_element_usage"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, general_material_property* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to general_material_property"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, simple_generic_expression* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, generic_literal* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, generic_variable* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, geometric_alignment* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to geometric_alignment"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, geometric_set* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to geometric_set"); } do { // convert the 'elements' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->elements, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to geometric_set to be a `SET [1:?] OF geometric_set_select`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, geometric_curve_set* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to geometric_curve_set"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, geometric_intersection* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to geometric_intersection"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, geometric_item_specific_usage* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to geometric_item_specific_usage"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, geometric_model_element_relationship* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, representation_context* in) -{ - size_t base = 0; - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to representation_context"); } do { // convert the 'context_identifier' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->context_identifier, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to representation_context to be a `identifier`")); } - } while (0); - do { // convert the 'context_type' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->context_type, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to representation_context to be a `text`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, geometric_representation_context* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to geometric_representation_context"); } do { // convert the 'coordinate_space_dimension' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->coordinate_space_dimension, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to geometric_representation_context to be a `dimension_count`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, geometric_tolerance_with_defined_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to geometric_tolerance_with_defined_unit"); } do { // convert the 'unit_size' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->unit_size, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to geometric_tolerance_with_defined_unit to be a `measure_with_unit`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, geometrical_tolerance_callout* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to geometrical_tolerance_callout"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, geometrically_bounded_2d_wireframe_representation* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to geometrically_bounded_2d_wireframe_representation"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, geometrically_bounded_surface_shape_representation* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to geometrically_bounded_surface_shape_representation"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, geometrically_bounded_wireframe_shape_representation* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to geometrically_bounded_wireframe_shape_representation"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, global_assignment* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to global_assignment"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, global_uncertainty_assigned_context* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to global_uncertainty_assigned_context"); } do { // convert the 'uncertainty' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->uncertainty, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to global_uncertainty_assigned_context to be a `SET [1:?] OF uncertainty_measure_with_unit`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, global_unit_assigned_context* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to global_unit_assigned_context"); } do { // convert the 'units' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->units, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to global_unit_assigned_context to be a `SET [1:?] OF unit`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, ground_fact* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to ground_fact"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, hardness_representation* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to hardness_representation"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, hidden_element_over_riding_styled_item* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to hidden_element_over_riding_styled_item"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, hyperbola* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to hyperbola"); } do { // convert the 'semi_axis' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->semi_axis, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to hyperbola to be a `positive_length_measure`")); } - } while (0); - do { // convert the 'semi_imag_axis' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->semi_imag_axis, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to hyperbola to be a `positive_length_measure`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, illuminance_measure_with_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to illuminance_measure_with_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, illuminance_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to illuminance_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, included_text_block* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to included_text_block"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, inclusion_product_concept_feature* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to inclusion_product_concept_feature"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, user_selected_elements* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to user_selected_elements"); } do { // convert the 'picked_items' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->picked_items, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to user_selected_elements to be a `SET [1:?] OF representation_item`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, indirectly_selected_elements* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to indirectly_selected_elements"); } do { // convert the 'indirectly_picked_items' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->indirectly_picked_items, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to indirectly_selected_elements to be a `SET [1:?] OF representation_item`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, indirectly_selected_shape_elements* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, inductance_measure_with_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to inductance_measure_with_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, inductance_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to inductance_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, information_right* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to information_right"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, information_usage_right* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to information_usage_right"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, instance_usage_context_assignment* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to instance_usage_context_assignment"); } do { // convert the 'items' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->items, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to instance_usage_context_assignment to be a `SET [1:?] OF instance_usage_context_select`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, instanced_feature* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, literal_number* in) -{ - size_t base = 0; - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to literal_number"); } do { // convert the 'the_value' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->the_value, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to literal_number to be a `NUMBER`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, int_literal* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to int_literal"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, integer_representation_item* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, surface_curve* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to surface_curve"); } do { // convert the 'curve_3d' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->curve_3d, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to surface_curve to be a `curve`")); } - } while (0); - do { // convert the 'associated_geometry' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->associated_geometry, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to surface_curve to be a `LIST [1:2] OF pcurve_or_surface`")); } - } while (0); - do { // convert the 'master_representation' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2] = true; break; } - try { GenericConvert(in->master_representation, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to surface_curve to be a `preferred_surface_curve_representation`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, intersection_curve* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to intersection_curve"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, interval_expression* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, iso4217_currency* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to iso4217_currency"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, known_source* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, laid_defined_transformation* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to laid_defined_transformation"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, language* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to language"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, leader_curve* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to leader_curve"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, leader_directed_callout* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to leader_directed_callout"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, leader_directed_dimension* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to leader_directed_dimension"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, leader_terminator* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to leader_terminator"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, length_measure_with_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to length_measure_with_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, length_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to length_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, light_source* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to light_source"); } do { // convert the 'light_colour' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->light_colour, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to light_source to be a `colour`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, light_source_ambient* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to light_source_ambient"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, light_source_directional* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to light_source_directional"); } do { // convert the 'orientation' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->orientation, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to light_source_directional to be a `direction`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, light_source_positional* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to light_source_positional"); } do { // convert the 'position' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->position, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to light_source_positional to be a `cartesian_point`")); } - } while (0); - do { // convert the 'constant_attenuation' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->constant_attenuation, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to light_source_positional to be a `REAL`")); } - } while (0); - do { // convert the 'distance_attenuation' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->distance_attenuation, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to light_source_positional to be a `REAL`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, light_source_spot* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 8) { throw STEP::TypeError("expected 8 arguments to light_source_spot"); } do { // convert the 'position' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->position, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to light_source_spot to be a `cartesian_point`")); } - } while (0); - do { // convert the 'orientation' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->orientation, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to light_source_spot to be a `direction`")); } - } while (0); - do { // convert the 'concentration_exponent' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->concentration_exponent, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to light_source_spot to be a `REAL`")); } - } while (0); - do { // convert the 'constant_attenuation' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->constant_attenuation, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to light_source_spot to be a `REAL`")); } - } while (0); - do { // convert the 'distance_attenuation' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->distance_attenuation, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to light_source_spot to be a `REAL`")); } - } while (0); - do { // convert the 'spread_angle' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->spread_angle, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 7 to light_source_spot to be a `positive_plane_angle_measure`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, line* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to line"); } do { // convert the 'pnt' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->pnt, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to line to be a `cartesian_point`")); } - } while (0); - do { // convert the 'dir' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->dir, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to line to be a `vector`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, line_profile_tolerance* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to line_profile_tolerance"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, linear_dimension* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to linear_dimension"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, simple_clause* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to simple_clause"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, literal_conjunction* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to literal_conjunction"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, literal_disjunction* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to literal_disjunction"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, logical_literal* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to logical_literal"); } do { // convert the 'lit_value' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->lit_value, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to logical_literal to be a `LOGICAL`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB&, const LIST& params, logical_representation_item* ) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, loop* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to loop"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, loss_tangent_measure_with_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to loss_tangent_measure_with_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, lot_effectivity* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to lot_effectivity"); } do { // convert the 'effectivity_lot_id' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->effectivity_lot_id, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to lot_effectivity to be a `identifier`")); } - } while (0); - do { // convert the 'effectivity_lot_size' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->effectivity_lot_size, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to lot_effectivity to be a `measure_with_unit`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, luminous_flux_measure_with_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to luminous_flux_measure_with_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, luminous_flux_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to luminous_flux_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, luminous_intensity_measure_with_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to luminous_intensity_measure_with_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, luminous_intensity_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to luminous_intensity_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, magnetic_flux_density_measure_with_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to magnetic_flux_density_measure_with_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, magnetic_flux_density_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to magnetic_flux_density_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, magnetic_flux_measure_with_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to magnetic_flux_measure_with_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, magnetic_flux_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to magnetic_flux_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, make_from_usage_option* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 8) { throw STEP::TypeError("expected 8 arguments to make_from_usage_option"); } do { // convert the 'ranking' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->ranking, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to make_from_usage_option to be a `INTEGER`")); } - } while (0); - do { // convert the 'ranking_rationale' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->ranking_rationale, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to make_from_usage_option to be a `text`")); } - } while (0); - do { // convert the 'quantity' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->quantity, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 7 to make_from_usage_option to be a `measure_with_unit`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, manifold_subsurface_shape_representation* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to manifold_subsurface_shape_representation"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, manifold_surface_shape_representation* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to manifold_surface_shape_representation"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, mass_measure_with_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to mass_measure_with_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, mass_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to mass_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, material_property* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to material_property"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, property_definition_representation* in) -{ - size_t base = 0; - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to property_definition_representation"); } do { // convert the 'definition' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->definition, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to property_definition_representation to be a `represented_definition`")); } - } while (0); - do { // convert the 'used_representation' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->used_representation, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to property_definition_representation to be a `representation`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, material_property_representation* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to material_property_representation"); } do { // convert the 'dependent_environment' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->dependent_environment, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to material_property_representation to be a `data_environment`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, measure_representation_item* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, product_context* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to product_context"); } do { // convert the 'discipline_type' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->discipline_type, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to product_context to be a `label`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, mechanical_context* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to mechanical_context"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, mechanical_design_and_draughting_relationship* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to mechanical_design_and_draughting_relationship"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, mechanical_design_geometric_presentation_area* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to mechanical_design_geometric_presentation_area"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, mechanical_design_geometric_presentation_representation* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to mechanical_design_geometric_presentation_representation"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, mechanical_design_presentation_representation_with_draughting* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to mechanical_design_presentation_representation_with_draughting"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, mechanical_design_shaded_presentation_area* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to mechanical_design_shaded_presentation_area"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, mechanical_design_shaded_presentation_representation* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to mechanical_design_shaded_presentation_representation"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, min_and_major_ply_orientation_basis* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, modified_geometric_tolerance* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to modified_geometric_tolerance"); } do { // convert the 'modifier' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->modifier, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to modified_geometric_tolerance to be a `limit_condition`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, modified_solid_with_placed_configuration* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to modified_solid_with_placed_configuration"); } do { // convert the 'placing' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->placing, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to modified_solid_with_placed_configuration to be a `axis2_placement_3d`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, moments_of_inertia_representation* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to moments_of_inertia_representation"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, multi_language_attribute_assignment* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to multi_language_attribute_assignment"); } do { // convert the 'items' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->items, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to multi_language_attribute_assignment to be a `SET [1:?] OF multi_language_attribute_item`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, multiple_arity_boolean_expression* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, multiple_arity_generic_expression* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to multiple_arity_generic_expression"); } do { // convert the 'operands' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->operands, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to multiple_arity_generic_expression to be a `LIST [2:?] OF generic_expression`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, multiple_arity_numeric_expression* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, next_assembly_usage_occurrence* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to next_assembly_usage_occurrence"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, non_manifold_surface_shape_representation* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to non_manifold_surface_shape_representation"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, null_representation_item* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to null_representation_item"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, numeric_expression* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, offset_curve_2d* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to offset_curve_2d"); } do { // convert the 'basis_curve' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->basis_curve, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to offset_curve_2d to be a `curve`")); } - } while (0); - do { // convert the 'distance' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->distance, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to offset_curve_2d to be a `length_measure`")); } - } while (0); - do { // convert the 'self_intersect' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->self_intersect, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to offset_curve_2d to be a `LOGICAL`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, offset_curve_3d* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to offset_curve_3d"); } do { // convert the 'basis_curve' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->basis_curve, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to offset_curve_3d to be a `curve`")); } - } while (0); - do { // convert the 'distance' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->distance, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to offset_curve_3d to be a `length_measure`")); } - } while (0); - do { // convert the 'self_intersect' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->self_intersect, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to offset_curve_3d to be a `LOGICAL`")); } - } while (0); - do { // convert the 'ref_direction' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->ref_direction, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to offset_curve_3d to be a `direction`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, offset_surface* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to offset_surface"); } do { // convert the 'basis_surface' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->basis_surface, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to offset_surface to be a `surface`")); } - } while (0); - do { // convert the 'distance' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->distance, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to offset_surface to be a `length_measure`")); } - } while (0); - do { // convert the 'self_intersect' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->self_intersect, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to offset_surface to be a `LOGICAL`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, one_direction_repeat_factor* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to one_direction_repeat_factor"); } do { // convert the 'repeat_factor' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->repeat_factor, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to one_direction_repeat_factor to be a `vector`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, open_shell* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to open_shell"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, ordinal_date* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to ordinal_date"); } do { // convert the 'day_component' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->day_component, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to ordinal_date to be a `day_in_year_number`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, projection_directed_callout* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to projection_directed_callout"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, ordinate_dimension* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to ordinate_dimension"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, organizational_address* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 14) { throw STEP::TypeError("expected 14 arguments to organizational_address"); } do { // convert the 'organizations' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->organizations, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 12 to organizational_address to be a `SET [1:?] OF organization`")); } - } while (0); - do { // convert the 'description' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) break; - try { GenericConvert(in->description, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 13 to organizational_address to be a `text`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, oriented_closed_shell* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to oriented_closed_shell"); } do { // convert the 'closed_shell_element' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->closed_shell_element, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to oriented_closed_shell to be a `closed_shell`")); } - } while (0); - do { // convert the 'orientation' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->orientation, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to oriented_closed_shell to be a `BOOLEAN`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, oriented_edge* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to oriented_edge"); } do { // convert the 'edge_element' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->edge_element, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to oriented_edge to be a `edge`")); } - } while (0); - do { // convert the 'orientation' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->orientation, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to oriented_edge to be a `BOOLEAN`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, oriented_face* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to oriented_face"); } do { // convert the 'face_element' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->face_element, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to oriented_face to be a `face`")); } - } while (0); - do { // convert the 'orientation' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->orientation, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to oriented_face to be a `BOOLEAN`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, oriented_open_shell* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to oriented_open_shell"); } do { // convert the 'open_shell_element' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->open_shell_element, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to oriented_open_shell to be a `open_shell`")); } - } while (0); - do { // convert the 'orientation' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->orientation, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to oriented_open_shell to be a `BOOLEAN`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, path* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to path"); } do { // convert the 'edge_list' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->edge_list, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to path to be a `LIST [1:?] OF oriented_edge`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, oriented_path* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to oriented_path"); } do { // convert the 'path_element' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->path_element, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to oriented_path to be a `path`")); } - } while (0); - do { // convert the 'orientation' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->orientation, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to oriented_path to be a `BOOLEAN`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, oriented_surface* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to oriented_surface"); } do { // convert the 'orientation' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->orientation, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to oriented_surface to be a `BOOLEAN`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, outer_boundary_curve* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to outer_boundary_curve"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, package_product_concept_feature* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to package_product_concept_feature"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, parabola* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to parabola"); } do { // convert the 'focal_dist' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->focal_dist, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to parabola to be a `length_measure`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, parallel_offset* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to parallel_offset"); } do { // convert the 'offset' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->offset, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to parallel_offset to be a `measure_with_unit`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, parallelism_tolerance* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to parallelism_tolerance"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, parametric_representation_context* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to parametric_representation_context"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, partial_document_with_structured_text_representation_assignment* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, pcurve* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to pcurve"); } do { // convert the 'basis_surface' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->basis_surface, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to pcurve to be a `surface`")); } - } while (0); - do { // convert the 'reference_to_curve' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->reference_to_curve, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to pcurve to be a `definitional_representation`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, percentage_laminate_definition* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to percentage_laminate_definition"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, zone_structural_makeup* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to zone_structural_makeup"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, percentage_laminate_table* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to percentage_laminate_table"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, percentage_ply_definition* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to percentage_ply_definition"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, perpendicular_to* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to perpendicular_to"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, perpendicularity_tolerance* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to perpendicularity_tolerance"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, person_and_organization_address* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, personal_address* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 14) { throw STEP::TypeError("expected 14 arguments to personal_address"); } do { // convert the 'people' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->people, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 12 to personal_address to be a `SET [1:?] OF person`")); } - } while (0); - do { // convert the 'description' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) break; - try { GenericConvert(in->description, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 13 to personal_address to be a `text`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, physical_breakdown_context* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to physical_breakdown_context"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, physical_element_usage* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to physical_element_usage"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, presentation_view* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to presentation_view"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, picture_representation* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to picture_representation"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, placed_datum_target_feature* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to placed_datum_target_feature"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, placed_feature* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to placed_feature"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, planar_extent* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to planar_extent"); } do { // convert the 'size_in_x' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->size_in_x, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to planar_extent to be a `length_measure`")); } - } while (0); - do { // convert the 'size_in_y' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->size_in_y, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to planar_extent to be a `length_measure`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, planar_box* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to planar_box"); } do { // convert the 'placement' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->placement, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to planar_box to be a `axis2_placement`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, plane* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to plane"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, plane_angle_measure_with_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to plane_angle_measure_with_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, plane_angle_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to plane_angle_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, ply_laminate_definition* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to ply_laminate_definition"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, ply_laminate_sequence_definition* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to ply_laminate_sequence_definition"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, ply_laminate_table* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to ply_laminate_table"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, point_and_vector* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, point_on_curve* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to point_on_curve"); } do { // convert the 'basis_curve' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->basis_curve, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to point_on_curve to be a `curve`")); } - } while (0); - do { // convert the 'point_parameter' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->point_parameter, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to point_on_curve to be a `parameter_value`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, point_on_surface* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to point_on_surface"); } do { // convert the 'basis_surface' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->basis_surface, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to point_on_surface to be a `surface`")); } - } while (0); - do { // convert the 'point_parameter_u' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->point_parameter_u, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to point_on_surface to be a `parameter_value`")); } - } while (0); - do { // convert the 'point_parameter_v' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->point_parameter_v, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to point_on_surface to be a `parameter_value`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, point_path* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, point_replica* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to point_replica"); } do { // convert the 'parent_pt' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->parent_pt, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to point_replica to be a `point`")); } - } while (0); - do { // convert the 'transformation' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->transformation, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to point_replica to be a `cartesian_transformation_operator`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, point_style* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to point_style"); } do { // convert the 'name' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->name, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to point_style to be a `label`")); } - } while (0); - do { // convert the 'marker' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->marker, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to point_style to be a `marker_select`")); } - } while (0); - do { // convert the 'marker_size' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->marker_size, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to point_style to be a `size_select`")); } - } while (0); - do { // convert the 'marker_colour' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->marker_colour, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to point_style to be a `colour`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, polar_complex_number_literal* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to polar_complex_number_literal"); } do { // convert the 'radius' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->radius, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to polar_complex_number_literal to be a `REAL`")); } - } while (0); - do { // convert the 'angle' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->angle, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to polar_complex_number_literal to be a `REAL`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, poly_loop* in) -{ - size_t base = 0; - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to poly_loop"); } do { // convert the 'polygon' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->polygon, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to poly_loop to be a `LIST [3:?] OF cartesian_point`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, polyline* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to polyline"); } do { // convert the 'points' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->points, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to polyline to be a `LIST [2:?] OF cartesian_point`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, position_tolerance* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to position_tolerance"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, positioned_sketch* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to positioned_sketch"); } do { // convert the 'sketch_basis' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->sketch_basis, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to positioned_sketch to be a `sketch_basis_select`")); } - } while (0); - do { // convert the 'auxiliary_elements' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->auxiliary_elements, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to positioned_sketch to be a `SET [0:?] OF auxiliary_geometric_representation_item`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, power_measure_with_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to power_measure_with_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, power_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to power_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, pre_defined_symbol* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to pre_defined_symbol"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, pre_defined_dimension_symbol* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to pre_defined_dimension_symbol"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, pre_defined_geometrical_tolerance_symbol* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to pre_defined_geometrical_tolerance_symbol"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, pre_defined_marker* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to pre_defined_marker"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, pre_defined_point_marker_symbol* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, pre_defined_surface_condition_symbol* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to pre_defined_surface_condition_symbol"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, pre_defined_surface_side_style* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to pre_defined_surface_side_style"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, pre_defined_terminator_symbol* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to pre_defined_terminator_symbol"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, pre_defined_tile* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to pre_defined_tile"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, predefined_picture_representation_item* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to predefined_picture_representation_item"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, presentation_style_assignment* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to presentation_style_assignment"); } do { // convert the 'styles' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->styles, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to presentation_style_assignment to be a `SET [1:?] OF presentation_style_select`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, presentation_style_by_context* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to presentation_style_by_context"); } do { // convert the 'style_context' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->style_context, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to presentation_style_by_context to be a `style_context_select`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, pressure_measure_with_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to pressure_measure_with_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, pressure_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to pressure_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, procedural_representation* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to procedural_representation"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, procedural_representation_sequence* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to procedural_representation_sequence"); } do { // convert the 'elements' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->elements, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to procedural_representation_sequence to be a `LIST [1:?] OF representation_item`")); } - } while (0); - do { // convert the 'suppressed_items' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->suppressed_items, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to procedural_representation_sequence to be a `SET [0:?] OF representation_item`")); } - } while (0); - do { // convert the 'rationale' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->rationale, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to procedural_representation_sequence to be a `text`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, procedural_shape_representation* in) -{ - size_t base = 0; - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, procedural_shape_representation_sequence* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, product_category* in) -{ - size_t base = 0; - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to product_category"); } do { // convert the 'name' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->name, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to product_category to be a `label`")); } - } while (0); - do { // convert the 'description' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert(in->description, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to product_category to be a `text`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, product_class* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, product_concept_context* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to product_concept_context"); } do { // convert the 'market_segment_type' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->market_segment_type, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to product_concept_context to be a `label`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, product_concept_feature_category_usage* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to product_concept_feature_category_usage"); } do { // convert the 'items' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->items, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to product_concept_feature_category_usage to be a `SET [1:?] OF category_usage_item`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, product_definition_element_relationship* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to product_definition_element_relationship"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, product_definition_formation* in) -{ - size_t base = 0; - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to product_definition_formation"); } do { // convert the 'id' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->id, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to product_definition_formation to be a `identifier`")); } - } while (0); - do { // convert the 'description' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert(in->description, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to product_definition_formation to be a `text`")); } - } while (0); - do { // convert the 'of_product' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2] = true; break; } - try { GenericConvert(in->of_product, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to product_definition_formation to be a `product`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, product_definition_formation_with_specified_source* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to product_definition_formation_with_specified_source"); } do { // convert the 'make_or_buy' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->make_or_buy, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to product_definition_formation_with_specified_source to be a `source`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, product_definition_group_assignment* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to product_definition_group_assignment"); } do { // convert the 'items' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->items, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to product_definition_group_assignment to be a `SET [1:1] OF product_definition_or_product_definition_relationship`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, product_definition_shape* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to product_definition_shape"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, product_definition_with_associated_documents* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to product_definition_with_associated_documents"); } do { // convert the 'documentation_ids' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->documentation_ids, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to product_definition_with_associated_documents to be a `SET [1:?] OF document`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, product_identification* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, product_material_composition_relationship* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 9) { throw STEP::TypeError("expected 9 arguments to product_material_composition_relationship"); } do { // convert the 'class' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->class_, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to product_material_composition_relationship to be a `label`")); } - } while (0); - do { // convert the 'constituent_amount' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->constituent_amount, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to product_material_composition_relationship to be a `SET [1:?] OF characterized_product_composition_value`")); } - } while (0); - do { // convert the 'composition_basis' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->composition_basis, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 7 to product_material_composition_relationship to be a `label`")); } - } while (0); - do { // convert the 'determination_method' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->determination_method, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 8 to product_material_composition_relationship to be a `text`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, product_related_product_category* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to product_related_product_category"); } do { // convert the 'products' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->products, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to product_related_product_category to be a `SET [1:?] OF product`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, product_specification* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, tolerance_zone_definition* in) -{ - size_t base = 0; - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to tolerance_zone_definition"); } do { // convert the 'zone' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->zone, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to tolerance_zone_definition to be a `tolerance_zone`")); } - } while (0); - do { // convert the 'boundaries' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->boundaries, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to tolerance_zone_definition to be a `SET [1:?] OF shape_aspect`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, projected_zone_definition* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to projected_zone_definition"); } do { // convert the 'projection_end' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->projection_end, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to projected_zone_definition to be a `shape_aspect`")); } - } while (0); - do { // convert the 'projected_length' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->projected_length, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to projected_zone_definition to be a `measure_with_unit`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, projection_curve* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to projection_curve"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, promissory_usage_occurrence* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to promissory_usage_occurrence"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, qualified_representation_item* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to qualified_representation_item"); } do { // convert the 'qualifiers' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->qualifiers, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to qualified_representation_item to be a `SET [1:?] OF value_qualifier`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, qualitative_uncertainty* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to qualitative_uncertainty"); } do { // convert the 'uncertainty_value' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->uncertainty_value, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to qualitative_uncertainty to be a `text`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, quantified_assembly_component_usage* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 7) { throw STEP::TypeError("expected 7 arguments to quantified_assembly_component_usage"); } do { // convert the 'quantity' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->quantity, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to quantified_assembly_component_usage to be a `measure_with_unit`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, quasi_uniform_curve* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to quasi_uniform_curve"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, quasi_uniform_surface* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 7) { throw STEP::TypeError("expected 7 arguments to quasi_uniform_surface"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, radioactivity_measure_with_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to radioactivity_measure_with_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, radioactivity_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to radioactivity_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, radius_dimension* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to radius_dimension"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, range_characteristic* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, ratio_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to ratio_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, rational_b_spline_curve* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 7) { throw STEP::TypeError("expected 7 arguments to rational_b_spline_curve"); } do { // convert the 'weights_data' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->weights_data, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to rational_b_spline_curve to be a `LIST [2:?] OF REAL`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, rational_b_spline_surface* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 7) { throw STEP::TypeError("expected 7 arguments to rational_b_spline_surface"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, rational_representation_item* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, real_literal* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to real_literal"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, real_representation_item* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, rectangular_composite_surface* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to rectangular_composite_surface"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, rectangular_trimmed_surface* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 8) { throw STEP::TypeError("expected 8 arguments to rectangular_trimmed_surface"); } do { // convert the 'basis_surface' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->basis_surface, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to rectangular_trimmed_surface to be a `surface`")); } - } while (0); - do { // convert the 'u1' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->u1, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to rectangular_trimmed_surface to be a `parameter_value`")); } - } while (0); - do { // convert the 'u2' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->u2, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to rectangular_trimmed_surface to be a `parameter_value`")); } - } while (0); - do { // convert the 'v1' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->v1, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to rectangular_trimmed_surface to be a `parameter_value`")); } - } while (0); - do { // convert the 'v2' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->v2, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to rectangular_trimmed_surface to be a `parameter_value`")); } - } while (0); - do { // convert the 'usense' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->usense, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to rectangular_trimmed_surface to be a `BOOLEAN`")); } - } while (0); - do { // convert the 'vsense' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->vsense, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 7 to rectangular_trimmed_surface to be a `BOOLEAN`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, referenced_modified_datum* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to referenced_modified_datum"); } do { // convert the 'modifier' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->modifier, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to referenced_modified_datum to be a `limit_condition`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, relative_event_occurrence* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to relative_event_occurrence"); } do { // convert the 'base_event' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->base_event, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to relative_event_occurrence to be a `event_occurrence`")); } - } while (0); - do { // convert the 'offset' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->offset, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to relative_event_occurrence to be a `time_measure_with_unit`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, rep_item_group* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, reparametrised_composite_curve_segment* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to reparametrised_composite_curve_segment"); } do { // convert the 'param_length' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->param_length, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to reparametrised_composite_curve_segment to be a `parameter_value`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, representation_relationship_with_transformation* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to representation_relationship_with_transformation"); } do { // convert the 'transformation_operator' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->transformation_operator, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to representation_relationship_with_transformation to be a `transformation`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, requirement_assigned_object* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to requirement_assigned_object"); } do { // convert the 'items' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->items, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to requirement_assigned_object to be a `SET [1:1] OF requirement_assigned_item`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, requirement_assignment* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, requirement_source* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to requirement_source"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, requirement_view_definition_relationship* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to requirement_view_definition_relationship"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, resistance_measure_with_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to resistance_measure_with_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, resistance_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to resistance_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, revolved_area_solid* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to revolved_area_solid"); } do { // convert the 'axis' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->axis, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to revolved_area_solid to be a `axis1_placement`")); } - } while (0); - do { // convert the 'angle' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->angle, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to revolved_area_solid to be a `plane_angle_measure`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, revolved_face_solid* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to revolved_face_solid"); } do { // convert the 'axis' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->axis, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to revolved_face_solid to be a `axis1_placement`")); } - } while (0); - do { // convert the 'angle' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->angle, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to revolved_face_solid to be a `plane_angle_measure`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, revolved_face_solid_with_trim_conditions* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to revolved_face_solid_with_trim_conditions"); } do { // convert the 'first_trim_condition' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->first_trim_condition, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to revolved_face_solid_with_trim_conditions to be a `trim_condition_select`")); } - } while (0); - do { // convert the 'second_trim_condition' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->second_trim_condition, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to revolved_face_solid_with_trim_conditions to be a `trim_condition_select`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, right_angular_wedge* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to right_angular_wedge"); } do { // convert the 'position' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->position, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to right_angular_wedge to be a `axis2_placement_3d`")); } - } while (0); - do { // convert the 'x' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->x, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to right_angular_wedge to be a `positive_length_measure`")); } - } while (0); - do { // convert the 'y' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->y, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to right_angular_wedge to be a `positive_length_measure`")); } - } while (0); - do { // convert the 'z' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->z, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to right_angular_wedge to be a `positive_length_measure`")); } - } while (0); - do { // convert the 'ltx' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->ltx, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to right_angular_wedge to be a `length_measure`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, right_circular_cone* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to right_circular_cone"); } do { // convert the 'position' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->position, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to right_circular_cone to be a `axis1_placement`")); } - } while (0); - do { // convert the 'height' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->height, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to right_circular_cone to be a `positive_length_measure`")); } - } while (0); - do { // convert the 'radius' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->radius, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to right_circular_cone to be a `length_measure`")); } - } while (0); - do { // convert the 'semi_angle' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->semi_angle, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to right_circular_cone to be a `plane_angle_measure`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, right_circular_cylinder* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to right_circular_cylinder"); } do { // convert the 'position' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->position, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to right_circular_cylinder to be a `axis1_placement`")); } - } while (0); - do { // convert the 'height' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->height, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to right_circular_cylinder to be a `positive_length_measure`")); } - } while (0); - do { // convert the 'radius' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->radius, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to right_circular_cylinder to be a `positive_length_measure`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, right_to_usage_association* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to right_to_usage_association"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, roundness_tolerance* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to roundness_tolerance"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, row_representation_item* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to row_representation_item"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, row_value* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to row_value"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, row_variable* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, rule_action* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to rule_action"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, rule_condition* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to rule_condition"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, rule_set* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to rule_set"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, rule_set_group* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to rule_set_group"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, rule_superseded_assignment* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to rule_superseded_assignment"); } do { // convert the 'items' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->items, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to rule_superseded_assignment to be a `SET [1:?] OF rule_superseded_item`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, rule_supersedence* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to rule_supersedence"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, surface_curve_swept_area_solid* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to surface_curve_swept_area_solid"); } do { // convert the 'directrix' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->directrix, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to surface_curve_swept_area_solid to be a `curve`")); } - } while (0); - do { // convert the 'start_param' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->start_param, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to surface_curve_swept_area_solid to be a `REAL`")); } - } while (0); - do { // convert the 'end_param' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2] = true; break; } - try { GenericConvert(in->end_param, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to surface_curve_swept_area_solid to be a `REAL`")); } - } while (0); - do { // convert the 'reference_surface' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[3] = true; break; } - try { GenericConvert(in->reference_surface, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to surface_curve_swept_area_solid to be a `surface`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, ruled_surface_swept_area_solid* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to ruled_surface_swept_area_solid"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, runout_zone_definition* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to runout_zone_definition"); } do { // convert the 'orientation' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->orientation, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to runout_zone_definition to be a `runout_zone_orientation`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, runout_zone_orientation* in) -{ - size_t base = 0; - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to runout_zone_orientation"); } do { // convert the 'angle' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->angle, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to runout_zone_orientation to be a `measure_with_unit`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, runout_zone_orientation_reference_direction* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to runout_zone_orientation_reference_direction"); } do { // convert the 'orientation_defining_relationship' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->orientation_defining_relationship, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to runout_zone_orientation_reference_direction to be a `shape_aspect_relationship`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, satisfied_requirement* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to satisfied_requirement"); } do { // convert the 'items' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->items, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to satisfied_requirement to be a `SET [1:1] OF product_definition`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, satisfies_requirement* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to satisfies_requirement"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, satisfying_item* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to satisfying_item"); } do { // convert the 'items' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->items, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to satisfying_item to be a `SET [1:1] OF requirement_satisfaction_item`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, scalar_variable* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, scattering_parameter* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to scattering_parameter"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, sculptured_solid* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to sculptured_solid"); } do { // convert the 'sculpturing_element' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->sculpturing_element, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to sculptured_solid to be a `generalized_surface_select`")); } - } while (0); - do { // convert the 'positive_side' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->positive_side, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to sculptured_solid to be a `BOOLEAN`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, seam_curve* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to seam_curve"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, serial_numbered_effectivity* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to serial_numbered_effectivity"); } do { // convert the 'effectivity_start_id' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->effectivity_start_id, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to serial_numbered_effectivity to be a `identifier`")); } - } while (0); - do { // convert the 'effectivity_end_id' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) break; - try { GenericConvert(in->effectivity_end_id, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to serial_numbered_effectivity to be a `identifier`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, shape_aspect_associativity* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to shape_aspect_associativity"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, shape_aspect_deriving_relationship* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to shape_aspect_deriving_relationship"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, shape_definition_representation* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to shape_definition_representation"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, shape_dimension_representation* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to shape_dimension_representation"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, shape_feature_definition* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to shape_feature_definition"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, shape_representation_with_parameters* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to shape_representation_with_parameters"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, shell_based_surface_model* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to shell_based_surface_model"); } do { // convert the 'sbsm_boundary' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->sbsm_boundary, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to shell_based_surface_model to be a `SET [1:?] OF shell`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, shell_based_wireframe_model* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to shell_based_wireframe_model"); } do { // convert the 'sbwm_boundary' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->sbwm_boundary, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to shell_based_wireframe_model to be a `SET [1:?] OF shell`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, shell_based_wireframe_shape_representation* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to shell_based_wireframe_shape_representation"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, si_absorbed_dose_unit* in) -{ - size_t base = 0; - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, si_capacitance_unit* in) -{ - size_t base = 0; - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, si_conductance_unit* in) -{ - size_t base = 0; - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, si_dose_equivalent_unit* in) -{ - size_t base = 0; - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, si_electric_charge_unit* in) -{ - size_t base = 0; - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, si_electric_potential_unit* in) -{ - size_t base = 0; - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, si_energy_unit* in) -{ - size_t base = 0; - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, si_force_unit* in) -{ - size_t base = 0; - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, si_frequency_unit* in) -{ - size_t base = 0; - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, si_illuminance_unit* in) -{ - size_t base = 0; - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, si_inductance_unit* in) -{ - size_t base = 0; - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, si_magnetic_flux_density_unit* in) -{ - size_t base = 0; - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, si_magnetic_flux_unit* in) -{ - size_t base = 0; - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, si_power_unit* in) -{ - size_t base = 0; - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, si_pressure_unit* in) -{ - size_t base = 0; - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, si_radioactivity_unit* in) -{ - size_t base = 0; - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, si_resistance_unit* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, si_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to si_unit"); } do { // convert the 'prefix' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) break; - try { GenericConvert(in->prefix, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to si_unit to be a `si_prefix`")); } - } while (0); - do { // convert the 'name' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->name, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to si_unit to be a `si_unit_name`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, simple_boolean_expression* in) -{ - size_t base = 0; - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, simple_numeric_expression* in) -{ - size_t base = 0; - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, slash_expression* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, smeared_material_definition* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to smeared_material_definition"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, solid_angle_measure_with_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to solid_angle_measure_with_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, solid_angle_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to solid_angle_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, solid_curve_font* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to solid_curve_font"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, solid_replica* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to solid_replica"); } do { // convert the 'parent_solid' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->parent_solid, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to solid_replica to be a `solid_model`")); } - } while (0); - do { // convert the 'transformation' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->transformation, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to solid_replica to be a `cartesian_transformation_operator_3d`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, solid_with_chamfered_edges* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to solid_with_chamfered_edges"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, solid_with_angle_based_chamfer* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 7) { throw STEP::TypeError("expected 7 arguments to solid_with_angle_based_chamfer"); } do { // convert the 'offset_distance' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->offset_distance, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to solid_with_angle_based_chamfer to be a `positive_length_measure`")); } - } while (0); - do { // convert the 'left_offset' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->left_offset, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to solid_with_angle_based_chamfer to be a `BOOLEAN`")); } - } while (0); - do { // convert the 'offset_angle' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->offset_angle, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to solid_with_angle_based_chamfer to be a `positive_plane_angle_measure`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, solid_with_shape_element_pattern* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to solid_with_shape_element_pattern"); } do { // convert the 'replicated_element' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->replicated_element, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to solid_with_shape_element_pattern to be a `modified_solid_with_placed_configuration`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, solid_with_circular_pattern* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 9) { throw STEP::TypeError("expected 9 arguments to solid_with_circular_pattern"); } do { // convert the 'replicate_count' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->replicate_count, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to solid_with_circular_pattern to be a `positive_integer`")); } - } while (0); - do { // convert the 'angular_spacing' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->angular_spacing, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to solid_with_circular_pattern to be a `plane_angle_measure`")); } - } while (0); - do { // convert the 'radial_alignment' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2] = true; break; } - try { GenericConvert(in->radial_alignment, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 7 to solid_with_circular_pattern to be a `BOOLEAN`")); } - } while (0); - do { // convert the 'reference_point' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[3] = true; break; } - try { GenericConvert(in->reference_point, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 8 to solid_with_circular_pattern to be a `point`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, solid_with_depression* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to solid_with_depression"); } do { // convert the 'depth' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->depth, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to solid_with_depression to be a `positive_length_measure`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, solid_with_pocket* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 7) { throw STEP::TypeError("expected 7 arguments to solid_with_pocket"); } do { // convert the 'floor_blend_radius' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->floor_blend_radius, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to solid_with_pocket to be a `non_negative_length_measure`")); } - } while (0); - do { // convert the 'draft_angle' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->draft_angle, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to solid_with_pocket to be a `plane_angle_measure`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, solid_with_circular_pocket* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 8) { throw STEP::TypeError("expected 8 arguments to solid_with_circular_pocket"); } do { // convert the 'pocket_radius' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->pocket_radius, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 7 to solid_with_circular_pocket to be a `positive_length_measure`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, solid_with_protrusion* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to solid_with_protrusion"); } do { // convert the 'protrusion_height' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->protrusion_height, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to solid_with_protrusion to be a `positive_length_measure`")); } - } while (0); - do { // convert the 'protrusion_draft_angle' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->protrusion_draft_angle, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to solid_with_protrusion to be a `plane_angle_measure`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, solid_with_circular_protrusion* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 7) { throw STEP::TypeError("expected 7 arguments to solid_with_circular_protrusion"); } do { // convert the 'protrusion_radius' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->protrusion_radius, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to solid_with_circular_protrusion to be a `positive_length_measure`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, solid_with_hole* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to solid_with_hole"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, solid_with_stepped_round_hole* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to solid_with_stepped_round_hole"); } do { // convert the 'segments' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->segments, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to solid_with_stepped_round_hole to be a `positive_integer`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, solid_with_conical_bottom_round_hole* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 8) { throw STEP::TypeError("expected 8 arguments to solid_with_conical_bottom_round_hole"); } do { // convert the 'semi_apex_angle' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->semi_apex_angle, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to solid_with_conical_bottom_round_hole to be a `positive_plane_angle_measure`")); } - } while (0); - do { // convert the 'tip_radius' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->tip_radius, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 7 to solid_with_conical_bottom_round_hole to be a `non_negative_length_measure`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, solid_with_constant_radius_edge_blend* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to solid_with_constant_radius_edge_blend"); } do { // convert the 'radius' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->radius, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to solid_with_constant_radius_edge_blend to be a `positive_length_measure`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, solid_with_slot* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 7) { throw STEP::TypeError("expected 7 arguments to solid_with_slot"); } do { // convert the 'slot_width' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->slot_width, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to solid_with_slot to be a `positive_length_measure`")); } - } while (0); - do { // convert the 'closed_ends' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->closed_ends, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to solid_with_slot to be a `LIST [2:2] OF LOGICAL`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, solid_with_curved_slot* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 8) { throw STEP::TypeError("expected 8 arguments to solid_with_curved_slot"); } do { // convert the 'slot_centreline' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->slot_centreline, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 7 to solid_with_curved_slot to be a `bounded_curve`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, solid_with_double_offset_chamfer* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to solid_with_double_offset_chamfer"); } do { // convert the 'left_offset_distance' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->left_offset_distance, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to solid_with_double_offset_chamfer to be a `positive_length_measure`")); } - } while (0); - do { // convert the 'right_offset_distance' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->right_offset_distance, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to solid_with_double_offset_chamfer to be a `positive_length_measure`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, solid_with_flat_bottom_round_hole* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 7) { throw STEP::TypeError("expected 7 arguments to solid_with_flat_bottom_round_hole"); } do { // convert the 'fillet_radius' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->fillet_radius, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to solid_with_flat_bottom_round_hole to be a `non_negative_length_measure`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, solid_with_general_pocket* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 9) { throw STEP::TypeError("expected 9 arguments to solid_with_general_pocket"); } do { // convert the 'profile' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->profile, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 7 to solid_with_general_pocket to be a `positioned_sketch`")); } - } while (0); - do { // convert the 'reference_point' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->reference_point, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 8 to solid_with_general_pocket to be a `point`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, solid_with_general_protrusion* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 8) { throw STEP::TypeError("expected 8 arguments to solid_with_general_protrusion"); } do { // convert the 'profile' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->profile, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to solid_with_general_protrusion to be a `positioned_sketch`")); } - } while (0); - do { // convert the 'reference_point' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->reference_point, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 7 to solid_with_general_protrusion to be a `point`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, solid_with_groove* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 10) { throw STEP::TypeError("expected 10 arguments to solid_with_groove"); } do { // convert the 'groove_radius' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->groove_radius, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to solid_with_groove to be a `positive_length_measure`")); } - } while (0); - do { // convert the 'groove_width' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->groove_width, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to solid_with_groove to be a `positive_length_measure`")); } - } while (0); - do { // convert the 'draft_angle' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->draft_angle, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 7 to solid_with_groove to be a `plane_angle_measure`")); } - } while (0); - do { // convert the 'floor_fillet_radius' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->floor_fillet_radius, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 8 to solid_with_groove to be a `non_negative_length_measure`")); } - } while (0); - do { // convert the 'external_groove' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->external_groove, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 9 to solid_with_groove to be a `BOOLEAN`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, solid_with_incomplete_circular_pattern* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 10) { throw STEP::TypeError("expected 10 arguments to solid_with_incomplete_circular_pattern"); } do { // convert the 'omitted_instances' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->omitted_instances, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 9 to solid_with_incomplete_circular_pattern to be a `SET [1:?] OF positive_integer`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, solid_with_rectangular_pattern* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 9) { throw STEP::TypeError("expected 9 arguments to solid_with_rectangular_pattern"); } do { // convert the 'row_count' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->row_count, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to solid_with_rectangular_pattern to be a `positive_integer`")); } - } while (0); - do { // convert the 'column_count' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->column_count, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to solid_with_rectangular_pattern to be a `positive_integer`")); } - } while (0); - do { // convert the 'row_spacing' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2] = true; break; } - try { GenericConvert(in->row_spacing, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 7 to solid_with_rectangular_pattern to be a `length_measure`")); } - } while (0); - do { // convert the 'column_spacing' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[3] = true; break; } - try { GenericConvert(in->column_spacing, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 8 to solid_with_rectangular_pattern to be a `length_measure`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, solid_with_incomplete_rectangular_pattern* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 9) { throw STEP::TypeError("expected 9 arguments to solid_with_incomplete_rectangular_pattern"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, solid_with_rectangular_pocket* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 10) { throw STEP::TypeError("expected 10 arguments to solid_with_rectangular_pocket"); } do { // convert the 'pocket_length' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->pocket_length, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 7 to solid_with_rectangular_pocket to be a `positive_length_measure`")); } - } while (0); - do { // convert the 'pocket_width' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->pocket_width, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 8 to solid_with_rectangular_pocket to be a `positive_length_measure`")); } - } while (0); - do { // convert the 'corner_radius' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->corner_radius, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 9 to solid_with_rectangular_pocket to be a `non_negative_length_measure`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, solid_with_rectangular_protrusion* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 9) { throw STEP::TypeError("expected 9 arguments to solid_with_rectangular_protrusion"); } do { // convert the 'protrusion_length' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->protrusion_length, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to solid_with_rectangular_protrusion to be a `positive_length_measure`")); } - } while (0); - do { // convert the 'protrusion_width' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->protrusion_width, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 7 to solid_with_rectangular_protrusion to be a `positive_length_measure`")); } - } while (0); - do { // convert the 'protrusion_corner_radius' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->protrusion_corner_radius, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 8 to solid_with_rectangular_protrusion to be a `non_negative_length_measure`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, solid_with_single_offset_chamfer* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to solid_with_single_offset_chamfer"); } do { // convert the 'offset_distance' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->offset_distance, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to solid_with_single_offset_chamfer to be a `positive_length_measure`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, solid_with_spherical_bottom_round_hole* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 7) { throw STEP::TypeError("expected 7 arguments to solid_with_spherical_bottom_round_hole"); } do { // convert the 'sphere_radius' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->sphere_radius, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to solid_with_spherical_bottom_round_hole to be a `positive_length_measure`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, solid_with_stepped_round_hole_and_conical_transitions* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 7) { throw STEP::TypeError("expected 7 arguments to solid_with_stepped_round_hole_and_conical_transitions"); } do { // convert the 'conical_transitions' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->conical_transitions, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to solid_with_stepped_round_hole_and_conical_transitions to be a `SET [1:?] OF conical_stepped_hole_transition`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, solid_with_straight_slot* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 8) { throw STEP::TypeError("expected 8 arguments to solid_with_straight_slot"); } do { // convert the 'slot_length' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->slot_length, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 7 to solid_with_straight_slot to be a `positive_length_measure`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, solid_with_tee_section_slot* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 9) { throw STEP::TypeError("expected 9 arguments to solid_with_tee_section_slot"); } do { // convert the 'tee_section_width' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->tee_section_width, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 7 to solid_with_tee_section_slot to be a `positive_length_measure`")); } - } while (0); - do { // convert the 'collar_depth' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->collar_depth, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 8 to solid_with_tee_section_slot to be a `positive_length_measure`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, solid_with_through_depression* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to solid_with_through_depression"); } do { // convert the 'exit_faces' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->exit_faces, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to solid_with_through_depression to be a `SET [1:?] OF face_surface`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, solid_with_trapezoidal_section_slot* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 9) { throw STEP::TypeError("expected 9 arguments to solid_with_trapezoidal_section_slot"); } do { // convert the 'draft_angle' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->draft_angle, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 7 to solid_with_trapezoidal_section_slot to be a `plane_angle_measure`")); } - } while (0); - do { // convert the 'floor_fillet_radius' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->floor_fillet_radius, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 8 to solid_with_trapezoidal_section_slot to be a `non_negative_length_measure`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, solid_with_variable_radius_edge_blend* in) -{ - size_t base = 0; - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to solid_with_variable_radius_edge_blend"); } do { // convert the 'point_list' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->point_list, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to solid_with_variable_radius_edge_blend to be a `LIST [2:?] OF point`")); } - } while (0); - do { // convert the 'radius_list' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->radius_list, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to solid_with_variable_radius_edge_blend to be a `LIST [2:?] OF positive_length_measure`")); } - } while (0); - do { // convert the 'edge_function_list' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->edge_function_list, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to solid_with_variable_radius_edge_blend to be a `LIST [1:?] OF blend_radius_variation_type`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, source_for_requirement* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to source_for_requirement"); } do { // convert the 'items' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->items, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to source_for_requirement to be a `SET [1:1] OF requirement_source_item`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, sourced_requirement* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to sourced_requirement"); } do { // convert the 'items' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->items, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to sourced_requirement to be a `SET [1:1] OF product_definition`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, specification_definition* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to specification_definition"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, specified_higher_usage_occurrence* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 8) { throw STEP::TypeError("expected 8 arguments to specified_higher_usage_occurrence"); } do { // convert the 'upper_usage' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->upper_usage, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to specified_higher_usage_occurrence to be a `assembly_component_usage`")); } - } while (0); - do { // convert the 'next_usage' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->next_usage, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 7 to specified_higher_usage_occurrence to be a `next_assembly_usage_occurrence`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, sphere* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to sphere"); } do { // convert the 'radius' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->radius, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to sphere to be a `positive_length_measure`")); } - } while (0); - do { // convert the 'centre' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->centre, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to sphere to be a `point`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, spherical_surface* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to spherical_surface"); } do { // convert the 'radius' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->radius, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to spherical_surface to be a `positive_length_measure`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, start_request* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to start_request"); } do { // convert the 'items' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->items, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to start_request to be a `SET [1:?] OF start_request_item`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, start_work* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to start_work"); } do { // convert the 'items' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->items, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to start_work to be a `SET [1:?] OF work_item`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, straightness_tolerance* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to straightness_tolerance"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, structured_dimension_callout* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to structured_dimension_callout"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, structured_text_composition* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to structured_text_composition"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, structured_text_representation* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to structured_text_representation"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, subedge* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to subedge"); } do { // convert the 'parent_edge' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->parent_edge, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to subedge to be a `edge`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, subface* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to subface"); } do { // convert the 'parent_face' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->parent_face, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to subface to be a `face`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, supplied_part_relationship* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to supplied_part_relationship"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, surface_condition_callout* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to surface_condition_callout"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, swept_surface* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to swept_surface"); } do { // convert the 'swept_curve' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->swept_curve, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to swept_surface to be a `curve`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, surface_of_linear_extrusion* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to surface_of_linear_extrusion"); } do { // convert the 'extrusion_axis' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->extrusion_axis, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to surface_of_linear_extrusion to be a `vector`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, surface_of_revolution* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to surface_of_revolution"); } do { // convert the 'axis_position' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->axis_position, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to surface_of_revolution to be a `axis1_placement`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, surface_patch* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to surface_patch"); } do { // convert the 'parent_surface' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->parent_surface, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to surface_patch to be a `bounded_surface`")); } - } while (0); - do { // convert the 'u_transition' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->u_transition, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to surface_patch to be a `transition_code`")); } - } while (0); - do { // convert the 'v_transition' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->v_transition, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to surface_patch to be a `transition_code`")); } - } while (0); - do { // convert the 'u_sense' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->u_sense, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to surface_patch to be a `BOOLEAN`")); } - } while (0); - do { // convert the 'v_sense' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->v_sense, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to surface_patch to be a `BOOLEAN`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, surface_profile_tolerance* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to surface_profile_tolerance"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, surface_replica* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to surface_replica"); } do { // convert the 'parent_surface' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->parent_surface, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to surface_replica to be a `surface`")); } - } while (0); - do { // convert the 'transformation' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->transformation, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to surface_replica to be a `cartesian_transformation_operator_3d`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, surface_side_style* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to surface_side_style"); } do { // convert the 'name' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->name, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to surface_side_style to be a `label`")); } - } while (0); - do { // convert the 'styles' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->styles, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to surface_side_style to be a `SET [1:7] OF surface_style_element_select`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, surface_style_boundary* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to surface_style_boundary"); } do { // convert the 'style_of_boundary' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->style_of_boundary, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to surface_style_boundary to be a `curve_or_render`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, surface_style_control_grid* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to surface_style_control_grid"); } do { // convert the 'style_of_control_grid' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->style_of_control_grid, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to surface_style_control_grid to be a `curve_or_render`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, surface_style_fill_area* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to surface_style_fill_area"); } do { // convert the 'fill_area' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->fill_area, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to surface_style_fill_area to be a `fill_area_style`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, surface_style_parameter_line* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to surface_style_parameter_line"); } do { // convert the 'style_of_parameter_lines' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->style_of_parameter_lines, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to surface_style_parameter_line to be a `curve_or_render`")); } - } while (0); - do { // convert the 'direction_counts' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->direction_counts, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to surface_style_parameter_line to be a `SET [1:2] OF direction_count_select`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, surface_style_reflectance_ambient* in) -{ - size_t base = 0; - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to surface_style_reflectance_ambient"); } do { // convert the 'ambient_reflectance' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->ambient_reflectance, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to surface_style_reflectance_ambient to be a `REAL`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, surface_style_reflectance_ambient_diffuse* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to surface_style_reflectance_ambient_diffuse"); } do { // convert the 'diffuse_reflectance' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->diffuse_reflectance, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to surface_style_reflectance_ambient_diffuse to be a `REAL`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, surface_style_reflectance_ambient_diffuse_specular* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to surface_style_reflectance_ambient_diffuse_specular"); } do { // convert the 'specular_reflectance' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->specular_reflectance, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to surface_style_reflectance_ambient_diffuse_specular to be a `REAL`")); } - } while (0); - do { // convert the 'specular_exponent' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->specular_exponent, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to surface_style_reflectance_ambient_diffuse_specular to be a `REAL`")); } - } while (0); - do { // convert the 'specular_colour' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->specular_colour, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to surface_style_reflectance_ambient_diffuse_specular to be a `colour`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, surface_style_rendering* in) -{ - size_t base = 0; - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to surface_style_rendering"); } do { // convert the 'rendering_method' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->rendering_method, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to surface_style_rendering to be a `shading_surface_method`")); } - } while (0); - do { // convert the 'surface_colour' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->surface_colour, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to surface_style_rendering to be a `colour`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, surface_style_rendering_with_properties* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to surface_style_rendering_with_properties"); } do { // convert the 'properties' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->properties, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to surface_style_rendering_with_properties to be a `SET [1:2] OF rendering_properties_select`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, surface_style_segmentation_curve* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to surface_style_segmentation_curve"); } do { // convert the 'style_of_segmentation_curve' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->style_of_segmentation_curve, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to surface_style_segmentation_curve to be a `curve_or_render`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, surface_style_silhouette* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to surface_style_silhouette"); } do { // convert the 'style_of_silhouette' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->style_of_silhouette, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to surface_style_silhouette to be a `curve_or_render`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, surface_style_usage* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to surface_style_usage"); } do { // convert the 'side' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->side, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to surface_style_usage to be a `surface_side`")); } - } while (0); - do { // convert the 'style' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->style, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to surface_style_usage to be a `surface_side_style_select`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, surface_texture_representation* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to surface_texture_representation"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, surfaced_open_shell* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to surfaced_open_shell"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, swept_disk_solid* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to swept_disk_solid"); } do { // convert the 'directrix' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->directrix, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to swept_disk_solid to be a `curve`")); } - } while (0); - do { // convert the 'radius' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->radius, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to swept_disk_solid to be a `positive_length_measure`")); } - } while (0); - do { // convert the 'inner_radius' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) break; - try { GenericConvert(in->inner_radius, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to swept_disk_solid to be a `positive_length_measure`")); } - } while (0); - do { // convert the 'start_param' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->start_param, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to swept_disk_solid to be a `REAL`")); } - } while (0); - do { // convert the 'end_param' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->end_param, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to swept_disk_solid to be a `REAL`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, symbol* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to symbol"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, symbol_representation_map* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to symbol_representation_map"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, symbol_style* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to symbol_style"); } do { // convert the 'name' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->name, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to symbol_style to be a `label`")); } - } while (0); - do { // convert the 'style_of_symbol' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->style_of_symbol, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to symbol_style to be a `symbol_style_select`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, symbol_target* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to symbol_target"); } do { // convert the 'placement' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->placement, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to symbol_target to be a `axis2_placement`")); } - } while (0); - do { // convert the 'x_scale' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->x_scale, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to symbol_target to be a `positive_ratio_measure`")); } - } while (0); - do { // convert the 'y_scale' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->y_scale, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to symbol_target to be a `positive_ratio_measure`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, symmetric_shape_aspect* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to symmetric_shape_aspect"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, symmetry_tolerance* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to symmetry_tolerance"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, table_representation_item* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to table_representation_item"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, tactile_appearance_representation* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to tactile_appearance_representation"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, tagged_text_format* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to tagged_text_format"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, tagged_text_item* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to tagged_text_item"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, tangent* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to tangent"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, text_literal_with_associated_curves* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 7) { throw STEP::TypeError("expected 7 arguments to text_literal_with_associated_curves"); } do { // convert the 'associated_curves' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->associated_curves, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to text_literal_with_associated_curves to be a `SET [1:?] OF curve`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, text_literal_with_blanking_box* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 7) { throw STEP::TypeError("expected 7 arguments to text_literal_with_blanking_box"); } do { // convert the 'blanking' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->blanking, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to text_literal_with_blanking_box to be a `planar_box`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, text_literal_with_extent* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 7) { throw STEP::TypeError("expected 7 arguments to text_literal_with_extent"); } do { // convert the 'extent' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->extent, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to text_literal_with_extent to be a `planar_extent`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, text_string_representation* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to text_string_representation"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, text_style* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to text_style"); } do { // convert the 'name' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->name, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to text_style to be a `label`")); } - } while (0); - do { // convert the 'character_appearance' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->character_appearance, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to text_style to be a `character_style_select`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, text_style_with_box_characteristics* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to text_style_with_box_characteristics"); } do { // convert the 'characteristics' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->characteristics, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to text_style_with_box_characteristics to be a `SET [1:4] OF box_characteristic_select`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, text_style_with_mirror* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to text_style_with_mirror"); } do { // convert the 'mirror_placement' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->mirror_placement, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to text_style_with_mirror to be a `axis2_placement`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, text_style_with_spacing* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to text_style_with_spacing"); } do { // convert the 'character_spacing' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->character_spacing, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to text_style_with_spacing to be a `character_spacing_select`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, thermal_resistance_measure_with_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to thermal_resistance_measure_with_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, thermal_resistance_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to thermal_resistance_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, thermodynamic_temperature_measure_with_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to thermodynamic_temperature_measure_with_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, thermodynamic_temperature_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to thermodynamic_temperature_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, thickened_face_solid* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to thickened_face_solid"); } do { // convert the 'base_element' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->base_element, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to thickened_face_solid to be a `generalized_surface_select`")); } - } while (0); - do { // convert the 'offset1' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->offset1, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to thickened_face_solid to be a `length_measure`")); } - } while (0); - do { // convert the 'offset2' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->offset2, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to thickened_face_solid to be a `length_measure`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, thickness_laminate_definition* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to thickness_laminate_definition"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, thickness_laminate_table* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to thickness_laminate_table"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, time_interval* in) -{ - size_t base = 0; - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to time_interval"); } do { // convert the 'id' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0] = true; break; } - try { GenericConvert(in->id, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to time_interval to be a `identifier`")); } - } while (0); - do { // convert the 'name' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1] = true; break; } - try { GenericConvert(in->name, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to time_interval to be a `label`")); } - } while (0); - do { // convert the 'description' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2] = true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert(in->description, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to time_interval to be a `text`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, time_interval_based_effectivity* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to time_interval_based_effectivity"); } do { // convert the 'effectivity_period' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->effectivity_period, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to time_interval_based_effectivity to be a `time_interval`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, time_interval_with_bounds* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to time_interval_with_bounds"); } do { // convert the 'primary_bound' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) break; - try { GenericConvert(in->primary_bound, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to time_interval_with_bounds to be a `date_time_or_event_occurrence`")); } - } while (0); - do { // convert the 'secondary_bound' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) break; - try { GenericConvert(in->secondary_bound, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to time_interval_with_bounds to be a `date_time_or_event_occurrence`")); } - } while (0); - do { // convert the 'duration' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) break; - try { GenericConvert(in->duration, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to time_interval_with_bounds to be a `time_measure_with_unit`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, time_measure_with_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to time_measure_with_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, time_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to time_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, tolerance_zone* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to tolerance_zone"); } do { // convert the 'defining_tolerance' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->defining_tolerance, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to tolerance_zone to be a `SET [1:?] OF geometric_tolerance`")); } - } while (0); - do { // convert the 'form' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->form, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to tolerance_zone to be a `tolerance_zone_form`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, torus* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to torus"); } do { // convert the 'position' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->position, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to torus to be a `axis1_placement`")); } - } while (0); - do { // convert the 'major_radius' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->major_radius, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to torus to be a `positive_length_measure`")); } - } while (0); - do { // convert the 'minor_radius' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->minor_radius, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to torus to be a `positive_length_measure`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, total_runout_tolerance* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to total_runout_tolerance"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, track_blended_solid* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to track_blended_solid"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, track_blended_solid_with_end_conditions* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to track_blended_solid_with_end_conditions"); } do { // convert the 'end_conditions' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->end_conditions, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to track_blended_solid_with_end_conditions to be a `LIST [2:2] OF blend_end_condition_select`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, trimmed_curve* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to trimmed_curve"); } do { // convert the 'basis_curve' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->basis_curve, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to trimmed_curve to be a `curve`")); } - } while (0); - do { // convert the 'trim_1' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->trim_1, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to trimmed_curve to be a `SET [1:2] OF trimming_select`")); } - } while (0); - do { // convert the 'trim_2' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->trim_2, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to trimmed_curve to be a `SET [1:2] OF trimming_select`")); } - } while (0); - do { // convert the 'sense_agreement' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->sense_agreement, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to trimmed_curve to be a `BOOLEAN`")); } - } while (0); - do { // convert the 'master_representation' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->master_representation, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to trimmed_curve to be a `trimming_preference`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, two_direction_repeat_factor* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to two_direction_repeat_factor"); } do { // convert the 'second_repeat_factor' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->second_repeat_factor, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to two_direction_repeat_factor to be a `vector`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, unary_generic_expression* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to unary_generic_expression"); } do { // convert the 'operand' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->operand, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to unary_generic_expression to be a `generic_expression`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, unary_numeric_expression* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, uncertainty_assigned_representation* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to uncertainty_assigned_representation"); } do { // convert the 'uncertainty' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->uncertainty, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to uncertainty_assigned_representation to be a `SET [1:?] OF uncertainty_measure_with_unit`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, uncertainty_measure_with_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to uncertainty_measure_with_unit"); } do { // convert the 'name' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->name, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to uncertainty_measure_with_unit to be a `label`")); } - } while (0); - do { // convert the 'description' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) break; - try { GenericConvert(in->description, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to uncertainty_measure_with_unit to be a `text`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, uniform_curve* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to uniform_curve"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, uniform_resource_identifier* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to uniform_resource_identifier"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, uniform_surface* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 7) { throw STEP::TypeError("expected 7 arguments to uniform_surface"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, usage_association* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to usage_association"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, user_defined_curve_font* in) -{ - size_t base = 0; - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, user_defined_marker* in) -{ - size_t base = 0; - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, user_defined_terminator_symbol* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, user_selected_shape_elements* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to user_selected_shape_elements"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, value_range* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to value_range"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, value_representation_item* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to value_representation_item"); } do { // convert the 'value_component' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->value_component, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to value_representation_item to be a `measure_value`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, variable_semantics* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, variational_representation_item* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to variational_representation_item"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, vector* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to vector"); } do { // convert the 'orientation' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->orientation, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to vector to be a `direction`")); } - } while (0); - do { // convert the 'magnitude' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->magnitude, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to vector to be a `length_measure`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -/*template <> size_t GenericFill(const DB& db, const LIST& params, vector_style* in) -{ - size_t base = 0; - return base; -}*/ -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, velocity_measure_with_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to velocity_measure_with_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, velocity_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to velocity_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, vertex* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to vertex"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, vertex_loop* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to vertex_loop"); } do { // convert the 'loop_vertex' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->loop_vertex, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to vertex_loop to be a `vertex`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, vertex_point* in) -{ - size_t base = 0; - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to vertex_point"); } do { // convert the 'vertex_geometry' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->vertex_geometry, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to vertex_point to be a `point`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, vertex_shell* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to vertex_shell"); } do { // convert the 'vertex_shell_extent' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->vertex_shell_extent, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to vertex_shell to be a `vertex_loop`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, view_volume* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 9) { throw STEP::TypeError("expected 9 arguments to view_volume"); } do { // convert the 'projection_type' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->projection_type, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to view_volume to be a `central_or_parallel`")); } - } while (0); - do { // convert the 'projection_point' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->projection_point, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to view_volume to be a `cartesian_point`")); } - } while (0); - do { // convert the 'view_plane_distance' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->view_plane_distance, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to view_volume to be a `length_measure`")); } - } while (0); - do { // convert the 'front_plane_distance' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->front_plane_distance, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to view_volume to be a `length_measure`")); } - } while (0); - do { // convert the 'front_plane_clipping' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->front_plane_clipping, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to view_volume to be a `BOOLEAN`")); } - } while (0); - do { // convert the 'back_plane_distance' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->back_plane_distance, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to view_volume to be a `length_measure`")); } - } while (0); - do { // convert the 'back_plane_clipping' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->back_plane_clipping, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to view_volume to be a `BOOLEAN`")); } - } while (0); - do { // convert the 'view_volume_sides_clipping' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->view_volume_sides_clipping, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 7 to view_volume to be a `BOOLEAN`")); } - } while (0); - do { // convert the 'view_window' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->view_window, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 8 to view_volume to be a `planar_box`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, visual_appearance_representation* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to visual_appearance_representation"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, volume_measure_with_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to volume_measure_with_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, volume_unit* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to volume_unit"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, week_of_year_and_day_date* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to week_of_year_and_day_date"); } do { // convert the 'week_component' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->week_component, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to week_of_year_and_day_date to be a `week_in_year_number`")); } - } while (0); - do { // convert the 'day_component' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) break; - try { GenericConvert(in->day_component, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to week_of_year_and_day_date to be a `day_in_week_number`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, wire_shell* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to wire_shell"); } do { // convert the 'wire_shell_extent' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->wire_shell_extent, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to wire_shell to be a `SET [1:?] OF loop`")); } - } while (0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, year_month* in) -{ - size_t base = GenericFill(db, params, static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to year_month"); } do { // convert the 'month_component' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert(in->month_component, arg, db); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to year_month to be a `month_in_year_number`")); } - } while (0); - return base; -} - -} -} diff --git a/code/AssetLib/StepFile/StepFileImporter.cpp b/code/AssetLib/StepFile/StepFileImporter.cpp deleted file mode 100644 index f536ec90e..000000000 --- a/code/AssetLib/StepFile/StepFileImporter.cpp +++ /dev/null @@ -1,114 +0,0 @@ -/* ---------------------------------------------------------------------------- -Open Asset Import Library (assimp) ---------------------------------------------------------------------------- - -Copyright (c) 2006-2020, 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. ---------------------------------------------------------------------------- -*/ - -#ifndef ASSIMP_BUILD_NO_STEP_IMPORTER - -#include "StepFileImporter.h" -#include "../../Importer/STEPParser/STEPFileReader.h" -#include -#include - -namespace Assimp { -namespace StepFile { - -using namespace STEP; - -static const aiImporterDesc desc = { "StepFile Importer", - "", - "", - "", - 0, - 0, - 0, - 0, - 0, - "stp" }; - -StepFileImporter::StepFileImporter() -: BaseImporter() { - -} - -StepFileImporter::~StepFileImporter() { - -} - -bool StepFileImporter::CanRead(const std::string& file, IOSystem* pIOHandler, bool checkSig) const { - const std::string &extension = GetExtension(file); - if ( extension == "stp" || extension == "step" ) { - return true; - } else if ((!extension.length() || checkSig) && pIOHandler) { - const char* tokens[] = { "ISO-10303-21" }; - const bool found(SearchFileHeaderForToken(pIOHandler, file, tokens, 1)); - return found; - } - - return false; -} - -const aiImporterDesc *StepFileImporter::GetInfo() const { - return &desc; -} - -static const std::string mode = "rb"; -static const std::string StepFileSchema = "CONFIG_CONTROL_DESIGN"; - -void StepFileImporter::InternReadFile(const std::string &file, aiScene*, IOSystem* pIOHandler) { - // Read file into memory - std::shared_ptr fileStream(pIOHandler->Open(file, mode)); - if (!fileStream.get()) { - throw DeadlyImportError("Failed to open file " + file + "."); - } - - std::unique_ptr db(STEP::ReadFileHeader(fileStream)); - const STEP::HeaderInfo& head = static_cast(*db).GetHeader(); - if (!head.fileSchema.size() || head.fileSchema != StepFileSchema) { - DeadlyImportError("Unrecognized file schema: " + head.fileSchema); - } -} - -} // Namespace StepFile -} // Namespace Assimp - -#endif // ASSIMP_BUILD_NO_STEP_IMPORTER - diff --git a/code/AssetLib/StepFile/StepFileImporter.h b/code/AssetLib/StepFile/StepFileImporter.h deleted file mode 100644 index c6ac08bb6..000000000 --- a/code/AssetLib/StepFile/StepFileImporter.h +++ /dev/null @@ -1,69 +0,0 @@ -/* ---------------------------------------------------------------------------- -Open Asset Import Library (assimp) ---------------------------------------------------------------------------- - -Copyright (c) 2006-2020, 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. ---------------------------------------------------------------------------- -*/ - -#pragma once - -#ifndef ASSIMP_BUILD_NO_STEP_IMPORTER - -#include - -namespace Assimp { -namespace StepFile { - -class StepFileImporter : public BaseImporter { -public: - StepFileImporter(); - ~StepFileImporter(); - bool CanRead(const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const override; - const aiImporterDesc* GetInfo() const override; - -protected: - void InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler ) override; - -private: -}; - -} // Namespace StepFile -} // Namespace Assimp - -#endif // ASSIMP_BUILD_NO_STEP_IMPORTER diff --git a/code/AssetLib/StepFile/StepReaderGen.h b/code/AssetLib/StepFile/StepReaderGen.h deleted file mode 100644 index c45220a83..000000000 --- a/code/AssetLib/StepFile/StepReaderGen.h +++ /dev/null @@ -1,7291 +0,0 @@ -/* -Open Asset Import Library (ASSIMP) ----------------------------------------------------------------------- - -Copyright (c) 2006-2020, ASSIMP Development 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 Development 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. - ----------------------------------------------------------------------- -*/ - -/** MACHINE-GENERATED by scripts/ICFImporter/CppGenerator.py */ - -#ifndef INCLUDED_STEPFILE_READER_GEN_H -#define INCLUDED_STEPFILE_READER_GEN_H - -#include "code/Step/STEPFile.h" - -#ifdef _WIN32 -# pragma warning( disable : 4512 ) -#endif // _WIN32 -namespace Assimp { -namespace StepFile { - using namespace STEP; - using namespace STEP::EXPRESS; - - - struct NotImplemented : public ObjectHelper { - - }; - - - // ****************************************************************************** - // StepFile Custom data types - // ****************************************************************************** - - - // C++ wrapper type for absorbed_dose_measure - typedef REAL absorbed_dose_measure; - // C++ wrapper type for acceleration_measure - typedef REAL acceleration_measure; - // C++ wrapper type for action_items - typedef SELECT action_items; - // C++ wrapper type for action_method_items - typedef SELECT action_method_items; - // C++ wrapper type for action_request_item - typedef SELECT action_request_item; - // C++ wrapper type for ahead_or_behind - typedef ENUMERATION ahead_or_behind; - // C++ wrapper type for amount_of_substance_measure - typedef REAL amount_of_substance_measure; - // C++ wrapper type for angle_direction_reference_select - typedef SELECT angle_direction_reference_select; - // C++ wrapper type for angle_direction_reference_with_a2p3d_select - typedef SELECT angle_direction_reference_with_a2p3d_select; - // C++ wrapper type for angle_relator - typedef ENUMERATION angle_relator; - // C++ wrapper type for annotation_plane_element - typedef SELECT annotation_plane_element; - // C++ wrapper type for annotation_representation_select - typedef SELECT annotation_representation_select; - // C++ wrapper type for annotation_symbol_occurrence_item - typedef SELECT annotation_symbol_occurrence_item; - // C++ wrapper type for annotation_text_occurrence_item - typedef SELECT annotation_text_occurrence_item; - // C++ wrapper type for approval_item - typedef SELECT approval_item; - // C++ wrapper type for approved_item - typedef SELECT approved_item; - // C++ wrapper type for area_measure - typedef REAL area_measure; - // C++ wrapper type for area_or_view - typedef SELECT area_or_view; - // C++ wrapper type for attribute_classification_item - typedef SELECT attribute_classification_item; - // C++ wrapper type for attribute_language_item - typedef SELECT attribute_language_item; - // C++ wrapper type for attribute_type - typedef SELECT attribute_type; - // C++ wrapper type for axis2_placement - typedef SELECT axis2_placement; - // C++ wrapper type for b_spline_curve_form - typedef ENUMERATION b_spline_curve_form; - // C++ wrapper type for b_spline_surface_form - typedef ENUMERATION b_spline_surface_form; - // C++ wrapper type for base_solid_select - typedef SELECT base_solid_select; - // C++ wrapper type for blend_end_condition_select - typedef SELECT blend_end_condition_select; - // C++ wrapper type for blend_radius_variation_type - typedef ENUMERATION blend_radius_variation_type; - // C++ wrapper type for boolean_operand - typedef SELECT boolean_operand; - // C++ wrapper type for boolean_operator - typedef ENUMERATION boolean_operator; - // C++ wrapper type for box_characteristic_select - typedef SELECT box_characteristic_select; - // C++ wrapper type for box_height - typedef REAL box_height; - // C++ wrapper type for box_rotate_angle - typedef REAL box_rotate_angle; - // C++ wrapper type for box_slant_angle - typedef REAL box_slant_angle; - // C++ wrapper type for box_width - typedef REAL box_width; - // C++ wrapper type for camera_model_d3_multi_clipping_interection_select - typedef SELECT camera_model_d3_multi_clipping_interection_select; - // C++ wrapper type for camera_model_d3_multi_clipping_union_select - typedef SELECT camera_model_d3_multi_clipping_union_select; - // C++ wrapper type for capacitance_measure - typedef REAL capacitance_measure; - // C++ wrapper type for category_usage_item - typedef SELECT category_usage_item; - // C++ wrapper type for cc_classified_item - typedef SELECT cc_classified_item; - // C++ wrapper type for cc_person_organization_item - typedef SELECT cc_person_organization_item; - // C++ wrapper type for cc_specified_item - typedef SELECT cc_specified_item; - // C++ wrapper type for celsius_temperature_measure - typedef REAL celsius_temperature_measure; - // C++ wrapper type for central_or_parallel - typedef ENUMERATION central_or_parallel; - // C++ wrapper type for certification_item - typedef SELECT certification_item; - // C++ wrapper type for certified_item - typedef SELECT certified_item; - // C++ wrapper type for change_request_item - typedef SELECT change_request_item; - // C++ wrapper type for character_spacing_select - typedef SELECT character_spacing_select; - // C++ wrapper type for character_style_select - typedef SELECT character_style_select; - // C++ wrapper type for characterized_action_definition - typedef SELECT characterized_action_definition; - // C++ wrapper type for characterized_definition - typedef SELECT characterized_definition; - // C++ wrapper type for characterized_material_property - typedef SELECT characterized_material_property; - // C++ wrapper type for characterized_product_composition_value - typedef SELECT characterized_product_composition_value; - // C++ wrapper type for characterized_product_definition - typedef SELECT characterized_product_definition; - // C++ wrapper type for class_usage_effectivity_context_item - typedef SELECT class_usage_effectivity_context_item; - // C++ wrapper type for classification_item - typedef SELECT classification_item; - // C++ wrapper type for classified_item - typedef SELECT classified_item; - // C++ wrapper type for compound_item_definition - typedef SELECT compound_item_definition; - // C++ wrapper type for conductance_measure - typedef REAL conductance_measure; - // C++ wrapper type for configuration_design_item - typedef SELECT configuration_design_item; - // C++ wrapper type for configured_effectivity_context_item - typedef SELECT configured_effectivity_context_item; - // C++ wrapper type for configured_effectivity_item - typedef SELECT configured_effectivity_item; - // C++ wrapper type for constructive_geometry_representation_or_shape_represenation - typedef SELECT constructive_geometry_representation_or_shape_represenation; - // C++ wrapper type for context_dependent_measure - typedef REAL context_dependent_measure; - // C++ wrapper type for contract_item - typedef SELECT contract_item; - // C++ wrapper type for contracted_item - typedef SELECT contracted_item; - // C++ wrapper type for count_measure - typedef NUMBER count_measure; - // C++ wrapper type for csg_primitive - typedef SELECT csg_primitive; - // C++ wrapper type for csg_select - typedef SELECT csg_select; - // C++ wrapper type for curve_font_or_scaled_curve_font_select - typedef SELECT curve_font_or_scaled_curve_font_select; - // C++ wrapper type for curve_on_surface - typedef SELECT curve_on_surface; - // C++ wrapper type for curve_or_annotation_curve_occurrence - typedef SELECT curve_or_annotation_curve_occurrence; - // C++ wrapper type for curve_or_render - typedef SELECT curve_or_render; - // C++ wrapper type for curve_style_font_select - typedef SELECT curve_style_font_select; - // C++ wrapper type for date_and_time_item - typedef SELECT date_and_time_item; - // C++ wrapper type for date_item - typedef SELECT date_item; - // C++ wrapper type for date_time_item - typedef SELECT date_time_item; - // C++ wrapper type for date_time_or_event_occurrence - typedef SELECT date_time_or_event_occurrence; - // C++ wrapper type for date_time_select - typedef SELECT date_time_select; - // C++ wrapper type for day_in_month_number - typedef INTEGER day_in_month_number; - // C++ wrapper type for day_in_week_number - typedef INTEGER day_in_week_number; - // C++ wrapper type for day_in_year_number - typedef INTEGER day_in_year_number; - // C++ wrapper type for defined_symbol_select - typedef SELECT defined_symbol_select; - // C++ wrapper type for derived_property_select - typedef SELECT derived_property_select; - // C++ wrapper type for description_attribute_select - typedef SELECT description_attribute_select; - // C++ wrapper type for descriptive_measure - typedef STRING descriptive_measure; - // C++ wrapper type for dimension_count - typedef INTEGER dimension_count; - // C++ wrapper type for dimension_extent_usage - typedef ENUMERATION dimension_extent_usage; - // C++ wrapper type for dimensional_characteristic - typedef SELECT dimensional_characteristic; - // C++ wrapper type for direction_count_select - typedef SELECT direction_count_select; - // C++ wrapper type for document_identifier_assigned_item - typedef SELECT document_identifier_assigned_item; - // C++ wrapper type for document_reference_item - typedef SELECT document_reference_item; - // C++ wrapper type for dose_equivalent_measure - typedef REAL dose_equivalent_measure; - // C++ wrapper type for draughting_callout_element - typedef SELECT draughting_callout_element; - // C++ wrapper type for draughting_model_item_association_select - typedef SELECT draughting_model_item_association_select; - // C++ wrapper type for draughting_model_item_select - typedef SELECT draughting_model_item_select; - // C++ wrapper type for draughting_titled_item - typedef SELECT draughting_titled_item; - // C++ wrapper type for effectivity_item - typedef SELECT effectivity_item; - // C++ wrapper type for electric_charge_measure - typedef REAL electric_charge_measure; - // C++ wrapper type for electric_current_measure - typedef REAL electric_current_measure; - // C++ wrapper type for electric_potential_measure - typedef REAL electric_potential_measure; - // C++ wrapper type for energy_measure - typedef REAL energy_measure; - // C++ wrapper type for event_occurrence_item - typedef SELECT event_occurrence_item; - // C++ wrapper type for external_identification_item - typedef SELECT external_identification_item; - // C++ wrapper type for fill_area_style_tile_shape_select - typedef SELECT fill_area_style_tile_shape_select; - // C++ wrapper type for fill_style_select - typedef SELECT fill_style_select; - // C++ wrapper type for font_select - typedef SELECT font_select; - // C++ wrapper type for force_measure - typedef REAL force_measure; - // C++ wrapper type for founded_item_select - typedef SELECT founded_item_select; - // C++ wrapper type for frequency_measure - typedef REAL frequency_measure; - // C++ wrapper type for generalized_surface_select - typedef SELECT generalized_surface_select; - // C++ wrapper type for geometric_item_specific_usage_select - typedef SELECT geometric_item_specific_usage_select; - // C++ wrapper type for geometric_set_select - typedef SELECT geometric_set_select; - // C++ wrapper type for groupable_item - typedef SELECT groupable_item; - // C++ wrapper type for hour_in_day - typedef INTEGER hour_in_day; - // C++ wrapper type for id_attribute_select - typedef SELECT id_attribute_select; - // C++ wrapper type for identification_item - typedef SELECT identification_item; - // C++ wrapper type for identifier - typedef STRING identifier; - // C++ wrapper type for illuminance_measure - typedef REAL illuminance_measure; - // C++ wrapper type for inductance_measure - typedef REAL inductance_measure; - // C++ wrapper type for instance_usage_context_select - typedef SELECT instance_usage_context_select; - // C++ wrapper type for invisibility_context - typedef SELECT invisibility_context; - // C++ wrapper type for invisible_item - typedef SELECT invisible_item; - // C++ wrapper type for ir_usage_item - typedef SELECT ir_usage_item; - // C++ wrapper type for knot_type - typedef ENUMERATION knot_type; - // C++ wrapper type for label - typedef STRING label; - // C++ wrapper type for layered_item - typedef SELECT layered_item; - // C++ wrapper type for length_measure - typedef REAL length_measure; - // C++ wrapper type for limit_condition - typedef ENUMERATION limit_condition; - // C++ wrapper type for list_of_reversible_topology_item - typedef ListOf< SELECT, 0, 0 > list_of_reversible_topology_item; - // C++ wrapper type for luminous_flux_measure - typedef REAL luminous_flux_measure; - // C++ wrapper type for luminous_intensity_measure - typedef REAL luminous_intensity_measure; - // C++ wrapper type for magnetic_flux_density_measure - typedef REAL magnetic_flux_density_measure; - // C++ wrapper type for magnetic_flux_measure - typedef REAL magnetic_flux_measure; - // C++ wrapper type for marker_select - typedef SELECT marker_select; - // C++ wrapper type for marker_type - typedef ENUMERATION marker_type; - // C++ wrapper type for mass_measure - typedef REAL mass_measure; - // C++ wrapper type for measure_value - typedef SELECT measure_value; - // C++ wrapper type for mechanical_design_and_draughting_relationship_select - typedef SELECT mechanical_design_and_draughting_relationship_select; - // C++ wrapper type for mechanical_design_geometric_presentation_area_items - typedef SELECT mechanical_design_geometric_presentation_area_items; - // C++ wrapper type for mechanical_design_geometric_presentation_representation_items - typedef SELECT mechanical_design_geometric_presentation_representation_items; - // C++ wrapper type for message - typedef STRING message; - // C++ wrapper type for minute_in_hour - typedef INTEGER minute_in_hour; - // C++ wrapper type for month_in_year_number - typedef INTEGER month_in_year_number; - // C++ wrapper type for multi_language_attribute_item - typedef SELECT multi_language_attribute_item; - // C++ wrapper type for name_attribute_select - typedef SELECT name_attribute_select; - // C++ wrapper type for name_item - typedef SELECT name_item; - // C++ wrapper type for non_negative_length_measure - typedef REAL non_negative_length_measure; - // C++ wrapper type for nonnegative_integer - typedef INTEGER nonnegative_integer; - // C++ wrapper type for null_style - typedef ENUMERATION null_style; - // C++ wrapper type for numeric_measure - typedef NUMBER numeric_measure; - // C++ wrapper type for organization_item - typedef SELECT organization_item; - // C++ wrapper type for orientation_basis_select - typedef SELECT orientation_basis_select; - // C++ wrapper type for parameter_value - typedef REAL parameter_value; - // C++ wrapper type for pcurve_or_surface - typedef SELECT pcurve_or_surface; - // C++ wrapper type for person_and_organization_item - typedef SELECT person_and_organization_item; - // C++ wrapper type for person_organization_select - typedef SELECT person_organization_select; - // C++ wrapper type for picture_representation_item_select - typedef SELECT picture_representation_item_select; - // C++ wrapper type for plane_angle_measure - typedef REAL plane_angle_measure; - // C++ wrapper type for plane_or_planar_box - typedef SELECT plane_or_planar_box; - // C++ wrapper type for point_and_vector_member - typedef SELECT point_and_vector_member; - // C++ wrapper type for point_and_vector_members - typedef ListOf< SELECT, 2, 3 > point_and_vector_members; - // C++ wrapper type for positive_integer - typedef INTEGER positive_integer; - // C++ wrapper type for positive_length_measure - typedef REAL positive_length_measure; - // C++ wrapper type for positive_plane_angle_measure - typedef REAL positive_plane_angle_measure; - // C++ wrapper type for positive_ratio_measure - typedef REAL positive_ratio_measure; - // C++ wrapper type for power_measure - typedef REAL power_measure; - // C++ wrapper type for preferred_surface_curve_representation - typedef ENUMERATION preferred_surface_curve_representation; - // C++ wrapper type for presentable_text - typedef STRING presentable_text; - // C++ wrapper type for presentation_representation_select - typedef SELECT presentation_representation_select; - // C++ wrapper type for presentation_size_assignment_select - typedef SELECT presentation_size_assignment_select; - // C++ wrapper type for presentation_style_select - typedef SELECT presentation_style_select; - // C++ wrapper type for presented_item_select - //typedef SELECT presented_item_select; - // C++ wrapper type for pressure_measure - typedef REAL pressure_measure; - // C++ wrapper type for product_definition_or_assembly_relationship - typedef SELECT product_definition_or_assembly_relationship; - // C++ wrapper type for product_definition_or_breakdown_element_usage - typedef SELECT product_definition_or_breakdown_element_usage; - // C++ wrapper type for product_definition_or_product_definition_relationship - typedef SELECT product_definition_or_product_definition_relationship; - // C++ wrapper type for product_or_formation_or_definition - typedef SELECT product_or_formation_or_definition; - // C++ wrapper type for project_item - typedef SELECT project_item; - // C++ wrapper type for radioactivity_measure - typedef REAL radioactivity_measure; - // C++ wrapper type for ratio_measure - typedef REAL ratio_measure; - // C++ wrapper type for rendering_properties_select - typedef SELECT rendering_properties_select; - // C++ wrapper type for represented_definition - typedef SELECT represented_definition; - // C++ wrapper type for requirement_assigned_item - typedef SELECT requirement_assigned_item; - // C++ wrapper type for requirement_satisfaction_item - typedef SELECT requirement_satisfaction_item; - // C++ wrapper type for requirement_source_item - typedef SELECT requirement_source_item; - // C++ wrapper type for resistance_measure - typedef REAL resistance_measure; - // C++ wrapper type for reversible_topology - typedef SELECT reversible_topology; - // C++ wrapper type for reversible_topology_item - typedef SELECT reversible_topology_item; - // C++ wrapper type for role_select - typedef SELECT role_select; - // C++ wrapper type for rule_superseded_item - typedef SELECT rule_superseded_item; - // C++ wrapper type for second_in_minute - typedef REAL second_in_minute; - // C++ wrapper type for security_classification_item - typedef SELECT security_classification_item; - // C++ wrapper type for set_of_reversible_topology_item - typedef ListOf< SELECT, 0, 0 > set_of_reversible_topology_item; - // C++ wrapper type for shading_curve_method - typedef ENUMERATION shading_curve_method; - // C++ wrapper type for shading_surface_method - typedef ENUMERATION shading_surface_method; - // C++ wrapper type for shape_definition - typedef SELECT shape_definition; - // C++ wrapper type for shell - typedef SELECT shell; - // C++ wrapper type for si_prefix - typedef ENUMERATION si_prefix; - // C++ wrapper type for si_unit_name - typedef ENUMERATION si_unit_name; - // C++ wrapper type for size_select - typedef SELECT size_select; - // C++ wrapper type for sketch_basis_select - typedef SELECT sketch_basis_select; - // C++ wrapper type for solid_angle_measure - typedef REAL solid_angle_measure; - // C++ wrapper type for source - typedef ENUMERATION source; - // C++ wrapper type for source_item - typedef SELECT source_item; - // C++ wrapper type for start_request_item - typedef SELECT start_request_item; - // C++ wrapper type for string_representation_item_select - typedef SELECT string_representation_item_select; - // C++ wrapper type for style_context_select - typedef SELECT style_context_select; - // C++ wrapper type for surface_side - typedef ENUMERATION surface_side; - // C++ wrapper type for surface_side_style_select - typedef SELECT surface_side_style_select; - // C++ wrapper type for surface_style_element_select - typedef SELECT surface_style_element_select; - // C++ wrapper type for symbol_style_select - typedef SELECT symbol_style_select; - // C++ wrapper type for text - typedef STRING text; - // C++ wrapper type for text_alignment - typedef STRING text_alignment; - // C++ wrapper type for text_delineation - typedef STRING text_delineation; - // C++ wrapper type for text_or_character - typedef SELECT text_or_character; - // C++ wrapper type for text_path - typedef ENUMERATION text_path; - // C++ wrapper type for text_string_representation_item - typedef SELECT text_string_representation_item; - // C++ wrapper type for thermodynamic_temperature_measure - typedef REAL thermodynamic_temperature_measure; - // C++ wrapper type for time_interval_item - typedef SELECT time_interval_item; - // C++ wrapper type for time_measure - typedef REAL time_measure; - // C++ wrapper type for tolerance_method_definition - typedef SELECT tolerance_method_definition; - // C++ wrapper type for transformation - typedef SELECT transformation; - // C++ wrapper type for transition_code - typedef ENUMERATION transition_code; - // C++ wrapper type for trim_condition_select - typedef SELECT trim_condition_select; - // C++ wrapper type for trim_intent - typedef ENUMERATION trim_intent; - // C++ wrapper type for trimming_preference - typedef ENUMERATION trimming_preference; - // C++ wrapper type for trimming_select - typedef SELECT trimming_select; - // C++ wrapper type for u_direction_count - typedef INTEGER u_direction_count; - // C++ wrapper type for unit - typedef SELECT unit; - // C++ wrapper type for v_direction_count - typedef INTEGER v_direction_count; - // C++ wrapper type for value_qualifier - typedef SELECT value_qualifier; - // C++ wrapper type for vector_or_direction - typedef SELECT vector_or_direction; - // C++ wrapper type for velocity_measure - typedef REAL velocity_measure; - // C++ wrapper type for volume_measure - typedef REAL volume_measure; - // C++ wrapper type for week_in_year_number - typedef INTEGER week_in_year_number; - // C++ wrapper type for work_item - typedef SELECT work_item; - // C++ wrapper type for year_number - typedef INTEGER year_number; - - - // ****************************************************************************** - // StepFile Entities - // ****************************************************************************** - - struct measure_with_unit; - struct absorbed_dose_measure_with_unit; - struct derived_unit; - struct absorbed_dose_unit; - //struct abstract_variable; - struct acceleration_measure_with_unit; - struct acceleration_unit; - struct action; - struct action_assignment; - typedef NotImplemented action_directive; // (not currently used by Assimp) - struct action_method; - struct action_method_assignment; - struct action_method_relationship; - typedef NotImplemented action_method_role; // (not currently used by Assimp) - typedef NotImplemented action_property; // (not currently used by Assimp) - typedef NotImplemented action_property_representation; // (not currently used by Assimp) - typedef NotImplemented action_relationship; // (not currently used by Assimp) - struct action_request_assignment; - typedef NotImplemented action_request_solution; // (not currently used by Assimp) - typedef NotImplemented action_request_status; // (not currently used by Assimp) - typedef NotImplemented action_status; // (not currently used by Assimp) - struct address; - struct representation; - struct shape_representation; - struct advanced_brep_shape_representation; - struct face_surface; - struct advanced_face; - typedef NotImplemented alternate_product_relationship; // (not currently used by Assimp) - struct amount_of_substance_measure_with_unit; - struct named_unit; - struct amount_of_substance_unit; - struct angle_direction_reference; - struct representation_item; - struct geometric_representation_item; - struct draughting_callout; - struct dimension_curve_directed_callout; - struct angular_dimension; - struct shape_aspect_relationship; - struct dimensional_location; - struct angular_location; - struct dimensional_size; - struct angular_size; - struct geometric_tolerance; - struct geometric_tolerance_with_datum_reference; - struct angularity_tolerance; - struct styled_item; - struct annotation_occurrence; - struct annotation_curve_occurrence; - struct annotation_fill_area; - struct annotation_fill_area_occurrence; - struct annotation_occurrence_relationship; - struct annotation_occurrence_associativity; - struct annotation_plane; - struct annotation_symbol_occurrence; - struct annotation_subfigure_occurrence; - struct mapped_item; - struct annotation_symbol; - struct annotation_text; - struct annotation_text_character; - struct annotation_text_occurrence; - struct shape_aspect; - struct derived_shape_aspect; - struct apex; - typedef NotImplemented application_context; // (not currently used by Assimp) - struct application_context_element; - typedef NotImplemented application_protocol_definition; // (not currently used by Assimp) - struct applied_action_assignment; - struct applied_action_method_assignment; - struct applied_action_request_assignment; - struct approval_assignment; - struct applied_approval_assignment; - struct attribute_classification_assignment; - struct applied_attribute_classification_assignment; - struct certification_assignment; - struct applied_certification_assignment; - struct classification_assignment; - struct applied_classification_assignment; - struct contract_assignment; - struct applied_contract_assignment; - struct date_and_time_assignment; - struct applied_date_and_time_assignment; - struct date_assignment; - struct applied_date_assignment; - struct document_reference; - struct applied_document_reference; - struct document_usage_constraint_assignment; - struct applied_document_usage_constraint_assignment; - struct effectivity_assignment; - struct applied_effectivity_assignment; - struct event_occurrence_assignment; - struct applied_event_occurrence_assignment; - struct identification_assignment; - struct external_identification_assignment; - struct applied_external_identification_assignment; - struct group_assignment; - struct applied_group_assignment; - struct applied_identification_assignment; - struct name_assignment; - struct applied_name_assignment; - struct organization_assignment; - struct applied_organization_assignment; - struct organizational_project_assignment; - struct applied_organizational_project_assignment; - struct person_and_organization_assignment; - struct applied_person_and_organization_assignment; - //struct presented_item; - struct applied_presented_item; - struct security_classification_assignment; - struct applied_security_classification_assignment; - struct time_interval_assignment; - struct applied_time_interval_assignment; - struct applied_usage_right; - typedef NotImplemented approval; // (not currently used by Assimp) - typedef NotImplemented approval_date_time; // (not currently used by Assimp) - typedef NotImplemented approval_person_organization; // (not currently used by Assimp) - typedef NotImplemented approval_relationship; // (not currently used by Assimp) - typedef NotImplemented approval_role; // (not currently used by Assimp) - typedef NotImplemented approval_status; // (not currently used by Assimp) - struct area_in_set; - struct area_measure_with_unit; - struct area_unit; - struct product_definition_relationship; - struct product_definition_usage; - struct assembly_component_usage; - typedef NotImplemented assembly_component_usage_substitute; // (not currently used by Assimp) - struct assigned_requirement; - struct compound_representation_item; - struct atomic_formula; - struct attribute_assertion; - struct attribute_language_assignment; - struct attribute_value_assignment; - typedef NotImplemented attribute_value_role; // (not currently used by Assimp) - struct auxiliary_geometric_representation_item; - struct placement; - struct axis1_placement; - struct axis2_placement_2d; - struct axis2_placement_3d; - struct curve; - struct bounded_curve; - struct b_spline_curve; - struct b_spline_curve_with_knots; - struct surface; - struct bounded_surface; - struct b_spline_surface; - struct b_spline_surface_with_knots; - struct product_definition; - struct rule_software_definition; - struct rule_definition; - struct back_chaining_rule; - struct back_chaining_rule_body; - struct colour; - struct background_colour; - struct beveled_sheet_representation; - struct bezier_curve; - struct bezier_surface; - struct generic_expression; - struct binary_generic_expression; - struct binary_numeric_expression; - struct binary_representation_item; - struct block; - struct expression; - struct boolean_expression; - struct boolean_literal; - struct boolean_representation_item; - struct boolean_result; - struct composite_curve; - struct composite_curve_on_surface; - struct boundary_curve; - struct bounded_pcurve; - struct bounded_surface_curve; - struct founded_item; - struct box_domain; - struct half_space_solid; - struct boxed_half_space; - struct breakdown_context; - struct breakdown_element_group_assignment; - struct breakdown_element_realization; - struct breakdown_element_usage; - struct breakdown_of; - struct solid_model; - struct manifold_solid_brep; - struct brep_with_voids; - struct bytes_representation_item; - struct date; - struct calendar_date; - struct camera_image; - struct camera_image_3d_with_scale; - struct camera_model; - struct camera_model_d3; - struct camera_model_d3_multi_clipping; - struct camera_model_d3_multi_clipping_intersection; - struct camera_model_d3_multi_clipping_union; - struct camera_model_d3_with_hlhsr; - struct camera_model_with_light_sources; - struct representation_map; - struct camera_usage; - struct capacitance_measure_with_unit; - struct capacitance_unit; - struct point; - struct cartesian_point; - struct cartesian_transformation_operator; - struct cartesian_transformation_operator_2d; - struct cartesian_transformation_operator_3d; - struct cc_design_approval; - struct cc_design_certification; - struct cc_design_contract; - struct cc_design_date_and_time_assignment; - struct cc_design_person_and_organization_assignment; - struct cc_design_security_classification; - struct cc_design_specification_reference; - struct celsius_temperature_measure_with_unit; - struct centre_of_symmetry; - typedef NotImplemented certification; // (not currently used by Assimp) - typedef NotImplemented certification_type; // (not currently used by Assimp) - struct change; - struct change_request; - typedef NotImplemented character_glyph_font_usage; // (not currently used by Assimp) - struct character_glyph_style_outline; - struct character_glyph_style_stroke; - struct symbol_representation; - struct generic_character_glyph_symbol; - struct character_glyph_symbol; - struct character_glyph_symbol_outline; - struct character_glyph_symbol_stroke; - struct general_property; - struct characteristic_data_column_header; - struct general_property_relationship; - struct characteristic_data_column_header_link; - struct characteristic_data_table_header; - struct characteristic_data_table_header_decomposition; - struct group; - struct characteristic_type; - struct characterized_class; - struct characterized_object; - struct conic; - struct circle; - struct circular_runout_tolerance; - typedef NotImplemented class_t; // (not currently used by Assimp) - struct class_by_extension; - struct class_by_intension; - struct class_system; - struct effectivity_context_assignment; - struct class_usage_effectivity_context_assignment; - typedef NotImplemented classification_role; // (not currently used by Assimp) - struct topological_representation_item; - struct connected_face_set; - struct closed_shell; - struct coaxiality_tolerance; - struct colour_specification; - struct colour_rgb; - struct common_datum; - struct comparison_expression; - struct complex_clause; - struct complex_conjunctive_clause; - struct complex_disjunctive_clause; - struct modified_solid; - struct shelled_solid; - struct complex_shelled_solid; - struct composite_assembly_definition; - struct composite_assembly_sequence_definition; - struct laminate_table; - struct part_laminate_table; - struct composite_assembly_table; - struct composite_curve_segment; - struct material_designation; - struct composite_material_designation; - struct composite_shape_aspect; - struct composite_sheet_representation; - struct composite_text; - struct composite_text_with_associated_curves; - struct composite_text_with_blanking_box; - struct composite_text_with_delineation; - struct composite_text_with_extent; - struct compound_shape_representation; - struct concentricity_tolerance; - typedef NotImplemented concept_feature_operator; // (not currently used by Assimp) - struct concept_feature_relationship; - struct concept_feature_relationship_with_condition; - struct product_concept_feature; - struct conditional_concept_feature; - struct conductance_measure_with_unit; - struct conductance_unit; - struct configuration_item; - struct configurable_item; - typedef NotImplemented configuration_design; // (not currently used by Assimp) - struct effectivity; - struct product_definition_effectivity; - struct configuration_effectivity; - struct configuration_item_relationship; - struct configuration_item_hierarchical_relationship; - struct configuration_item_revision_sequence; - struct configured_effectivity_assignment; - struct configured_effectivity_context_assignment; - struct conical_stepped_hole_transition; - struct elementary_surface; - struct conical_surface; - struct connected_edge_set; - struct connected_face_sub_set; - struct constructive_geometry_representation; - struct representation_relationship; - struct constructive_geometry_representation_relationship; - struct contact_ratio_representation; - struct invisibility; - struct context_dependent_invisibility; - struct over_riding_styled_item; - struct context_dependent_over_riding_styled_item; - typedef NotImplemented context_dependent_shape_representation; // (not currently used by Assimp) - struct context_dependent_unit; - typedef NotImplemented contract; // (not currently used by Assimp) - typedef NotImplemented contract_relationship; // (not currently used by Assimp) - typedef NotImplemented contract_type; // (not currently used by Assimp) - struct conversion_based_unit; - typedef NotImplemented coordinated_universal_time_offset; // (not currently used by Assimp) - struct csg_shape_representation; - struct csg_solid; - struct currency; - struct currency_measure_with_unit; - struct curve_bounded_surface; - struct curve_dimension; - struct curve_replica; - struct curve_style; - struct curve_style_font; - struct curve_style_font_and_scaling; - struct curve_style_font_pattern; - typedef NotImplemented curve_style_rendering; // (not currently used by Assimp) - struct curve_swept_solid_shape_representation; - struct cylindrical_surface; - struct cylindricity_tolerance; - typedef NotImplemented data_environment; // (not currently used by Assimp) - typedef NotImplemented date_and_time; // (not currently used by Assimp) - struct date_representation_item; - typedef NotImplemented date_role; // (not currently used by Assimp) - struct date_time_representation_item; - typedef NotImplemented date_time_role; // (not currently used by Assimp) - struct dated_effectivity; - struct datum; - struct datum_feature; - struct datum_feature_callout; - struct datum_reference; - struct datum_target; - struct datum_target_callout; - struct default_tolerance_table; - struct default_tolerance_table_cell; - struct defined_symbol; - struct definitional_representation; - struct definitional_representation_relationship; - struct definitional_representation_relationship_with_same_context; - struct degenerate_pcurve; - struct toroidal_surface; - struct degenerate_toroidal_surface; - typedef NotImplemented derived_unit_element; // (not currently used by Assimp) - typedef NotImplemented description_attribute; // (not currently used by Assimp) - struct descriptive_representation_item; - struct product_definition_context; - struct design_context; - struct design_make_from_relationship; - struct diameter_dimension; - struct ratio_measure_with_unit; - struct dielectric_constant_measure_with_unit; - struct dimension_callout; - struct draughting_callout_relationship; - struct dimension_callout_component_relationship; - struct dimension_callout_relationship; - struct dimension_curve; - struct terminator_symbol; - struct dimension_curve_terminator; - struct dimension_curve_terminator_to_projection_curve_associativity; - struct dimension_pair; - typedef NotImplemented dimension_related_tolerance_zone_element; // (not currently used by Assimp) - struct dimension_text_associativity; - typedef NotImplemented dimensional_characteristic_representation; // (not currently used by Assimp) - typedef NotImplemented dimensional_exponents; // (not currently used by Assimp) - struct dimensional_location_with_path; - struct dimensional_size_with_path; - struct executed_action; - struct directed_action; - struct directed_dimensional_location; - struct direction; - typedef NotImplemented document; // (not currently used by Assimp) - struct document_file; - struct document_identifier; - struct document_identifier_assignment; - struct document_product_association; - struct document_product_equivalence; - typedef NotImplemented document_relationship; // (not currently used by Assimp) - typedef NotImplemented document_representation_type; // (not currently used by Assimp) - typedef NotImplemented document_type; // (not currently used by Assimp) - typedef NotImplemented document_usage_constraint; // (not currently used by Assimp) - typedef NotImplemented document_usage_role; // (not currently used by Assimp) - struct dose_equivalent_measure_with_unit; - struct dose_equivalent_unit; - struct double_offset_shelled_solid; - struct item_defined_transformation; - struct transformation_with_derived_angle; - struct draped_defined_transformation; - struct draughting_annotation_occurrence; - struct draughting_elements; - struct draughting_model; - struct item_identified_representation_usage; - struct draughting_model_item_association; - struct pre_defined_colour; - struct draughting_pre_defined_colour; - struct pre_defined_item; - struct pre_defined_curve_font; - struct draughting_pre_defined_curve_font; - struct pre_defined_text_font; - struct draughting_pre_defined_text_font; - struct draughting_subfigure_representation; - struct draughting_symbol_representation; - struct text_literal; - struct text_literal_with_delineation; - struct draughting_text_literal_with_delineation; - typedef NotImplemented draughting_title; // (not currently used by Assimp) - typedef NotImplemented drawing_definition; // (not currently used by Assimp) - struct presentation_set; - struct drawing_revision; - typedef NotImplemented drawing_revision_sequence; // (not currently used by Assimp) - struct presentation_representation; - struct presentation_area; - struct drawing_sheet_revision; - struct drawing_sheet_revision_sequence; - struct drawing_sheet_revision_usage; - struct edge; - struct edge_based_wireframe_model; - struct edge_based_wireframe_shape_representation; - struct edge_blended_solid; - struct edge_curve; - struct edge_loop; - typedef NotImplemented effectivity_context_role; // (not currently used by Assimp) - typedef NotImplemented effectivity_relationship; // (not currently used by Assimp) - struct electric_charge_measure_with_unit; - struct electric_charge_unit; - struct electric_current_measure_with_unit; - struct electric_current_unit; - struct electric_potential_measure_with_unit; - struct electric_potential_unit; - struct elementary_brep_shape_representation; - struct ellipse; - struct energy_measure_with_unit; - struct energy_unit; - struct property_definition; - struct fact_type; - struct entity_assertion; - struct enum_reference_prefix; - typedef NotImplemented environment; // (not currently used by Assimp) - struct evaluated_characteristic; - struct evaluated_degenerate_pcurve; - struct evaluation_product_definition; - struct event_occurrence; - typedef NotImplemented event_occurrence_relationship; // (not currently used by Assimp) - typedef NotImplemented event_occurrence_role; // (not currently used by Assimp) - struct product_concept_feature_category; - struct exclusive_product_concept_feature_category; - struct uncertainty_qualifier; - struct standard_uncertainty; - struct expanded_uncertainty; - struct representation_item_relationship; - struct explicit_procedural_representation_item_relationship; - struct explicit_procedural_geometric_representation_item_relationship; - struct explicit_procedural_representation_relationship; - struct explicit_procedural_shape_representation_relationship; - struct expression_conversion_based_unit; - struct extension; - struct extent; - struct external_source; - struct external_class_library; - typedef NotImplemented external_source_relationship; // (not currently used by Assimp) - struct externally_defined_class; - struct externally_defined_colour; - struct externally_defined_context_dependent_unit; - struct externally_defined_conversion_based_unit; - struct externally_defined_currency; - struct externally_defined_item; - struct externally_defined_curve_font; - struct externally_defined_dimension_definition; - struct externally_defined_general_property; - struct externally_defined_hatch_style; - typedef NotImplemented externally_defined_item_relationship; // (not currently used by Assimp) - struct externally_defined_marker; - struct picture_representation_item; - struct externally_defined_picture_representation_item; - struct externally_defined_representation_item; - struct externally_defined_string; - struct externally_defined_symbol; - struct externally_defined_terminator_symbol; - struct externally_defined_text_font; - struct externally_defined_tile; - struct externally_defined_tile_style; - struct swept_area_solid; - struct extruded_area_solid; - struct swept_face_solid; - struct extruded_face_solid; - struct extruded_face_solid_with_trim_conditions; - struct extruded_face_solid_with_draft_angle; - struct extruded_face_solid_with_multiple_draft_angles; - struct face; - struct face_based_surface_model; - struct face_bound; - struct face_outer_bound; - struct faceted_brep; - struct faceted_brep_shape_representation; - struct fill_area_style; - typedef NotImplemented fill_area_style_colour; // (not currently used by Assimp) - struct fill_area_style_hatching; - struct fill_area_style_tile_coloured_region; - struct fill_area_style_tile_curve_with_style; - struct fill_area_style_tile_symbol_with_style; - struct fill_area_style_tiles; - struct shape_representation_relationship; - struct flat_pattern_ply_representation_relationship; - struct flatness_tolerance; - struct force_measure_with_unit; - struct force_unit; - struct forward_chaining_rule; - struct forward_chaining_rule_premise; - struct frequency_measure_with_unit; - struct frequency_unit; - struct func; - struct functional_breakdown_context; - struct functional_element_usage; - typedef NotImplemented functionally_defined_transformation; // (not currently used by Assimp) - struct general_material_property; - typedef NotImplemented general_property_association; // (not currently used by Assimp) - struct simple_generic_expression; - struct generic_literal; - struct generic_variable; - struct geometric_alignment; - struct geometric_set; - struct geometric_curve_set; - struct geometric_intersection; - struct geometric_item_specific_usage; - struct geometric_model_element_relationship; - struct representation_context; - struct geometric_representation_context; - typedef NotImplemented geometric_tolerance_relationship; // (not currently used by Assimp) - struct geometric_tolerance_with_defined_unit; - struct geometrical_tolerance_callout; - struct geometrically_bounded_2d_wireframe_representation; - struct geometrically_bounded_surface_shape_representation; - struct geometrically_bounded_wireframe_shape_representation; - struct global_assignment; - struct global_uncertainty_assigned_context; - struct global_unit_assigned_context; - struct ground_fact; - typedef NotImplemented group_relationship; // (not currently used by Assimp) - struct hardness_representation; - struct hidden_element_over_riding_styled_item; - struct hyperbola; - typedef NotImplemented id_attribute; // (not currently used by Assimp) - typedef NotImplemented identification_role; // (not currently used by Assimp) - struct illuminance_measure_with_unit; - struct illuminance_unit; - struct included_text_block; - struct inclusion_product_concept_feature; - struct user_selected_elements; - struct indirectly_selected_elements; - struct indirectly_selected_shape_elements; - struct inductance_measure_with_unit; - struct inductance_unit; - struct information_right; - struct information_usage_right; - struct instance_usage_context_assignment; - struct instanced_feature; - struct literal_number; - struct int_literal; - struct integer_representation_item; - struct surface_curve; - struct intersection_curve; - struct interval_expression; - struct iso4217_currency; - struct known_source; - struct laid_defined_transformation; - struct language; - struct leader_curve; - struct leader_directed_callout; - struct leader_directed_dimension; - struct leader_terminator; - struct length_measure_with_unit; - struct length_unit; - struct light_source; - struct light_source_ambient; - struct light_source_directional; - struct light_source_positional; - struct light_source_spot; - typedef NotImplemented limits_and_fits; // (not currently used by Assimp) - struct line; - struct line_profile_tolerance; - struct linear_dimension; - struct simple_clause; - struct literal_conjunction; - struct literal_disjunction; - typedef NotImplemented local_time; // (not currently used by Assimp) - struct logical_literal; - struct logical_representation_item; - struct loop; - struct loss_tangent_measure_with_unit; - struct lot_effectivity; - struct luminous_flux_measure_with_unit; - struct luminous_flux_unit; - struct luminous_intensity_measure_with_unit; - struct luminous_intensity_unit; - struct magnetic_flux_density_measure_with_unit; - struct magnetic_flux_density_unit; - struct magnetic_flux_measure_with_unit; - struct magnetic_flux_unit; - struct make_from_usage_option; - struct manifold_subsurface_shape_representation; - struct manifold_surface_shape_representation; - struct mass_measure_with_unit; - struct mass_unit; - typedef NotImplemented material_designation_characterization; // (not currently used by Assimp) - struct material_property; - struct property_definition_representation; - struct material_property_representation; - typedef NotImplemented measure_qualification; // (not currently used by Assimp) - struct measure_representation_item; - struct product_context; - struct mechanical_context; - struct mechanical_design_and_draughting_relationship; - struct mechanical_design_geometric_presentation_area; - struct mechanical_design_geometric_presentation_representation; - struct mechanical_design_presentation_representation_with_draughting; - struct mechanical_design_shaded_presentation_area; - struct mechanical_design_shaded_presentation_representation; - struct min_and_major_ply_orientation_basis; - struct modified_geometric_tolerance; - struct modified_solid_with_placed_configuration; - struct moments_of_inertia_representation; - struct multi_language_attribute_assignment; - struct multiple_arity_boolean_expression; - struct multiple_arity_generic_expression; - struct multiple_arity_numeric_expression; - typedef NotImplemented name_attribute; // (not currently used by Assimp) - struct next_assembly_usage_occurrence; - struct non_manifold_surface_shape_representation; - struct null_representation_item; - struct numeric_expression; - typedef NotImplemented object_role; // (not currently used by Assimp) - struct offset_curve_2d; - struct offset_curve_3d; - struct offset_surface; - struct one_direction_repeat_factor; - struct open_shell; - struct ordinal_date; - struct projection_directed_callout; - struct ordinate_dimension; - typedef NotImplemented organization; // (not currently used by Assimp) - typedef NotImplemented organization_relationship; // (not currently used by Assimp) - typedef NotImplemented organization_role; // (not currently used by Assimp) - struct organizational_address; - typedef NotImplemented organizational_project; // (not currently used by Assimp) - typedef NotImplemented organizational_project_relationship; // (not currently used by Assimp) - typedef NotImplemented organizational_project_role; // (not currently used by Assimp) - struct oriented_closed_shell; - struct oriented_edge; - struct oriented_face; - struct oriented_open_shell; - struct path; - struct oriented_path; - struct oriented_surface; - struct outer_boundary_curve; - struct package_product_concept_feature; - struct parabola; - struct parallel_offset; - struct parallelism_tolerance; - struct parametric_representation_context; - struct partial_document_with_structured_text_representation_assignment; - struct pcurve; - struct percentage_laminate_definition; - struct zone_structural_makeup; - struct percentage_laminate_table; - struct percentage_ply_definition; - struct perpendicular_to; - struct perpendicularity_tolerance; - typedef NotImplemented person; // (not currently used by Assimp) - typedef NotImplemented person_and_organization; // (not currently used by Assimp) - struct person_and_organization_address; - typedef NotImplemented person_and_organization_role; // (not currently used by Assimp) - struct personal_address; - struct physical_breakdown_context; - struct physical_element_usage; - struct presentation_view; - struct picture_representation; - struct placed_datum_target_feature; - struct placed_feature; - struct planar_extent; - struct planar_box; - struct plane; - struct plane_angle_measure_with_unit; - struct plane_angle_unit; - typedef NotImplemented plus_minus_tolerance; // (not currently used by Assimp) - struct ply_laminate_definition; - struct ply_laminate_sequence_definition; - struct ply_laminate_table; - struct point_and_vector; - struct point_on_curve; - struct point_on_surface; - struct point_path; - struct point_replica; - struct point_style; - struct polar_complex_number_literal; - struct poly_loop; - struct polyline; - struct position_tolerance; - struct positioned_sketch; - struct power_measure_with_unit; - struct power_unit; - struct pre_defined_symbol; - struct pre_defined_dimension_symbol; - struct pre_defined_geometrical_tolerance_symbol; - struct pre_defined_marker; - struct pre_defined_point_marker_symbol; - struct pre_defined_surface_condition_symbol; - struct pre_defined_surface_side_style; - struct pre_defined_terminator_symbol; - struct pre_defined_tile; - typedef NotImplemented precision_qualifier; // (not currently used by Assimp) - struct predefined_picture_representation_item; - typedef NotImplemented presentation_layer_assignment; // (not currently used by Assimp) - typedef NotImplemented presentation_size; // (not currently used by Assimp) - struct presentation_style_assignment; - struct presentation_style_by_context; - typedef NotImplemented presented_item_representation; // (not currently used by Assimp) - struct pressure_measure_with_unit; - struct pressure_unit; - struct procedural_representation; - struct procedural_representation_sequence; - struct procedural_shape_representation; - struct procedural_shape_representation_sequence; - typedef NotImplemented product; // (not currently used by Assimp) - struct product_category; - struct product_class; - typedef NotImplemented product_concept; // (not currently used by Assimp) - struct product_concept_context; - typedef NotImplemented product_concept_feature_association; // (not currently used by Assimp) - struct product_concept_feature_category_usage; - typedef NotImplemented product_concept_relationship; // (not currently used by Assimp) - typedef NotImplemented product_definition_context_association; // (not currently used by Assimp) - typedef NotImplemented product_definition_context_role; // (not currently used by Assimp) - struct product_definition_element_relationship; - struct product_definition_formation; - typedef NotImplemented product_definition_formation_relationship; // (not currently used by Assimp) - struct product_definition_formation_with_specified_source; - struct product_definition_group_assignment; - typedef NotImplemented product_definition_occurrence_relationship; // (not currently used by Assimp) - struct product_definition_shape; - typedef NotImplemented product_definition_substitute; // (not currently used by Assimp) - struct product_definition_with_associated_documents; - struct product_identification; - struct product_material_composition_relationship; - struct product_related_product_category; - struct product_specification; - struct tolerance_zone_definition; - struct projected_zone_definition; - struct projection_curve; - struct promissory_usage_occurrence; - typedef NotImplemented property_definition_relationship; // (not currently used by Assimp) - struct qualified_representation_item; - struct qualitative_uncertainty; - struct quantified_assembly_component_usage; - struct quasi_uniform_curve; - struct quasi_uniform_surface; - struct radioactivity_measure_with_unit; - struct radioactivity_unit; - struct radius_dimension; - struct range_characteristic; - struct ratio_unit; - struct rational_b_spline_curve; - struct rational_b_spline_surface; - struct rational_representation_item; - struct real_literal; - struct real_representation_item; - struct rectangular_composite_surface; - struct rectangular_trimmed_surface; - struct referenced_modified_datum; - struct relative_event_occurrence; - struct rep_item_group; - struct reparametrised_composite_curve_segment; - struct representation_relationship_with_transformation; - struct requirement_assigned_object; - struct requirement_assignment; - struct requirement_source; - struct requirement_view_definition_relationship; - struct resistance_measure_with_unit; - struct resistance_unit; - struct revolved_area_solid; - struct revolved_face_solid; - struct revolved_face_solid_with_trim_conditions; - struct right_angular_wedge; - struct right_circular_cone; - struct right_circular_cylinder; - struct right_to_usage_association; - typedef NotImplemented role_association; // (not currently used by Assimp) - struct roundness_tolerance; - struct row_representation_item; - struct row_value; - struct row_variable; - struct rule_action; - struct rule_condition; - struct rule_set; - struct rule_set_group; - struct rule_superseded_assignment; - struct rule_supersedence; - struct surface_curve_swept_area_solid; - struct ruled_surface_swept_area_solid; - struct runout_zone_definition; - struct runout_zone_orientation; - struct runout_zone_orientation_reference_direction; - struct satisfied_requirement; - struct satisfies_requirement; - struct satisfying_item; - struct scalar_variable; - struct scattering_parameter; - struct sculptured_solid; - struct seam_curve; - typedef NotImplemented security_classification; // (not currently used by Assimp) - typedef NotImplemented security_classification_level; // (not currently used by Assimp) - struct serial_numbered_effectivity; - struct shape_aspect_associativity; - struct shape_aspect_deriving_relationship; - struct shape_definition_representation; - struct shape_dimension_representation; - struct shape_feature_definition; - struct shape_representation_with_parameters; - struct shell_based_surface_model; - struct shell_based_wireframe_model; - struct shell_based_wireframe_shape_representation; - struct si_absorbed_dose_unit; - struct si_capacitance_unit; - struct si_conductance_unit; - struct si_dose_equivalent_unit; - struct si_electric_charge_unit; - struct si_electric_potential_unit; - struct si_energy_unit; - struct si_force_unit; - struct si_frequency_unit; - struct si_illuminance_unit; - struct si_inductance_unit; - struct si_magnetic_flux_density_unit; - struct si_magnetic_flux_unit; - struct si_power_unit; - struct si_pressure_unit; - struct si_radioactivity_unit; - struct si_resistance_unit; - struct si_unit; - struct simple_boolean_expression; - struct simple_numeric_expression; - struct slash_expression; - struct smeared_material_definition; - struct solid_angle_measure_with_unit; - struct solid_angle_unit; - struct solid_curve_font; - struct solid_replica; - struct solid_with_chamfered_edges; - struct solid_with_angle_based_chamfer; - struct solid_with_shape_element_pattern; - struct solid_with_circular_pattern; - struct solid_with_depression; - struct solid_with_pocket; - struct solid_with_circular_pocket; - struct solid_with_protrusion; - struct solid_with_circular_protrusion; - struct solid_with_hole; - struct solid_with_stepped_round_hole; - struct solid_with_conical_bottom_round_hole; - struct solid_with_constant_radius_edge_blend; - struct solid_with_slot; - struct solid_with_curved_slot; - struct solid_with_double_offset_chamfer; - struct solid_with_flat_bottom_round_hole; - struct solid_with_general_pocket; - struct solid_with_general_protrusion; - struct solid_with_groove; - struct solid_with_incomplete_circular_pattern; - struct solid_with_rectangular_pattern; - struct solid_with_incomplete_rectangular_pattern; - struct solid_with_rectangular_pocket; - struct solid_with_rectangular_protrusion; - struct solid_with_single_offset_chamfer; - struct solid_with_spherical_bottom_round_hole; - struct solid_with_stepped_round_hole_and_conical_transitions; - struct solid_with_straight_slot; - struct solid_with_tee_section_slot; - struct solid_with_through_depression; - struct solid_with_trapezoidal_section_slot; - struct solid_with_variable_radius_edge_blend; - struct source_for_requirement; - struct sourced_requirement; - struct specification_definition; - struct specified_higher_usage_occurrence; - struct sphere; - struct spherical_surface; - struct start_request; - struct start_work; - struct straightness_tolerance; - struct structured_dimension_callout; - struct structured_text_composition; - struct structured_text_representation; - struct subedge; - struct subface; - struct supplied_part_relationship; - struct surface_condition_callout; - struct swept_surface; - struct surface_of_linear_extrusion; - struct surface_of_revolution; - struct surface_patch; - struct surface_profile_tolerance; - typedef NotImplemented surface_rendering_properties; // (not currently used by Assimp) - struct surface_replica; - struct surface_side_style; - struct surface_style_boundary; - struct surface_style_control_grid; - struct surface_style_fill_area; - struct surface_style_parameter_line; - struct surface_style_reflectance_ambient; - struct surface_style_reflectance_ambient_diffuse; - struct surface_style_reflectance_ambient_diffuse_specular; - struct surface_style_rendering; - struct surface_style_rendering_with_properties; - struct surface_style_segmentation_curve; - struct surface_style_silhouette; - typedef NotImplemented surface_style_transparent; // (not currently used by Assimp) - struct surface_style_usage; - struct surface_texture_representation; - struct surfaced_open_shell; - struct swept_disk_solid; - struct symbol; - typedef NotImplemented symbol_colour; // (not currently used by Assimp) - struct symbol_representation_map; - struct symbol_style; - struct symbol_target; - struct symmetric_shape_aspect; - struct symmetry_tolerance; - struct table_representation_item; - struct tactile_appearance_representation; - struct tagged_text_format; - struct tagged_text_item; - struct tangent; - typedef NotImplemented text_font; // (not currently used by Assimp) - typedef NotImplemented text_font_family; // (not currently used by Assimp) - typedef NotImplemented text_font_in_family; // (not currently used by Assimp) - struct text_literal_with_associated_curves; - struct text_literal_with_blanking_box; - struct text_literal_with_extent; - struct text_string_representation; - struct text_style; - typedef NotImplemented text_style_for_defined_font; // (not currently used by Assimp) - struct text_style_with_box_characteristics; - struct text_style_with_mirror; - struct text_style_with_spacing; - struct thermal_resistance_measure_with_unit; - struct thermal_resistance_unit; - struct thermodynamic_temperature_measure_with_unit; - struct thermodynamic_temperature_unit; - struct thickened_face_solid; - struct thickness_laminate_definition; - struct thickness_laminate_table; - struct time_interval; - struct time_interval_based_effectivity; - typedef NotImplemented time_interval_relationship; // (not currently used by Assimp) - typedef NotImplemented time_interval_role; // (not currently used by Assimp) - struct time_interval_with_bounds; - struct time_measure_with_unit; - struct time_unit; - typedef NotImplemented tolerance_value; // (not currently used by Assimp) - struct tolerance_zone; - typedef NotImplemented tolerance_zone_form; // (not currently used by Assimp) - struct torus; - struct total_runout_tolerance; - struct track_blended_solid; - struct track_blended_solid_with_end_conditions; - struct trimmed_curve; - struct two_direction_repeat_factor; - typedef NotImplemented type_qualifier; // (not currently used by Assimp) - struct unary_generic_expression; - struct unary_numeric_expression; - struct uncertainty_assigned_representation; - struct uncertainty_measure_with_unit; - struct uniform_curve; - struct uniform_resource_identifier; - struct uniform_surface; - struct usage_association; - struct user_defined_curve_font; - struct user_defined_marker; - struct user_defined_terminator_symbol; - struct user_selected_shape_elements; - struct value_range; - struct value_representation_item; - struct variable_semantics; - struct variational_representation_item; - struct vector; - struct vector_style; - struct velocity_measure_with_unit; - struct velocity_unit; - typedef NotImplemented versioned_action_request; // (not currently used by Assimp) - struct vertex; - struct vertex_loop; - struct vertex_point; - struct vertex_shell; - struct view_volume; - struct visual_appearance_representation; - struct volume_measure_with_unit; - struct volume_unit; - struct week_of_year_and_day_date; - struct wire_shell; - struct year_month; - - - - // C++ wrapper for measure_with_unit - struct measure_with_unit : ObjectHelper { measure_with_unit() : Object("measure_with_unit") {} - measure_value::Out value_component; - unit::Out unit_component; - }; - - // C++ wrapper for absorbed_dose_measure_with_unit - struct absorbed_dose_measure_with_unit : measure_with_unit, ObjectHelper { absorbed_dose_measure_with_unit() : Object("absorbed_dose_measure_with_unit") {} - - }; - - // C++ wrapper for derived_unit - struct derived_unit : ObjectHelper { derived_unit() : Object("derived_unit") {} - ListOf< Lazy< NotImplemented >, 1, 0 > elements; - }; - - // C++ wrapper for absorbed_dose_unit - struct absorbed_dose_unit : derived_unit, ObjectHelper { absorbed_dose_unit() : Object("absorbed_dose_unit") {} - - }; - - // C++ wrapper for abstract_variable - struct abstract_variable : ObjectHelper { abstract_variable() : Object("abstract_variable") {} - - }; - - // C++ wrapper for acceleration_measure_with_unit - struct acceleration_measure_with_unit : measure_with_unit, ObjectHelper { acceleration_measure_with_unit() : Object("acceleration_measure_with_unit") {} - - }; - - // C++ wrapper for acceleration_unit - struct acceleration_unit : derived_unit, ObjectHelper { acceleration_unit() : Object("acceleration_unit") {} - - }; - - // C++ wrapper for action - struct action : ObjectHelper { action() : Object("action") {} - label::Out name; - Maybe< text::Out > description; - Lazy< action_method > chosen_method; - }; - - // C++ wrapper for action_assignment - struct action_assignment : ObjectHelper { action_assignment() : Object("action_assignment") {} - Lazy< action > assigned_action; - }; - - // C++ wrapper for action_method - struct action_method : ObjectHelper { action_method() : Object("action_method") {} - label::Out name; - Maybe< text::Out > description; - text::Out consequence; - text::Out purpose; - }; - - // C++ wrapper for action_method_assignment - struct action_method_assignment : ObjectHelper { action_method_assignment() : Object("action_method_assignment") {} - Lazy< action_method > assigned_action_method; - Lazy< NotImplemented > role; - }; - - // C++ wrapper for action_method_relationship - struct action_method_relationship : ObjectHelper { action_method_relationship() : Object("action_method_relationship") {} - label::Out name; - Maybe< text::Out > description; - Lazy< action_method > relating_method; - Lazy< action_method > related_method; - }; - - // C++ wrapper for action_request_assignment - struct action_request_assignment : ObjectHelper { action_request_assignment() : Object("action_request_assignment") {} - Lazy< NotImplemented > assigned_action_request; - }; - - // C++ wrapper for address - struct address : ObjectHelper { address() : Object("address") {} - Maybe< label::Out > internal_location; - Maybe< label::Out > street_number; - Maybe< label::Out > street; - Maybe< label::Out > postal_box; - Maybe< label::Out > town; - Maybe< label::Out > region; - Maybe< label::Out > postal_code; - Maybe< label::Out > country; - Maybe< label::Out > facsimile_number; - Maybe< label::Out > telephone_number; - Maybe< label::Out > electronic_mail_address; - Maybe< label::Out > telex_number; - }; - - // C++ wrapper for representation - struct representation : ObjectHelper { representation() : Object("representation") {} - label::Out name; - ListOf< Lazy< representation_item >, 1, 0 > items; - Lazy< representation_context > context_of_items; - }; - - // C++ wrapper for shape_representation - struct shape_representation : representation, ObjectHelper { shape_representation() : Object("shape_representation") {} - - }; - - // C++ wrapper for advanced_brep_shape_representation - struct advanced_brep_shape_representation : shape_representation, ObjectHelper { advanced_brep_shape_representation() : Object("advanced_brep_shape_representation") {} - - }; - - // C++ wrapper for face_surface - struct face_surface : ObjectHelper { face_surface() : Object("face_surface") {} - Lazy< surface > face_geometry; - BOOLEAN::Out same_sense; - }; - - // C++ wrapper for advanced_face - struct advanced_face : face_surface, ObjectHelper { advanced_face() : Object("advanced_face") {} - - }; - - // C++ wrapper for amount_of_substance_measure_with_unit - struct amount_of_substance_measure_with_unit : measure_with_unit, ObjectHelper { amount_of_substance_measure_with_unit() : Object("amount_of_substance_measure_with_unit") {} - - }; - - // C++ wrapper for named_unit - struct named_unit : ObjectHelper { named_unit() : Object("named_unit") {} - Lazy< NotImplemented > dimensions; - }; - - // C++ wrapper for amount_of_substance_unit - struct amount_of_substance_unit : named_unit, ObjectHelper { amount_of_substance_unit() : Object("amount_of_substance_unit") {} - - }; - - // C++ wrapper for angle_direction_reference - struct angle_direction_reference : ObjectHelper { angle_direction_reference() : Object("angle_direction_reference") {} - - }; - - // C++ wrapper for representation_item - struct representation_item : ObjectHelper { representation_item() : Object("representation_item") {} - label::Out name; - }; - - // C++ wrapper for geometric_representation_item - struct geometric_representation_item : representation_item, ObjectHelper { geometric_representation_item() : Object("geometric_representation_item") {} - - }; - - // C++ wrapper for draughting_callout - struct draughting_callout : geometric_representation_item, ObjectHelper { draughting_callout() : Object("draughting_callout") {} - ListOf< draughting_callout_element, 1, 0 >::Out contents; - }; - - // C++ wrapper for dimension_curve_directed_callout - struct dimension_curve_directed_callout : draughting_callout, ObjectHelper { dimension_curve_directed_callout() : Object("dimension_curve_directed_callout") {} - - }; - - // C++ wrapper for angular_dimension - struct angular_dimension : dimension_curve_directed_callout, ObjectHelper { angular_dimension() : Object("angular_dimension") {} - - }; - - // C++ wrapper for shape_aspect_relationship - struct shape_aspect_relationship : ObjectHelper { shape_aspect_relationship() : Object("shape_aspect_relationship") {} - label::Out name; - Maybe< text::Out > description; - Lazy< shape_aspect > relating_shape_aspect; - Lazy< shape_aspect > related_shape_aspect; - }; - - // C++ wrapper for dimensional_location - struct dimensional_location : shape_aspect_relationship, ObjectHelper { dimensional_location() : Object("dimensional_location") {} - - }; - - // C++ wrapper for angular_location - struct angular_location : dimensional_location, ObjectHelper { angular_location() : Object("angular_location") {} - angle_relator::Out angle_selection; - }; - - // C++ wrapper for dimensional_size - struct dimensional_size : ObjectHelper { dimensional_size() : Object("dimensional_size") {} - Lazy< shape_aspect > applies_to; - label::Out name; - }; - - // C++ wrapper for angular_size - struct angular_size : dimensional_size, ObjectHelper { angular_size() : Object("angular_size") {} - angle_relator::Out angle_selection; - }; - - // C++ wrapper for geometric_tolerance - struct geometric_tolerance : ObjectHelper { geometric_tolerance() : Object("geometric_tolerance") {} - label::Out name; - text::Out description; - Lazy< measure_with_unit > magnitude; - Lazy< shape_aspect > toleranced_shape_aspect; - }; - - // C++ wrapper for geometric_tolerance_with_datum_reference - struct geometric_tolerance_with_datum_reference : geometric_tolerance, ObjectHelper { geometric_tolerance_with_datum_reference() : Object("geometric_tolerance_with_datum_reference") {} - ListOf< Lazy< datum_reference >, 1, 0 > datum_system; - }; - - // C++ wrapper for angularity_tolerance - struct angularity_tolerance : geometric_tolerance_with_datum_reference, ObjectHelper { angularity_tolerance() : Object("angularity_tolerance") {} - - }; - - // C++ wrapper for styled_item - struct styled_item : representation_item, ObjectHelper { styled_item() : Object("styled_item") {} - ListOf< Lazy< presentation_style_assignment >, 1, 0 > styles; - Lazy< representation_item > item; - }; - - // C++ wrapper for annotation_occurrence - struct annotation_occurrence : styled_item, ObjectHelper { annotation_occurrence() : Object("annotation_occurrence") {} - - }; - - // C++ wrapper for annotation_curve_occurrence - struct annotation_curve_occurrence : annotation_occurrence, ObjectHelper { annotation_curve_occurrence() : Object("annotation_curve_occurrence") {} - - }; - - // C++ wrapper for annotation_fill_area - struct annotation_fill_area : geometric_representation_item, ObjectHelper { annotation_fill_area() : Object("annotation_fill_area") {} - ListOf< Lazy< curve >, 1, 0 > boundaries; - }; - - // C++ wrapper for annotation_fill_area_occurrence - struct annotation_fill_area_occurrence : annotation_occurrence, ObjectHelper { annotation_fill_area_occurrence() : Object("annotation_fill_area_occurrence") {} - Lazy< point > fill_style_target; - }; - - // C++ wrapper for annotation_occurrence_relationship - struct annotation_occurrence_relationship : ObjectHelper { annotation_occurrence_relationship() : Object("annotation_occurrence_relationship") {} - label::Out name; - text::Out description; - Lazy< annotation_occurrence > relating_annotation_occurrence; - Lazy< annotation_occurrence > related_annotation_occurrence; - }; - - // C++ wrapper for annotation_occurrence_associativity - struct annotation_occurrence_associativity : annotation_occurrence_relationship, ObjectHelper { annotation_occurrence_associativity() : Object("annotation_occurrence_associativity") {} - - }; - - // C++ wrapper for annotation_plane - struct annotation_plane : ObjectHelper { annotation_plane() : Object("annotation_plane") {} - Maybe< ListOf< annotation_plane_element, 1, 0 >::Out > elements; - }; - - // C++ wrapper for annotation_symbol_occurrence - struct annotation_symbol_occurrence : annotation_occurrence, ObjectHelper { annotation_symbol_occurrence() : Object("annotation_symbol_occurrence") {} - - }; - - // C++ wrapper for annotation_subfigure_occurrence - struct annotation_subfigure_occurrence : annotation_symbol_occurrence, ObjectHelper { annotation_subfigure_occurrence() : Object("annotation_subfigure_occurrence") {} - - }; - - // C++ wrapper for mapped_item - struct mapped_item : representation_item, ObjectHelper { mapped_item() : Object("mapped_item") {} - Lazy< representation_map > mapping_source; - Lazy< representation_item > mapping_target; - }; - - // C++ wrapper for annotation_symbol - struct annotation_symbol : mapped_item, ObjectHelper { annotation_symbol() : Object("annotation_symbol") {} - - }; - - // C++ wrapper for annotation_text - struct annotation_text : mapped_item, ObjectHelper { annotation_text() : Object("annotation_text") {} - - }; - - // C++ wrapper for annotation_text_character - struct annotation_text_character : mapped_item, ObjectHelper { annotation_text_character() : Object("annotation_text_character") {} - text_alignment::Out alignment; - }; - - // C++ wrapper for annotation_text_occurrence - struct annotation_text_occurrence : annotation_occurrence, ObjectHelper { annotation_text_occurrence() : Object("annotation_text_occurrence") {} - - }; - - // C++ wrapper for shape_aspect - struct shape_aspect : ObjectHelper { shape_aspect() : Object("shape_aspect") {} - label::Out name; - Maybe< text::Out > description; - Lazy< product_definition_shape > of_shape; - LOGICAL::Out product_definitional; - }; - - // C++ wrapper for derived_shape_aspect - struct derived_shape_aspect : shape_aspect, ObjectHelper { derived_shape_aspect() : Object("derived_shape_aspect") {} - - }; - - // C++ wrapper for apex - struct apex : derived_shape_aspect, ObjectHelper { apex() : Object("apex") {} - - }; - - // C++ wrapper for application_context_element - struct application_context_element : ObjectHelper { application_context_element() : Object("application_context_element") {} - label::Out name; - Lazy< NotImplemented > frame_of_reference; - }; - - // C++ wrapper for applied_action_assignment - struct applied_action_assignment : action_assignment, ObjectHelper { applied_action_assignment() : Object("applied_action_assignment") {} - ListOf< action_items, 1, 0 >::Out items; - }; - - // C++ wrapper for applied_action_method_assignment - struct applied_action_method_assignment : action_method_assignment, ObjectHelper { applied_action_method_assignment() : Object("applied_action_method_assignment") {} - ListOf< action_method_items, 1, 0 >::Out items; - }; - - // C++ wrapper for applied_action_request_assignment - struct applied_action_request_assignment : action_request_assignment, ObjectHelper { applied_action_request_assignment() : Object("applied_action_request_assignment") {} - ListOf< action_request_item, 1, 0 >::Out items; - }; - - // C++ wrapper for approval_assignment - struct approval_assignment : ObjectHelper { approval_assignment() : Object("approval_assignment") {} - Lazy< NotImplemented > assigned_approval; - }; - - // C++ wrapper for applied_approval_assignment - struct applied_approval_assignment : approval_assignment, ObjectHelper { applied_approval_assignment() : Object("applied_approval_assignment") {} - ListOf< approval_item, 1, 0 >::Out items; - }; - - // C++ wrapper for attribute_classification_assignment - struct attribute_classification_assignment : ObjectHelper { attribute_classification_assignment() : Object("attribute_classification_assignment") {} - Lazy< group > assigned_class; - label::Out attribute_name; - Lazy< NotImplemented > role; - }; - - // C++ wrapper for applied_attribute_classification_assignment - struct applied_attribute_classification_assignment : attribute_classification_assignment, ObjectHelper { applied_attribute_classification_assignment() : Object("applied_attribute_classification_assignment") {} - ListOf< attribute_classification_item, 1, 0 >::Out items; - }; - - // C++ wrapper for certification_assignment - struct certification_assignment : ObjectHelper { certification_assignment() : Object("certification_assignment") {} - Lazy< NotImplemented > assigned_certification; - }; - - // C++ wrapper for applied_certification_assignment - struct applied_certification_assignment : certification_assignment, ObjectHelper { applied_certification_assignment() : Object("applied_certification_assignment") {} - ListOf< certification_item, 1, 0 >::Out items; - }; - - // C++ wrapper for classification_assignment - struct classification_assignment : ObjectHelper { classification_assignment() : Object("classification_assignment") {} - Lazy< group > assigned_class; - Lazy< NotImplemented > role; - }; - - // C++ wrapper for applied_classification_assignment - struct applied_classification_assignment : classification_assignment, ObjectHelper { applied_classification_assignment() : Object("applied_classification_assignment") {} - ListOf< classification_item, 1, 0 >::Out items; - }; - - // C++ wrapper for contract_assignment - struct contract_assignment : ObjectHelper { contract_assignment() : Object("contract_assignment") {} - Lazy< NotImplemented > assigned_contract; - }; - - // C++ wrapper for applied_contract_assignment - struct applied_contract_assignment : contract_assignment, ObjectHelper { applied_contract_assignment() : Object("applied_contract_assignment") {} - ListOf< contract_item, 1, 0 >::Out items; - }; - - // C++ wrapper for date_and_time_assignment - struct date_and_time_assignment : ObjectHelper { date_and_time_assignment() : Object("date_and_time_assignment") {} - Lazy< NotImplemented > assigned_date_and_time; - Lazy< NotImplemented > role; - }; - - // C++ wrapper for applied_date_and_time_assignment - struct applied_date_and_time_assignment : date_and_time_assignment, ObjectHelper { applied_date_and_time_assignment() : Object("applied_date_and_time_assignment") {} - ListOf< date_and_time_item, 1, 0 >::Out items; - }; - - // C++ wrapper for date_assignment - struct date_assignment : ObjectHelper { date_assignment() : Object("date_assignment") {} - Lazy< date > assigned_date; - Lazy< NotImplemented > role; - }; - - // C++ wrapper for applied_date_assignment - struct applied_date_assignment : date_assignment, ObjectHelper { applied_date_assignment() : Object("applied_date_assignment") {} - ListOf< date_item, 1, 0 >::Out items; - }; - - // C++ wrapper for document_reference - struct document_reference : ObjectHelper { document_reference() : Object("document_reference") {} - Lazy< NotImplemented > assigned_document; - label::Out source; - }; - - // C++ wrapper for applied_document_reference - struct applied_document_reference : document_reference, ObjectHelper { applied_document_reference() : Object("applied_document_reference") {} - ListOf< document_reference_item, 1, 0 >::Out items; - }; - - // C++ wrapper for document_usage_constraint_assignment - struct document_usage_constraint_assignment : ObjectHelper { document_usage_constraint_assignment() : Object("document_usage_constraint_assignment") {} - Lazy< NotImplemented > assigned_document_usage; - Lazy< NotImplemented > role; - }; - - // C++ wrapper for applied_document_usage_constraint_assignment - struct applied_document_usage_constraint_assignment : document_usage_constraint_assignment, ObjectHelper { applied_document_usage_constraint_assignment() : Object("applied_document_usage_constraint_assignment") {} - ListOf< document_reference_item, 1, 0 >::Out items; - }; - - // C++ wrapper for effectivity_assignment - struct effectivity_assignment : ObjectHelper { effectivity_assignment() : Object("effectivity_assignment") {} - Lazy< effectivity > assigned_effectivity; - }; - - // C++ wrapper for applied_effectivity_assignment - struct applied_effectivity_assignment : effectivity_assignment, ObjectHelper { applied_effectivity_assignment() : Object("applied_effectivity_assignment") {} - ListOf< effectivity_item, 1, 0 >::Out items; - }; - - // C++ wrapper for event_occurrence_assignment - struct event_occurrence_assignment : ObjectHelper { event_occurrence_assignment() : Object("event_occurrence_assignment") {} - Lazy< event_occurrence > assigned_event_occurrence; - Lazy< NotImplemented > role; - }; - - // C++ wrapper for applied_event_occurrence_assignment - struct applied_event_occurrence_assignment : event_occurrence_assignment, ObjectHelper { applied_event_occurrence_assignment() : Object("applied_event_occurrence_assignment") {} - ListOf< event_occurrence_item, 1, 0 >::Out items; - }; - - // C++ wrapper for identification_assignment - struct identification_assignment : ObjectHelper { identification_assignment() : Object("identification_assignment") {} - identifier::Out assigned_id; - Lazy< NotImplemented > role; - }; - - // C++ wrapper for external_identification_assignment - struct external_identification_assignment : identification_assignment, ObjectHelper { external_identification_assignment() : Object("external_identification_assignment") {} - Lazy< external_source > source; - }; - - // C++ wrapper for applied_external_identification_assignment - struct applied_external_identification_assignment : external_identification_assignment, ObjectHelper { applied_external_identification_assignment() : Object("applied_external_identification_assignment") {} - ListOf< external_identification_item, 1, 0 >::Out items; - }; - - // C++ wrapper for group_assignment - struct group_assignment : ObjectHelper { group_assignment() : Object("group_assignment") {} - Lazy< group > assigned_group; - }; - - // C++ wrapper for applied_group_assignment - struct applied_group_assignment : group_assignment, ObjectHelper { applied_group_assignment() : Object("applied_group_assignment") {} - ListOf< groupable_item, 1, 0 >::Out items; - }; - - // C++ wrapper for applied_identification_assignment - struct applied_identification_assignment : identification_assignment, ObjectHelper { applied_identification_assignment() : Object("applied_identification_assignment") {} - ListOf< identification_item, 1, 0 >::Out items; - }; - - // C++ wrapper for name_assignment - struct name_assignment : ObjectHelper { name_assignment() : Object("name_assignment") {} - label::Out assigned_name; - }; - - // C++ wrapper for applied_name_assignment - struct applied_name_assignment : name_assignment, ObjectHelper { applied_name_assignment() : Object("applied_name_assignment") {} - name_item::Out item; - }; - - // C++ wrapper for organization_assignment - struct organization_assignment : ObjectHelper { organization_assignment() : Object("organization_assignment") {} - Lazy< NotImplemented > assigned_organization; - Lazy< NotImplemented > role; - }; - - // C++ wrapper for applied_organization_assignment - struct applied_organization_assignment : organization_assignment, ObjectHelper { applied_organization_assignment() : Object("applied_organization_assignment") {} - ListOf< organization_item, 1, 0 >::Out items; - }; - - // C++ wrapper for organizational_project_assignment - struct organizational_project_assignment : ObjectHelper { organizational_project_assignment() : Object("organizational_project_assignment") {} - Lazy< NotImplemented > assigned_organizational_project; - Lazy< NotImplemented > role; - }; - - // C++ wrapper for applied_organizational_project_assignment - struct applied_organizational_project_assignment : organizational_project_assignment, ObjectHelper { applied_organizational_project_assignment() : Object("applied_organizational_project_assignment") {} - ListOf< project_item, 1, 0 >::Out items; - }; - - // C++ wrapper for person_and_organization_assignment - struct person_and_organization_assignment : ObjectHelper { person_and_organization_assignment() : Object("person_and_organization_assignment") {} - Lazy< NotImplemented > assigned_person_and_organization; - Lazy< NotImplemented > role; - }; - - // C++ wrapper for applied_person_and_organization_assignment - struct applied_person_and_organization_assignment : person_and_organization_assignment, ObjectHelper { applied_person_and_organization_assignment() : Object("applied_person_and_organization_assignment") {} - ListOf< person_and_organization_item, 1, 0 >::Out items; - }; - - // C++ wrapper for presented_item - struct presented_item : ObjectHelper { presented_item() : Object("presented_item") {} - - }; - - // C++ wrapper for applied_presented_item - struct applied_presented_item : presented_item, ObjectHelper { applied_presented_item() : Object("applied_presented_item") {} - ListOf< presented_item_select, 1, 0 >::Out items; - }; - - // C++ wrapper for security_classification_assignment - struct security_classification_assignment : ObjectHelper { security_classification_assignment() : Object("security_classification_assignment") {} - Lazy< NotImplemented > assigned_security_classification; - }; - - // C++ wrapper for applied_security_classification_assignment - struct applied_security_classification_assignment : security_classification_assignment, ObjectHelper { applied_security_classification_assignment() : Object("applied_security_classification_assignment") {} - ListOf< security_classification_item, 1, 0 >::Out items; - }; - - // C++ wrapper for time_interval_assignment - struct time_interval_assignment : ObjectHelper { time_interval_assignment() : Object("time_interval_assignment") {} - Lazy< time_interval > assigned_time_interval; - Lazy< NotImplemented > role; - }; - - // C++ wrapper for applied_time_interval_assignment - struct applied_time_interval_assignment : time_interval_assignment, ObjectHelper { applied_time_interval_assignment() : Object("applied_time_interval_assignment") {} - ListOf< time_interval_item, 0, 0 >::Out items; - }; - - // C++ wrapper for applied_usage_right - struct applied_usage_right : applied_action_assignment, ObjectHelper { applied_usage_right() : Object("applied_usage_right") {} - - }; - - // C++ wrapper for area_in_set - struct area_in_set : ObjectHelper { area_in_set() : Object("area_in_set") {} - Lazy< presentation_area > area; - Lazy< presentation_set > in_set; - }; - - // C++ wrapper for area_measure_with_unit - struct area_measure_with_unit : measure_with_unit, ObjectHelper { area_measure_with_unit() : Object("area_measure_with_unit") {} - - }; - - // C++ wrapper for area_unit - struct area_unit : derived_unit, ObjectHelper { area_unit() : Object("area_unit") {} - - }; - - // C++ wrapper for product_definition_relationship - struct product_definition_relationship : ObjectHelper { product_definition_relationship() : Object("product_definition_relationship") {} - identifier::Out id; - label::Out name; - Maybe< text::Out > description; - Lazy< product_definition > relating_product_definition; - Lazy< product_definition > related_product_definition; - }; - - // C++ wrapper for product_definition_usage - struct product_definition_usage : product_definition_relationship, ObjectHelper { product_definition_usage() : Object("product_definition_usage") {} - - }; - - // C++ wrapper for assembly_component_usage - struct assembly_component_usage : product_definition_usage, ObjectHelper { assembly_component_usage() : Object("assembly_component_usage") {} - Maybe< identifier::Out > reference_designator; - }; - - // C++ wrapper for assigned_requirement - struct assigned_requirement : group_assignment, ObjectHelper { assigned_requirement() : Object("assigned_requirement") {} - ListOf< Lazy< product_definition >, 1, 1 > items; - }; - - // C++ wrapper for compound_representation_item - struct compound_representation_item : representation_item, ObjectHelper { compound_representation_item() : Object("compound_representation_item") {} - compound_item_definition::Out item_element; - }; - - // C++ wrapper for atomic_formula - struct atomic_formula : compound_representation_item, ObjectHelper { atomic_formula() : Object("atomic_formula") {} - - }; - - // C++ wrapper for attribute_assertion - struct attribute_assertion : ObjectHelper { attribute_assertion() : Object("attribute_assertion") {} - - }; - - // C++ wrapper for attribute_language_assignment - struct attribute_language_assignment : attribute_classification_assignment, ObjectHelper { attribute_language_assignment() : Object("attribute_language_assignment") {} - ListOf< attribute_language_item, 1, 0 >::Out items; - }; - - // C++ wrapper for attribute_value_assignment - struct attribute_value_assignment : ObjectHelper { attribute_value_assignment() : Object("attribute_value_assignment") {} - label::Out attribute_name; - attribute_type::Out attribute_value; - Lazy< NotImplemented > role; - }; - - // C++ wrapper for auxiliary_geometric_representation_item - struct auxiliary_geometric_representation_item : ObjectHelper { auxiliary_geometric_representation_item() : Object("auxiliary_geometric_representation_item") {} - - }; - - // C++ wrapper for placement - struct placement : geometric_representation_item, ObjectHelper { placement() : Object("placement") {} - Lazy< cartesian_point > location; - }; - - // C++ wrapper for axis1_placement - struct axis1_placement : placement, ObjectHelper { axis1_placement() : Object("axis1_placement") {} - Maybe< Lazy< direction > > axis; - }; - - // C++ wrapper for axis2_placement_2d - struct axis2_placement_2d : placement, ObjectHelper { axis2_placement_2d() : Object("axis2_placement_2d") {} - Maybe< Lazy< direction > > ref_direction; - }; - - // C++ wrapper for axis2_placement_3d - struct axis2_placement_3d : placement, ObjectHelper { axis2_placement_3d() : Object("axis2_placement_3d") {} - Maybe< Lazy< direction > > axis; - Maybe< Lazy< direction > > ref_direction; - }; - - // C++ wrapper for curve - struct curve : geometric_representation_item, ObjectHelper { curve() : Object("curve") {} - - }; - - // C++ wrapper for bounded_curve - struct bounded_curve : curve, ObjectHelper { bounded_curve() : Object("bounded_curve") {} - - }; - - // C++ wrapper for b_spline_curve - struct b_spline_curve : bounded_curve, ObjectHelper { b_spline_curve() : Object("b_spline_curve") {} - INTEGER::Out degree; - ListOf< Lazy< cartesian_point >, 2, 0 > control_points_list; - b_spline_curve_form::Out curve_form; - LOGICAL::Out closed_curve; - LOGICAL::Out self_intersect; - }; - - // C++ wrapper for b_spline_curve_with_knots - struct b_spline_curve_with_knots : b_spline_curve, ObjectHelper { b_spline_curve_with_knots() : Object("b_spline_curve_with_knots") {} - ListOf< INTEGER, 2, 0 >::Out knot_multiplicities; - ListOf< parameter_value, 2, 0 >::Out knots; - knot_type::Out knot_spec; - }; - - // C++ wrapper for surface - struct surface : geometric_representation_item, ObjectHelper { surface() : Object("surface") {} - - }; - - // C++ wrapper for bounded_surface - struct bounded_surface : surface, ObjectHelper { bounded_surface() : Object("bounded_surface") {} - - }; - - // C++ wrapper for b_spline_surface - struct b_spline_surface : bounded_surface, ObjectHelper { b_spline_surface() : Object("b_spline_surface") {} - INTEGER::Out u_degree; - INTEGER::Out v_degree; - b_spline_surface_form::Out surface_form; - LOGICAL::Out u_closed; - LOGICAL::Out v_closed; - LOGICAL::Out self_intersect; - }; - - // C++ wrapper for b_spline_surface_with_knots - struct b_spline_surface_with_knots : b_spline_surface, ObjectHelper { b_spline_surface_with_knots() : Object("b_spline_surface_with_knots") {} - ListOf< INTEGER, 2, 0 >::Out u_multiplicities; - ListOf< INTEGER, 2, 0 >::Out v_multiplicities; - ListOf< parameter_value, 2, 0 >::Out u_knots; - ListOf< parameter_value, 2, 0 >::Out v_knots; - knot_type::Out knot_spec; - }; - - // C++ wrapper for product_definition - struct product_definition : ObjectHelper { product_definition() : Object("product_definition") {} - identifier::Out id; - Maybe< text::Out > description; - Lazy< product_definition_formation > formation; - Lazy< product_definition_context > frame_of_reference; - }; - - // C++ wrapper for rule_software_definition - struct rule_software_definition : product_definition, ObjectHelper { rule_software_definition() : Object("rule_software_definition") {} - - }; - - // C++ wrapper for rule_definition - struct rule_definition : rule_software_definition, ObjectHelper { rule_definition() : Object("rule_definition") {} - - }; - - // C++ wrapper for back_chaining_rule - struct back_chaining_rule : rule_definition, ObjectHelper { back_chaining_rule() : Object("back_chaining_rule") {} - - }; - - // C++ wrapper for back_chaining_rule_body - struct back_chaining_rule_body : ObjectHelper { back_chaining_rule_body() : Object("back_chaining_rule_body") {} - - }; - - // C++ wrapper for colour - struct colour : ObjectHelper { colour() : Object("colour") {} - - }; - - // C++ wrapper for background_colour - struct background_colour : colour, ObjectHelper { background_colour() : Object("background_colour") {} - area_or_view::Out presentation; - }; - - // C++ wrapper for beveled_sheet_representation - struct beveled_sheet_representation : shape_representation, ObjectHelper { beveled_sheet_representation() : Object("beveled_sheet_representation") {} - - }; - - // C++ wrapper for bezier_curve - struct bezier_curve : b_spline_curve, ObjectHelper { bezier_curve() : Object("bezier_curve") {} - - }; - - // C++ wrapper for bezier_surface - struct bezier_surface : b_spline_surface, ObjectHelper { bezier_surface() : Object("bezier_surface") {} - - }; - - // C++ wrapper for generic_expression - struct generic_expression : ObjectHelper { generic_expression() : Object("generic_expression") {} - - }; - - // C++ wrapper for binary_generic_expression - struct binary_generic_expression : generic_expression, ObjectHelper { binary_generic_expression() : Object("binary_generic_expression") {} - ListOf< Lazy< generic_expression >, 2, 2 > operands; - }; - - // C++ wrapper for binary_numeric_expression - struct binary_numeric_expression : ObjectHelper { binary_numeric_expression() : Object("binary_numeric_expression") {} - - }; - - // C++ wrapper for binary_representation_item - struct binary_representation_item : representation_item, ObjectHelper { binary_representation_item() : Object("binary_representation_item") {} - BINARY::Out binary_value; - }; - - // C++ wrapper for block - struct block : geometric_representation_item, ObjectHelper { block() : Object("block") {} - Lazy< axis2_placement_3d > position; - positive_length_measure::Out x; - positive_length_measure::Out y; - positive_length_measure::Out z; - }; - - // C++ wrapper for expression - struct expression : generic_expression, ObjectHelper { expression() : Object("expression") {} - - }; - - // C++ wrapper for boolean_expression - struct boolean_expression : expression, ObjectHelper { boolean_expression() : Object("boolean_expression") {} - - }; - - // C++ wrapper for boolean_literal - struct boolean_literal : ObjectHelper { boolean_literal() : Object("boolean_literal") {} - BOOLEAN::Out the_value; - }; - - // C++ wrapper for boolean_representation_item - struct boolean_representation_item : ObjectHelper { boolean_representation_item() : Object("boolean_representation_item") {} - - }; - - // C++ wrapper for boolean_result - struct boolean_result : geometric_representation_item, ObjectHelper { boolean_result() : Object("boolean_result") {} - boolean_operator::Out operator_; - boolean_operand::Out first_operand; - boolean_operand::Out second_operand; - }; - - // C++ wrapper for composite_curve - struct composite_curve : bounded_curve, ObjectHelper { composite_curve() : Object("composite_curve") {} - ListOf< Lazy< composite_curve_segment >, 1, 0 > segments; - LOGICAL::Out self_intersect; - }; - - // C++ wrapper for composite_curve_on_surface - struct composite_curve_on_surface : composite_curve, ObjectHelper { composite_curve_on_surface() : Object("composite_curve_on_surface") {} - - }; - - // C++ wrapper for boundary_curve - struct boundary_curve : composite_curve_on_surface, ObjectHelper { boundary_curve() : Object("boundary_curve") {} - - }; - - // C++ wrapper for bounded_pcurve - struct bounded_pcurve : ObjectHelper { bounded_pcurve() : Object("bounded_pcurve") {} - - }; - - // C++ wrapper for bounded_surface_curve - struct bounded_surface_curve : ObjectHelper { bounded_surface_curve() : Object("bounded_surface_curve") {} - - }; - - // C++ wrapper for founded_item - struct founded_item : ObjectHelper { founded_item() : Object("founded_item") {} - - }; - - // C++ wrapper for box_domain - struct box_domain : founded_item, ObjectHelper { box_domain() : Object("box_domain") {} - Lazy< cartesian_point > corner; - positive_length_measure::Out xlength; - positive_length_measure::Out ylength; - positive_length_measure::Out zlength; - }; - - // C++ wrapper for half_space_solid - struct half_space_solid : geometric_representation_item, ObjectHelper { half_space_solid() : Object("half_space_solid") {} - Lazy< surface > base_surface; - BOOLEAN::Out agreement_flag; - }; - - // C++ wrapper for boxed_half_space - struct boxed_half_space : half_space_solid, ObjectHelper { boxed_half_space() : Object("boxed_half_space") {} - Lazy< box_domain > enclosure; - }; - - // C++ wrapper for breakdown_context - struct breakdown_context : product_definition_relationship, ObjectHelper { breakdown_context() : Object("breakdown_context") {} - - }; - - // C++ wrapper for breakdown_element_group_assignment - struct breakdown_element_group_assignment : group_assignment, ObjectHelper { breakdown_element_group_assignment() : Object("breakdown_element_group_assignment") {} - ListOf< product_definition_or_breakdown_element_usage, 1, 1 >::Out items; - }; - - // C++ wrapper for breakdown_element_realization - struct breakdown_element_realization : ObjectHelper { breakdown_element_realization() : Object("breakdown_element_realization") {} - - }; - - // C++ wrapper for breakdown_element_usage - struct breakdown_element_usage : product_definition_relationship, ObjectHelper { breakdown_element_usage() : Object("breakdown_element_usage") {} - - }; - - // C++ wrapper for breakdown_of - struct breakdown_of : product_definition_relationship, ObjectHelper { breakdown_of() : Object("breakdown_of") {} - - }; - - // C++ wrapper for solid_model - struct solid_model : geometric_representation_item, ObjectHelper { solid_model() : Object("solid_model") {} - - }; - - // C++ wrapper for manifold_solid_brep - struct manifold_solid_brep : solid_model, ObjectHelper { manifold_solid_brep() : Object("manifold_solid_brep") {} - Lazy< closed_shell > outer; - }; - - // C++ wrapper for brep_with_voids - struct brep_with_voids : manifold_solid_brep, ObjectHelper { brep_with_voids() : Object("brep_with_voids") {} - ListOf< Lazy< oriented_closed_shell >, 1, 0 > voids; - }; - - // C++ wrapper for bytes_representation_item - struct bytes_representation_item : binary_representation_item, ObjectHelper { bytes_representation_item() : Object("bytes_representation_item") {} - - }; - - // C++ wrapper for date - struct date : ObjectHelper { date() : Object("date") {} - year_number::Out year_component; - }; - - // C++ wrapper for calendar_date - struct calendar_date : date, ObjectHelper { calendar_date() : Object("calendar_date") {} - day_in_month_number::Out day_component; - month_in_year_number::Out month_component; - }; - - // C++ wrapper for camera_image - struct camera_image : mapped_item, ObjectHelper { camera_image() : Object("camera_image") {} - - }; - - // C++ wrapper for camera_image_3d_with_scale - struct camera_image_3d_with_scale : camera_image, ObjectHelper { camera_image_3d_with_scale() : Object("camera_image_3d_with_scale") {} - - }; - - // C++ wrapper for camera_model - struct camera_model : geometric_representation_item, ObjectHelper { camera_model() : Object("camera_model") {} - - }; - - // C++ wrapper for camera_model_d3 - struct camera_model_d3 : camera_model, ObjectHelper { camera_model_d3() : Object("camera_model_d3") {} - Lazy< axis2_placement_3d > view_reference_system; - Lazy< view_volume > perspective_of_volume; - }; - - // C++ wrapper for camera_model_d3_multi_clipping - struct camera_model_d3_multi_clipping : camera_model_d3, ObjectHelper { camera_model_d3_multi_clipping() : Object("camera_model_d3_multi_clipping") {} - ListOf< camera_model_d3_multi_clipping_interection_select, 1, 0 >::Out shape_clipping; - }; - - // C++ wrapper for camera_model_d3_multi_clipping_intersection - struct camera_model_d3_multi_clipping_intersection : geometric_representation_item, ObjectHelper { camera_model_d3_multi_clipping_intersection() : Object("camera_model_d3_multi_clipping_intersection") {} - ListOf< camera_model_d3_multi_clipping_interection_select, 2, 0 >::Out shape_clipping; - }; - - // C++ wrapper for camera_model_d3_multi_clipping_union - struct camera_model_d3_multi_clipping_union : geometric_representation_item, ObjectHelper { camera_model_d3_multi_clipping_union() : Object("camera_model_d3_multi_clipping_union") {} - ListOf< camera_model_d3_multi_clipping_union_select, 2, 0 >::Out shape_clipping; - }; - - // C++ wrapper for camera_model_d3_with_hlhsr - struct camera_model_d3_with_hlhsr : camera_model_d3, ObjectHelper { camera_model_d3_with_hlhsr() : Object("camera_model_d3_with_hlhsr") {} - BOOLEAN::Out hidden_line_surface_removal; - }; - - // C++ wrapper for camera_model_with_light_sources - struct camera_model_with_light_sources : camera_model_d3, ObjectHelper { camera_model_with_light_sources() : Object("camera_model_with_light_sources") {} - ListOf< Lazy< light_source >, 1, 0 > sources; - }; - - // C++ wrapper for representation_map - struct representation_map : ObjectHelper { representation_map() : Object("representation_map") {} - Lazy< representation_item > mapping_origin; - Lazy< representation > mapped_representation; - }; - - // C++ wrapper for camera_usage - struct camera_usage : representation_map, ObjectHelper { camera_usage() : Object("camera_usage") {} - - }; - - // C++ wrapper for capacitance_measure_with_unit - struct capacitance_measure_with_unit : measure_with_unit, ObjectHelper { capacitance_measure_with_unit() : Object("capacitance_measure_with_unit") {} - - }; - - // C++ wrapper for capacitance_unit - struct capacitance_unit : derived_unit, ObjectHelper { capacitance_unit() : Object("capacitance_unit") {} - - }; - - // C++ wrapper for point - struct point : geometric_representation_item, ObjectHelper { point() : Object("point") {} - - }; - - // C++ wrapper for cartesian_point - struct cartesian_point : point, ObjectHelper { cartesian_point() : Object("cartesian_point") {} - ListOf< length_measure, 1, 3 >::Out coordinates; - }; - - // C++ wrapper for cartesian_transformation_operator - struct cartesian_transformation_operator : ObjectHelper { cartesian_transformation_operator() : Object("cartesian_transformation_operator") {} - Maybe< Lazy< direction > > axis1; - Maybe< Lazy< direction > > axis2; - Lazy< cartesian_point > local_origin; - Maybe< REAL::Out > scale; - }; - - // C++ wrapper for cartesian_transformation_operator_2d - struct cartesian_transformation_operator_2d : cartesian_transformation_operator, ObjectHelper { cartesian_transformation_operator_2d() : Object("cartesian_transformation_operator_2d") {} - - }; - - // C++ wrapper for cartesian_transformation_operator_3d - struct cartesian_transformation_operator_3d : cartesian_transformation_operator, ObjectHelper { cartesian_transformation_operator_3d() : Object("cartesian_transformation_operator_3d") {} - Maybe< Lazy< direction > > axis3; - }; - - // C++ wrapper for cc_design_approval - struct cc_design_approval : approval_assignment, ObjectHelper { cc_design_approval() : Object("cc_design_approval") {} - ListOf< approved_item, 1, 0 >::Out items; - }; - - // C++ wrapper for cc_design_certification - struct cc_design_certification : certification_assignment, ObjectHelper { cc_design_certification() : Object("cc_design_certification") {} - ListOf< certified_item, 1, 0 >::Out items; - }; - - // C++ wrapper for cc_design_contract - struct cc_design_contract : contract_assignment, ObjectHelper { cc_design_contract() : Object("cc_design_contract") {} - ListOf< contracted_item, 1, 0 >::Out items; - }; - - // C++ wrapper for cc_design_date_and_time_assignment - struct cc_design_date_and_time_assignment : date_and_time_assignment, ObjectHelper { cc_design_date_and_time_assignment() : Object("cc_design_date_and_time_assignment") {} - ListOf< date_time_item, 1, 0 >::Out items; - }; - - // C++ wrapper for cc_design_person_and_organization_assignment - struct cc_design_person_and_organization_assignment : person_and_organization_assignment, ObjectHelper { cc_design_person_and_organization_assignment() : Object("cc_design_person_and_organization_assignment") {} - ListOf< cc_person_organization_item, 1, 0 >::Out items; - }; - - // C++ wrapper for cc_design_security_classification - struct cc_design_security_classification : security_classification_assignment, ObjectHelper { cc_design_security_classification() : Object("cc_design_security_classification") {} - ListOf< cc_classified_item, 1, 0 >::Out items; - }; - - // C++ wrapper for cc_design_specification_reference - struct cc_design_specification_reference : document_reference, ObjectHelper { cc_design_specification_reference() : Object("cc_design_specification_reference") {} - ListOf< cc_specified_item, 1, 0 >::Out items; - }; - - // C++ wrapper for celsius_temperature_measure_with_unit - struct celsius_temperature_measure_with_unit : measure_with_unit, ObjectHelper { celsius_temperature_measure_with_unit() : Object("celsius_temperature_measure_with_unit") {} - - }; - - // C++ wrapper for centre_of_symmetry - struct centre_of_symmetry : derived_shape_aspect, ObjectHelper { centre_of_symmetry() : Object("centre_of_symmetry") {} - - }; - - // C++ wrapper for change - struct change : action_assignment, ObjectHelper { change() : Object("change") {} - ListOf< work_item, 1, 0 >::Out items; - }; - - // C++ wrapper for change_request - struct change_request : action_request_assignment, ObjectHelper { change_request() : Object("change_request") {} - ListOf< change_request_item, 1, 0 >::Out items; - }; - - // C++ wrapper for character_glyph_style_outline - struct character_glyph_style_outline : founded_item, ObjectHelper { character_glyph_style_outline() : Object("character_glyph_style_outline") {} - Lazy< curve_style > outline_style; - }; - - // C++ wrapper for character_glyph_style_stroke - struct character_glyph_style_stroke : founded_item, ObjectHelper { character_glyph_style_stroke() : Object("character_glyph_style_stroke") {} - Lazy< curve_style > stroke_style; - }; - - // C++ wrapper for symbol_representation - struct symbol_representation : representation, ObjectHelper { symbol_representation() : Object("symbol_representation") {} - - }; - - // C++ wrapper for generic_character_glyph_symbol - struct generic_character_glyph_symbol : symbol_representation, ObjectHelper { generic_character_glyph_symbol() : Object("generic_character_glyph_symbol") {} - - }; - - // C++ wrapper for character_glyph_symbol - struct character_glyph_symbol : generic_character_glyph_symbol, ObjectHelper { character_glyph_symbol() : Object("character_glyph_symbol") {} - Lazy< planar_extent > character_box; - ratio_measure::Out baseline_ratio; - }; - - // C++ wrapper for character_glyph_symbol_outline - struct character_glyph_symbol_outline : character_glyph_symbol, ObjectHelper { character_glyph_symbol_outline() : Object("character_glyph_symbol_outline") {} - ListOf< Lazy< annotation_fill_area >, 1, 0 > outlines; - }; - - // C++ wrapper for character_glyph_symbol_stroke - struct character_glyph_symbol_stroke : character_glyph_symbol, ObjectHelper { character_glyph_symbol_stroke() : Object("character_glyph_symbol_stroke") {} - ListOf< Lazy< curve >, 1, 0 > strokes; - }; - - // C++ wrapper for general_property - struct general_property : ObjectHelper { general_property() : Object("general_property") {} - identifier::Out id; - label::Out name; - Maybe< text::Out > description; - }; - - // C++ wrapper for characteristic_data_column_header - struct characteristic_data_column_header : general_property, ObjectHelper { characteristic_data_column_header() : Object("characteristic_data_column_header") {} - - }; - - // C++ wrapper for general_property_relationship - struct general_property_relationship : ObjectHelper { general_property_relationship() : Object("general_property_relationship") {} - label::Out name; - Maybe< text::Out > description; - Lazy< general_property > relating_property; - Lazy< general_property > related_property; - }; - - // C++ wrapper for characteristic_data_column_header_link - struct characteristic_data_column_header_link : general_property_relationship, ObjectHelper { characteristic_data_column_header_link() : Object("characteristic_data_column_header_link") {} - - }; - - // C++ wrapper for characteristic_data_table_header - struct characteristic_data_table_header : general_property, ObjectHelper { characteristic_data_table_header() : Object("characteristic_data_table_header") {} - - }; - - // C++ wrapper for characteristic_data_table_header_decomposition - struct characteristic_data_table_header_decomposition : general_property_relationship, ObjectHelper { characteristic_data_table_header_decomposition() : Object("characteristic_data_table_header_decomposition") {} - - }; - - // C++ wrapper for group - struct group : ObjectHelper { group() : Object("group") {} - label::Out name; - Maybe< text::Out > description; - }; - - // C++ wrapper for characteristic_type - struct characteristic_type : group, ObjectHelper { characteristic_type() : Object("characteristic_type") {} - - }; - - // C++ wrapper for characterized_class - struct characterized_class : ObjectHelper { characterized_class() : Object("characterized_class") {} - - }; - - // C++ wrapper for characterized_object - struct characterized_object : ObjectHelper { characterized_object() : Object("characterized_object") {} - label::Out name; - Maybe< text::Out > description; - }; - - // C++ wrapper for conic - struct conic : curve, ObjectHelper { conic() : Object("conic") {} - axis2_placement::Out position; - }; - - // C++ wrapper for circle - struct circle : conic, ObjectHelper { circle() : Object("circle") {} - positive_length_measure::Out radius; - }; - - // C++ wrapper for circular_runout_tolerance - struct circular_runout_tolerance : geometric_tolerance_with_datum_reference, ObjectHelper { circular_runout_tolerance() : Object("circular_runout_tolerance") {} - - }; - - // C++ wrapper for class_by_extension - struct class_by_extension : class_t, ObjectHelper { class_by_extension() : Object("class_by_extension") {} - - }; - - // C++ wrapper for class_by_intension - struct class_by_intension : class_t, ObjectHelper { class_by_intension() : Object("class_by_intension") {} - - }; - - // C++ wrapper for class_system - struct class_system : group, ObjectHelper { class_system() : Object("class_system") {} - - }; - - // C++ wrapper for effectivity_context_assignment - struct effectivity_context_assignment : ObjectHelper { effectivity_context_assignment() : Object("effectivity_context_assignment") {} - Lazy< effectivity_assignment > assigned_effectivity_assignment; - Lazy< NotImplemented > role; - }; - - // C++ wrapper for class_usage_effectivity_context_assignment - struct class_usage_effectivity_context_assignment : effectivity_context_assignment, ObjectHelper { class_usage_effectivity_context_assignment() : Object("class_usage_effectivity_context_assignment") {} - ListOf< class_usage_effectivity_context_item, 1, 0 >::Out items; - }; - - // C++ wrapper for topological_representation_item - struct topological_representation_item : representation_item, ObjectHelper { topological_representation_item() : Object("topological_representation_item") {} - - }; - - // C++ wrapper for connected_face_set - struct connected_face_set : topological_representation_item, ObjectHelper { connected_face_set() : Object("connected_face_set") {} - ListOf< Lazy< face >, 1, 0 > cfs_faces; - }; - - // C++ wrapper for closed_shell - struct closed_shell : connected_face_set, ObjectHelper { closed_shell() : Object("closed_shell") {} - - }; - - // C++ wrapper for coaxiality_tolerance - struct coaxiality_tolerance : geometric_tolerance_with_datum_reference, ObjectHelper { coaxiality_tolerance() : Object("coaxiality_tolerance") {} - - }; - - // C++ wrapper for colour_specification - struct colour_specification : colour, ObjectHelper { colour_specification() : Object("colour_specification") {} - label::Out name; - }; - - // C++ wrapper for colour_rgb - struct colour_rgb : colour_specification, ObjectHelper { colour_rgb() : Object("colour_rgb") {} - REAL::Out red; - REAL::Out green; - REAL::Out blue; - }; - - // C++ wrapper for common_datum - struct common_datum : ObjectHelper { common_datum() : Object("common_datum") {} - - }; - - // C++ wrapper for comparison_expression - struct comparison_expression : ObjectHelper { comparison_expression() : Object("comparison_expression") {} - - }; - - // C++ wrapper for complex_clause - struct complex_clause : compound_representation_item, ObjectHelper { complex_clause() : Object("complex_clause") {} - - }; - - // C++ wrapper for complex_conjunctive_clause - struct complex_conjunctive_clause : complex_clause, ObjectHelper { complex_conjunctive_clause() : Object("complex_conjunctive_clause") {} - - }; - - // C++ wrapper for complex_disjunctive_clause - struct complex_disjunctive_clause : complex_clause, ObjectHelper { complex_disjunctive_clause() : Object("complex_disjunctive_clause") {} - - }; - - // C++ wrapper for modified_solid - struct modified_solid : solid_model, ObjectHelper { modified_solid() : Object("modified_solid") {} - text::Out rationale; - base_solid_select::Out base_solid; - }; - - // C++ wrapper for shelled_solid - struct shelled_solid : modified_solid, ObjectHelper { shelled_solid() : Object("shelled_solid") {} - ListOf< Lazy< face_surface >, 1, 0 > deleted_face_set; - length_measure::Out thickness; - }; - - // C++ wrapper for complex_shelled_solid - struct complex_shelled_solid : shelled_solid, ObjectHelper { complex_shelled_solid() : Object("complex_shelled_solid") {} - ListOf< length_measure, 1, 0 >::Out thickness_list; - }; - - // C++ wrapper for composite_assembly_definition - struct composite_assembly_definition : product_definition, ObjectHelper { composite_assembly_definition() : Object("composite_assembly_definition") {} - - }; - - // C++ wrapper for composite_assembly_sequence_definition - struct composite_assembly_sequence_definition : product_definition, ObjectHelper { composite_assembly_sequence_definition() : Object("composite_assembly_sequence_definition") {} - - }; - - // C++ wrapper for laminate_table - struct laminate_table : product_definition, ObjectHelper { laminate_table() : Object("laminate_table") {} - - }; - - // C++ wrapper for part_laminate_table - struct part_laminate_table : laminate_table, ObjectHelper { part_laminate_table() : Object("part_laminate_table") {} - - }; - - // C++ wrapper for composite_assembly_table - struct composite_assembly_table : part_laminate_table, ObjectHelper { composite_assembly_table() : Object("composite_assembly_table") {} - - }; - - // C++ wrapper for composite_curve_segment - struct composite_curve_segment : founded_item, ObjectHelper { composite_curve_segment() : Object("composite_curve_segment") {} - transition_code::Out transition; - BOOLEAN::Out same_sense; - Lazy< curve > parent_curve; - }; - - // C++ wrapper for material_designation - struct material_designation : ObjectHelper { material_designation() : Object("material_designation") {} - label::Out name; - ListOf< characterized_definition, 1, 0 >::Out definitions; - }; - - // C++ wrapper for composite_material_designation - struct composite_material_designation : material_designation, ObjectHelper { composite_material_designation() : Object("composite_material_designation") {} - - }; - - // C++ wrapper for composite_shape_aspect - struct composite_shape_aspect : shape_aspect, ObjectHelper { composite_shape_aspect() : Object("composite_shape_aspect") {} - - }; - - // C++ wrapper for composite_sheet_representation - struct composite_sheet_representation : shape_representation, ObjectHelper { composite_sheet_representation() : Object("composite_sheet_representation") {} - - }; - - // C++ wrapper for composite_text - struct composite_text : geometric_representation_item, ObjectHelper { composite_text() : Object("composite_text") {} - ListOf< text_or_character, 2, 0 >::Out collected_text; - }; - - // C++ wrapper for composite_text_with_associated_curves - struct composite_text_with_associated_curves : composite_text, ObjectHelper { composite_text_with_associated_curves() : Object("composite_text_with_associated_curves") {} - ListOf< Lazy< curve >, 1, 0 > associated_curves; - }; - - // C++ wrapper for composite_text_with_blanking_box - struct composite_text_with_blanking_box : composite_text, ObjectHelper { composite_text_with_blanking_box() : Object("composite_text_with_blanking_box") {} - Lazy< planar_box > blanking; - }; - - // C++ wrapper for composite_text_with_delineation - struct composite_text_with_delineation : composite_text, ObjectHelper { composite_text_with_delineation() : Object("composite_text_with_delineation") {} - text_delineation::Out delineation; - }; - - // C++ wrapper for composite_text_with_extent - struct composite_text_with_extent : composite_text, ObjectHelper { composite_text_with_extent() : Object("composite_text_with_extent") {} - Lazy< planar_extent > extent; - }; - - // C++ wrapper for compound_shape_representation - struct compound_shape_representation : shape_representation, ObjectHelper { compound_shape_representation() : Object("compound_shape_representation") {} - - }; - - // C++ wrapper for concentricity_tolerance - struct concentricity_tolerance : geometric_tolerance_with_datum_reference, ObjectHelper { concentricity_tolerance() : Object("concentricity_tolerance") {} - - }; - - // C++ wrapper for concept_feature_relationship - struct concept_feature_relationship : ObjectHelper { concept_feature_relationship() : Object("concept_feature_relationship") {} - label::Out name; - Maybe< text::Out > description; - Lazy< product_concept_feature > relating_product_concept_feature; - Lazy< product_concept_feature > related_product_concept_feature; - }; - - // C++ wrapper for concept_feature_relationship_with_condition - struct concept_feature_relationship_with_condition : concept_feature_relationship, ObjectHelper { concept_feature_relationship_with_condition() : Object("concept_feature_relationship_with_condition") {} - Lazy< NotImplemented > conditional_operator; - }; - - // C++ wrapper for product_concept_feature - struct product_concept_feature : ObjectHelper { product_concept_feature() : Object("product_concept_feature") {} - identifier::Out id; - label::Out name; - Maybe< text::Out > description; - }; - - // C++ wrapper for conditional_concept_feature - struct conditional_concept_feature : product_concept_feature, ObjectHelper { conditional_concept_feature() : Object("conditional_concept_feature") {} - Lazy< concept_feature_relationship_with_condition > condition; - }; - - // C++ wrapper for conductance_measure_with_unit - struct conductance_measure_with_unit : measure_with_unit, ObjectHelper { conductance_measure_with_unit() : Object("conductance_measure_with_unit") {} - - }; - - // C++ wrapper for conductance_unit - struct conductance_unit : derived_unit, ObjectHelper { conductance_unit() : Object("conductance_unit") {} - - }; - - // C++ wrapper for configuration_item - struct configuration_item : ObjectHelper { configuration_item() : Object("configuration_item") {} - identifier::Out id; - label::Out name; - Maybe< text::Out > description; - Lazy< NotImplemented > item_concept; - Maybe< label::Out > purpose; - }; - - // C++ wrapper for configurable_item - struct configurable_item : configuration_item, ObjectHelper { configurable_item() : Object("configurable_item") {} - ListOf< Lazy< NotImplemented >, 1, 0 > item_concept_feature; - }; - - // C++ wrapper for effectivity - struct effectivity : ObjectHelper { effectivity() : Object("effectivity") {} - identifier::Out id; - }; - - // C++ wrapper for product_definition_effectivity - struct product_definition_effectivity : effectivity, ObjectHelper { product_definition_effectivity() : Object("product_definition_effectivity") {} - Lazy< product_definition_relationship > usage; - }; - - // C++ wrapper for configuration_effectivity - struct configuration_effectivity : product_definition_effectivity, ObjectHelper { configuration_effectivity() : Object("configuration_effectivity") {} - Lazy< NotImplemented > configuration; - }; - - // C++ wrapper for configuration_item_relationship - struct configuration_item_relationship : ObjectHelper { configuration_item_relationship() : Object("configuration_item_relationship") {} - label::Out name; - Maybe< text::Out > description; - Lazy< configuration_item > relating_configuration_item; - Lazy< configuration_item > related_configuration_item; - }; - - // C++ wrapper for configuration_item_hierarchical_relationship - struct configuration_item_hierarchical_relationship : configuration_item_relationship, ObjectHelper { configuration_item_hierarchical_relationship() : Object("configuration_item_hierarchical_relationship") {} - - }; - - // C++ wrapper for configuration_item_revision_sequence - struct configuration_item_revision_sequence : configuration_item_relationship, ObjectHelper { configuration_item_revision_sequence() : Object("configuration_item_revision_sequence") {} - - }; - - // C++ wrapper for configured_effectivity_assignment - struct configured_effectivity_assignment : effectivity_assignment, ObjectHelper { configured_effectivity_assignment() : Object("configured_effectivity_assignment") {} - ListOf< configured_effectivity_item, 1, 0 >::Out items; - }; - - // C++ wrapper for configured_effectivity_context_assignment - struct configured_effectivity_context_assignment : effectivity_context_assignment, ObjectHelper { configured_effectivity_context_assignment() : Object("configured_effectivity_context_assignment") {} - ListOf< configured_effectivity_context_item, 1, 0 >::Out items; - }; - - // C++ wrapper for conical_stepped_hole_transition - struct conical_stepped_hole_transition : geometric_representation_item, ObjectHelper { conical_stepped_hole_transition() : Object("conical_stepped_hole_transition") {} - positive_integer::Out transition_number; - plane_angle_measure::Out cone_apex_angle; - positive_length_measure::Out cone_base_radius; - }; - - // C++ wrapper for elementary_surface - struct elementary_surface : surface, ObjectHelper { elementary_surface() : Object("elementary_surface") {} - Lazy< axis2_placement_3d > position; - }; - - // C++ wrapper for conical_surface - struct conical_surface : elementary_surface, ObjectHelper { conical_surface() : Object("conical_surface") {} - length_measure::Out radius; - plane_angle_measure::Out semi_angle; - }; - - // C++ wrapper for connected_edge_set - struct connected_edge_set : topological_representation_item, ObjectHelper { connected_edge_set() : Object("connected_edge_set") {} - ListOf< Lazy< edge >, 1, 0 > ces_edges; - }; - - // C++ wrapper for connected_face_sub_set - struct connected_face_sub_set : connected_face_set, ObjectHelper { connected_face_sub_set() : Object("connected_face_sub_set") {} - Lazy< connected_face_set > parent_face_set; - }; - - // C++ wrapper for constructive_geometry_representation - struct constructive_geometry_representation : representation, ObjectHelper { constructive_geometry_representation() : Object("constructive_geometry_representation") {} - - }; - - // C++ wrapper for representation_relationship - struct representation_relationship : ObjectHelper { representation_relationship() : Object("representation_relationship") {} - label::Out name; - Maybe< text::Out > description; - Lazy< representation > rep_1; - Lazy< representation > rep_2; - }; - - // C++ wrapper for constructive_geometry_representation_relationship - struct constructive_geometry_representation_relationship : representation_relationship, ObjectHelper { constructive_geometry_representation_relationship() : Object("constructive_geometry_representation_relationship") {} - - }; - - // C++ wrapper for contact_ratio_representation - struct contact_ratio_representation : representation, ObjectHelper { contact_ratio_representation() : Object("contact_ratio_representation") {} - - }; - - // C++ wrapper for invisibility - struct invisibility : ObjectHelper { invisibility() : Object("invisibility") {} - ListOf< invisible_item, 1, 0 >::Out invisible_items; - }; - - // C++ wrapper for context_dependent_invisibility - struct context_dependent_invisibility : invisibility, ObjectHelper { context_dependent_invisibility() : Object("context_dependent_invisibility") {} - invisibility_context::Out presentation_context; - }; - - // C++ wrapper for over_riding_styled_item - struct over_riding_styled_item : styled_item, ObjectHelper { over_riding_styled_item() : Object("over_riding_styled_item") {} - Lazy< styled_item > over_ridden_style; - }; - - // C++ wrapper for context_dependent_over_riding_styled_item - struct context_dependent_over_riding_styled_item : over_riding_styled_item, ObjectHelper { context_dependent_over_riding_styled_item() : Object("context_dependent_over_riding_styled_item") {} - ListOf< style_context_select, 1, 0 >::Out style_context; - }; - - // C++ wrapper for context_dependent_unit - struct context_dependent_unit : named_unit, ObjectHelper { context_dependent_unit() : Object("context_dependent_unit") {} - label::Out name; - }; - - // C++ wrapper for conversion_based_unit - struct conversion_based_unit : named_unit, ObjectHelper { conversion_based_unit() : Object("conversion_based_unit") {} - label::Out name; - Lazy< measure_with_unit > conversion_factor; - }; - - // C++ wrapper for csg_shape_representation - struct csg_shape_representation : shape_representation, ObjectHelper { csg_shape_representation() : Object("csg_shape_representation") {} - - }; - - // C++ wrapper for csg_solid - struct csg_solid : solid_model, ObjectHelper { csg_solid() : Object("csg_solid") {} - csg_select::Out tree_root_expression; - }; - - // C++ wrapper for currency - struct currency : context_dependent_unit, ObjectHelper { currency() : Object("currency") {} - - }; - - // C++ wrapper for currency_measure_with_unit - struct currency_measure_with_unit : measure_with_unit, ObjectHelper { currency_measure_with_unit() : Object("currency_measure_with_unit") {} - - }; - - // C++ wrapper for curve_bounded_surface - struct curve_bounded_surface : bounded_surface, ObjectHelper { curve_bounded_surface() : Object("curve_bounded_surface") {} - Lazy< surface > basis_surface; - ListOf< Lazy< boundary_curve >, 1, 0 > boundaries; - BOOLEAN::Out implicit_outer; - }; - - // C++ wrapper for curve_dimension - struct curve_dimension : dimension_curve_directed_callout, ObjectHelper { curve_dimension() : Object("curve_dimension") {} - - }; - - // C++ wrapper for curve_replica - struct curve_replica : curve, ObjectHelper { curve_replica() : Object("curve_replica") {} - Lazy< curve > parent_curve; - Lazy< cartesian_transformation_operator > transformation; - }; - - // C++ wrapper for curve_style - struct curve_style : founded_item, ObjectHelper { curve_style() : Object("curve_style") {} - label::Out name; - curve_font_or_scaled_curve_font_select::Out curve_font; - size_select::Out curve_width; - Lazy< colour > curve_colour; - }; - - // C++ wrapper for curve_style_font - struct curve_style_font : founded_item, ObjectHelper { curve_style_font() : Object("curve_style_font") {} - label::Out name; - ListOf< Lazy< curve_style_font_pattern >, 1, 0 > pattern_list; - }; - - // C++ wrapper for curve_style_font_and_scaling - struct curve_style_font_and_scaling : founded_item, ObjectHelper { curve_style_font_and_scaling() : Object("curve_style_font_and_scaling") {} - label::Out name; - curve_style_font_select::Out curve_font; - REAL::Out curve_font_scaling; - }; - - // C++ wrapper for curve_style_font_pattern - struct curve_style_font_pattern : founded_item, ObjectHelper { curve_style_font_pattern() : Object("curve_style_font_pattern") {} - positive_length_measure::Out visible_segment_length; - positive_length_measure::Out invisible_segment_length; - }; - - // C++ wrapper for curve_swept_solid_shape_representation - struct curve_swept_solid_shape_representation : shape_representation, ObjectHelper { curve_swept_solid_shape_representation() : Object("curve_swept_solid_shape_representation") {} - - }; - - // C++ wrapper for cylindrical_surface - struct cylindrical_surface : elementary_surface, ObjectHelper { cylindrical_surface() : Object("cylindrical_surface") {} - positive_length_measure::Out radius; - }; - - // C++ wrapper for cylindricity_tolerance - struct cylindricity_tolerance : geometric_tolerance, ObjectHelper { cylindricity_tolerance() : Object("cylindricity_tolerance") {} - - }; - - // C++ wrapper for date_representation_item - struct date_representation_item : ObjectHelper { date_representation_item() : Object("date_representation_item") {} - - }; - - // C++ wrapper for date_time_representation_item - struct date_time_representation_item : ObjectHelper { date_time_representation_item() : Object("date_time_representation_item") {} - - }; - - // C++ wrapper for dated_effectivity - struct dated_effectivity : effectivity, ObjectHelper { dated_effectivity() : Object("dated_effectivity") {} - Maybe< date_time_or_event_occurrence::Out > effectivity_end_date; - date_time_or_event_occurrence::Out effectivity_start_date; - }; - - // C++ wrapper for datum - struct datum : shape_aspect, ObjectHelper { datum() : Object("datum") {} - identifier::Out identification; - }; - - // C++ wrapper for datum_feature - struct datum_feature : shape_aspect, ObjectHelper { datum_feature() : Object("datum_feature") {} - - }; - - // C++ wrapper for datum_feature_callout - struct datum_feature_callout : draughting_callout, ObjectHelper { datum_feature_callout() : Object("datum_feature_callout") {} - - }; - - // C++ wrapper for datum_reference - struct datum_reference : ObjectHelper { datum_reference() : Object("datum_reference") {} - INTEGER::Out precedence; - Lazy< datum > referenced_datum; - }; - - // C++ wrapper for datum_target - struct datum_target : shape_aspect, ObjectHelper { datum_target() : Object("datum_target") {} - identifier::Out target_id; - }; - - // C++ wrapper for datum_target_callout - struct datum_target_callout : draughting_callout, ObjectHelper { datum_target_callout() : Object("datum_target_callout") {} - - }; - - // C++ wrapper for default_tolerance_table - struct default_tolerance_table : representation, ObjectHelper { default_tolerance_table() : Object("default_tolerance_table") {} - - }; - - // C++ wrapper for default_tolerance_table_cell - struct default_tolerance_table_cell : compound_representation_item, ObjectHelper { default_tolerance_table_cell() : Object("default_tolerance_table_cell") {} - - }; - - // C++ wrapper for defined_symbol - struct defined_symbol : geometric_representation_item, ObjectHelper { defined_symbol() : Object("defined_symbol") {} - defined_symbol_select::Out definition; - Lazy< symbol_target > target; - }; - - // C++ wrapper for definitional_representation - struct definitional_representation : representation, ObjectHelper { definitional_representation() : Object("definitional_representation") {} - - }; - - // C++ wrapper for definitional_representation_relationship - struct definitional_representation_relationship : representation_relationship, ObjectHelper { definitional_representation_relationship() : Object("definitional_representation_relationship") {} - - }; - - // C++ wrapper for definitional_representation_relationship_with_same_context - struct definitional_representation_relationship_with_same_context : definitional_representation_relationship, ObjectHelper { definitional_representation_relationship_with_same_context() : Object("definitional_representation_relationship_with_same_context") {} - - }; - - // C++ wrapper for degenerate_pcurve - struct degenerate_pcurve : point, ObjectHelper { degenerate_pcurve() : Object("degenerate_pcurve") {} - Lazy< surface > basis_surface; - Lazy< definitional_representation > reference_to_curve; - }; - - // C++ wrapper for toroidal_surface - struct toroidal_surface : elementary_surface, ObjectHelper { toroidal_surface() : Object("toroidal_surface") {} - positive_length_measure::Out major_radius; - positive_length_measure::Out minor_radius; - }; - - // C++ wrapper for degenerate_toroidal_surface - struct degenerate_toroidal_surface : toroidal_surface, ObjectHelper { degenerate_toroidal_surface() : Object("degenerate_toroidal_surface") {} - BOOLEAN::Out select_outer; - }; - - // C++ wrapper for descriptive_representation_item - struct descriptive_representation_item : representation_item, ObjectHelper { descriptive_representation_item() : Object("descriptive_representation_item") {} - text::Out description; - }; - - // C++ wrapper for product_definition_context - struct product_definition_context : application_context_element, ObjectHelper { product_definition_context() : Object("product_definition_context") {} - label::Out life_cycle_stage; - }; - - // C++ wrapper for design_context - struct design_context : product_definition_context, ObjectHelper { design_context() : Object("design_context") {} - - }; - - // C++ wrapper for design_make_from_relationship - struct design_make_from_relationship : product_definition_relationship, ObjectHelper { design_make_from_relationship() : Object("design_make_from_relationship") {} - - }; - - // C++ wrapper for diameter_dimension - struct diameter_dimension : dimension_curve_directed_callout, ObjectHelper { diameter_dimension() : Object("diameter_dimension") {} - - }; - - // C++ wrapper for ratio_measure_with_unit - struct ratio_measure_with_unit : measure_with_unit, ObjectHelper { ratio_measure_with_unit() : Object("ratio_measure_with_unit") {} - - }; - - // C++ wrapper for dielectric_constant_measure_with_unit - struct dielectric_constant_measure_with_unit : ratio_measure_with_unit, ObjectHelper { dielectric_constant_measure_with_unit() : Object("dielectric_constant_measure_with_unit") {} - - }; - - // C++ wrapper for dimension_callout - struct dimension_callout : draughting_callout, ObjectHelper { dimension_callout() : Object("dimension_callout") {} - - }; - - // C++ wrapper for draughting_callout_relationship - struct draughting_callout_relationship : ObjectHelper { draughting_callout_relationship() : Object("draughting_callout_relationship") {} - label::Out name; - text::Out description; - Lazy< draughting_callout > relating_draughting_callout; - Lazy< draughting_callout > related_draughting_callout; - }; - - // C++ wrapper for dimension_callout_component_relationship - struct dimension_callout_component_relationship : draughting_callout_relationship, ObjectHelper { dimension_callout_component_relationship() : Object("dimension_callout_component_relationship") {} - - }; - - // C++ wrapper for dimension_callout_relationship - struct dimension_callout_relationship : draughting_callout_relationship, ObjectHelper { dimension_callout_relationship() : Object("dimension_callout_relationship") {} - - }; - - // C++ wrapper for dimension_curve - struct dimension_curve : annotation_curve_occurrence, ObjectHelper { dimension_curve() : Object("dimension_curve") {} - - }; - - // C++ wrapper for terminator_symbol - struct terminator_symbol : annotation_symbol_occurrence, ObjectHelper { terminator_symbol() : Object("terminator_symbol") {} - Lazy< annotation_curve_occurrence > annotated_curve; - }; - - // C++ wrapper for dimension_curve_terminator - struct dimension_curve_terminator : terminator_symbol, ObjectHelper { dimension_curve_terminator() : Object("dimension_curve_terminator") {} - dimension_extent_usage::Out role; - }; - - // C++ wrapper for dimension_curve_terminator_to_projection_curve_associativity - struct dimension_curve_terminator_to_projection_curve_associativity : annotation_occurrence_associativity, ObjectHelper { dimension_curve_terminator_to_projection_curve_associativity() : Object("dimension_curve_terminator_to_projection_curve_associativity") {} - - }; - - // C++ wrapper for dimension_pair - struct dimension_pair : draughting_callout_relationship, ObjectHelper { dimension_pair() : Object("dimension_pair") {} - - }; - - // C++ wrapper for dimension_text_associativity - struct dimension_text_associativity : ObjectHelper { dimension_text_associativity() : Object("dimension_text_associativity") {} - - }; - - // C++ wrapper for dimensional_location_with_path - struct dimensional_location_with_path : dimensional_location, ObjectHelper { dimensional_location_with_path() : Object("dimensional_location_with_path") {} - Lazy< shape_aspect > path; - }; - - // C++ wrapper for dimensional_size_with_path - struct dimensional_size_with_path : dimensional_size, ObjectHelper { dimensional_size_with_path() : Object("dimensional_size_with_path") {} - Lazy< shape_aspect > path; - }; - - // C++ wrapper for executed_action - struct executed_action : action, ObjectHelper { executed_action() : Object("executed_action") {} - - }; - - // C++ wrapper for directed_action - struct directed_action : executed_action, ObjectHelper { directed_action() : Object("directed_action") {} - Lazy< NotImplemented > directive; - }; - - // C++ wrapper for directed_dimensional_location - struct directed_dimensional_location : dimensional_location, ObjectHelper { directed_dimensional_location() : Object("directed_dimensional_location") {} - - }; - - // C++ wrapper for direction - struct direction : geometric_representation_item, ObjectHelper { direction() : Object("direction") {} - ListOf< REAL, 2, 3 >::Out direction_ratios; - }; - - // C++ wrapper for document_file - struct document_file : ObjectHelper { document_file() : Object("document_file") {} - - }; - - // C++ wrapper for document_identifier - struct document_identifier : group, ObjectHelper { document_identifier() : Object("document_identifier") {} - - }; - - // C++ wrapper for document_identifier_assignment - struct document_identifier_assignment : group_assignment, ObjectHelper { document_identifier_assignment() : Object("document_identifier_assignment") {} - ListOf< document_identifier_assigned_item, 1, 0 >::Out items; - }; - - // C++ wrapper for document_product_association - struct document_product_association : ObjectHelper { document_product_association() : Object("document_product_association") {} - label::Out name; - Maybe< text::Out > description; - Lazy< NotImplemented > relating_document; - product_or_formation_or_definition::Out related_product; - }; - - // C++ wrapper for document_product_equivalence - struct document_product_equivalence : document_product_association, ObjectHelper { document_product_equivalence() : Object("document_product_equivalence") {} - - }; - - // C++ wrapper for dose_equivalent_measure_with_unit - struct dose_equivalent_measure_with_unit : measure_with_unit, ObjectHelper { dose_equivalent_measure_with_unit() : Object("dose_equivalent_measure_with_unit") {} - - }; - - // C++ wrapper for dose_equivalent_unit - struct dose_equivalent_unit : derived_unit, ObjectHelper { dose_equivalent_unit() : Object("dose_equivalent_unit") {} - - }; - - // C++ wrapper for double_offset_shelled_solid - struct double_offset_shelled_solid : shelled_solid, ObjectHelper { double_offset_shelled_solid() : Object("double_offset_shelled_solid") {} - length_measure::Out thickness2; - }; - - // C++ wrapper for item_defined_transformation - struct item_defined_transformation : ObjectHelper { item_defined_transformation() : Object("item_defined_transformation") {} - label::Out name; - Maybe< text::Out > description; - Lazy< representation_item > transform_item_1; - Lazy< representation_item > transform_item_2; - }; - - // C++ wrapper for transformation_with_derived_angle - struct transformation_with_derived_angle : item_defined_transformation, ObjectHelper { transformation_with_derived_angle() : Object("transformation_with_derived_angle") {} - - }; - - // C++ wrapper for draped_defined_transformation - struct draped_defined_transformation : transformation_with_derived_angle, ObjectHelper { draped_defined_transformation() : Object("draped_defined_transformation") {} - - }; - - // C++ wrapper for draughting_annotation_occurrence - struct draughting_annotation_occurrence : annotation_occurrence, ObjectHelper { draughting_annotation_occurrence() : Object("draughting_annotation_occurrence") {} - - }; - - // C++ wrapper for draughting_elements - struct draughting_elements : draughting_callout, ObjectHelper { draughting_elements() : Object("draughting_elements") {} - - }; - - // C++ wrapper for draughting_model - struct draughting_model : representation, ObjectHelper { draughting_model() : Object("draughting_model") {} - - }; - - // C++ wrapper for item_identified_representation_usage - struct item_identified_representation_usage : ObjectHelper { item_identified_representation_usage() : Object("item_identified_representation_usage") {} - label::Out name; - Maybe< text::Out > description; - represented_definition::Out definition; - Lazy< representation > used_representation; - Lazy< representation_item > identified_item; - }; - - // C++ wrapper for draughting_model_item_association - struct draughting_model_item_association : item_identified_representation_usage, ObjectHelper { draughting_model_item_association() : Object("draughting_model_item_association") {} - - }; - - // C++ wrapper for pre_defined_colour - struct pre_defined_colour : ObjectHelper { pre_defined_colour() : Object("pre_defined_colour") {} - - }; - - // C++ wrapper for draughting_pre_defined_colour - struct draughting_pre_defined_colour : pre_defined_colour, ObjectHelper { draughting_pre_defined_colour() : Object("draughting_pre_defined_colour") {} - - }; - - // C++ wrapper for pre_defined_item - struct pre_defined_item : ObjectHelper { pre_defined_item() : Object("pre_defined_item") {} - label::Out name; - }; - - // C++ wrapper for pre_defined_curve_font - struct pre_defined_curve_font : pre_defined_item, ObjectHelper { pre_defined_curve_font() : Object("pre_defined_curve_font") {} - - }; - - // C++ wrapper for draughting_pre_defined_curve_font - struct draughting_pre_defined_curve_font : pre_defined_curve_font, ObjectHelper { draughting_pre_defined_curve_font() : Object("draughting_pre_defined_curve_font") {} - - }; - - // C++ wrapper for pre_defined_text_font - struct pre_defined_text_font : pre_defined_item, ObjectHelper { pre_defined_text_font() : Object("pre_defined_text_font") {} - - }; - - // C++ wrapper for draughting_pre_defined_text_font - struct draughting_pre_defined_text_font : pre_defined_text_font, ObjectHelper { draughting_pre_defined_text_font() : Object("draughting_pre_defined_text_font") {} - - }; - - // C++ wrapper for draughting_subfigure_representation - struct draughting_subfigure_representation : symbol_representation, ObjectHelper { draughting_subfigure_representation() : Object("draughting_subfigure_representation") {} - - }; - - // C++ wrapper for draughting_symbol_representation - struct draughting_symbol_representation : symbol_representation, ObjectHelper { draughting_symbol_representation() : Object("draughting_symbol_representation") {} - - }; - - // C++ wrapper for text_literal - struct text_literal : geometric_representation_item, ObjectHelper { text_literal() : Object("text_literal") {} - presentable_text::Out literal; - axis2_placement::Out placement; - text_alignment::Out alignment; - text_path::Out path; - font_select::Out font; - }; - - // C++ wrapper for text_literal_with_delineation - struct text_literal_with_delineation : text_literal, ObjectHelper { text_literal_with_delineation() : Object("text_literal_with_delineation") {} - text_delineation::Out delineation; - }; - - // C++ wrapper for draughting_text_literal_with_delineation - struct draughting_text_literal_with_delineation : text_literal_with_delineation, ObjectHelper { draughting_text_literal_with_delineation() : Object("draughting_text_literal_with_delineation") {} - - }; - - // C++ wrapper for presentation_set - struct presentation_set : ObjectHelper { presentation_set() : Object("presentation_set") {} - - }; - - // C++ wrapper for drawing_revision - struct drawing_revision : presentation_set, ObjectHelper { drawing_revision() : Object("drawing_revision") {} - identifier::Out revision_identifier; - Lazy< NotImplemented > drawing_identifier; - Maybe< text::Out > intended_scale; - }; - - // C++ wrapper for presentation_representation - struct presentation_representation : representation, ObjectHelper { presentation_representation() : Object("presentation_representation") {} - - }; - - // C++ wrapper for presentation_area - struct presentation_area : presentation_representation, ObjectHelper { presentation_area() : Object("presentation_area") {} - - }; - - // C++ wrapper for drawing_sheet_revision - struct drawing_sheet_revision : presentation_area, ObjectHelper { drawing_sheet_revision() : Object("drawing_sheet_revision") {} - identifier::Out revision_identifier; - }; - - // C++ wrapper for drawing_sheet_revision_sequence - struct drawing_sheet_revision_sequence : representation_relationship, ObjectHelper { drawing_sheet_revision_sequence() : Object("drawing_sheet_revision_sequence") {} - - }; - - // C++ wrapper for drawing_sheet_revision_usage - struct drawing_sheet_revision_usage : area_in_set, ObjectHelper { drawing_sheet_revision_usage() : Object("drawing_sheet_revision_usage") {} - identifier::Out sheet_number; - }; - - // C++ wrapper for edge - struct edge : topological_representation_item, ObjectHelper { edge() : Object("edge") {} - Lazy< vertex > edge_start; - Lazy< vertex > edge_end; - }; - - // C++ wrapper for edge_based_wireframe_model - struct edge_based_wireframe_model : geometric_representation_item, ObjectHelper { edge_based_wireframe_model() : Object("edge_based_wireframe_model") {} - ListOf< Lazy< connected_edge_set >, 1, 0 > ebwm_boundary; - }; - - // C++ wrapper for edge_based_wireframe_shape_representation - struct edge_based_wireframe_shape_representation : shape_representation, ObjectHelper { edge_based_wireframe_shape_representation() : Object("edge_based_wireframe_shape_representation") {} - - }; - - // C++ wrapper for edge_blended_solid - struct edge_blended_solid : modified_solid, ObjectHelper { edge_blended_solid() : Object("edge_blended_solid") {} - ListOf< Lazy< edge_curve >, 1, 0 > blended_edges; - }; - - // C++ wrapper for edge_curve - struct edge_curve : ObjectHelper { edge_curve() : Object("edge_curve") {} - Lazy< curve > edge_geometry; - BOOLEAN::Out same_sense; - }; - - // C++ wrapper for edge_loop - struct edge_loop : ObjectHelper { edge_loop() : Object("edge_loop") {} - - }; - - // C++ wrapper for electric_charge_measure_with_unit - struct electric_charge_measure_with_unit : measure_with_unit, ObjectHelper { electric_charge_measure_with_unit() : Object("electric_charge_measure_with_unit") {} - - }; - - // C++ wrapper for electric_charge_unit - struct electric_charge_unit : derived_unit, ObjectHelper { electric_charge_unit() : Object("electric_charge_unit") {} - - }; - - // C++ wrapper for electric_current_measure_with_unit - struct electric_current_measure_with_unit : measure_with_unit, ObjectHelper { electric_current_measure_with_unit() : Object("electric_current_measure_with_unit") {} - - }; - - // C++ wrapper for electric_current_unit - struct electric_current_unit : named_unit, ObjectHelper { electric_current_unit() : Object("electric_current_unit") {} - - }; - - // C++ wrapper for electric_potential_measure_with_unit - struct electric_potential_measure_with_unit : measure_with_unit, ObjectHelper { electric_potential_measure_with_unit() : Object("electric_potential_measure_with_unit") {} - - }; - - // C++ wrapper for electric_potential_unit - struct electric_potential_unit : derived_unit, ObjectHelper { electric_potential_unit() : Object("electric_potential_unit") {} - - }; - - // C++ wrapper for elementary_brep_shape_representation - struct elementary_brep_shape_representation : shape_representation, ObjectHelper { elementary_brep_shape_representation() : Object("elementary_brep_shape_representation") {} - - }; - - // C++ wrapper for ellipse - struct ellipse : conic, ObjectHelper { ellipse() : Object("ellipse") {} - positive_length_measure::Out semi_axis_1; - positive_length_measure::Out semi_axis_2; - }; - - // C++ wrapper for energy_measure_with_unit - struct energy_measure_with_unit : measure_with_unit, ObjectHelper { energy_measure_with_unit() : Object("energy_measure_with_unit") {} - - }; - - // C++ wrapper for energy_unit - struct energy_unit : derived_unit, ObjectHelper { energy_unit() : Object("energy_unit") {} - - }; - - // C++ wrapper for property_definition - struct property_definition : ObjectHelper { property_definition() : Object("property_definition") {} - label::Out name; - Maybe< text::Out > description; - characterized_definition::Out definition; - }; - - // C++ wrapper for fact_type - struct fact_type : property_definition, ObjectHelper { fact_type() : Object("fact_type") {} - - }; - - // C++ wrapper for entity_assertion - struct entity_assertion : fact_type, ObjectHelper { entity_assertion() : Object("entity_assertion") {} - - }; - - // C++ wrapper for enum_reference_prefix - struct enum_reference_prefix : descriptive_representation_item, ObjectHelper { enum_reference_prefix() : Object("enum_reference_prefix") {} - - }; - - // C++ wrapper for evaluated_characteristic - struct evaluated_characteristic : ObjectHelper { evaluated_characteristic() : Object("evaluated_characteristic") {} - - }; - - // C++ wrapper for evaluated_degenerate_pcurve - struct evaluated_degenerate_pcurve : degenerate_pcurve, ObjectHelper { evaluated_degenerate_pcurve() : Object("evaluated_degenerate_pcurve") {} - Lazy< cartesian_point > equivalent_point; - }; - - // C++ wrapper for evaluation_product_definition - struct evaluation_product_definition : product_definition, ObjectHelper { evaluation_product_definition() : Object("evaluation_product_definition") {} - - }; - - // C++ wrapper for event_occurrence - struct event_occurrence : ObjectHelper { event_occurrence() : Object("event_occurrence") {} - identifier::Out id; - label::Out name; - Maybe< text::Out > description; - }; - - // C++ wrapper for product_concept_feature_category - struct product_concept_feature_category : group, ObjectHelper { product_concept_feature_category() : Object("product_concept_feature_category") {} - - }; - - // C++ wrapper for exclusive_product_concept_feature_category - struct exclusive_product_concept_feature_category : product_concept_feature_category, ObjectHelper { exclusive_product_concept_feature_category() : Object("exclusive_product_concept_feature_category") {} - - }; - - // C++ wrapper for uncertainty_qualifier - struct uncertainty_qualifier : ObjectHelper { uncertainty_qualifier() : Object("uncertainty_qualifier") {} - label::Out measure_name; - text::Out description; - }; - - // C++ wrapper for standard_uncertainty - struct standard_uncertainty : uncertainty_qualifier, ObjectHelper { standard_uncertainty() : Object("standard_uncertainty") {} - REAL::Out uncertainty_value; - }; - - // C++ wrapper for expanded_uncertainty - struct expanded_uncertainty : standard_uncertainty, ObjectHelper { expanded_uncertainty() : Object("expanded_uncertainty") {} - REAL::Out coverage_factor; - }; - - // C++ wrapper for representation_item_relationship - struct representation_item_relationship : ObjectHelper { representation_item_relationship() : Object("representation_item_relationship") {} - label::Out name; - Maybe< text::Out > description; - Lazy< representation_item > relating_representation_item; - Lazy< representation_item > related_representation_item; - }; - - // C++ wrapper for explicit_procedural_representation_item_relationship - struct explicit_procedural_representation_item_relationship : representation_item_relationship, ObjectHelper { explicit_procedural_representation_item_relationship() : Object("explicit_procedural_representation_item_relationship") {} - - }; - - // C++ wrapper for explicit_procedural_geometric_representation_item_relationship - struct explicit_procedural_geometric_representation_item_relationship : explicit_procedural_representation_item_relationship, ObjectHelper { explicit_procedural_geometric_representation_item_relationship() : Object("explicit_procedural_geometric_representation_item_relationship") {} - - }; - - // C++ wrapper for explicit_procedural_representation_relationship - struct explicit_procedural_representation_relationship : representation_relationship, ObjectHelper { explicit_procedural_representation_relationship() : Object("explicit_procedural_representation_relationship") {} - - }; - - // C++ wrapper for explicit_procedural_shape_representation_relationship - struct explicit_procedural_shape_representation_relationship : explicit_procedural_representation_relationship, ObjectHelper { explicit_procedural_shape_representation_relationship() : Object("explicit_procedural_shape_representation_relationship") {} - - }; - - // C++ wrapper for expression_conversion_based_unit - struct expression_conversion_based_unit : ObjectHelper { expression_conversion_based_unit() : Object("expression_conversion_based_unit") {} - - }; - - // C++ wrapper for extension - struct extension : derived_shape_aspect, ObjectHelper { extension() : Object("extension") {} - - }; - - // C++ wrapper for extent - struct extent : characterized_object, ObjectHelper { extent() : Object("extent") {} - - }; - - // C++ wrapper for external_source - struct external_source : ObjectHelper { external_source() : Object("external_source") {} - source_item::Out source_id; - }; - - // C++ wrapper for external_class_library - struct external_class_library : external_source, ObjectHelper { external_class_library() : Object("external_class_library") {} - - }; - - // C++ wrapper for externally_defined_class - struct externally_defined_class : ObjectHelper { externally_defined_class() : Object("externally_defined_class") {} - - }; - - // C++ wrapper for externally_defined_colour - struct externally_defined_colour : ObjectHelper { externally_defined_colour() : Object("externally_defined_colour") {} - - }; - - // C++ wrapper for externally_defined_context_dependent_unit - struct externally_defined_context_dependent_unit : ObjectHelper { externally_defined_context_dependent_unit() : Object("externally_defined_context_dependent_unit") {} - - }; - - // C++ wrapper for externally_defined_conversion_based_unit - struct externally_defined_conversion_based_unit : ObjectHelper { externally_defined_conversion_based_unit() : Object("externally_defined_conversion_based_unit") {} - - }; - - // C++ wrapper for externally_defined_currency - struct externally_defined_currency : ObjectHelper { externally_defined_currency() : Object("externally_defined_currency") {} - - }; - - // C++ wrapper for externally_defined_item - struct externally_defined_item : ObjectHelper { externally_defined_item() : Object("externally_defined_item") {} - source_item::Out item_id; - Lazy< external_source > source; - }; - - // C++ wrapper for externally_defined_curve_font - struct externally_defined_curve_font : externally_defined_item, ObjectHelper { externally_defined_curve_font() : Object("externally_defined_curve_font") {} - - }; - - // C++ wrapper for externally_defined_dimension_definition - struct externally_defined_dimension_definition : ObjectHelper { externally_defined_dimension_definition() : Object("externally_defined_dimension_definition") {} - - }; - - // C++ wrapper for externally_defined_general_property - struct externally_defined_general_property : ObjectHelper { externally_defined_general_property() : Object("externally_defined_general_property") {} - - }; - - // C++ wrapper for externally_defined_hatch_style - struct externally_defined_hatch_style : ObjectHelper { externally_defined_hatch_style() : Object("externally_defined_hatch_style") {} - - }; - - // C++ wrapper for externally_defined_marker - struct externally_defined_marker : ObjectHelper { externally_defined_marker() : Object("externally_defined_marker") {} - - }; - - // C++ wrapper for picture_representation_item - struct picture_representation_item : bytes_representation_item, ObjectHelper { picture_representation_item() : Object("picture_representation_item") {} - - }; - - // C++ wrapper for externally_defined_picture_representation_item - struct externally_defined_picture_representation_item : picture_representation_item, ObjectHelper { externally_defined_picture_representation_item() : Object("externally_defined_picture_representation_item") {} - - }; - - // C++ wrapper for externally_defined_representation_item - struct externally_defined_representation_item : ObjectHelper { externally_defined_representation_item() : Object("externally_defined_representation_item") {} - - }; - - // C++ wrapper for externally_defined_string - struct externally_defined_string : externally_defined_representation_item, ObjectHelper { externally_defined_string() : Object("externally_defined_string") {} - - }; - - // C++ wrapper for externally_defined_symbol - struct externally_defined_symbol : externally_defined_item, ObjectHelper { externally_defined_symbol() : Object("externally_defined_symbol") {} - - }; - - // C++ wrapper for externally_defined_terminator_symbol - struct externally_defined_terminator_symbol : externally_defined_symbol, ObjectHelper { externally_defined_terminator_symbol() : Object("externally_defined_terminator_symbol") {} - - }; - - // C++ wrapper for externally_defined_text_font - struct externally_defined_text_font : externally_defined_item, ObjectHelper { externally_defined_text_font() : Object("externally_defined_text_font") {} - - }; - - // C++ wrapper for externally_defined_tile - struct externally_defined_tile : externally_defined_item, ObjectHelper { externally_defined_tile() : Object("externally_defined_tile") {} - - }; - - // C++ wrapper for externally_defined_tile_style - struct externally_defined_tile_style : ObjectHelper { externally_defined_tile_style() : Object("externally_defined_tile_style") {} - - }; - - // C++ wrapper for swept_area_solid - struct swept_area_solid : solid_model, ObjectHelper { swept_area_solid() : Object("swept_area_solid") {} - Lazy< curve_bounded_surface > swept_area; - }; - - // C++ wrapper for extruded_area_solid - struct extruded_area_solid : swept_area_solid, ObjectHelper { extruded_area_solid() : Object("extruded_area_solid") {} - Lazy< direction > extruded_direction; - positive_length_measure::Out depth; - }; - - // C++ wrapper for swept_face_solid - struct swept_face_solid : solid_model, ObjectHelper { swept_face_solid() : Object("swept_face_solid") {} - Lazy< face_surface > swept_face; - }; - - // C++ wrapper for extruded_face_solid - struct extruded_face_solid : swept_face_solid, ObjectHelper { extruded_face_solid() : Object("extruded_face_solid") {} - Lazy< direction > extruded_direction; - positive_length_measure::Out depth; - }; - - // C++ wrapper for extruded_face_solid_with_trim_conditions - struct extruded_face_solid_with_trim_conditions : extruded_face_solid, ObjectHelper { extruded_face_solid_with_trim_conditions() : Object("extruded_face_solid_with_trim_conditions") {} - trim_condition_select::Out first_trim_condition; - trim_condition_select::Out second_trim_condition; - trim_intent::Out first_trim_intent; - trim_intent::Out second_trim_intent; - non_negative_length_measure::Out first_offset; - non_negative_length_measure::Out second_offset; - }; - - // C++ wrapper for extruded_face_solid_with_draft_angle - struct extruded_face_solid_with_draft_angle : extruded_face_solid_with_trim_conditions, ObjectHelper { extruded_face_solid_with_draft_angle() : Object("extruded_face_solid_with_draft_angle") {} - plane_angle_measure::Out draft_angle; - }; - - // C++ wrapper for extruded_face_solid_with_multiple_draft_angles - struct extruded_face_solid_with_multiple_draft_angles : extruded_face_solid_with_trim_conditions, ObjectHelper { extruded_face_solid_with_multiple_draft_angles() : Object("extruded_face_solid_with_multiple_draft_angles") {} - ListOf< plane_angle_measure, 2, 0 >::Out draft_angles; - }; - - // C++ wrapper for face - struct face : topological_representation_item, ObjectHelper { face() : Object("face") {} - ListOf< Lazy< face_bound >, 1, 0 > bounds; - }; - - // C++ wrapper for face_based_surface_model - struct face_based_surface_model : geometric_representation_item, ObjectHelper { face_based_surface_model() : Object("face_based_surface_model") {} - ListOf< Lazy< connected_face_set >, 1, 0 > fbsm_faces; - }; - - // C++ wrapper for face_bound - struct face_bound : topological_representation_item, ObjectHelper { face_bound() : Object("face_bound") {} - Lazy< loop > bound; - BOOLEAN::Out orientation; - }; - - // C++ wrapper for face_outer_bound - struct face_outer_bound : face_bound, ObjectHelper { face_outer_bound() : Object("face_outer_bound") {} - - }; - - // C++ wrapper for faceted_brep - struct faceted_brep : manifold_solid_brep, ObjectHelper { faceted_brep() : Object("faceted_brep") {} - - }; - - // C++ wrapper for faceted_brep_shape_representation - struct faceted_brep_shape_representation : shape_representation, ObjectHelper { faceted_brep_shape_representation() : Object("faceted_brep_shape_representation") {} - - }; - - // C++ wrapper for fill_area_style - struct fill_area_style : founded_item, ObjectHelper { fill_area_style() : Object("fill_area_style") {} - label::Out name; - ListOf< fill_style_select, 1, 0 >::Out fill_styles; - }; - - // C++ wrapper for fill_area_style_hatching - struct fill_area_style_hatching : geometric_representation_item, ObjectHelper { fill_area_style_hatching() : Object("fill_area_style_hatching") {} - Lazy< curve_style > hatch_line_appearance; - Lazy< one_direction_repeat_factor > start_of_next_hatch_line; - Lazy< cartesian_point > point_of_reference_hatch_line; - Lazy< cartesian_point > pattern_start; - plane_angle_measure::Out hatch_line_angle; - }; - - // C++ wrapper for fill_area_style_tile_coloured_region - struct fill_area_style_tile_coloured_region : geometric_representation_item, ObjectHelper { fill_area_style_tile_coloured_region() : Object("fill_area_style_tile_coloured_region") {} - curve_or_annotation_curve_occurrence::Out closed_curve; - Lazy< colour > region_colour; - }; - - // C++ wrapper for fill_area_style_tile_curve_with_style - struct fill_area_style_tile_curve_with_style : geometric_representation_item, ObjectHelper { fill_area_style_tile_curve_with_style() : Object("fill_area_style_tile_curve_with_style") {} - Lazy< annotation_curve_occurrence > styled_curve; - }; - - // C++ wrapper for fill_area_style_tile_symbol_with_style - struct fill_area_style_tile_symbol_with_style : geometric_representation_item, ObjectHelper { fill_area_style_tile_symbol_with_style() : Object("fill_area_style_tile_symbol_with_style") {} - Lazy< annotation_symbol_occurrence > symbol; - }; - - // C++ wrapper for fill_area_style_tiles - struct fill_area_style_tiles : geometric_representation_item, ObjectHelper { fill_area_style_tiles() : Object("fill_area_style_tiles") {} - Lazy< two_direction_repeat_factor > tiling_pattern; - ListOf< fill_area_style_tile_shape_select, 1, 0 >::Out tiles; - positive_ratio_measure::Out tiling_scale; - }; - - // C++ wrapper for shape_representation_relationship - struct shape_representation_relationship : representation_relationship, ObjectHelper { shape_representation_relationship() : Object("shape_representation_relationship") {} - - }; - - // C++ wrapper for flat_pattern_ply_representation_relationship - struct flat_pattern_ply_representation_relationship : shape_representation_relationship, ObjectHelper { flat_pattern_ply_representation_relationship() : Object("flat_pattern_ply_representation_relationship") {} - - }; - - // C++ wrapper for flatness_tolerance - struct flatness_tolerance : geometric_tolerance, ObjectHelper { flatness_tolerance() : Object("flatness_tolerance") {} - - }; - - // C++ wrapper for force_measure_with_unit - struct force_measure_with_unit : measure_with_unit, ObjectHelper { force_measure_with_unit() : Object("force_measure_with_unit") {} - - }; - - // C++ wrapper for force_unit - struct force_unit : derived_unit, ObjectHelper { force_unit() : Object("force_unit") {} - - }; - - // C++ wrapper for forward_chaining_rule - struct forward_chaining_rule : rule_definition, ObjectHelper { forward_chaining_rule() : Object("forward_chaining_rule") {} - - }; - - // C++ wrapper for forward_chaining_rule_premise - struct forward_chaining_rule_premise : ObjectHelper { forward_chaining_rule_premise() : Object("forward_chaining_rule_premise") {} - - }; - - // C++ wrapper for frequency_measure_with_unit - struct frequency_measure_with_unit : measure_with_unit, ObjectHelper { frequency_measure_with_unit() : Object("frequency_measure_with_unit") {} - - }; - - // C++ wrapper for frequency_unit - struct frequency_unit : derived_unit, ObjectHelper { frequency_unit() : Object("frequency_unit") {} - - }; - - // C++ wrapper for func - struct func : compound_representation_item, ObjectHelper { func() : Object("func") {} - - }; - - // C++ wrapper for functional_breakdown_context - struct functional_breakdown_context : breakdown_context, ObjectHelper { functional_breakdown_context() : Object("functional_breakdown_context") {} - - }; - - // C++ wrapper for functional_element_usage - struct functional_element_usage : breakdown_element_usage, ObjectHelper { functional_element_usage() : Object("functional_element_usage") {} - - }; - - // C++ wrapper for general_material_property - struct general_material_property : general_property, ObjectHelper { general_material_property() : Object("general_material_property") {} - - }; - - // C++ wrapper for simple_generic_expression - struct simple_generic_expression : generic_expression, ObjectHelper { simple_generic_expression() : Object("simple_generic_expression") {} - - }; - - // C++ wrapper for generic_literal - struct generic_literal : simple_generic_expression, ObjectHelper { generic_literal() : Object("generic_literal") {} - - }; - - // C++ wrapper for generic_variable - struct generic_variable : simple_generic_expression, ObjectHelper { generic_variable() : Object("generic_variable") {} - - }; - - // C++ wrapper for geometric_alignment - struct geometric_alignment : derived_shape_aspect, ObjectHelper { geometric_alignment() : Object("geometric_alignment") {} - - }; - - // C++ wrapper for geometric_set - struct geometric_set : geometric_representation_item, ObjectHelper { geometric_set() : Object("geometric_set") {} - ListOf< geometric_set_select, 1, 0 >::Out elements; - }; - - // C++ wrapper for geometric_curve_set - struct geometric_curve_set : geometric_set, ObjectHelper { geometric_curve_set() : Object("geometric_curve_set") {} - - }; - - // C++ wrapper for geometric_intersection - struct geometric_intersection : derived_shape_aspect, ObjectHelper { geometric_intersection() : Object("geometric_intersection") {} - - }; - - // C++ wrapper for geometric_item_specific_usage - struct geometric_item_specific_usage : item_identified_representation_usage, ObjectHelper { geometric_item_specific_usage() : Object("geometric_item_specific_usage") {} - - }; - - // C++ wrapper for geometric_model_element_relationship - struct geometric_model_element_relationship : ObjectHelper { geometric_model_element_relationship() : Object("geometric_model_element_relationship") {} - - }; - - // C++ wrapper for representation_context - struct representation_context : ObjectHelper { representation_context() : Object("representation_context") {} - identifier::Out context_identifier; - text::Out context_type; - }; - - // C++ wrapper for geometric_representation_context - struct geometric_representation_context : representation_context, ObjectHelper { geometric_representation_context() : Object("geometric_representation_context") {} - dimension_count::Out coordinate_space_dimension; - }; - - // C++ wrapper for geometric_tolerance_with_defined_unit - struct geometric_tolerance_with_defined_unit : geometric_tolerance, ObjectHelper { geometric_tolerance_with_defined_unit() : Object("geometric_tolerance_with_defined_unit") {} - Lazy< measure_with_unit > unit_size; - }; - - // C++ wrapper for geometrical_tolerance_callout - struct geometrical_tolerance_callout : draughting_callout, ObjectHelper { geometrical_tolerance_callout() : Object("geometrical_tolerance_callout") {} - - }; - - // C++ wrapper for geometrically_bounded_2d_wireframe_representation - struct geometrically_bounded_2d_wireframe_representation : shape_representation, ObjectHelper { geometrically_bounded_2d_wireframe_representation() : Object("geometrically_bounded_2d_wireframe_representation") {} - - }; - - // C++ wrapper for geometrically_bounded_surface_shape_representation - struct geometrically_bounded_surface_shape_representation : shape_representation, ObjectHelper { geometrically_bounded_surface_shape_representation() : Object("geometrically_bounded_surface_shape_representation") {} - - }; - - // C++ wrapper for geometrically_bounded_wireframe_shape_representation - struct geometrically_bounded_wireframe_shape_representation : shape_representation, ObjectHelper { geometrically_bounded_wireframe_shape_representation() : Object("geometrically_bounded_wireframe_shape_representation") {} - - }; - - // C++ wrapper for global_assignment - struct global_assignment : representation_item_relationship, ObjectHelper { global_assignment() : Object("global_assignment") {} - - }; - - // C++ wrapper for global_uncertainty_assigned_context - struct global_uncertainty_assigned_context : representation_context, ObjectHelper { global_uncertainty_assigned_context() : Object("global_uncertainty_assigned_context") {} - ListOf< Lazy< uncertainty_measure_with_unit >, 1, 0 > uncertainty; - }; - - // C++ wrapper for global_unit_assigned_context - struct global_unit_assigned_context : representation_context, ObjectHelper { global_unit_assigned_context() : Object("global_unit_assigned_context") {} - ListOf< unit, 1, 0 >::Out units; - }; - - // C++ wrapper for ground_fact - struct ground_fact : atomic_formula, ObjectHelper { ground_fact() : Object("ground_fact") {} - - }; - - // C++ wrapper for hardness_representation - struct hardness_representation : representation, ObjectHelper { hardness_representation() : Object("hardness_representation") {} - - }; - - // C++ wrapper for hidden_element_over_riding_styled_item - struct hidden_element_over_riding_styled_item : context_dependent_over_riding_styled_item, ObjectHelper { hidden_element_over_riding_styled_item() : Object("hidden_element_over_riding_styled_item") {} - - }; - - // C++ wrapper for hyperbola - struct hyperbola : conic, ObjectHelper { hyperbola() : Object("hyperbola") {} - positive_length_measure::Out semi_axis; - positive_length_measure::Out semi_imag_axis; - }; - - // C++ wrapper for illuminance_measure_with_unit - struct illuminance_measure_with_unit : measure_with_unit, ObjectHelper { illuminance_measure_with_unit() : Object("illuminance_measure_with_unit") {} - - }; - - // C++ wrapper for illuminance_unit - struct illuminance_unit : derived_unit, ObjectHelper { illuminance_unit() : Object("illuminance_unit") {} - - }; - - // C++ wrapper for included_text_block - struct included_text_block : mapped_item, ObjectHelper { included_text_block() : Object("included_text_block") {} - - }; - - // C++ wrapper for inclusion_product_concept_feature - struct inclusion_product_concept_feature : conditional_concept_feature, ObjectHelper { inclusion_product_concept_feature() : Object("inclusion_product_concept_feature") {} - - }; - - // C++ wrapper for user_selected_elements - struct user_selected_elements : representation_item, ObjectHelper { user_selected_elements() : Object("user_selected_elements") {} - ListOf< Lazy< representation_item >, 1, 0 > picked_items; - }; - - // C++ wrapper for indirectly_selected_elements - struct indirectly_selected_elements : user_selected_elements, ObjectHelper { indirectly_selected_elements() : Object("indirectly_selected_elements") {} - ListOf< Lazy< representation_item >, 1, 0 > indirectly_picked_items; - }; - - // C++ wrapper for indirectly_selected_shape_elements - struct indirectly_selected_shape_elements : ObjectHelper { indirectly_selected_shape_elements() : Object("indirectly_selected_shape_elements") {} - - }; - - // C++ wrapper for inductance_measure_with_unit - struct inductance_measure_with_unit : measure_with_unit, ObjectHelper { inductance_measure_with_unit() : Object("inductance_measure_with_unit") {} - - }; - - // C++ wrapper for inductance_unit - struct inductance_unit : derived_unit, ObjectHelper { inductance_unit() : Object("inductance_unit") {} - - }; - - // C++ wrapper for information_right - struct information_right : action_method, ObjectHelper { information_right() : Object("information_right") {} - - }; - - // C++ wrapper for information_usage_right - struct information_usage_right : action_method, ObjectHelper { information_usage_right() : Object("information_usage_right") {} - - }; - - // C++ wrapper for instance_usage_context_assignment - struct instance_usage_context_assignment : product_definition_context, ObjectHelper { instance_usage_context_assignment() : Object("instance_usage_context_assignment") {} - ListOf< instance_usage_context_select, 1, 0 >::Out items; - }; - - // C++ wrapper for instanced_feature - struct instanced_feature : ObjectHelper { instanced_feature() : Object("instanced_feature") {} - - }; - - // C++ wrapper for literal_number - struct literal_number : ObjectHelper { literal_number() : Object("literal_number") {} - NUMBER::Out the_value; - }; - - // C++ wrapper for int_literal - struct int_literal : literal_number, ObjectHelper { int_literal() : Object("int_literal") {} - - }; - - // C++ wrapper for integer_representation_item - struct integer_representation_item : ObjectHelper { integer_representation_item() : Object("integer_representation_item") {} - - }; - - // C++ wrapper for surface_curve - struct surface_curve : curve, ObjectHelper { surface_curve() : Object("surface_curve") {} - Lazy< curve > curve_3d; - ListOf< pcurve_or_surface, 1, 2 >::Out associated_geometry; - preferred_surface_curve_representation::Out master_representation; - }; - - // C++ wrapper for intersection_curve - struct intersection_curve : surface_curve, ObjectHelper { intersection_curve() : Object("intersection_curve") {} - - }; - - // C++ wrapper for interval_expression - struct interval_expression : ObjectHelper { interval_expression() : Object("interval_expression") {} - - }; - - // C++ wrapper for iso4217_currency - struct iso4217_currency : currency, ObjectHelper { iso4217_currency() : Object("iso4217_currency") {} - - }; - - // C++ wrapper for known_source - struct known_source : ObjectHelper { known_source() : Object("known_source") {} - - }; - - // C++ wrapper for laid_defined_transformation - struct laid_defined_transformation : transformation_with_derived_angle, ObjectHelper { laid_defined_transformation() : Object("laid_defined_transformation") {} - - }; - - // C++ wrapper for language - struct language : group, ObjectHelper { language() : Object("language") {} - - }; - - // C++ wrapper for leader_curve - struct leader_curve : annotation_curve_occurrence, ObjectHelper { leader_curve() : Object("leader_curve") {} - - }; - - // C++ wrapper for leader_directed_callout - struct leader_directed_callout : draughting_callout, ObjectHelper { leader_directed_callout() : Object("leader_directed_callout") {} - - }; - - // C++ wrapper for leader_directed_dimension - struct leader_directed_dimension : leader_directed_callout, ObjectHelper { leader_directed_dimension() : Object("leader_directed_dimension") {} - - }; - - // C++ wrapper for leader_terminator - struct leader_terminator : terminator_symbol, ObjectHelper { leader_terminator() : Object("leader_terminator") {} - - }; - - // C++ wrapper for length_measure_with_unit - struct length_measure_with_unit : measure_with_unit, ObjectHelper { length_measure_with_unit() : Object("length_measure_with_unit") {} - - }; - - // C++ wrapper for length_unit - struct length_unit : named_unit, ObjectHelper { length_unit() : Object("length_unit") {} - - }; - - // C++ wrapper for light_source - struct light_source : geometric_representation_item, ObjectHelper { light_source() : Object("light_source") {} - Lazy< colour > light_colour; - }; - - // C++ wrapper for light_source_ambient - struct light_source_ambient : light_source, ObjectHelper { light_source_ambient() : Object("light_source_ambient") {} - - }; - - // C++ wrapper for light_source_directional - struct light_source_directional : light_source, ObjectHelper { light_source_directional() : Object("light_source_directional") {} - Lazy< direction > orientation; - }; - - // C++ wrapper for light_source_positional - struct light_source_positional : light_source, ObjectHelper { light_source_positional() : Object("light_source_positional") {} - Lazy< cartesian_point > position; - REAL::Out constant_attenuation; - REAL::Out distance_attenuation; - }; - - // C++ wrapper for light_source_spot - struct light_source_spot : light_source, ObjectHelper { light_source_spot() : Object("light_source_spot") {} - Lazy< cartesian_point > position; - Lazy< direction > orientation; - REAL::Out concentration_exponent; - REAL::Out constant_attenuation; - REAL::Out distance_attenuation; - positive_plane_angle_measure::Out spread_angle; - }; - - // C++ wrapper for line - struct line : curve, ObjectHelper { line() : Object("line") {} - Lazy< cartesian_point > pnt; - Lazy< vector > dir; - }; - - // C++ wrapper for line_profile_tolerance - struct line_profile_tolerance : geometric_tolerance, ObjectHelper { line_profile_tolerance() : Object("line_profile_tolerance") {} - - }; - - // C++ wrapper for linear_dimension - struct linear_dimension : dimension_curve_directed_callout, ObjectHelper { linear_dimension() : Object("linear_dimension") {} - - }; - - // C++ wrapper for simple_clause - struct simple_clause : compound_representation_item, ObjectHelper { simple_clause() : Object("simple_clause") {} - - }; - - // C++ wrapper for literal_conjunction - struct literal_conjunction : simple_clause, ObjectHelper { literal_conjunction() : Object("literal_conjunction") {} - - }; - - // C++ wrapper for literal_disjunction - struct literal_disjunction : simple_clause, ObjectHelper { literal_disjunction() : Object("literal_disjunction") {} - - }; - - // C++ wrapper for logical_literal - struct logical_literal : generic_literal, ObjectHelper { logical_literal() : Object("logical_literal") {} - LOGICAL::Out lit_value; - }; - - // C++ wrapper for logical_representation_item - struct logical_representation_item : ObjectHelper { logical_representation_item() : Object("logical_representation_item") {} - - }; - - // C++ wrapper for loop - struct loop : topological_representation_item, ObjectHelper { loop() : Object("loop") {} - - }; - - // C++ wrapper for loss_tangent_measure_with_unit - struct loss_tangent_measure_with_unit : ratio_measure_with_unit, ObjectHelper { loss_tangent_measure_with_unit() : Object("loss_tangent_measure_with_unit") {} - - }; - - // C++ wrapper for lot_effectivity - struct lot_effectivity : effectivity, ObjectHelper { lot_effectivity() : Object("lot_effectivity") {} - identifier::Out effectivity_lot_id; - Lazy< measure_with_unit > effectivity_lot_size; - }; - - // C++ wrapper for luminous_flux_measure_with_unit - struct luminous_flux_measure_with_unit : measure_with_unit, ObjectHelper { luminous_flux_measure_with_unit() : Object("luminous_flux_measure_with_unit") {} - - }; - - // C++ wrapper for luminous_flux_unit - struct luminous_flux_unit : named_unit, ObjectHelper { luminous_flux_unit() : Object("luminous_flux_unit") {} - - }; - - // C++ wrapper for luminous_intensity_measure_with_unit - struct luminous_intensity_measure_with_unit : measure_with_unit, ObjectHelper { luminous_intensity_measure_with_unit() : Object("luminous_intensity_measure_with_unit") {} - - }; - - // C++ wrapper for luminous_intensity_unit - struct luminous_intensity_unit : named_unit, ObjectHelper { luminous_intensity_unit() : Object("luminous_intensity_unit") {} - - }; - - // C++ wrapper for magnetic_flux_density_measure_with_unit - struct magnetic_flux_density_measure_with_unit : measure_with_unit, ObjectHelper { magnetic_flux_density_measure_with_unit() : Object("magnetic_flux_density_measure_with_unit") {} - - }; - - // C++ wrapper for magnetic_flux_density_unit - struct magnetic_flux_density_unit : derived_unit, ObjectHelper { magnetic_flux_density_unit() : Object("magnetic_flux_density_unit") {} - - }; - - // C++ wrapper for magnetic_flux_measure_with_unit - struct magnetic_flux_measure_with_unit : measure_with_unit, ObjectHelper { magnetic_flux_measure_with_unit() : Object("magnetic_flux_measure_with_unit") {} - - }; - - // C++ wrapper for magnetic_flux_unit - struct magnetic_flux_unit : derived_unit, ObjectHelper { magnetic_flux_unit() : Object("magnetic_flux_unit") {} - - }; - - // C++ wrapper for make_from_usage_option - struct make_from_usage_option : product_definition_usage, ObjectHelper { make_from_usage_option() : Object("make_from_usage_option") {} - INTEGER::Out ranking; - text::Out ranking_rationale; - Lazy< measure_with_unit > quantity; - }; - - // C++ wrapper for manifold_subsurface_shape_representation - struct manifold_subsurface_shape_representation : shape_representation, ObjectHelper { manifold_subsurface_shape_representation() : Object("manifold_subsurface_shape_representation") {} - - }; - - // C++ wrapper for manifold_surface_shape_representation - struct manifold_surface_shape_representation : shape_representation, ObjectHelper { manifold_surface_shape_representation() : Object("manifold_surface_shape_representation") {} - - }; - - // C++ wrapper for mass_measure_with_unit - struct mass_measure_with_unit : measure_with_unit, ObjectHelper { mass_measure_with_unit() : Object("mass_measure_with_unit") {} - - }; - - // C++ wrapper for mass_unit - struct mass_unit : named_unit, ObjectHelper { mass_unit() : Object("mass_unit") {} - - }; - - // C++ wrapper for material_property - struct material_property : property_definition, ObjectHelper { material_property() : Object("material_property") {} - - }; - - // C++ wrapper for property_definition_representation - struct property_definition_representation : ObjectHelper { property_definition_representation() : Object("property_definition_representation") {} - represented_definition::Out definition; - Lazy< representation > used_representation; - }; - - // C++ wrapper for material_property_representation - struct material_property_representation : property_definition_representation, ObjectHelper { material_property_representation() : Object("material_property_representation") {} - Lazy< NotImplemented > dependent_environment; - }; - - // C++ wrapper for measure_representation_item - struct measure_representation_item : ObjectHelper { measure_representation_item() : Object("measure_representation_item") {} - - }; - - // C++ wrapper for product_context - struct product_context : application_context_element, ObjectHelper { product_context() : Object("product_context") {} - label::Out discipline_type; - }; - - // C++ wrapper for mechanical_context - struct mechanical_context : product_context, ObjectHelper { mechanical_context() : Object("mechanical_context") {} - - }; - - // C++ wrapper for mechanical_design_and_draughting_relationship - struct mechanical_design_and_draughting_relationship : definitional_representation_relationship_with_same_context, ObjectHelper { mechanical_design_and_draughting_relationship() : Object("mechanical_design_and_draughting_relationship") {} - - }; - - // C++ wrapper for mechanical_design_geometric_presentation_area - struct mechanical_design_geometric_presentation_area : presentation_area, ObjectHelper { mechanical_design_geometric_presentation_area() : Object("mechanical_design_geometric_presentation_area") {} - - }; - - // C++ wrapper for mechanical_design_geometric_presentation_representation - struct mechanical_design_geometric_presentation_representation : representation, ObjectHelper { mechanical_design_geometric_presentation_representation() : Object("mechanical_design_geometric_presentation_representation") {} - - }; - - // C++ wrapper for mechanical_design_presentation_representation_with_draughting - struct mechanical_design_presentation_representation_with_draughting : representation, ObjectHelper { mechanical_design_presentation_representation_with_draughting() : Object("mechanical_design_presentation_representation_with_draughting") {} - - }; - - // C++ wrapper for mechanical_design_shaded_presentation_area - struct mechanical_design_shaded_presentation_area : presentation_area, ObjectHelper { mechanical_design_shaded_presentation_area() : Object("mechanical_design_shaded_presentation_area") {} - - }; - - // C++ wrapper for mechanical_design_shaded_presentation_representation - struct mechanical_design_shaded_presentation_representation : representation, ObjectHelper { mechanical_design_shaded_presentation_representation() : Object("mechanical_design_shaded_presentation_representation") {} - - }; - - // C++ wrapper for min_and_major_ply_orientation_basis - struct min_and_major_ply_orientation_basis : ObjectHelper { min_and_major_ply_orientation_basis() : Object("min_and_major_ply_orientation_basis") {} - - }; - - // C++ wrapper for modified_geometric_tolerance - struct modified_geometric_tolerance : geometric_tolerance, ObjectHelper { modified_geometric_tolerance() : Object("modified_geometric_tolerance") {} - limit_condition::Out modifier; - }; - - // C++ wrapper for modified_solid_with_placed_configuration - struct modified_solid_with_placed_configuration : modified_solid, ObjectHelper { modified_solid_with_placed_configuration() : Object("modified_solid_with_placed_configuration") {} - Lazy< axis2_placement_3d > placing; - }; - - // C++ wrapper for moments_of_inertia_representation - struct moments_of_inertia_representation : representation, ObjectHelper { moments_of_inertia_representation() : Object("moments_of_inertia_representation") {} - - }; - - // C++ wrapper for multi_language_attribute_assignment - struct multi_language_attribute_assignment : attribute_value_assignment, ObjectHelper { multi_language_attribute_assignment() : Object("multi_language_attribute_assignment") {} - ListOf< multi_language_attribute_item, 1, 0 >::Out items; - }; - - // C++ wrapper for multiple_arity_boolean_expression - struct multiple_arity_boolean_expression : ObjectHelper { multiple_arity_boolean_expression() : Object("multiple_arity_boolean_expression") {} - - }; - - // C++ wrapper for multiple_arity_generic_expression - struct multiple_arity_generic_expression : generic_expression, ObjectHelper { multiple_arity_generic_expression() : Object("multiple_arity_generic_expression") {} - ListOf< Lazy< generic_expression >, 2, 0 > operands; - }; - - // C++ wrapper for multiple_arity_numeric_expression - struct multiple_arity_numeric_expression : ObjectHelper { multiple_arity_numeric_expression() : Object("multiple_arity_numeric_expression") {} - - }; - - // C++ wrapper for next_assembly_usage_occurrence - struct next_assembly_usage_occurrence : assembly_component_usage, ObjectHelper { next_assembly_usage_occurrence() : Object("next_assembly_usage_occurrence") {} - - }; - - // C++ wrapper for non_manifold_surface_shape_representation - struct non_manifold_surface_shape_representation : shape_representation, ObjectHelper { non_manifold_surface_shape_representation() : Object("non_manifold_surface_shape_representation") {} - - }; - - // C++ wrapper for null_representation_item - struct null_representation_item : representation_item, ObjectHelper { null_representation_item() : Object("null_representation_item") {} - - }; - - // C++ wrapper for numeric_expression - struct numeric_expression : expression, ObjectHelper { numeric_expression() : Object("numeric_expression") {} - - }; - - // C++ wrapper for offset_curve_2d - struct offset_curve_2d : curve, ObjectHelper { offset_curve_2d() : Object("offset_curve_2d") {} - Lazy< curve > basis_curve; - length_measure::Out distance; - LOGICAL::Out self_intersect; - }; - - // C++ wrapper for offset_curve_3d - struct offset_curve_3d : curve, ObjectHelper { offset_curve_3d() : Object("offset_curve_3d") {} - Lazy< curve > basis_curve; - length_measure::Out distance; - LOGICAL::Out self_intersect; - Lazy< direction > ref_direction; - }; - - // C++ wrapper for offset_surface - struct offset_surface : surface, ObjectHelper { offset_surface() : Object("offset_surface") {} - Lazy< surface > basis_surface; - length_measure::Out distance; - LOGICAL::Out self_intersect; - }; - - // C++ wrapper for one_direction_repeat_factor - struct one_direction_repeat_factor : geometric_representation_item, ObjectHelper { one_direction_repeat_factor() : Object("one_direction_repeat_factor") {} - Lazy< vector > repeat_factor; - }; - - // C++ wrapper for open_shell - struct open_shell : connected_face_set, ObjectHelper { open_shell() : Object("open_shell") {} - - }; - - // C++ wrapper for ordinal_date - struct ordinal_date : date, ObjectHelper { ordinal_date() : Object("ordinal_date") {} - day_in_year_number::Out day_component; - }; - - // C++ wrapper for projection_directed_callout - struct projection_directed_callout : draughting_callout, ObjectHelper { projection_directed_callout() : Object("projection_directed_callout") {} - - }; - - // C++ wrapper for ordinate_dimension - struct ordinate_dimension : projection_directed_callout, ObjectHelper { ordinate_dimension() : Object("ordinate_dimension") {} - - }; - - // C++ wrapper for organizational_address - struct organizational_address : address, ObjectHelper { organizational_address() : Object("organizational_address") {} - ListOf< Lazy< NotImplemented >, 1, 0 > organizations; - Maybe< text::Out > description; - }; - - // C++ wrapper for oriented_closed_shell - struct oriented_closed_shell : closed_shell, ObjectHelper { oriented_closed_shell() : Object("oriented_closed_shell") {} - Lazy< closed_shell > closed_shell_element; - BOOLEAN::Out orientation; - }; - - // C++ wrapper for oriented_edge - struct oriented_edge : edge, ObjectHelper { oriented_edge() : Object("oriented_edge") {} - Lazy< edge > edge_element; - BOOLEAN::Out orientation; - }; - - // C++ wrapper for oriented_face - struct oriented_face : face, ObjectHelper { oriented_face() : Object("oriented_face") {} - Lazy< face > face_element; - BOOLEAN::Out orientation; - }; - - // C++ wrapper for oriented_open_shell - struct oriented_open_shell : open_shell, ObjectHelper { oriented_open_shell() : Object("oriented_open_shell") {} - Lazy< open_shell > open_shell_element; - BOOLEAN::Out orientation; - }; - - // C++ wrapper for path - struct path : topological_representation_item, ObjectHelper { path() : Object("path") {} - ListOf< Lazy< oriented_edge >, 1, 0 > edge_list; - }; - - // C++ wrapper for oriented_path - struct oriented_path : path, ObjectHelper { oriented_path() : Object("oriented_path") {} - Lazy< path > path_element; - BOOLEAN::Out orientation; - }; - - // C++ wrapper for oriented_surface - struct oriented_surface : surface, ObjectHelper { oriented_surface() : Object("oriented_surface") {} - BOOLEAN::Out orientation; - }; - - // C++ wrapper for outer_boundary_curve - struct outer_boundary_curve : boundary_curve, ObjectHelper { outer_boundary_curve() : Object("outer_boundary_curve") {} - - }; - - // C++ wrapper for package_product_concept_feature - struct package_product_concept_feature : product_concept_feature, ObjectHelper { package_product_concept_feature() : Object("package_product_concept_feature") {} - - }; - - // C++ wrapper for parabola - struct parabola : conic, ObjectHelper { parabola() : Object("parabola") {} - length_measure::Out focal_dist; - }; - - // C++ wrapper for parallel_offset - struct parallel_offset : derived_shape_aspect, ObjectHelper { parallel_offset() : Object("parallel_offset") {} - Lazy< measure_with_unit > offset; - }; - - // C++ wrapper for parallelism_tolerance - struct parallelism_tolerance : geometric_tolerance_with_datum_reference, ObjectHelper { parallelism_tolerance() : Object("parallelism_tolerance") {} - - }; - - // C++ wrapper for parametric_representation_context - struct parametric_representation_context : representation_context, ObjectHelper { parametric_representation_context() : Object("parametric_representation_context") {} - - }; - - // C++ wrapper for partial_document_with_structured_text_representation_assignment - struct partial_document_with_structured_text_representation_assignment : ObjectHelper { partial_document_with_structured_text_representation_assignment() : Object("partial_document_with_structured_text_representation_assignment") {} - - }; - - // C++ wrapper for pcurve - struct pcurve : curve, ObjectHelper { pcurve() : Object("pcurve") {} - Lazy< surface > basis_surface; - Lazy< definitional_representation > reference_to_curve; - }; - - // C++ wrapper for percentage_laminate_definition - struct percentage_laminate_definition : product_definition, ObjectHelper { percentage_laminate_definition() : Object("percentage_laminate_definition") {} - - }; - - // C++ wrapper for zone_structural_makeup - struct zone_structural_makeup : laminate_table, ObjectHelper { zone_structural_makeup() : Object("zone_structural_makeup") {} - - }; - - // C++ wrapper for percentage_laminate_table - struct percentage_laminate_table : zone_structural_makeup, ObjectHelper { percentage_laminate_table() : Object("percentage_laminate_table") {} - - }; - - // C++ wrapper for percentage_ply_definition - struct percentage_ply_definition : product_definition, ObjectHelper { percentage_ply_definition() : Object("percentage_ply_definition") {} - - }; - - // C++ wrapper for perpendicular_to - struct perpendicular_to : derived_shape_aspect, ObjectHelper { perpendicular_to() : Object("perpendicular_to") {} - - }; - - // C++ wrapper for perpendicularity_tolerance - struct perpendicularity_tolerance : geometric_tolerance_with_datum_reference, ObjectHelper { perpendicularity_tolerance() : Object("perpendicularity_tolerance") {} - - }; - - // C++ wrapper for person_and_organization_address - struct person_and_organization_address : ObjectHelper { person_and_organization_address() : Object("person_and_organization_address") {} - - }; - - // C++ wrapper for personal_address - struct personal_address : address, ObjectHelper { personal_address() : Object("personal_address") {} - ListOf< Lazy< NotImplemented >, 1, 0 > people; - Maybe< text::Out > description; - }; - - // C++ wrapper for physical_breakdown_context - struct physical_breakdown_context : breakdown_context, ObjectHelper { physical_breakdown_context() : Object("physical_breakdown_context") {} - - }; - - // C++ wrapper for physical_element_usage - struct physical_element_usage : breakdown_element_usage, ObjectHelper { physical_element_usage() : Object("physical_element_usage") {} - - }; - - // C++ wrapper for presentation_view - struct presentation_view : presentation_representation, ObjectHelper { presentation_view() : Object("presentation_view") {} - - }; - - // C++ wrapper for picture_representation - struct picture_representation : presentation_view, ObjectHelper { picture_representation() : Object("picture_representation") {} - - }; - - // C++ wrapper for placed_datum_target_feature - struct placed_datum_target_feature : datum_target, ObjectHelper { placed_datum_target_feature() : Object("placed_datum_target_feature") {} - - }; - - // C++ wrapper for placed_feature - struct placed_feature : shape_aspect, ObjectHelper { placed_feature() : Object("placed_feature") {} - - }; - - // C++ wrapper for planar_extent - struct planar_extent : geometric_representation_item, ObjectHelper { planar_extent() : Object("planar_extent") {} - length_measure::Out size_in_x; - length_measure::Out size_in_y; - }; - - // C++ wrapper for planar_box - struct planar_box : planar_extent, ObjectHelper { planar_box() : Object("planar_box") {} - axis2_placement::Out placement; - }; - - // C++ wrapper for plane - struct plane : elementary_surface, ObjectHelper { plane() : Object("plane") {} - - }; - - // C++ wrapper for plane_angle_measure_with_unit - struct plane_angle_measure_with_unit : measure_with_unit, ObjectHelper { plane_angle_measure_with_unit() : Object("plane_angle_measure_with_unit") {} - - }; - - // C++ wrapper for plane_angle_unit - struct plane_angle_unit : named_unit, ObjectHelper { plane_angle_unit() : Object("plane_angle_unit") {} - - }; - - // C++ wrapper for ply_laminate_definition - struct ply_laminate_definition : product_definition, ObjectHelper { ply_laminate_definition() : Object("ply_laminate_definition") {} - - }; - - // C++ wrapper for ply_laminate_sequence_definition - struct ply_laminate_sequence_definition : product_definition, ObjectHelper { ply_laminate_sequence_definition() : Object("ply_laminate_sequence_definition") {} - - }; - - // C++ wrapper for ply_laminate_table - struct ply_laminate_table : part_laminate_table, ObjectHelper { ply_laminate_table() : Object("ply_laminate_table") {} - - }; - - // C++ wrapper for point_and_vector - struct point_and_vector : ObjectHelper { point_and_vector() : Object("point_and_vector") {} - - }; - - // C++ wrapper for point_on_curve - struct point_on_curve : point, ObjectHelper { point_on_curve() : Object("point_on_curve") {} - Lazy< curve > basis_curve; - parameter_value::Out point_parameter; - }; - - // C++ wrapper for point_on_surface - struct point_on_surface : point, ObjectHelper { point_on_surface() : Object("point_on_surface") {} - Lazy< surface > basis_surface; - parameter_value::Out point_parameter_u; - parameter_value::Out point_parameter_v; - }; - - // C++ wrapper for point_path - struct point_path : ObjectHelper { point_path() : Object("point_path") {} - - }; - - // C++ wrapper for point_replica - struct point_replica : point, ObjectHelper { point_replica() : Object("point_replica") {} - Lazy< point > parent_pt; - Lazy< cartesian_transformation_operator > transformation; - }; - - // C++ wrapper for point_style - struct point_style : founded_item, ObjectHelper { point_style() : Object("point_style") {} - label::Out name; - marker_select::Out marker; - size_select::Out marker_size; - Lazy< colour > marker_colour; - }; - - // C++ wrapper for polar_complex_number_literal - struct polar_complex_number_literal : generic_literal, ObjectHelper { polar_complex_number_literal() : Object("polar_complex_number_literal") {} - REAL::Out radius; - REAL::Out angle; - }; - - // C++ wrapper for poly_loop - struct poly_loop : ObjectHelper { poly_loop() : Object("poly_loop") {} - ListOf< Lazy< cartesian_point >, 3, 0 > polygon; - }; - - // C++ wrapper for polyline - struct polyline : bounded_curve, ObjectHelper { polyline() : Object("polyline") {} - ListOf< Lazy< cartesian_point >, 2, 0 > points; - }; - - // C++ wrapper for position_tolerance - struct position_tolerance : geometric_tolerance, ObjectHelper { position_tolerance() : Object("position_tolerance") {} - - }; - - // C++ wrapper for positioned_sketch - struct positioned_sketch : geometric_representation_item, ObjectHelper { positioned_sketch() : Object("positioned_sketch") {} - sketch_basis_select::Out sketch_basis; - ListOf< Lazy< auxiliary_geometric_representation_item >, 0, 0 > auxiliary_elements; - }; - - // C++ wrapper for power_measure_with_unit - struct power_measure_with_unit : measure_with_unit, ObjectHelper { power_measure_with_unit() : Object("power_measure_with_unit") {} - - }; - - // C++ wrapper for power_unit - struct power_unit : derived_unit, ObjectHelper { power_unit() : Object("power_unit") {} - - }; - - // C++ wrapper for pre_defined_symbol - struct pre_defined_symbol : pre_defined_item, ObjectHelper { pre_defined_symbol() : Object("pre_defined_symbol") {} - - }; - - // C++ wrapper for pre_defined_dimension_symbol - struct pre_defined_dimension_symbol : pre_defined_symbol, ObjectHelper { pre_defined_dimension_symbol() : Object("pre_defined_dimension_symbol") {} - - }; - - // C++ wrapper for pre_defined_geometrical_tolerance_symbol - struct pre_defined_geometrical_tolerance_symbol : pre_defined_symbol, ObjectHelper { pre_defined_geometrical_tolerance_symbol() : Object("pre_defined_geometrical_tolerance_symbol") {} - - }; - - // C++ wrapper for pre_defined_marker - struct pre_defined_marker : pre_defined_item, ObjectHelper { pre_defined_marker() : Object("pre_defined_marker") {} - - }; - - // C++ wrapper for pre_defined_point_marker_symbol - struct pre_defined_point_marker_symbol : ObjectHelper { pre_defined_point_marker_symbol() : Object("pre_defined_point_marker_symbol") {} - - }; - - // C++ wrapper for pre_defined_surface_condition_symbol - struct pre_defined_surface_condition_symbol : pre_defined_symbol, ObjectHelper { pre_defined_surface_condition_symbol() : Object("pre_defined_surface_condition_symbol") {} - - }; - - // C++ wrapper for pre_defined_surface_side_style - struct pre_defined_surface_side_style : pre_defined_item, ObjectHelper { pre_defined_surface_side_style() : Object("pre_defined_surface_side_style") {} - - }; - - // C++ wrapper for pre_defined_terminator_symbol - struct pre_defined_terminator_symbol : pre_defined_symbol, ObjectHelper { pre_defined_terminator_symbol() : Object("pre_defined_terminator_symbol") {} - - }; - - // C++ wrapper for pre_defined_tile - struct pre_defined_tile : pre_defined_item, ObjectHelper { pre_defined_tile() : Object("pre_defined_tile") {} - - }; - - // C++ wrapper for predefined_picture_representation_item - struct predefined_picture_representation_item : picture_representation_item, ObjectHelper { predefined_picture_representation_item() : Object("predefined_picture_representation_item") {} - - }; - - // C++ wrapper for presentation_style_assignment - struct presentation_style_assignment : founded_item, ObjectHelper { presentation_style_assignment() : Object("presentation_style_assignment") {} - ListOf< presentation_style_select, 1, 0 >::Out styles; - }; - - // C++ wrapper for presentation_style_by_context - struct presentation_style_by_context : presentation_style_assignment, ObjectHelper { presentation_style_by_context() : Object("presentation_style_by_context") {} - style_context_select::Out style_context; - }; - - // C++ wrapper for pressure_measure_with_unit - struct pressure_measure_with_unit : measure_with_unit, ObjectHelper { pressure_measure_with_unit() : Object("pressure_measure_with_unit") {} - - }; - - // C++ wrapper for pressure_unit - struct pressure_unit : derived_unit, ObjectHelper { pressure_unit() : Object("pressure_unit") {} - - }; - - // C++ wrapper for procedural_representation - struct procedural_representation : representation, ObjectHelper { procedural_representation() : Object("procedural_representation") {} - - }; - - // C++ wrapper for procedural_representation_sequence - struct procedural_representation_sequence : representation_item, ObjectHelper { procedural_representation_sequence() : Object("procedural_representation_sequence") {} - ListOf< Lazy< representation_item >, 1, 0 > elements; - ListOf< Lazy< representation_item >, 0, 0 > suppressed_items; - text::Out rationale; - }; - - // C++ wrapper for procedural_shape_representation - struct procedural_shape_representation : ObjectHelper { procedural_shape_representation() : Object("procedural_shape_representation") {} - - }; - - // C++ wrapper for procedural_shape_representation_sequence - struct procedural_shape_representation_sequence : ObjectHelper { procedural_shape_representation_sequence() : Object("procedural_shape_representation_sequence") {} - - }; - - // C++ wrapper for product_category - struct product_category : ObjectHelper { product_category() : Object("product_category") {} - label::Out name; - Maybe< text::Out > description; - }; - - // C++ wrapper for product_class - struct product_class : ObjectHelper { product_class() : Object("product_class") {} - - }; - - // C++ wrapper for product_concept_context - struct product_concept_context : application_context_element, ObjectHelper { product_concept_context() : Object("product_concept_context") {} - label::Out market_segment_type; - }; - - // C++ wrapper for product_concept_feature_category_usage - struct product_concept_feature_category_usage : group_assignment, ObjectHelper { product_concept_feature_category_usage() : Object("product_concept_feature_category_usage") {} - ListOf< category_usage_item, 1, 0 >::Out items; - }; - - // C++ wrapper for product_definition_element_relationship - struct product_definition_element_relationship : group, ObjectHelper { product_definition_element_relationship() : Object("product_definition_element_relationship") {} - - }; - - // C++ wrapper for product_definition_formation - struct product_definition_formation : ObjectHelper { product_definition_formation() : Object("product_definition_formation") {} - identifier::Out id; - Maybe< text::Out > description; - Lazy< NotImplemented > of_product; - }; - - // C++ wrapper for product_definition_formation_with_specified_source - struct product_definition_formation_with_specified_source : product_definition_formation, ObjectHelper { product_definition_formation_with_specified_source() : Object("product_definition_formation_with_specified_source") {} - source::Out make_or_buy; - }; - - // C++ wrapper for product_definition_group_assignment - struct product_definition_group_assignment : group_assignment, ObjectHelper { product_definition_group_assignment() : Object("product_definition_group_assignment") {} - ListOf< product_definition_or_product_definition_relationship, 1, 1 >::Out items; - }; - - // C++ wrapper for product_definition_shape - struct product_definition_shape : property_definition, ObjectHelper { product_definition_shape() : Object("product_definition_shape") {} - - }; - - // C++ wrapper for product_definition_with_associated_documents - struct product_definition_with_associated_documents : product_definition, ObjectHelper { product_definition_with_associated_documents() : Object("product_definition_with_associated_documents") {} - ListOf< Lazy< NotImplemented >, 1, 0 > documentation_ids; - }; - - // C++ wrapper for product_identification - struct product_identification : ObjectHelper { product_identification() : Object("product_identification") {} - - }; - - // C++ wrapper for product_material_composition_relationship - struct product_material_composition_relationship : product_definition_relationship, ObjectHelper { product_material_composition_relationship() : Object("product_material_composition_relationship") {} - label::Out class_; - ListOf< characterized_product_composition_value, 1, 0 >::Out constituent_amount; - label::Out composition_basis; - text::Out determination_method; - }; - - // C++ wrapper for product_related_product_category - struct product_related_product_category : product_category, ObjectHelper { product_related_product_category() : Object("product_related_product_category") {} - ListOf< Lazy< NotImplemented >, 1, 0 > products; - }; - - // C++ wrapper for product_specification - struct product_specification : ObjectHelper { product_specification() : Object("product_specification") {} - - }; - - // C++ wrapper for tolerance_zone_definition - struct tolerance_zone_definition : ObjectHelper { tolerance_zone_definition() : Object("tolerance_zone_definition") {} - Lazy< tolerance_zone > zone; - ListOf< Lazy< shape_aspect >, 1, 0 > boundaries; - }; - - // C++ wrapper for projected_zone_definition - struct projected_zone_definition : tolerance_zone_definition, ObjectHelper { projected_zone_definition() : Object("projected_zone_definition") {} - Lazy< shape_aspect > projection_end; - Lazy< measure_with_unit > projected_length; - }; - - // C++ wrapper for projection_curve - struct projection_curve : annotation_curve_occurrence, ObjectHelper { projection_curve() : Object("projection_curve") {} - - }; - - // C++ wrapper for promissory_usage_occurrence - struct promissory_usage_occurrence : assembly_component_usage, ObjectHelper { promissory_usage_occurrence() : Object("promissory_usage_occurrence") {} - - }; - - // C++ wrapper for qualified_representation_item - struct qualified_representation_item : representation_item, ObjectHelper { qualified_representation_item() : Object("qualified_representation_item") {} - ListOf< value_qualifier, 1, 0 >::Out qualifiers; - }; - - // C++ wrapper for qualitative_uncertainty - struct qualitative_uncertainty : uncertainty_qualifier, ObjectHelper { qualitative_uncertainty() : Object("qualitative_uncertainty") {} - text::Out uncertainty_value; - }; - - // C++ wrapper for quantified_assembly_component_usage - struct quantified_assembly_component_usage : assembly_component_usage, ObjectHelper { quantified_assembly_component_usage() : Object("quantified_assembly_component_usage") {} - Lazy< measure_with_unit > quantity; - }; - - // C++ wrapper for quasi_uniform_curve - struct quasi_uniform_curve : b_spline_curve, ObjectHelper { quasi_uniform_curve() : Object("quasi_uniform_curve") {} - - }; - - // C++ wrapper for quasi_uniform_surface - struct quasi_uniform_surface : b_spline_surface, ObjectHelper { quasi_uniform_surface() : Object("quasi_uniform_surface") {} - - }; - - // C++ wrapper for radioactivity_measure_with_unit - struct radioactivity_measure_with_unit : measure_with_unit, ObjectHelper { radioactivity_measure_with_unit() : Object("radioactivity_measure_with_unit") {} - - }; - - // C++ wrapper for radioactivity_unit - struct radioactivity_unit : derived_unit, ObjectHelper { radioactivity_unit() : Object("radioactivity_unit") {} - - }; - - // C++ wrapper for radius_dimension - struct radius_dimension : dimension_curve_directed_callout, ObjectHelper { radius_dimension() : Object("radius_dimension") {} - - }; - - // C++ wrapper for range_characteristic - struct range_characteristic : ObjectHelper { range_characteristic() : Object("range_characteristic") {} - - }; - - // C++ wrapper for ratio_unit - struct ratio_unit : named_unit, ObjectHelper { ratio_unit() : Object("ratio_unit") {} - - }; - - // C++ wrapper for rational_b_spline_curve - struct rational_b_spline_curve : b_spline_curve, ObjectHelper { rational_b_spline_curve() : Object("rational_b_spline_curve") {} - ListOf< REAL, 2, 0 >::Out weights_data; - }; - - // C++ wrapper for rational_b_spline_surface - struct rational_b_spline_surface : b_spline_surface, ObjectHelper { rational_b_spline_surface() : Object("rational_b_spline_surface") {} - - }; - - // C++ wrapper for rational_representation_item - struct rational_representation_item : ObjectHelper { rational_representation_item() : Object("rational_representation_item") {} - - }; - - // C++ wrapper for real_literal - struct real_literal : literal_number, ObjectHelper { real_literal() : Object("real_literal") {} - - }; - - // C++ wrapper for real_representation_item - struct real_representation_item : ObjectHelper { real_representation_item() : Object("real_representation_item") {} - - }; - - // C++ wrapper for rectangular_composite_surface - struct rectangular_composite_surface : bounded_surface, ObjectHelper { rectangular_composite_surface() : Object("rectangular_composite_surface") {} - - }; - - // C++ wrapper for rectangular_trimmed_surface - struct rectangular_trimmed_surface : bounded_surface, ObjectHelper { rectangular_trimmed_surface() : Object("rectangular_trimmed_surface") {} - Lazy< surface > basis_surface; - parameter_value::Out u1; - parameter_value::Out u2; - parameter_value::Out v1; - parameter_value::Out v2; - BOOLEAN::Out usense; - BOOLEAN::Out vsense; - }; - - // C++ wrapper for referenced_modified_datum - struct referenced_modified_datum : datum_reference, ObjectHelper { referenced_modified_datum() : Object("referenced_modified_datum") {} - limit_condition::Out modifier; - }; - - // C++ wrapper for relative_event_occurrence - struct relative_event_occurrence : event_occurrence, ObjectHelper { relative_event_occurrence() : Object("relative_event_occurrence") {} - Lazy< event_occurrence > base_event; - Lazy< time_measure_with_unit > offset; - }; - - // C++ wrapper for rep_item_group - struct rep_item_group : ObjectHelper { rep_item_group() : Object("rep_item_group") {} - - }; - - // C++ wrapper for reparametrised_composite_curve_segment - struct reparametrised_composite_curve_segment : composite_curve_segment, ObjectHelper { reparametrised_composite_curve_segment() : Object("reparametrised_composite_curve_segment") {} - parameter_value::Out param_length; - }; - - // C++ wrapper for representation_relationship_with_transformation - struct representation_relationship_with_transformation : representation_relationship, ObjectHelper { representation_relationship_with_transformation() : Object("representation_relationship_with_transformation") {} - transformation::Out transformation_operator; - }; - - // C++ wrapper for requirement_assigned_object - struct requirement_assigned_object : group_assignment, ObjectHelper { requirement_assigned_object() : Object("requirement_assigned_object") {} - ListOf< requirement_assigned_item, 1, 1 >::Out items; - }; - - // C++ wrapper for requirement_assignment - struct requirement_assignment : ObjectHelper { requirement_assignment() : Object("requirement_assignment") {} - - }; - - // C++ wrapper for requirement_source - struct requirement_source : group, ObjectHelper { requirement_source() : Object("requirement_source") {} - - }; - - // C++ wrapper for requirement_view_definition_relationship - struct requirement_view_definition_relationship : product_definition_relationship, ObjectHelper { requirement_view_definition_relationship() : Object("requirement_view_definition_relationship") {} - - }; - - // C++ wrapper for resistance_measure_with_unit - struct resistance_measure_with_unit : measure_with_unit, ObjectHelper { resistance_measure_with_unit() : Object("resistance_measure_with_unit") {} - - }; - - // C++ wrapper for resistance_unit - struct resistance_unit : derived_unit, ObjectHelper { resistance_unit() : Object("resistance_unit") {} - - }; - - // C++ wrapper for revolved_area_solid - struct revolved_area_solid : swept_area_solid, ObjectHelper { revolved_area_solid() : Object("revolved_area_solid") {} - Lazy< axis1_placement > axis; - plane_angle_measure::Out angle; - }; - - // C++ wrapper for revolved_face_solid - struct revolved_face_solid : swept_face_solid, ObjectHelper { revolved_face_solid() : Object("revolved_face_solid") {} - Lazy< axis1_placement > axis; - plane_angle_measure::Out angle; - }; - - // C++ wrapper for revolved_face_solid_with_trim_conditions - struct revolved_face_solid_with_trim_conditions : revolved_face_solid, ObjectHelper { revolved_face_solid_with_trim_conditions() : Object("revolved_face_solid_with_trim_conditions") {} - trim_condition_select::Out first_trim_condition; - trim_condition_select::Out second_trim_condition; - }; - - // C++ wrapper for right_angular_wedge - struct right_angular_wedge : geometric_representation_item, ObjectHelper { right_angular_wedge() : Object("right_angular_wedge") {} - Lazy< axis2_placement_3d > position; - positive_length_measure::Out x; - positive_length_measure::Out y; - positive_length_measure::Out z; - length_measure::Out ltx; - }; - - // C++ wrapper for right_circular_cone - struct right_circular_cone : geometric_representation_item, ObjectHelper { right_circular_cone() : Object("right_circular_cone") {} - Lazy< axis1_placement > position; - positive_length_measure::Out height; - length_measure::Out radius; - plane_angle_measure::Out semi_angle; - }; - - // C++ wrapper for right_circular_cylinder - struct right_circular_cylinder : geometric_representation_item, ObjectHelper { right_circular_cylinder() : Object("right_circular_cylinder") {} - Lazy< axis1_placement > position; - positive_length_measure::Out height; - positive_length_measure::Out radius; - }; - - // C++ wrapper for right_to_usage_association - struct right_to_usage_association : action_method_relationship, ObjectHelper { right_to_usage_association() : Object("right_to_usage_association") {} - - }; - - // C++ wrapper for roundness_tolerance - struct roundness_tolerance : geometric_tolerance, ObjectHelper { roundness_tolerance() : Object("roundness_tolerance") {} - - }; - - // C++ wrapper for row_representation_item - struct row_representation_item : compound_representation_item, ObjectHelper { row_representation_item() : Object("row_representation_item") {} - - }; - - // C++ wrapper for row_value - struct row_value : compound_representation_item, ObjectHelper { row_value() : Object("row_value") {} - - }; - - // C++ wrapper for row_variable - struct row_variable : abstract_variable, ObjectHelper { row_variable() : Object("row_variable") {} - - }; - - // C++ wrapper for rule_action - struct rule_action : action, ObjectHelper { rule_action() : Object("rule_action") {} - - }; - - // C++ wrapper for rule_condition - struct rule_condition : atomic_formula, ObjectHelper { rule_condition() : Object("rule_condition") {} - - }; - - // C++ wrapper for rule_set - struct rule_set : rule_software_definition, ObjectHelper { rule_set() : Object("rule_set") {} - - }; - - // C++ wrapper for rule_set_group - struct rule_set_group : rule_software_definition, ObjectHelper { rule_set_group() : Object("rule_set_group") {} - - }; - - // C++ wrapper for rule_superseded_assignment - struct rule_superseded_assignment : action_assignment, ObjectHelper { rule_superseded_assignment() : Object("rule_superseded_assignment") {} - ListOf< rule_superseded_item, 1, 0 >::Out items; - }; - - // C++ wrapper for rule_supersedence - struct rule_supersedence : rule_action, ObjectHelper { rule_supersedence() : Object("rule_supersedence") {} - - }; - - // C++ wrapper for surface_curve_swept_area_solid - struct surface_curve_swept_area_solid : swept_area_solid, ObjectHelper { surface_curve_swept_area_solid() : Object("surface_curve_swept_area_solid") {} - Lazy< curve > directrix; - REAL::Out start_param; - REAL::Out end_param; - Lazy< surface > reference_surface; - }; - - // C++ wrapper for ruled_surface_swept_area_solid - struct ruled_surface_swept_area_solid : surface_curve_swept_area_solid, ObjectHelper { ruled_surface_swept_area_solid() : Object("ruled_surface_swept_area_solid") {} - - }; - - // C++ wrapper for runout_zone_definition - struct runout_zone_definition : tolerance_zone_definition, ObjectHelper { runout_zone_definition() : Object("runout_zone_definition") {} - Lazy< runout_zone_orientation > orientation; - }; - - // C++ wrapper for runout_zone_orientation - struct runout_zone_orientation : ObjectHelper { runout_zone_orientation() : Object("runout_zone_orientation") {} - Lazy< measure_with_unit > angle; - }; - - // C++ wrapper for runout_zone_orientation_reference_direction - struct runout_zone_orientation_reference_direction : runout_zone_orientation, ObjectHelper { runout_zone_orientation_reference_direction() : Object("runout_zone_orientation_reference_direction") {} - Lazy< shape_aspect_relationship > orientation_defining_relationship; - }; - - // C++ wrapper for satisfied_requirement - struct satisfied_requirement : group_assignment, ObjectHelper { satisfied_requirement() : Object("satisfied_requirement") {} - ListOf< Lazy< product_definition >, 1, 1 > items; - }; - - // C++ wrapper for satisfies_requirement - struct satisfies_requirement : group, ObjectHelper { satisfies_requirement() : Object("satisfies_requirement") {} - - }; - - // C++ wrapper for satisfying_item - struct satisfying_item : group_assignment, ObjectHelper { satisfying_item() : Object("satisfying_item") {} - ListOf< requirement_satisfaction_item, 1, 1 >::Out items; - }; - - // C++ wrapper for scalar_variable - struct scalar_variable : abstract_variable, ObjectHelper { scalar_variable() : Object("scalar_variable") {} - - }; - - // C++ wrapper for scattering_parameter - struct scattering_parameter : polar_complex_number_literal, ObjectHelper { scattering_parameter() : Object("scattering_parameter") {} - - }; - - // C++ wrapper for sculptured_solid - struct sculptured_solid : modified_solid, ObjectHelper { sculptured_solid() : Object("sculptured_solid") {} - generalized_surface_select::Out sculpturing_element; - BOOLEAN::Out positive_side; - }; - - // C++ wrapper for seam_curve - struct seam_curve : surface_curve, ObjectHelper { seam_curve() : Object("seam_curve") {} - - }; - - // C++ wrapper for serial_numbered_effectivity - struct serial_numbered_effectivity : effectivity, ObjectHelper { serial_numbered_effectivity() : Object("serial_numbered_effectivity") {} - identifier::Out effectivity_start_id; - Maybe< identifier::Out > effectivity_end_id; - }; - - // C++ wrapper for shape_aspect_associativity - struct shape_aspect_associativity : shape_aspect_relationship, ObjectHelper { shape_aspect_associativity() : Object("shape_aspect_associativity") {} - - }; - - // C++ wrapper for shape_aspect_deriving_relationship - struct shape_aspect_deriving_relationship : shape_aspect_relationship, ObjectHelper { shape_aspect_deriving_relationship() : Object("shape_aspect_deriving_relationship") {} - - }; - - // C++ wrapper for shape_definition_representation - struct shape_definition_representation : property_definition_representation, ObjectHelper { shape_definition_representation() : Object("shape_definition_representation") {} - - }; - - // C++ wrapper for shape_dimension_representation - struct shape_dimension_representation : shape_representation, ObjectHelper { shape_dimension_representation() : Object("shape_dimension_representation") {} - - }; - - // C++ wrapper for shape_feature_definition - struct shape_feature_definition : characterized_object, ObjectHelper { shape_feature_definition() : Object("shape_feature_definition") {} - - }; - - // C++ wrapper for shape_representation_with_parameters - struct shape_representation_with_parameters : shape_representation, ObjectHelper { shape_representation_with_parameters() : Object("shape_representation_with_parameters") {} - - }; - - // C++ wrapper for shell_based_surface_model - struct shell_based_surface_model : geometric_representation_item, ObjectHelper { shell_based_surface_model() : Object("shell_based_surface_model") {} - ListOf< shell, 1, 0 >::Out sbsm_boundary; - }; - - // C++ wrapper for shell_based_wireframe_model - struct shell_based_wireframe_model : geometric_representation_item, ObjectHelper { shell_based_wireframe_model() : Object("shell_based_wireframe_model") {} - ListOf< shell, 1, 0 >::Out sbwm_boundary; - }; - - // C++ wrapper for shell_based_wireframe_shape_representation - struct shell_based_wireframe_shape_representation : shape_representation, ObjectHelper { shell_based_wireframe_shape_representation() : Object("shell_based_wireframe_shape_representation") {} - - }; - - // C++ wrapper for si_absorbed_dose_unit - struct si_absorbed_dose_unit : ObjectHelper { si_absorbed_dose_unit() : Object("si_absorbed_dose_unit") {} - - }; - - // C++ wrapper for si_capacitance_unit - struct si_capacitance_unit : ObjectHelper { si_capacitance_unit() : Object("si_capacitance_unit") {} - - }; - - // C++ wrapper for si_conductance_unit - struct si_conductance_unit : ObjectHelper { si_conductance_unit() : Object("si_conductance_unit") {} - - }; - - // C++ wrapper for si_dose_equivalent_unit - struct si_dose_equivalent_unit : ObjectHelper { si_dose_equivalent_unit() : Object("si_dose_equivalent_unit") {} - - }; - - // C++ wrapper for si_electric_charge_unit - struct si_electric_charge_unit : ObjectHelper { si_electric_charge_unit() : Object("si_electric_charge_unit") {} - - }; - - // C++ wrapper for si_electric_potential_unit - struct si_electric_potential_unit : ObjectHelper { si_electric_potential_unit() : Object("si_electric_potential_unit") {} - - }; - - // C++ wrapper for si_energy_unit - struct si_energy_unit : ObjectHelper { si_energy_unit() : Object("si_energy_unit") {} - - }; - - // C++ wrapper for si_force_unit - struct si_force_unit : ObjectHelper { si_force_unit() : Object("si_force_unit") {} - - }; - - // C++ wrapper for si_frequency_unit - struct si_frequency_unit : ObjectHelper { si_frequency_unit() : Object("si_frequency_unit") {} - - }; - - // C++ wrapper for si_illuminance_unit - struct si_illuminance_unit : ObjectHelper { si_illuminance_unit() : Object("si_illuminance_unit") {} - - }; - - // C++ wrapper for si_inductance_unit - struct si_inductance_unit : ObjectHelper { si_inductance_unit() : Object("si_inductance_unit") {} - - }; - - // C++ wrapper for si_magnetic_flux_density_unit - struct si_magnetic_flux_density_unit : ObjectHelper { si_magnetic_flux_density_unit() : Object("si_magnetic_flux_density_unit") {} - - }; - - // C++ wrapper for si_magnetic_flux_unit - struct si_magnetic_flux_unit : ObjectHelper { si_magnetic_flux_unit() : Object("si_magnetic_flux_unit") {} - - }; - - // C++ wrapper for si_power_unit - struct si_power_unit : ObjectHelper { si_power_unit() : Object("si_power_unit") {} - - }; - - // C++ wrapper for si_pressure_unit - struct si_pressure_unit : ObjectHelper { si_pressure_unit() : Object("si_pressure_unit") {} - - }; - - // C++ wrapper for si_radioactivity_unit - struct si_radioactivity_unit : ObjectHelper { si_radioactivity_unit() : Object("si_radioactivity_unit") {} - - }; - - // C++ wrapper for si_resistance_unit - struct si_resistance_unit : ObjectHelper { si_resistance_unit() : Object("si_resistance_unit") {} - - }; - - // C++ wrapper for si_unit - struct si_unit : named_unit, ObjectHelper { si_unit() : Object("si_unit") {} - Maybe< si_prefix::Out > prefix; - si_unit_name::Out name; - }; - - // C++ wrapper for simple_boolean_expression - struct simple_boolean_expression : ObjectHelper { simple_boolean_expression() : Object("simple_boolean_expression") {} - - }; - - // C++ wrapper for simple_numeric_expression - struct simple_numeric_expression : ObjectHelper { simple_numeric_expression() : Object("simple_numeric_expression") {} - - }; - - // C++ wrapper for slash_expression - struct slash_expression : binary_numeric_expression, ObjectHelper { slash_expression() : Object("slash_expression") {} - - }; - - // C++ wrapper for smeared_material_definition - struct smeared_material_definition : zone_structural_makeup, ObjectHelper { smeared_material_definition() : Object("smeared_material_definition") {} - - }; - - // C++ wrapper for solid_angle_measure_with_unit - struct solid_angle_measure_with_unit : measure_with_unit, ObjectHelper { solid_angle_measure_with_unit() : Object("solid_angle_measure_with_unit") {} - - }; - - // C++ wrapper for solid_angle_unit - struct solid_angle_unit : named_unit, ObjectHelper { solid_angle_unit() : Object("solid_angle_unit") {} - - }; - - // C++ wrapper for solid_curve_font - struct solid_curve_font : pre_defined_curve_font, ObjectHelper { solid_curve_font() : Object("solid_curve_font") {} - - }; - - // C++ wrapper for solid_replica - struct solid_replica : solid_model, ObjectHelper { solid_replica() : Object("solid_replica") {} - Lazy< solid_model > parent_solid; - Lazy< cartesian_transformation_operator_3d > transformation; - }; - - // C++ wrapper for solid_with_chamfered_edges - struct solid_with_chamfered_edges : edge_blended_solid, ObjectHelper { solid_with_chamfered_edges() : Object("solid_with_chamfered_edges") {} - - }; - - // C++ wrapper for solid_with_angle_based_chamfer - struct solid_with_angle_based_chamfer : solid_with_chamfered_edges, ObjectHelper { solid_with_angle_based_chamfer() : Object("solid_with_angle_based_chamfer") {} - positive_length_measure::Out offset_distance; - BOOLEAN::Out left_offset; - positive_plane_angle_measure::Out offset_angle; - }; - - // C++ wrapper for solid_with_shape_element_pattern - struct solid_with_shape_element_pattern : modified_solid_with_placed_configuration, ObjectHelper { solid_with_shape_element_pattern() : Object("solid_with_shape_element_pattern") {} - Lazy< modified_solid_with_placed_configuration > replicated_element; - }; - - // C++ wrapper for solid_with_circular_pattern - struct solid_with_circular_pattern : solid_with_shape_element_pattern, ObjectHelper { solid_with_circular_pattern() : Object("solid_with_circular_pattern") {} - positive_integer::Out replicate_count; - plane_angle_measure::Out angular_spacing; - BOOLEAN::Out radial_alignment; - Lazy< point > reference_point; - }; - - // C++ wrapper for solid_with_depression - struct solid_with_depression : modified_solid_with_placed_configuration, ObjectHelper { solid_with_depression() : Object("solid_with_depression") {} - positive_length_measure::Out depth; - }; - - // C++ wrapper for solid_with_pocket - struct solid_with_pocket : solid_with_depression, ObjectHelper { solid_with_pocket() : Object("solid_with_pocket") {} - non_negative_length_measure::Out floor_blend_radius; - plane_angle_measure::Out draft_angle; - }; - - // C++ wrapper for solid_with_circular_pocket - struct solid_with_circular_pocket : solid_with_pocket, ObjectHelper { solid_with_circular_pocket() : Object("solid_with_circular_pocket") {} - positive_length_measure::Out pocket_radius; - }; - - // C++ wrapper for solid_with_protrusion - struct solid_with_protrusion : modified_solid_with_placed_configuration, ObjectHelper { solid_with_protrusion() : Object("solid_with_protrusion") {} - positive_length_measure::Out protrusion_height; - plane_angle_measure::Out protrusion_draft_angle; - }; - - // C++ wrapper for solid_with_circular_protrusion - struct solid_with_circular_protrusion : solid_with_protrusion, ObjectHelper { solid_with_circular_protrusion() : Object("solid_with_circular_protrusion") {} - positive_length_measure::Out protrusion_radius; - }; - - // C++ wrapper for solid_with_hole - struct solid_with_hole : solid_with_depression, ObjectHelper { solid_with_hole() : Object("solid_with_hole") {} - - }; - - // C++ wrapper for solid_with_stepped_round_hole - struct solid_with_stepped_round_hole : solid_with_hole, ObjectHelper { solid_with_stepped_round_hole() : Object("solid_with_stepped_round_hole") {} - positive_integer::Out segments; - }; - - // C++ wrapper for solid_with_conical_bottom_round_hole - struct solid_with_conical_bottom_round_hole : solid_with_stepped_round_hole, ObjectHelper { solid_with_conical_bottom_round_hole() : Object("solid_with_conical_bottom_round_hole") {} - positive_plane_angle_measure::Out semi_apex_angle; - non_negative_length_measure::Out tip_radius; - }; - - // C++ wrapper for solid_with_constant_radius_edge_blend - struct solid_with_constant_radius_edge_blend : edge_blended_solid, ObjectHelper { solid_with_constant_radius_edge_blend() : Object("solid_with_constant_radius_edge_blend") {} - positive_length_measure::Out radius; - }; - - // C++ wrapper for solid_with_slot - struct solid_with_slot : solid_with_depression, ObjectHelper { solid_with_slot() : Object("solid_with_slot") {} - positive_length_measure::Out slot_width; - ListOf< LOGICAL, 2, 2 >::Out closed_ends; - }; - - // C++ wrapper for solid_with_curved_slot - struct solid_with_curved_slot : solid_with_slot, ObjectHelper { solid_with_curved_slot() : Object("solid_with_curved_slot") {} - Lazy< bounded_curve > slot_centreline; - }; - - // C++ wrapper for solid_with_double_offset_chamfer - struct solid_with_double_offset_chamfer : solid_with_chamfered_edges, ObjectHelper { solid_with_double_offset_chamfer() : Object("solid_with_double_offset_chamfer") {} - positive_length_measure::Out left_offset_distance; - positive_length_measure::Out right_offset_distance; - }; - - // C++ wrapper for solid_with_flat_bottom_round_hole - struct solid_with_flat_bottom_round_hole : solid_with_stepped_round_hole, ObjectHelper { solid_with_flat_bottom_round_hole() : Object("solid_with_flat_bottom_round_hole") {} - non_negative_length_measure::Out fillet_radius; - }; - - // C++ wrapper for solid_with_general_pocket - struct solid_with_general_pocket : solid_with_pocket, ObjectHelper { solid_with_general_pocket() : Object("solid_with_general_pocket") {} - Lazy< positioned_sketch > profile; - Lazy< point > reference_point; - }; - - // C++ wrapper for solid_with_general_protrusion - struct solid_with_general_protrusion : solid_with_protrusion, ObjectHelper { solid_with_general_protrusion() : Object("solid_with_general_protrusion") {} - Lazy< positioned_sketch > profile; - Lazy< point > reference_point; - }; - - // C++ wrapper for solid_with_groove - struct solid_with_groove : solid_with_depression, ObjectHelper { solid_with_groove() : Object("solid_with_groove") {} - positive_length_measure::Out groove_radius; - positive_length_measure::Out groove_width; - plane_angle_measure::Out draft_angle; - non_negative_length_measure::Out floor_fillet_radius; - BOOLEAN::Out external_groove; - }; - - // C++ wrapper for solid_with_incomplete_circular_pattern - struct solid_with_incomplete_circular_pattern : solid_with_circular_pattern, ObjectHelper { solid_with_incomplete_circular_pattern() : Object("solid_with_incomplete_circular_pattern") {} - ListOf< positive_integer, 1, 0 >::Out omitted_instances; - }; - - // C++ wrapper for solid_with_rectangular_pattern - struct solid_with_rectangular_pattern : solid_with_shape_element_pattern, ObjectHelper { solid_with_rectangular_pattern() : Object("solid_with_rectangular_pattern") {} - positive_integer::Out row_count; - positive_integer::Out column_count; - length_measure::Out row_spacing; - length_measure::Out column_spacing; - }; - - // C++ wrapper for solid_with_incomplete_rectangular_pattern - struct solid_with_incomplete_rectangular_pattern : solid_with_rectangular_pattern, ObjectHelper { solid_with_incomplete_rectangular_pattern() : Object("solid_with_incomplete_rectangular_pattern") {} - - }; - - // C++ wrapper for solid_with_rectangular_pocket - struct solid_with_rectangular_pocket : solid_with_pocket, ObjectHelper { solid_with_rectangular_pocket() : Object("solid_with_rectangular_pocket") {} - positive_length_measure::Out pocket_length; - positive_length_measure::Out pocket_width; - non_negative_length_measure::Out corner_radius; - }; - - // C++ wrapper for solid_with_rectangular_protrusion - struct solid_with_rectangular_protrusion : solid_with_protrusion, ObjectHelper { solid_with_rectangular_protrusion() : Object("solid_with_rectangular_protrusion") {} - positive_length_measure::Out protrusion_length; - positive_length_measure::Out protrusion_width; - non_negative_length_measure::Out protrusion_corner_radius; - }; - - // C++ wrapper for solid_with_single_offset_chamfer - struct solid_with_single_offset_chamfer : solid_with_chamfered_edges, ObjectHelper { solid_with_single_offset_chamfer() : Object("solid_with_single_offset_chamfer") {} - positive_length_measure::Out offset_distance; - }; - - // C++ wrapper for solid_with_spherical_bottom_round_hole - struct solid_with_spherical_bottom_round_hole : solid_with_stepped_round_hole, ObjectHelper { solid_with_spherical_bottom_round_hole() : Object("solid_with_spherical_bottom_round_hole") {} - positive_length_measure::Out sphere_radius; - }; - - // C++ wrapper for solid_with_stepped_round_hole_and_conical_transitions - struct solid_with_stepped_round_hole_and_conical_transitions : solid_with_stepped_round_hole, ObjectHelper { solid_with_stepped_round_hole_and_conical_transitions() : Object("solid_with_stepped_round_hole_and_conical_transitions") {} - ListOf< Lazy< conical_stepped_hole_transition >, 1, 0 > conical_transitions; - }; - - // C++ wrapper for solid_with_straight_slot - struct solid_with_straight_slot : solid_with_slot, ObjectHelper { solid_with_straight_slot() : Object("solid_with_straight_slot") {} - positive_length_measure::Out slot_length; - }; - - // C++ wrapper for solid_with_tee_section_slot - struct solid_with_tee_section_slot : solid_with_slot, ObjectHelper { solid_with_tee_section_slot() : Object("solid_with_tee_section_slot") {} - positive_length_measure::Out tee_section_width; - positive_length_measure::Out collar_depth; - }; - - // C++ wrapper for solid_with_through_depression - struct solid_with_through_depression : solid_with_depression, ObjectHelper { solid_with_through_depression() : Object("solid_with_through_depression") {} - ListOf< Lazy< face_surface >, 1, 0 > exit_faces; - }; - - // C++ wrapper for solid_with_trapezoidal_section_slot - struct solid_with_trapezoidal_section_slot : solid_with_slot, ObjectHelper { solid_with_trapezoidal_section_slot() : Object("solid_with_trapezoidal_section_slot") {} - plane_angle_measure::Out draft_angle; - non_negative_length_measure::Out floor_fillet_radius; - }; - - // C++ wrapper for solid_with_variable_radius_edge_blend - struct solid_with_variable_radius_edge_blend : ObjectHelper { solid_with_variable_radius_edge_blend() : Object("solid_with_variable_radius_edge_blend") {} - ListOf< Lazy< point >, 2, 0 > point_list; - ListOf< positive_length_measure, 2, 0 >::Out radius_list; - ListOf< blend_radius_variation_type, 1, 0 >::Out edge_function_list; - }; - - // C++ wrapper for source_for_requirement - struct source_for_requirement : group_assignment, ObjectHelper { source_for_requirement() : Object("source_for_requirement") {} - ListOf< requirement_source_item, 1, 1 >::Out items; - }; - - // C++ wrapper for sourced_requirement - struct sourced_requirement : group_assignment, ObjectHelper { sourced_requirement() : Object("sourced_requirement") {} - ListOf< Lazy< product_definition >, 1, 1 > items; - }; - - // C++ wrapper for specification_definition - struct specification_definition : product_definition, ObjectHelper { specification_definition() : Object("specification_definition") {} - - }; - - // C++ wrapper for specified_higher_usage_occurrence - struct specified_higher_usage_occurrence : assembly_component_usage, ObjectHelper { specified_higher_usage_occurrence() : Object("specified_higher_usage_occurrence") {} - Lazy< assembly_component_usage > upper_usage; - Lazy< next_assembly_usage_occurrence > next_usage; - }; - - // C++ wrapper for sphere - struct sphere : geometric_representation_item, ObjectHelper { sphere() : Object("sphere") {} - positive_length_measure::Out radius; - Lazy< point > centre; - }; - - // C++ wrapper for spherical_surface - struct spherical_surface : elementary_surface, ObjectHelper { spherical_surface() : Object("spherical_surface") {} - positive_length_measure::Out radius; - }; - - // C++ wrapper for start_request - struct start_request : action_request_assignment, ObjectHelper { start_request() : Object("start_request") {} - ListOf< start_request_item, 1, 0 >::Out items; - }; - - // C++ wrapper for start_work - struct start_work : action_assignment, ObjectHelper { start_work() : Object("start_work") {} - ListOf< work_item, 1, 0 >::Out items; - }; - - // C++ wrapper for straightness_tolerance - struct straightness_tolerance : geometric_tolerance, ObjectHelper { straightness_tolerance() : Object("straightness_tolerance") {} - - }; - - // C++ wrapper for structured_dimension_callout - struct structured_dimension_callout : draughting_callout, ObjectHelper { structured_dimension_callout() : Object("structured_dimension_callout") {} - - }; - - // C++ wrapper for structured_text_composition - struct structured_text_composition : compound_representation_item, ObjectHelper { structured_text_composition() : Object("structured_text_composition") {} - - }; - - // C++ wrapper for structured_text_representation - struct structured_text_representation : representation, ObjectHelper { structured_text_representation() : Object("structured_text_representation") {} - - }; - - // C++ wrapper for subedge - struct subedge : edge, ObjectHelper { subedge() : Object("subedge") {} - Lazy< edge > parent_edge; - }; - - // C++ wrapper for subface - struct subface : face, ObjectHelper { subface() : Object("subface") {} - Lazy< face > parent_face; - }; - - // C++ wrapper for supplied_part_relationship - struct supplied_part_relationship : product_definition_relationship, ObjectHelper { supplied_part_relationship() : Object("supplied_part_relationship") {} - - }; - - // C++ wrapper for surface_condition_callout - struct surface_condition_callout : draughting_callout, ObjectHelper { surface_condition_callout() : Object("surface_condition_callout") {} - - }; - - // C++ wrapper for swept_surface - struct swept_surface : surface, ObjectHelper { swept_surface() : Object("swept_surface") {} - Lazy< curve > swept_curve; - }; - - // C++ wrapper for surface_of_linear_extrusion - struct surface_of_linear_extrusion : swept_surface, ObjectHelper { surface_of_linear_extrusion() : Object("surface_of_linear_extrusion") {} - Lazy< vector > extrusion_axis; - }; - - // C++ wrapper for surface_of_revolution - struct surface_of_revolution : swept_surface, ObjectHelper { surface_of_revolution() : Object("surface_of_revolution") {} - Lazy< axis1_placement > axis_position; - }; - - // C++ wrapper for surface_patch - struct surface_patch : founded_item, ObjectHelper { surface_patch() : Object("surface_patch") {} - Lazy< bounded_surface > parent_surface; - transition_code::Out u_transition; - transition_code::Out v_transition; - BOOLEAN::Out u_sense; - BOOLEAN::Out v_sense; - }; - - // C++ wrapper for surface_profile_tolerance - struct surface_profile_tolerance : geometric_tolerance, ObjectHelper { surface_profile_tolerance() : Object("surface_profile_tolerance") {} - - }; - - // C++ wrapper for surface_replica - struct surface_replica : surface, ObjectHelper { surface_replica() : Object("surface_replica") {} - Lazy< surface > parent_surface; - Lazy< cartesian_transformation_operator_3d > transformation; - }; - - // C++ wrapper for surface_side_style - struct surface_side_style : founded_item, ObjectHelper { surface_side_style() : Object("surface_side_style") {} - label::Out name; - ListOf< surface_style_element_select, 1, 7 >::Out styles; - }; - - // C++ wrapper for surface_style_boundary - struct surface_style_boundary : founded_item, ObjectHelper { surface_style_boundary() : Object("surface_style_boundary") {} - curve_or_render::Out style_of_boundary; - }; - - // C++ wrapper for surface_style_control_grid - struct surface_style_control_grid : founded_item, ObjectHelper { surface_style_control_grid() : Object("surface_style_control_grid") {} - curve_or_render::Out style_of_control_grid; - }; - - // C++ wrapper for surface_style_fill_area - struct surface_style_fill_area : founded_item, ObjectHelper { surface_style_fill_area() : Object("surface_style_fill_area") {} - Lazy< fill_area_style > fill_area; - }; - - // C++ wrapper for surface_style_parameter_line - struct surface_style_parameter_line : founded_item, ObjectHelper { surface_style_parameter_line() : Object("surface_style_parameter_line") {} - curve_or_render::Out style_of_parameter_lines; - ListOf< direction_count_select, 1, 2 >::Out direction_counts; - }; - - // C++ wrapper for surface_style_reflectance_ambient - struct surface_style_reflectance_ambient : ObjectHelper { surface_style_reflectance_ambient() : Object("surface_style_reflectance_ambient") {} - REAL::Out ambient_reflectance; - }; - - // C++ wrapper for surface_style_reflectance_ambient_diffuse - struct surface_style_reflectance_ambient_diffuse : surface_style_reflectance_ambient, ObjectHelper { surface_style_reflectance_ambient_diffuse() : Object("surface_style_reflectance_ambient_diffuse") {} - REAL::Out diffuse_reflectance; - }; - - // C++ wrapper for surface_style_reflectance_ambient_diffuse_specular - struct surface_style_reflectance_ambient_diffuse_specular : surface_style_reflectance_ambient_diffuse, ObjectHelper { surface_style_reflectance_ambient_diffuse_specular() : Object("surface_style_reflectance_ambient_diffuse_specular") {} - REAL::Out specular_reflectance; - REAL::Out specular_exponent; - Lazy< colour > specular_colour; - }; - - // C++ wrapper for surface_style_rendering - struct surface_style_rendering : ObjectHelper { surface_style_rendering() : Object("surface_style_rendering") {} - shading_surface_method::Out rendering_method; - Lazy< colour > surface_colour; - }; - - // C++ wrapper for surface_style_rendering_with_properties - struct surface_style_rendering_with_properties : surface_style_rendering, ObjectHelper { surface_style_rendering_with_properties() : Object("surface_style_rendering_with_properties") {} - ListOf< rendering_properties_select, 1, 2 >::Out properties; - }; - - // C++ wrapper for surface_style_segmentation_curve - struct surface_style_segmentation_curve : founded_item, ObjectHelper { surface_style_segmentation_curve() : Object("surface_style_segmentation_curve") {} - curve_or_render::Out style_of_segmentation_curve; - }; - - // C++ wrapper for surface_style_silhouette - struct surface_style_silhouette : founded_item, ObjectHelper { surface_style_silhouette() : Object("surface_style_silhouette") {} - curve_or_render::Out style_of_silhouette; - }; - - // C++ wrapper for surface_style_usage - struct surface_style_usage : founded_item, ObjectHelper { surface_style_usage() : Object("surface_style_usage") {} - surface_side::Out side; - surface_side_style_select::Out style; - }; - - // C++ wrapper for surface_texture_representation - struct surface_texture_representation : representation, ObjectHelper { surface_texture_representation() : Object("surface_texture_representation") {} - - }; - - // C++ wrapper for surfaced_open_shell - struct surfaced_open_shell : open_shell, ObjectHelper { surfaced_open_shell() : Object("surfaced_open_shell") {} - - }; - - // C++ wrapper for swept_disk_solid - struct swept_disk_solid : solid_model, ObjectHelper { swept_disk_solid() : Object("swept_disk_solid") {} - Lazy< curve > directrix; - positive_length_measure::Out radius; - Maybe< positive_length_measure::Out > inner_radius; - REAL::Out start_param; - REAL::Out end_param; - }; - - // C++ wrapper for symbol - struct symbol : representation_item, ObjectHelper { symbol() : Object("symbol") {} - - }; - - // C++ wrapper for symbol_representation_map - struct symbol_representation_map : representation_map, ObjectHelper { symbol_representation_map() : Object("symbol_representation_map") {} - - }; - - // C++ wrapper for symbol_style - struct symbol_style : founded_item, ObjectHelper { symbol_style() : Object("symbol_style") {} - label::Out name; - symbol_style_select::Out style_of_symbol; - }; - - // C++ wrapper for symbol_target - struct symbol_target : geometric_representation_item, ObjectHelper { symbol_target() : Object("symbol_target") {} - axis2_placement::Out placement; - positive_ratio_measure::Out x_scale; - positive_ratio_measure::Out y_scale; - }; - - // C++ wrapper for symmetric_shape_aspect - struct symmetric_shape_aspect : shape_aspect, ObjectHelper { symmetric_shape_aspect() : Object("symmetric_shape_aspect") {} - - }; - - // C++ wrapper for symmetry_tolerance - struct symmetry_tolerance : geometric_tolerance_with_datum_reference, ObjectHelper { symmetry_tolerance() : Object("symmetry_tolerance") {} - - }; - - // C++ wrapper for table_representation_item - struct table_representation_item : compound_representation_item, ObjectHelper { table_representation_item() : Object("table_representation_item") {} - - }; - - // C++ wrapper for tactile_appearance_representation - struct tactile_appearance_representation : representation, ObjectHelper { tactile_appearance_representation() : Object("tactile_appearance_representation") {} - - }; - - // C++ wrapper for tagged_text_format - struct tagged_text_format : representation_context, ObjectHelper { tagged_text_format() : Object("tagged_text_format") {} - - }; - - // C++ wrapper for tagged_text_item - struct tagged_text_item : descriptive_representation_item, ObjectHelper { tagged_text_item() : Object("tagged_text_item") {} - - }; - - // C++ wrapper for tangent - struct tangent : derived_shape_aspect, ObjectHelper { tangent() : Object("tangent") {} - - }; - - // C++ wrapper for text_literal_with_associated_curves - struct text_literal_with_associated_curves : text_literal, ObjectHelper { text_literal_with_associated_curves() : Object("text_literal_with_associated_curves") {} - ListOf< Lazy< curve >, 1, 0 > associated_curves; - }; - - // C++ wrapper for text_literal_with_blanking_box - struct text_literal_with_blanking_box : text_literal, ObjectHelper { text_literal_with_blanking_box() : Object("text_literal_with_blanking_box") {} - Lazy< planar_box > blanking; - }; - - // C++ wrapper for text_literal_with_extent - struct text_literal_with_extent : text_literal, ObjectHelper { text_literal_with_extent() : Object("text_literal_with_extent") {} - Lazy< planar_extent > extent; - }; - - // C++ wrapper for text_string_representation - struct text_string_representation : representation, ObjectHelper { text_string_representation() : Object("text_string_representation") {} - - }; - - // C++ wrapper for text_style - struct text_style : founded_item, ObjectHelper { text_style() : Object("text_style") {} - label::Out name; - character_style_select::Out character_appearance; - }; - - // C++ wrapper for text_style_with_box_characteristics - struct text_style_with_box_characteristics : text_style, ObjectHelper { text_style_with_box_characteristics() : Object("text_style_with_box_characteristics") {} - ListOf< box_characteristic_select, 1, 4 >::Out characteristics; - }; - - // C++ wrapper for text_style_with_mirror - struct text_style_with_mirror : text_style, ObjectHelper { text_style_with_mirror() : Object("text_style_with_mirror") {} - axis2_placement::Out mirror_placement; - }; - - // C++ wrapper for text_style_with_spacing - struct text_style_with_spacing : text_style, ObjectHelper { text_style_with_spacing() : Object("text_style_with_spacing") {} - character_spacing_select::Out character_spacing; - }; - - // C++ wrapper for thermal_resistance_measure_with_unit - struct thermal_resistance_measure_with_unit : measure_with_unit, ObjectHelper { thermal_resistance_measure_with_unit() : Object("thermal_resistance_measure_with_unit") {} - - }; - - // C++ wrapper for thermal_resistance_unit - struct thermal_resistance_unit : derived_unit, ObjectHelper { thermal_resistance_unit() : Object("thermal_resistance_unit") {} - - }; - - // C++ wrapper for thermodynamic_temperature_measure_with_unit - struct thermodynamic_temperature_measure_with_unit : measure_with_unit, ObjectHelper { thermodynamic_temperature_measure_with_unit() : Object("thermodynamic_temperature_measure_with_unit") {} - - }; - - // C++ wrapper for thermodynamic_temperature_unit - struct thermodynamic_temperature_unit : named_unit, ObjectHelper { thermodynamic_temperature_unit() : Object("thermodynamic_temperature_unit") {} - - }; - - // C++ wrapper for thickened_face_solid - struct thickened_face_solid : solid_model, ObjectHelper { thickened_face_solid() : Object("thickened_face_solid") {} - generalized_surface_select::Out base_element; - length_measure::Out offset1; - length_measure::Out offset2; - }; - - // C++ wrapper for thickness_laminate_definition - struct thickness_laminate_definition : product_definition, ObjectHelper { thickness_laminate_definition() : Object("thickness_laminate_definition") {} - - }; - - // C++ wrapper for thickness_laminate_table - struct thickness_laminate_table : zone_structural_makeup, ObjectHelper { thickness_laminate_table() : Object("thickness_laminate_table") {} - - }; - - // C++ wrapper for time_interval - struct time_interval : ObjectHelper { time_interval() : Object("time_interval") {} - identifier::Out id; - label::Out name; - Maybe< text::Out > description; - }; - - // C++ wrapper for time_interval_based_effectivity - struct time_interval_based_effectivity : effectivity, ObjectHelper { time_interval_based_effectivity() : Object("time_interval_based_effectivity") {} - Lazy< time_interval > effectivity_period; - }; - - // C++ wrapper for time_interval_with_bounds - struct time_interval_with_bounds : time_interval, ObjectHelper { time_interval_with_bounds() : Object("time_interval_with_bounds") {} - Maybe< date_time_or_event_occurrence::Out > primary_bound; - Maybe< date_time_or_event_occurrence::Out > secondary_bound; - Maybe< Lazy< time_measure_with_unit > > duration; - }; - - // C++ wrapper for time_measure_with_unit - struct time_measure_with_unit : measure_with_unit, ObjectHelper { time_measure_with_unit() : Object("time_measure_with_unit") {} - - }; - - // C++ wrapper for time_unit - struct time_unit : named_unit, ObjectHelper { time_unit() : Object("time_unit") {} - - }; - - // C++ wrapper for tolerance_zone - struct tolerance_zone : shape_aspect, ObjectHelper { tolerance_zone() : Object("tolerance_zone") {} - ListOf< Lazy< geometric_tolerance >, 1, 0 > defining_tolerance; - Lazy< NotImplemented > form; - }; - - // C++ wrapper for torus - struct torus : geometric_representation_item, ObjectHelper { torus() : Object("torus") {} - Lazy< axis1_placement > position; - positive_length_measure::Out major_radius; - positive_length_measure::Out minor_radius; - }; - - // C++ wrapper for total_runout_tolerance - struct total_runout_tolerance : geometric_tolerance_with_datum_reference, ObjectHelper { total_runout_tolerance() : Object("total_runout_tolerance") {} - - }; - - // C++ wrapper for track_blended_solid - struct track_blended_solid : edge_blended_solid, ObjectHelper { track_blended_solid() : Object("track_blended_solid") {} - - }; - - // C++ wrapper for track_blended_solid_with_end_conditions - struct track_blended_solid_with_end_conditions : track_blended_solid, ObjectHelper { track_blended_solid_with_end_conditions() : Object("track_blended_solid_with_end_conditions") {} - ListOf< blend_end_condition_select, 2, 2 >::Out end_conditions; - }; - - // C++ wrapper for trimmed_curve - struct trimmed_curve : bounded_curve, ObjectHelper { trimmed_curve() : Object("trimmed_curve") {} - Lazy< curve > basis_curve; - ListOf< trimming_select, 1, 2 >::Out trim_1; - ListOf< trimming_select, 1, 2 >::Out trim_2; - BOOLEAN::Out sense_agreement; - trimming_preference::Out master_representation; - }; - - // C++ wrapper for two_direction_repeat_factor - struct two_direction_repeat_factor : one_direction_repeat_factor, ObjectHelper { two_direction_repeat_factor() : Object("two_direction_repeat_factor") {} - Lazy< vector > second_repeat_factor; - }; - - // C++ wrapper for unary_generic_expression - struct unary_generic_expression : generic_expression, ObjectHelper { unary_generic_expression() : Object("unary_generic_expression") {} - Lazy< generic_expression > operand; - }; - - // C++ wrapper for unary_numeric_expression - struct unary_numeric_expression : ObjectHelper { unary_numeric_expression() : Object("unary_numeric_expression") {} - - }; - - // C++ wrapper for uncertainty_assigned_representation - struct uncertainty_assigned_representation : representation, ObjectHelper { uncertainty_assigned_representation() : Object("uncertainty_assigned_representation") {} - ListOf< Lazy< uncertainty_measure_with_unit >, 1, 0 > uncertainty; - }; - - // C++ wrapper for uncertainty_measure_with_unit - struct uncertainty_measure_with_unit : measure_with_unit, ObjectHelper { uncertainty_measure_with_unit() : Object("uncertainty_measure_with_unit") {} - label::Out name; - Maybe< text::Out > description; - }; - - // C++ wrapper for uniform_curve - struct uniform_curve : b_spline_curve, ObjectHelper { uniform_curve() : Object("uniform_curve") {} - - }; - - // C++ wrapper for uniform_resource_identifier - struct uniform_resource_identifier : descriptive_representation_item, ObjectHelper { uniform_resource_identifier() : Object("uniform_resource_identifier") {} - - }; - - // C++ wrapper for uniform_surface - struct uniform_surface : b_spline_surface, ObjectHelper { uniform_surface() : Object("uniform_surface") {} - - }; - - // C++ wrapper for usage_association - struct usage_association : action_method_relationship, ObjectHelper { usage_association() : Object("usage_association") {} - - }; - - // C++ wrapper for user_defined_curve_font - struct user_defined_curve_font : ObjectHelper { user_defined_curve_font() : Object("user_defined_curve_font") {} - - }; - - // C++ wrapper for user_defined_marker - struct user_defined_marker : ObjectHelper { user_defined_marker() : Object("user_defined_marker") {} - - }; - - // C++ wrapper for user_defined_terminator_symbol - struct user_defined_terminator_symbol : ObjectHelper { user_defined_terminator_symbol() : Object("user_defined_terminator_symbol") {} - - }; - - // C++ wrapper for user_selected_shape_elements - struct user_selected_shape_elements : user_selected_elements, ObjectHelper { user_selected_shape_elements() : Object("user_selected_shape_elements") {} - - }; - - // C++ wrapper for value_range - struct value_range : compound_representation_item, ObjectHelper { value_range() : Object("value_range") {} - - }; - - // C++ wrapper for value_representation_item - struct value_representation_item : representation_item, ObjectHelper { value_representation_item() : Object("value_representation_item") {} - measure_value::Out value_component; - }; - - // C++ wrapper for variable_semantics - struct variable_semantics : ObjectHelper { variable_semantics() : Object("variable_semantics") {} - - }; - - // C++ wrapper for variational_representation_item - struct variational_representation_item : representation_item, ObjectHelper { variational_representation_item() : Object("variational_representation_item") {} - - }; - - // C++ wrapper for vector - struct vector : geometric_representation_item, ObjectHelper { vector() : Object("vector") {} - Lazy< direction > orientation; - length_measure::Out magnitude; - }; - - // C++ wrapper for vector_style - struct vector_style : ObjectHelper { vector_style() : Object("vector_style") {} - - }; - - // C++ wrapper for velocity_measure_with_unit - struct velocity_measure_with_unit : measure_with_unit, ObjectHelper { velocity_measure_with_unit() : Object("velocity_measure_with_unit") {} - - }; - - // C++ wrapper for velocity_unit - struct velocity_unit : derived_unit, ObjectHelper { velocity_unit() : Object("velocity_unit") {} - - }; - - // C++ wrapper for vertex - struct vertex : topological_representation_item, ObjectHelper { vertex() : Object("vertex") {} - - }; - - // C++ wrapper for vertex_loop - struct vertex_loop : loop, ObjectHelper { vertex_loop() : Object("vertex_loop") {} - Lazy< vertex > loop_vertex; - }; - - // C++ wrapper for vertex_point - struct vertex_point : ObjectHelper { vertex_point() : Object("vertex_point") {} - Lazy< point > vertex_geometry; - }; - - // C++ wrapper for vertex_shell - struct vertex_shell : topological_representation_item, ObjectHelper { vertex_shell() : Object("vertex_shell") {} - Lazy< vertex_loop > vertex_shell_extent; - }; - - // C++ wrapper for view_volume - struct view_volume : founded_item, ObjectHelper { view_volume() : Object("view_volume") {} - central_or_parallel::Out projection_type; - Lazy< cartesian_point > projection_point; - length_measure::Out view_plane_distance; - length_measure::Out front_plane_distance; - BOOLEAN::Out front_plane_clipping; - length_measure::Out back_plane_distance; - BOOLEAN::Out back_plane_clipping; - BOOLEAN::Out view_volume_sides_clipping; - Lazy< planar_box > view_window; - }; - - // C++ wrapper for visual_appearance_representation - struct visual_appearance_representation : representation, ObjectHelper { visual_appearance_representation() : Object("visual_appearance_representation") {} - - }; - - // C++ wrapper for volume_measure_with_unit - struct volume_measure_with_unit : measure_with_unit, ObjectHelper { volume_measure_with_unit() : Object("volume_measure_with_unit") {} - - }; - - // C++ wrapper for volume_unit - struct volume_unit : derived_unit, ObjectHelper { volume_unit() : Object("volume_unit") {} - - }; - - // C++ wrapper for week_of_year_and_day_date - struct week_of_year_and_day_date : date, ObjectHelper { week_of_year_and_day_date() : Object("week_of_year_and_day_date") {} - week_in_year_number::Out week_component; - Maybe< day_in_week_number::Out > day_component; - }; - - // C++ wrapper for wire_shell - struct wire_shell : topological_representation_item, ObjectHelper { wire_shell() : Object("wire_shell") {} - ListOf< Lazy< loop >, 1, 0 > wire_shell_extent; - }; - - // C++ wrapper for year_month - struct year_month : date, ObjectHelper { year_month() : Object("year_month") {} - month_in_year_number::Out month_component; - }; - - void GetSchema(EXPRESS::ConversionSchema& out); - -} //! StepFile -namespace STEP { - - // ****************************************************************************** - // Converter stubs - // ****************************************************************************** - -#define DECL_CONV_STUB(type) template <> size_t GenericFill(const STEP::DB& db, const EXPRESS::LIST& params, StepFile::type* in) - - DECL_CONV_STUB(measure_with_unit); - DECL_CONV_STUB(absorbed_dose_measure_with_unit); - DECL_CONV_STUB(derived_unit); - DECL_CONV_STUB(absorbed_dose_unit); - DECL_CONV_STUB(abstract_variable); - DECL_CONV_STUB(acceleration_measure_with_unit); - DECL_CONV_STUB(acceleration_unit); - DECL_CONV_STUB(action); - DECL_CONV_STUB(action_assignment); - DECL_CONV_STUB(action_method); - DECL_CONV_STUB(action_method_assignment); - DECL_CONV_STUB(action_method_relationship); - DECL_CONV_STUB(action_request_assignment); - DECL_CONV_STUB(address); - DECL_CONV_STUB(representation); - DECL_CONV_STUB(shape_representation); - DECL_CONV_STUB(advanced_brep_shape_representation); - DECL_CONV_STUB(face_surface); - DECL_CONV_STUB(advanced_face); - DECL_CONV_STUB(amount_of_substance_measure_with_unit); - DECL_CONV_STUB(named_unit); - DECL_CONV_STUB(amount_of_substance_unit); - DECL_CONV_STUB(angle_direction_reference); - DECL_CONV_STUB(representation_item); - DECL_CONV_STUB(geometric_representation_item); - DECL_CONV_STUB(draughting_callout); - DECL_CONV_STUB(dimension_curve_directed_callout); - DECL_CONV_STUB(angular_dimension); - DECL_CONV_STUB(shape_aspect_relationship); - DECL_CONV_STUB(dimensional_location); - DECL_CONV_STUB(angular_location); - DECL_CONV_STUB(dimensional_size); - DECL_CONV_STUB(angular_size); - DECL_CONV_STUB(geometric_tolerance); - DECL_CONV_STUB(geometric_tolerance_with_datum_reference); - DECL_CONV_STUB(angularity_tolerance); - DECL_CONV_STUB(styled_item); - DECL_CONV_STUB(annotation_occurrence); - DECL_CONV_STUB(annotation_curve_occurrence); - DECL_CONV_STUB(annotation_fill_area); - DECL_CONV_STUB(annotation_fill_area_occurrence); - DECL_CONV_STUB(annotation_occurrence_relationship); - DECL_CONV_STUB(annotation_occurrence_associativity); - DECL_CONV_STUB(annotation_plane); - DECL_CONV_STUB(annotation_symbol_occurrence); - DECL_CONV_STUB(annotation_subfigure_occurrence); - DECL_CONV_STUB(mapped_item); - DECL_CONV_STUB(annotation_symbol); - DECL_CONV_STUB(annotation_text); - DECL_CONV_STUB(annotation_text_character); - DECL_CONV_STUB(annotation_text_occurrence); - DECL_CONV_STUB(shape_aspect); - DECL_CONV_STUB(derived_shape_aspect); - DECL_CONV_STUB(apex); - DECL_CONV_STUB(application_context_element); - DECL_CONV_STUB(applied_action_assignment); - DECL_CONV_STUB(applied_action_method_assignment); - DECL_CONV_STUB(applied_action_request_assignment); - DECL_CONV_STUB(approval_assignment); - DECL_CONV_STUB(applied_approval_assignment); - DECL_CONV_STUB(attribute_classification_assignment); - DECL_CONV_STUB(applied_attribute_classification_assignment); - DECL_CONV_STUB(certification_assignment); - DECL_CONV_STUB(applied_certification_assignment); - DECL_CONV_STUB(classification_assignment); - DECL_CONV_STUB(applied_classification_assignment); - DECL_CONV_STUB(contract_assignment); - DECL_CONV_STUB(applied_contract_assignment); - DECL_CONV_STUB(date_and_time_assignment); - DECL_CONV_STUB(applied_date_and_time_assignment); - DECL_CONV_STUB(date_assignment); - DECL_CONV_STUB(applied_date_assignment); - DECL_CONV_STUB(document_reference); - DECL_CONV_STUB(applied_document_reference); - DECL_CONV_STUB(document_usage_constraint_assignment); - DECL_CONV_STUB(applied_document_usage_constraint_assignment); - DECL_CONV_STUB(effectivity_assignment); - DECL_CONV_STUB(applied_effectivity_assignment); - DECL_CONV_STUB(event_occurrence_assignment); - DECL_CONV_STUB(applied_event_occurrence_assignment); - DECL_CONV_STUB(identification_assignment); - DECL_CONV_STUB(external_identification_assignment); - DECL_CONV_STUB(applied_external_identification_assignment); - DECL_CONV_STUB(group_assignment); - DECL_CONV_STUB(applied_group_assignment); - DECL_CONV_STUB(applied_identification_assignment); - DECL_CONV_STUB(name_assignment); - DECL_CONV_STUB(applied_name_assignment); - DECL_CONV_STUB(organization_assignment); - DECL_CONV_STUB(applied_organization_assignment); - DECL_CONV_STUB(organizational_project_assignment); - DECL_CONV_STUB(applied_organizational_project_assignment); - DECL_CONV_STUB(person_and_organization_assignment); - DECL_CONV_STUB(applied_person_and_organization_assignment); - DECL_CONV_STUB(presented_item); - DECL_CONV_STUB(applied_presented_item); - DECL_CONV_STUB(security_classification_assignment); - DECL_CONV_STUB(applied_security_classification_assignment); - DECL_CONV_STUB(time_interval_assignment); - DECL_CONV_STUB(applied_time_interval_assignment); - DECL_CONV_STUB(applied_usage_right); - DECL_CONV_STUB(area_in_set); - DECL_CONV_STUB(area_measure_with_unit); - DECL_CONV_STUB(area_unit); - DECL_CONV_STUB(product_definition_relationship); - DECL_CONV_STUB(product_definition_usage); - DECL_CONV_STUB(assembly_component_usage); - DECL_CONV_STUB(assigned_requirement); - DECL_CONV_STUB(compound_representation_item); - DECL_CONV_STUB(atomic_formula); - DECL_CONV_STUB(attribute_assertion); - DECL_CONV_STUB(attribute_language_assignment); - DECL_CONV_STUB(attribute_value_assignment); - DECL_CONV_STUB(auxiliary_geometric_representation_item); - DECL_CONV_STUB(placement); - DECL_CONV_STUB(axis1_placement); - DECL_CONV_STUB(axis2_placement_2d); - DECL_CONV_STUB(axis2_placement_3d); - DECL_CONV_STUB(curve); - DECL_CONV_STUB(bounded_curve); - DECL_CONV_STUB(b_spline_curve); - DECL_CONV_STUB(b_spline_curve_with_knots); - DECL_CONV_STUB(surface); - DECL_CONV_STUB(bounded_surface); - DECL_CONV_STUB(b_spline_surface); - DECL_CONV_STUB(b_spline_surface_with_knots); - DECL_CONV_STUB(product_definition); - DECL_CONV_STUB(rule_software_definition); - DECL_CONV_STUB(rule_definition); - DECL_CONV_STUB(back_chaining_rule); - DECL_CONV_STUB(back_chaining_rule_body); - DECL_CONV_STUB(colour); - DECL_CONV_STUB(background_colour); - DECL_CONV_STUB(beveled_sheet_representation); - DECL_CONV_STUB(bezier_curve); - DECL_CONV_STUB(bezier_surface); - DECL_CONV_STUB(generic_expression); - DECL_CONV_STUB(binary_generic_expression); - DECL_CONV_STUB(binary_numeric_expression); - DECL_CONV_STUB(binary_representation_item); - DECL_CONV_STUB(block); - DECL_CONV_STUB(expression); - DECL_CONV_STUB(boolean_expression); - DECL_CONV_STUB(boolean_literal); - DECL_CONV_STUB(boolean_representation_item); - DECL_CONV_STUB(boolean_result); - DECL_CONV_STUB(composite_curve); - DECL_CONV_STUB(composite_curve_on_surface); - DECL_CONV_STUB(boundary_curve); - DECL_CONV_STUB(bounded_pcurve); - DECL_CONV_STUB(bounded_surface_curve); - DECL_CONV_STUB(founded_item); - DECL_CONV_STUB(box_domain); - DECL_CONV_STUB(half_space_solid); - DECL_CONV_STUB(boxed_half_space); - DECL_CONV_STUB(breakdown_context); - DECL_CONV_STUB(breakdown_element_group_assignment); - DECL_CONV_STUB(breakdown_element_realization); - DECL_CONV_STUB(breakdown_element_usage); - DECL_CONV_STUB(breakdown_of); - DECL_CONV_STUB(solid_model); - DECL_CONV_STUB(manifold_solid_brep); - DECL_CONV_STUB(brep_with_voids); - DECL_CONV_STUB(bytes_representation_item); - DECL_CONV_STUB(date); - DECL_CONV_STUB(calendar_date); - DECL_CONV_STUB(camera_image); - DECL_CONV_STUB(camera_image_3d_with_scale); - DECL_CONV_STUB(camera_model); - DECL_CONV_STUB(camera_model_d3); - DECL_CONV_STUB(camera_model_d3_multi_clipping); - DECL_CONV_STUB(camera_model_d3_multi_clipping_intersection); - DECL_CONV_STUB(camera_model_d3_multi_clipping_union); - DECL_CONV_STUB(camera_model_d3_with_hlhsr); - DECL_CONV_STUB(camera_model_with_light_sources); - DECL_CONV_STUB(representation_map); - DECL_CONV_STUB(camera_usage); - DECL_CONV_STUB(capacitance_measure_with_unit); - DECL_CONV_STUB(capacitance_unit); - DECL_CONV_STUB(point); - DECL_CONV_STUB(cartesian_point); - DECL_CONV_STUB(cartesian_transformation_operator); - DECL_CONV_STUB(cartesian_transformation_operator_2d); - DECL_CONV_STUB(cartesian_transformation_operator_3d); - DECL_CONV_STUB(cc_design_approval); - DECL_CONV_STUB(cc_design_certification); - DECL_CONV_STUB(cc_design_contract); - DECL_CONV_STUB(cc_design_date_and_time_assignment); - DECL_CONV_STUB(cc_design_person_and_organization_assignment); - DECL_CONV_STUB(cc_design_security_classification); - DECL_CONV_STUB(cc_design_specification_reference); - DECL_CONV_STUB(celsius_temperature_measure_with_unit); - DECL_CONV_STUB(centre_of_symmetry); - DECL_CONV_STUB(change); - DECL_CONV_STUB(change_request); - DECL_CONV_STUB(character_glyph_style_outline); - DECL_CONV_STUB(character_glyph_style_stroke); - DECL_CONV_STUB(symbol_representation); - DECL_CONV_STUB(generic_character_glyph_symbol); - DECL_CONV_STUB(character_glyph_symbol); - DECL_CONV_STUB(character_glyph_symbol_outline); - DECL_CONV_STUB(character_glyph_symbol_stroke); - DECL_CONV_STUB(general_property); - DECL_CONV_STUB(characteristic_data_column_header); - DECL_CONV_STUB(general_property_relationship); - DECL_CONV_STUB(characteristic_data_column_header_link); - DECL_CONV_STUB(characteristic_data_table_header); - DECL_CONV_STUB(characteristic_data_table_header_decomposition); - DECL_CONV_STUB(group); - DECL_CONV_STUB(characteristic_type); - DECL_CONV_STUB(characterized_class); - DECL_CONV_STUB(characterized_object); - DECL_CONV_STUB(conic); - DECL_CONV_STUB(circle); - DECL_CONV_STUB(circular_runout_tolerance); - DECL_CONV_STUB(class_by_extension); - DECL_CONV_STUB(class_by_intension); - DECL_CONV_STUB(class_system); - DECL_CONV_STUB(effectivity_context_assignment); - DECL_CONV_STUB(class_usage_effectivity_context_assignment); - DECL_CONV_STUB(topological_representation_item); - DECL_CONV_STUB(connected_face_set); - DECL_CONV_STUB(closed_shell); - DECL_CONV_STUB(coaxiality_tolerance); - DECL_CONV_STUB(colour_specification); - DECL_CONV_STUB(colour_rgb); - DECL_CONV_STUB(common_datum); - DECL_CONV_STUB(comparison_expression); - DECL_CONV_STUB(complex_clause); - DECL_CONV_STUB(complex_conjunctive_clause); - DECL_CONV_STUB(complex_disjunctive_clause); - DECL_CONV_STUB(modified_solid); - DECL_CONV_STUB(shelled_solid); - DECL_CONV_STUB(complex_shelled_solid); - DECL_CONV_STUB(composite_assembly_definition); - DECL_CONV_STUB(composite_assembly_sequence_definition); - DECL_CONV_STUB(laminate_table); - DECL_CONV_STUB(part_laminate_table); - DECL_CONV_STUB(composite_assembly_table); - DECL_CONV_STUB(composite_curve_segment); - DECL_CONV_STUB(material_designation); - DECL_CONV_STUB(composite_material_designation); - DECL_CONV_STUB(composite_shape_aspect); - DECL_CONV_STUB(composite_sheet_representation); - DECL_CONV_STUB(composite_text); - DECL_CONV_STUB(composite_text_with_associated_curves); - DECL_CONV_STUB(composite_text_with_blanking_box); - DECL_CONV_STUB(composite_text_with_delineation); - DECL_CONV_STUB(composite_text_with_extent); - DECL_CONV_STUB(compound_shape_representation); - DECL_CONV_STUB(concentricity_tolerance); - DECL_CONV_STUB(concept_feature_relationship); - DECL_CONV_STUB(concept_feature_relationship_with_condition); - DECL_CONV_STUB(product_concept_feature); - DECL_CONV_STUB(conditional_concept_feature); - DECL_CONV_STUB(conductance_measure_with_unit); - DECL_CONV_STUB(conductance_unit); - DECL_CONV_STUB(configuration_item); - DECL_CONV_STUB(configurable_item); - DECL_CONV_STUB(effectivity); - DECL_CONV_STUB(product_definition_effectivity); - DECL_CONV_STUB(configuration_effectivity); - DECL_CONV_STUB(configuration_item_relationship); - DECL_CONV_STUB(configuration_item_hierarchical_relationship); - DECL_CONV_STUB(configuration_item_revision_sequence); - DECL_CONV_STUB(configured_effectivity_assignment); - DECL_CONV_STUB(configured_effectivity_context_assignment); - DECL_CONV_STUB(conical_stepped_hole_transition); - DECL_CONV_STUB(elementary_surface); - DECL_CONV_STUB(conical_surface); - DECL_CONV_STUB(connected_edge_set); - DECL_CONV_STUB(connected_face_sub_set); - DECL_CONV_STUB(constructive_geometry_representation); - DECL_CONV_STUB(representation_relationship); - DECL_CONV_STUB(constructive_geometry_representation_relationship); - DECL_CONV_STUB(contact_ratio_representation); - DECL_CONV_STUB(invisibility); - DECL_CONV_STUB(context_dependent_invisibility); - DECL_CONV_STUB(over_riding_styled_item); - DECL_CONV_STUB(context_dependent_over_riding_styled_item); - DECL_CONV_STUB(context_dependent_unit); - DECL_CONV_STUB(conversion_based_unit); - DECL_CONV_STUB(csg_shape_representation); - DECL_CONV_STUB(csg_solid); - DECL_CONV_STUB(currency); - DECL_CONV_STUB(currency_measure_with_unit); - DECL_CONV_STUB(curve_bounded_surface); - DECL_CONV_STUB(curve_dimension); - DECL_CONV_STUB(curve_replica); - DECL_CONV_STUB(curve_style); - DECL_CONV_STUB(curve_style_font); - DECL_CONV_STUB(curve_style_font_and_scaling); - DECL_CONV_STUB(curve_style_font_pattern); - DECL_CONV_STUB(curve_swept_solid_shape_representation); - DECL_CONV_STUB(cylindrical_surface); - DECL_CONV_STUB(cylindricity_tolerance); - DECL_CONV_STUB(date_representation_item); - DECL_CONV_STUB(date_time_representation_item); - DECL_CONV_STUB(dated_effectivity); - DECL_CONV_STUB(datum); - DECL_CONV_STUB(datum_feature); - DECL_CONV_STUB(datum_feature_callout); - DECL_CONV_STUB(datum_reference); - DECL_CONV_STUB(datum_target); - DECL_CONV_STUB(datum_target_callout); - DECL_CONV_STUB(default_tolerance_table); - DECL_CONV_STUB(default_tolerance_table_cell); - DECL_CONV_STUB(defined_symbol); - DECL_CONV_STUB(definitional_representation); - DECL_CONV_STUB(definitional_representation_relationship); - DECL_CONV_STUB(definitional_representation_relationship_with_same_context); - DECL_CONV_STUB(degenerate_pcurve); - DECL_CONV_STUB(toroidal_surface); - DECL_CONV_STUB(degenerate_toroidal_surface); - DECL_CONV_STUB(descriptive_representation_item); - DECL_CONV_STUB(product_definition_context); - DECL_CONV_STUB(design_context); - DECL_CONV_STUB(design_make_from_relationship); - DECL_CONV_STUB(diameter_dimension); - DECL_CONV_STUB(ratio_measure_with_unit); - DECL_CONV_STUB(dielectric_constant_measure_with_unit); - DECL_CONV_STUB(dimension_callout); - DECL_CONV_STUB(draughting_callout_relationship); - DECL_CONV_STUB(dimension_callout_component_relationship); - DECL_CONV_STUB(dimension_callout_relationship); - DECL_CONV_STUB(dimension_curve); - DECL_CONV_STUB(terminator_symbol); - DECL_CONV_STUB(dimension_curve_terminator); - DECL_CONV_STUB(dimension_curve_terminator_to_projection_curve_associativity); - DECL_CONV_STUB(dimension_pair); - DECL_CONV_STUB(dimension_text_associativity); - DECL_CONV_STUB(dimensional_location_with_path); - DECL_CONV_STUB(dimensional_size_with_path); - DECL_CONV_STUB(executed_action); - DECL_CONV_STUB(directed_action); - DECL_CONV_STUB(directed_dimensional_location); - DECL_CONV_STUB(direction); - DECL_CONV_STUB(document_file); - DECL_CONV_STUB(document_identifier); - DECL_CONV_STUB(document_identifier_assignment); - DECL_CONV_STUB(document_product_association); - DECL_CONV_STUB(document_product_equivalence); - DECL_CONV_STUB(dose_equivalent_measure_with_unit); - DECL_CONV_STUB(dose_equivalent_unit); - DECL_CONV_STUB(double_offset_shelled_solid); - DECL_CONV_STUB(item_defined_transformation); - DECL_CONV_STUB(transformation_with_derived_angle); - DECL_CONV_STUB(draped_defined_transformation); - DECL_CONV_STUB(draughting_annotation_occurrence); - DECL_CONV_STUB(draughting_elements); - DECL_CONV_STUB(draughting_model); - DECL_CONV_STUB(item_identified_representation_usage); - DECL_CONV_STUB(draughting_model_item_association); - DECL_CONV_STUB(pre_defined_colour); - DECL_CONV_STUB(draughting_pre_defined_colour); - DECL_CONV_STUB(pre_defined_item); - DECL_CONV_STUB(pre_defined_curve_font); - DECL_CONV_STUB(draughting_pre_defined_curve_font); - DECL_CONV_STUB(pre_defined_text_font); - DECL_CONV_STUB(draughting_pre_defined_text_font); - DECL_CONV_STUB(draughting_subfigure_representation); - DECL_CONV_STUB(draughting_symbol_representation); - DECL_CONV_STUB(text_literal); - DECL_CONV_STUB(text_literal_with_delineation); - DECL_CONV_STUB(draughting_text_literal_with_delineation); - DECL_CONV_STUB(presentation_set); - DECL_CONV_STUB(drawing_revision); - DECL_CONV_STUB(presentation_representation); - DECL_CONV_STUB(presentation_area); - DECL_CONV_STUB(drawing_sheet_revision); - DECL_CONV_STUB(drawing_sheet_revision_sequence); - DECL_CONV_STUB(drawing_sheet_revision_usage); - DECL_CONV_STUB(edge); - DECL_CONV_STUB(edge_based_wireframe_model); - DECL_CONV_STUB(edge_based_wireframe_shape_representation); - DECL_CONV_STUB(edge_blended_solid); - DECL_CONV_STUB(edge_curve); - DECL_CONV_STUB(edge_loop); - DECL_CONV_STUB(electric_charge_measure_with_unit); - DECL_CONV_STUB(electric_charge_unit); - DECL_CONV_STUB(electric_current_measure_with_unit); - DECL_CONV_STUB(electric_current_unit); - DECL_CONV_STUB(electric_potential_measure_with_unit); - DECL_CONV_STUB(electric_potential_unit); - DECL_CONV_STUB(elementary_brep_shape_representation); - DECL_CONV_STUB(ellipse); - DECL_CONV_STUB(energy_measure_with_unit); - DECL_CONV_STUB(energy_unit); - DECL_CONV_STUB(property_definition); - DECL_CONV_STUB(fact_type); - DECL_CONV_STUB(entity_assertion); - DECL_CONV_STUB(enum_reference_prefix); - DECL_CONV_STUB(evaluated_characteristic); - DECL_CONV_STUB(evaluated_degenerate_pcurve); - DECL_CONV_STUB(evaluation_product_definition); - DECL_CONV_STUB(event_occurrence); - DECL_CONV_STUB(product_concept_feature_category); - DECL_CONV_STUB(exclusive_product_concept_feature_category); - DECL_CONV_STUB(uncertainty_qualifier); - DECL_CONV_STUB(standard_uncertainty); - DECL_CONV_STUB(expanded_uncertainty); - DECL_CONV_STUB(representation_item_relationship); - DECL_CONV_STUB(explicit_procedural_representation_item_relationship); - DECL_CONV_STUB(explicit_procedural_geometric_representation_item_relationship); - DECL_CONV_STUB(explicit_procedural_representation_relationship); - DECL_CONV_STUB(explicit_procedural_shape_representation_relationship); - DECL_CONV_STUB(expression_conversion_based_unit); - DECL_CONV_STUB(extension); - DECL_CONV_STUB(extent); - DECL_CONV_STUB(external_source); - DECL_CONV_STUB(external_class_library); - DECL_CONV_STUB(externally_defined_class); - DECL_CONV_STUB(externally_defined_colour); - DECL_CONV_STUB(externally_defined_context_dependent_unit); - DECL_CONV_STUB(externally_defined_conversion_based_unit); - DECL_CONV_STUB(externally_defined_currency); - DECL_CONV_STUB(externally_defined_item); - DECL_CONV_STUB(externally_defined_curve_font); - DECL_CONV_STUB(externally_defined_dimension_definition); - DECL_CONV_STUB(externally_defined_general_property); - DECL_CONV_STUB(externally_defined_hatch_style); - DECL_CONV_STUB(externally_defined_marker); - DECL_CONV_STUB(picture_representation_item); - DECL_CONV_STUB(externally_defined_picture_representation_item); - DECL_CONV_STUB(externally_defined_representation_item); - DECL_CONV_STUB(externally_defined_string); - DECL_CONV_STUB(externally_defined_symbol); - DECL_CONV_STUB(externally_defined_terminator_symbol); - DECL_CONV_STUB(externally_defined_text_font); - DECL_CONV_STUB(externally_defined_tile); - DECL_CONV_STUB(externally_defined_tile_style); - DECL_CONV_STUB(swept_area_solid); - DECL_CONV_STUB(extruded_area_solid); - DECL_CONV_STUB(swept_face_solid); - DECL_CONV_STUB(extruded_face_solid); - DECL_CONV_STUB(extruded_face_solid_with_trim_conditions); - DECL_CONV_STUB(extruded_face_solid_with_draft_angle); - DECL_CONV_STUB(extruded_face_solid_with_multiple_draft_angles); - DECL_CONV_STUB(face); - DECL_CONV_STUB(face_based_surface_model); - DECL_CONV_STUB(face_bound); - DECL_CONV_STUB(face_outer_bound); - DECL_CONV_STUB(faceted_brep); - DECL_CONV_STUB(faceted_brep_shape_representation); - DECL_CONV_STUB(fill_area_style); - DECL_CONV_STUB(fill_area_style_hatching); - DECL_CONV_STUB(fill_area_style_tile_coloured_region); - DECL_CONV_STUB(fill_area_style_tile_curve_with_style); - DECL_CONV_STUB(fill_area_style_tile_symbol_with_style); - DECL_CONV_STUB(fill_area_style_tiles); - DECL_CONV_STUB(shape_representation_relationship); - DECL_CONV_STUB(flat_pattern_ply_representation_relationship); - DECL_CONV_STUB(flatness_tolerance); - DECL_CONV_STUB(force_measure_with_unit); - DECL_CONV_STUB(force_unit); - DECL_CONV_STUB(forward_chaining_rule); - DECL_CONV_STUB(forward_chaining_rule_premise); - DECL_CONV_STUB(frequency_measure_with_unit); - DECL_CONV_STUB(frequency_unit); - DECL_CONV_STUB(func); - DECL_CONV_STUB(functional_breakdown_context); - DECL_CONV_STUB(functional_element_usage); - DECL_CONV_STUB(general_material_property); - DECL_CONV_STUB(simple_generic_expression); - DECL_CONV_STUB(generic_literal); - DECL_CONV_STUB(generic_variable); - DECL_CONV_STUB(geometric_alignment); - DECL_CONV_STUB(geometric_set); - DECL_CONV_STUB(geometric_curve_set); - DECL_CONV_STUB(geometric_intersection); - DECL_CONV_STUB(geometric_item_specific_usage); - DECL_CONV_STUB(geometric_model_element_relationship); - DECL_CONV_STUB(representation_context); - DECL_CONV_STUB(geometric_representation_context); - DECL_CONV_STUB(geometric_tolerance_with_defined_unit); - DECL_CONV_STUB(geometrical_tolerance_callout); - DECL_CONV_STUB(geometrically_bounded_2d_wireframe_representation); - DECL_CONV_STUB(geometrically_bounded_surface_shape_representation); - DECL_CONV_STUB(geometrically_bounded_wireframe_shape_representation); - DECL_CONV_STUB(global_assignment); - DECL_CONV_STUB(global_uncertainty_assigned_context); - DECL_CONV_STUB(global_unit_assigned_context); - DECL_CONV_STUB(ground_fact); - DECL_CONV_STUB(hardness_representation); - DECL_CONV_STUB(hidden_element_over_riding_styled_item); - DECL_CONV_STUB(hyperbola); - DECL_CONV_STUB(illuminance_measure_with_unit); - DECL_CONV_STUB(illuminance_unit); - DECL_CONV_STUB(included_text_block); - DECL_CONV_STUB(inclusion_product_concept_feature); - DECL_CONV_STUB(user_selected_elements); - DECL_CONV_STUB(indirectly_selected_elements); - DECL_CONV_STUB(indirectly_selected_shape_elements); - DECL_CONV_STUB(inductance_measure_with_unit); - DECL_CONV_STUB(inductance_unit); - DECL_CONV_STUB(information_right); - DECL_CONV_STUB(information_usage_right); - DECL_CONV_STUB(instance_usage_context_assignment); - DECL_CONV_STUB(instanced_feature); - DECL_CONV_STUB(literal_number); - DECL_CONV_STUB(int_literal); - DECL_CONV_STUB(integer_representation_item); - DECL_CONV_STUB(surface_curve); - DECL_CONV_STUB(intersection_curve); - DECL_CONV_STUB(interval_expression); - DECL_CONV_STUB(iso4217_currency); - DECL_CONV_STUB(known_source); - DECL_CONV_STUB(laid_defined_transformation); - DECL_CONV_STUB(language); - DECL_CONV_STUB(leader_curve); - DECL_CONV_STUB(leader_directed_callout); - DECL_CONV_STUB(leader_directed_dimension); - DECL_CONV_STUB(leader_terminator); - DECL_CONV_STUB(length_measure_with_unit); - DECL_CONV_STUB(length_unit); - DECL_CONV_STUB(light_source); - DECL_CONV_STUB(light_source_ambient); - DECL_CONV_STUB(light_source_directional); - DECL_CONV_STUB(light_source_positional); - DECL_CONV_STUB(light_source_spot); - DECL_CONV_STUB(line); - DECL_CONV_STUB(line_profile_tolerance); - DECL_CONV_STUB(linear_dimension); - DECL_CONV_STUB(simple_clause); - DECL_CONV_STUB(literal_conjunction); - DECL_CONV_STUB(literal_disjunction); - DECL_CONV_STUB(logical_literal); - DECL_CONV_STUB(logical_representation_item); - DECL_CONV_STUB(loop); - DECL_CONV_STUB(loss_tangent_measure_with_unit); - DECL_CONV_STUB(lot_effectivity); - DECL_CONV_STUB(luminous_flux_measure_with_unit); - DECL_CONV_STUB(luminous_flux_unit); - DECL_CONV_STUB(luminous_intensity_measure_with_unit); - DECL_CONV_STUB(luminous_intensity_unit); - DECL_CONV_STUB(magnetic_flux_density_measure_with_unit); - DECL_CONV_STUB(magnetic_flux_density_unit); - DECL_CONV_STUB(magnetic_flux_measure_with_unit); - DECL_CONV_STUB(magnetic_flux_unit); - DECL_CONV_STUB(make_from_usage_option); - DECL_CONV_STUB(manifold_subsurface_shape_representation); - DECL_CONV_STUB(manifold_surface_shape_representation); - DECL_CONV_STUB(mass_measure_with_unit); - DECL_CONV_STUB(mass_unit); - DECL_CONV_STUB(material_property); - DECL_CONV_STUB(property_definition_representation); - DECL_CONV_STUB(material_property_representation); - DECL_CONV_STUB(measure_representation_item); - DECL_CONV_STUB(product_context); - DECL_CONV_STUB(mechanical_context); - DECL_CONV_STUB(mechanical_design_and_draughting_relationship); - DECL_CONV_STUB(mechanical_design_geometric_presentation_area); - DECL_CONV_STUB(mechanical_design_geometric_presentation_representation); - DECL_CONV_STUB(mechanical_design_presentation_representation_with_draughting); - DECL_CONV_STUB(mechanical_design_shaded_presentation_area); - DECL_CONV_STUB(mechanical_design_shaded_presentation_representation); - DECL_CONV_STUB(min_and_major_ply_orientation_basis); - DECL_CONV_STUB(modified_geometric_tolerance); - DECL_CONV_STUB(modified_solid_with_placed_configuration); - DECL_CONV_STUB(moments_of_inertia_representation); - DECL_CONV_STUB(multi_language_attribute_assignment); - DECL_CONV_STUB(multiple_arity_boolean_expression); - DECL_CONV_STUB(multiple_arity_generic_expression); - DECL_CONV_STUB(multiple_arity_numeric_expression); - DECL_CONV_STUB(next_assembly_usage_occurrence); - DECL_CONV_STUB(non_manifold_surface_shape_representation); - DECL_CONV_STUB(null_representation_item); - DECL_CONV_STUB(numeric_expression); - DECL_CONV_STUB(offset_curve_2d); - DECL_CONV_STUB(offset_curve_3d); - DECL_CONV_STUB(offset_surface); - DECL_CONV_STUB(one_direction_repeat_factor); - DECL_CONV_STUB(open_shell); - DECL_CONV_STUB(ordinal_date); - DECL_CONV_STUB(projection_directed_callout); - DECL_CONV_STUB(ordinate_dimension); - DECL_CONV_STUB(organizational_address); - DECL_CONV_STUB(oriented_closed_shell); - DECL_CONV_STUB(oriented_edge); - DECL_CONV_STUB(oriented_face); - DECL_CONV_STUB(oriented_open_shell); - DECL_CONV_STUB(path); - DECL_CONV_STUB(oriented_path); - DECL_CONV_STUB(oriented_surface); - DECL_CONV_STUB(outer_boundary_curve); - DECL_CONV_STUB(package_product_concept_feature); - DECL_CONV_STUB(parabola); - DECL_CONV_STUB(parallel_offset); - DECL_CONV_STUB(parallelism_tolerance); - DECL_CONV_STUB(parametric_representation_context); - DECL_CONV_STUB(partial_document_with_structured_text_representation_assignment); - DECL_CONV_STUB(pcurve); - DECL_CONV_STUB(percentage_laminate_definition); - DECL_CONV_STUB(zone_structural_makeup); - DECL_CONV_STUB(percentage_laminate_table); - DECL_CONV_STUB(percentage_ply_definition); - DECL_CONV_STUB(perpendicular_to); - DECL_CONV_STUB(perpendicularity_tolerance); - DECL_CONV_STUB(person_and_organization_address); - DECL_CONV_STUB(personal_address); - DECL_CONV_STUB(physical_breakdown_context); - DECL_CONV_STUB(physical_element_usage); - DECL_CONV_STUB(presentation_view); - DECL_CONV_STUB(picture_representation); - DECL_CONV_STUB(placed_datum_target_feature); - DECL_CONV_STUB(placed_feature); - DECL_CONV_STUB(planar_extent); - DECL_CONV_STUB(planar_box); - DECL_CONV_STUB(plane); - DECL_CONV_STUB(plane_angle_measure_with_unit); - DECL_CONV_STUB(plane_angle_unit); - DECL_CONV_STUB(ply_laminate_definition); - DECL_CONV_STUB(ply_laminate_sequence_definition); - DECL_CONV_STUB(ply_laminate_table); - DECL_CONV_STUB(point_and_vector); - DECL_CONV_STUB(point_on_curve); - DECL_CONV_STUB(point_on_surface); - DECL_CONV_STUB(point_path); - DECL_CONV_STUB(point_replica); - DECL_CONV_STUB(point_style); - DECL_CONV_STUB(polar_complex_number_literal); - DECL_CONV_STUB(poly_loop); - DECL_CONV_STUB(polyline); - DECL_CONV_STUB(position_tolerance); - DECL_CONV_STUB(positioned_sketch); - DECL_CONV_STUB(power_measure_with_unit); - DECL_CONV_STUB(power_unit); - DECL_CONV_STUB(pre_defined_symbol); - DECL_CONV_STUB(pre_defined_dimension_symbol); - DECL_CONV_STUB(pre_defined_geometrical_tolerance_symbol); - DECL_CONV_STUB(pre_defined_marker); - DECL_CONV_STUB(pre_defined_point_marker_symbol); - DECL_CONV_STUB(pre_defined_surface_condition_symbol); - DECL_CONV_STUB(pre_defined_surface_side_style); - DECL_CONV_STUB(pre_defined_terminator_symbol); - DECL_CONV_STUB(pre_defined_tile); - DECL_CONV_STUB(predefined_picture_representation_item); - DECL_CONV_STUB(presentation_style_assignment); - DECL_CONV_STUB(presentation_style_by_context); - DECL_CONV_STUB(pressure_measure_with_unit); - DECL_CONV_STUB(pressure_unit); - DECL_CONV_STUB(procedural_representation); - DECL_CONV_STUB(procedural_representation_sequence); - DECL_CONV_STUB(procedural_shape_representation); - DECL_CONV_STUB(procedural_shape_representation_sequence); - DECL_CONV_STUB(product_category); - DECL_CONV_STUB(product_class); - DECL_CONV_STUB(product_concept_context); - DECL_CONV_STUB(product_concept_feature_category_usage); - DECL_CONV_STUB(product_definition_element_relationship); - DECL_CONV_STUB(product_definition_formation); - DECL_CONV_STUB(product_definition_formation_with_specified_source); - DECL_CONV_STUB(product_definition_group_assignment); - DECL_CONV_STUB(product_definition_shape); - DECL_CONV_STUB(product_definition_with_associated_documents); - DECL_CONV_STUB(product_identification); - DECL_CONV_STUB(product_material_composition_relationship); - DECL_CONV_STUB(product_related_product_category); - DECL_CONV_STUB(product_specification); - DECL_CONV_STUB(tolerance_zone_definition); - DECL_CONV_STUB(projected_zone_definition); - DECL_CONV_STUB(projection_curve); - DECL_CONV_STUB(promissory_usage_occurrence); - DECL_CONV_STUB(qualified_representation_item); - DECL_CONV_STUB(qualitative_uncertainty); - DECL_CONV_STUB(quantified_assembly_component_usage); - DECL_CONV_STUB(quasi_uniform_curve); - DECL_CONV_STUB(quasi_uniform_surface); - DECL_CONV_STUB(radioactivity_measure_with_unit); - DECL_CONV_STUB(radioactivity_unit); - DECL_CONV_STUB(radius_dimension); - DECL_CONV_STUB(range_characteristic); - DECL_CONV_STUB(ratio_unit); - DECL_CONV_STUB(rational_b_spline_curve); - DECL_CONV_STUB(rational_b_spline_surface); - DECL_CONV_STUB(rational_representation_item); - DECL_CONV_STUB(real_literal); - DECL_CONV_STUB(real_representation_item); - DECL_CONV_STUB(rectangular_composite_surface); - DECL_CONV_STUB(rectangular_trimmed_surface); - DECL_CONV_STUB(referenced_modified_datum); - DECL_CONV_STUB(relative_event_occurrence); - DECL_CONV_STUB(rep_item_group); - DECL_CONV_STUB(reparametrised_composite_curve_segment); - DECL_CONV_STUB(representation_relationship_with_transformation); - DECL_CONV_STUB(requirement_assigned_object); - DECL_CONV_STUB(requirement_assignment); - DECL_CONV_STUB(requirement_source); - DECL_CONV_STUB(requirement_view_definition_relationship); - DECL_CONV_STUB(resistance_measure_with_unit); - DECL_CONV_STUB(resistance_unit); - DECL_CONV_STUB(revolved_area_solid); - DECL_CONV_STUB(revolved_face_solid); - DECL_CONV_STUB(revolved_face_solid_with_trim_conditions); - DECL_CONV_STUB(right_angular_wedge); - DECL_CONV_STUB(right_circular_cone); - DECL_CONV_STUB(right_circular_cylinder); - DECL_CONV_STUB(right_to_usage_association); - DECL_CONV_STUB(roundness_tolerance); - DECL_CONV_STUB(row_representation_item); - DECL_CONV_STUB(row_value); - DECL_CONV_STUB(row_variable); - DECL_CONV_STUB(rule_action); - DECL_CONV_STUB(rule_condition); - DECL_CONV_STUB(rule_set); - DECL_CONV_STUB(rule_set_group); - DECL_CONV_STUB(rule_superseded_assignment); - DECL_CONV_STUB(rule_supersedence); - DECL_CONV_STUB(surface_curve_swept_area_solid); - DECL_CONV_STUB(ruled_surface_swept_area_solid); - DECL_CONV_STUB(runout_zone_definition); - DECL_CONV_STUB(runout_zone_orientation); - DECL_CONV_STUB(runout_zone_orientation_reference_direction); - DECL_CONV_STUB(satisfied_requirement); - DECL_CONV_STUB(satisfies_requirement); - DECL_CONV_STUB(satisfying_item); - DECL_CONV_STUB(scalar_variable); - DECL_CONV_STUB(scattering_parameter); - DECL_CONV_STUB(sculptured_solid); - DECL_CONV_STUB(seam_curve); - DECL_CONV_STUB(serial_numbered_effectivity); - DECL_CONV_STUB(shape_aspect_associativity); - DECL_CONV_STUB(shape_aspect_deriving_relationship); - DECL_CONV_STUB(shape_definition_representation); - DECL_CONV_STUB(shape_dimension_representation); - DECL_CONV_STUB(shape_feature_definition); - DECL_CONV_STUB(shape_representation_with_parameters); - DECL_CONV_STUB(shell_based_surface_model); - DECL_CONV_STUB(shell_based_wireframe_model); - DECL_CONV_STUB(shell_based_wireframe_shape_representation); - DECL_CONV_STUB(si_absorbed_dose_unit); - DECL_CONV_STUB(si_capacitance_unit); - DECL_CONV_STUB(si_conductance_unit); - DECL_CONV_STUB(si_dose_equivalent_unit); - DECL_CONV_STUB(si_electric_charge_unit); - DECL_CONV_STUB(si_electric_potential_unit); - DECL_CONV_STUB(si_energy_unit); - DECL_CONV_STUB(si_force_unit); - DECL_CONV_STUB(si_frequency_unit); - DECL_CONV_STUB(si_illuminance_unit); - DECL_CONV_STUB(si_inductance_unit); - DECL_CONV_STUB(si_magnetic_flux_density_unit); - DECL_CONV_STUB(si_magnetic_flux_unit); - DECL_CONV_STUB(si_power_unit); - DECL_CONV_STUB(si_pressure_unit); - DECL_CONV_STUB(si_radioactivity_unit); - DECL_CONV_STUB(si_resistance_unit); - DECL_CONV_STUB(si_unit); - DECL_CONV_STUB(simple_boolean_expression); - DECL_CONV_STUB(simple_numeric_expression); - DECL_CONV_STUB(slash_expression); - DECL_CONV_STUB(smeared_material_definition); - DECL_CONV_STUB(solid_angle_measure_with_unit); - DECL_CONV_STUB(solid_angle_unit); - DECL_CONV_STUB(solid_curve_font); - DECL_CONV_STUB(solid_replica); - DECL_CONV_STUB(solid_with_chamfered_edges); - DECL_CONV_STUB(solid_with_angle_based_chamfer); - DECL_CONV_STUB(solid_with_shape_element_pattern); - DECL_CONV_STUB(solid_with_circular_pattern); - DECL_CONV_STUB(solid_with_depression); - DECL_CONV_STUB(solid_with_pocket); - DECL_CONV_STUB(solid_with_circular_pocket); - DECL_CONV_STUB(solid_with_protrusion); - DECL_CONV_STUB(solid_with_circular_protrusion); - DECL_CONV_STUB(solid_with_hole); - DECL_CONV_STUB(solid_with_stepped_round_hole); - DECL_CONV_STUB(solid_with_conical_bottom_round_hole); - DECL_CONV_STUB(solid_with_constant_radius_edge_blend); - DECL_CONV_STUB(solid_with_slot); - DECL_CONV_STUB(solid_with_curved_slot); - DECL_CONV_STUB(solid_with_double_offset_chamfer); - DECL_CONV_STUB(solid_with_flat_bottom_round_hole); - DECL_CONV_STUB(solid_with_general_pocket); - DECL_CONV_STUB(solid_with_general_protrusion); - DECL_CONV_STUB(solid_with_groove); - DECL_CONV_STUB(solid_with_incomplete_circular_pattern); - DECL_CONV_STUB(solid_with_rectangular_pattern); - DECL_CONV_STUB(solid_with_incomplete_rectangular_pattern); - DECL_CONV_STUB(solid_with_rectangular_pocket); - DECL_CONV_STUB(solid_with_rectangular_protrusion); - DECL_CONV_STUB(solid_with_single_offset_chamfer); - DECL_CONV_STUB(solid_with_spherical_bottom_round_hole); - DECL_CONV_STUB(solid_with_stepped_round_hole_and_conical_transitions); - DECL_CONV_STUB(solid_with_straight_slot); - DECL_CONV_STUB(solid_with_tee_section_slot); - DECL_CONV_STUB(solid_with_through_depression); - DECL_CONV_STUB(solid_with_trapezoidal_section_slot); - DECL_CONV_STUB(solid_with_variable_radius_edge_blend); - DECL_CONV_STUB(source_for_requirement); - DECL_CONV_STUB(sourced_requirement); - DECL_CONV_STUB(specification_definition); - DECL_CONV_STUB(specified_higher_usage_occurrence); - DECL_CONV_STUB(sphere); - DECL_CONV_STUB(spherical_surface); - DECL_CONV_STUB(start_request); - DECL_CONV_STUB(start_work); - DECL_CONV_STUB(straightness_tolerance); - DECL_CONV_STUB(structured_dimension_callout); - DECL_CONV_STUB(structured_text_composition); - DECL_CONV_STUB(structured_text_representation); - DECL_CONV_STUB(subedge); - DECL_CONV_STUB(subface); - DECL_CONV_STUB(supplied_part_relationship); - DECL_CONV_STUB(surface_condition_callout); - DECL_CONV_STUB(swept_surface); - DECL_CONV_STUB(surface_of_linear_extrusion); - DECL_CONV_STUB(surface_of_revolution); - DECL_CONV_STUB(surface_patch); - DECL_CONV_STUB(surface_profile_tolerance); - DECL_CONV_STUB(surface_replica); - DECL_CONV_STUB(surface_side_style); - DECL_CONV_STUB(surface_style_boundary); - DECL_CONV_STUB(surface_style_control_grid); - DECL_CONV_STUB(surface_style_fill_area); - DECL_CONV_STUB(surface_style_parameter_line); - DECL_CONV_STUB(surface_style_reflectance_ambient); - DECL_CONV_STUB(surface_style_reflectance_ambient_diffuse); - DECL_CONV_STUB(surface_style_reflectance_ambient_diffuse_specular); - DECL_CONV_STUB(surface_style_rendering); - DECL_CONV_STUB(surface_style_rendering_with_properties); - DECL_CONV_STUB(surface_style_segmentation_curve); - DECL_CONV_STUB(surface_style_silhouette); - DECL_CONV_STUB(surface_style_usage); - DECL_CONV_STUB(surface_texture_representation); - DECL_CONV_STUB(surfaced_open_shell); - DECL_CONV_STUB(swept_disk_solid); - DECL_CONV_STUB(symbol); - DECL_CONV_STUB(symbol_representation_map); - DECL_CONV_STUB(symbol_style); - DECL_CONV_STUB(symbol_target); - DECL_CONV_STUB(symmetric_shape_aspect); - DECL_CONV_STUB(symmetry_tolerance); - DECL_CONV_STUB(table_representation_item); - DECL_CONV_STUB(tactile_appearance_representation); - DECL_CONV_STUB(tagged_text_format); - DECL_CONV_STUB(tagged_text_item); - DECL_CONV_STUB(tangent); - DECL_CONV_STUB(text_literal_with_associated_curves); - DECL_CONV_STUB(text_literal_with_blanking_box); - DECL_CONV_STUB(text_literal_with_extent); - DECL_CONV_STUB(text_string_representation); - DECL_CONV_STUB(text_style); - DECL_CONV_STUB(text_style_with_box_characteristics); - DECL_CONV_STUB(text_style_with_mirror); - DECL_CONV_STUB(text_style_with_spacing); - DECL_CONV_STUB(thermal_resistance_measure_with_unit); - DECL_CONV_STUB(thermal_resistance_unit); - DECL_CONV_STUB(thermodynamic_temperature_measure_with_unit); - DECL_CONV_STUB(thermodynamic_temperature_unit); - DECL_CONV_STUB(thickened_face_solid); - DECL_CONV_STUB(thickness_laminate_definition); - DECL_CONV_STUB(thickness_laminate_table); - DECL_CONV_STUB(time_interval); - DECL_CONV_STUB(time_interval_based_effectivity); - DECL_CONV_STUB(time_interval_with_bounds); - DECL_CONV_STUB(time_measure_with_unit); - DECL_CONV_STUB(time_unit); - DECL_CONV_STUB(tolerance_zone); - DECL_CONV_STUB(torus); - DECL_CONV_STUB(total_runout_tolerance); - DECL_CONV_STUB(track_blended_solid); - DECL_CONV_STUB(track_blended_solid_with_end_conditions); - DECL_CONV_STUB(trimmed_curve); - DECL_CONV_STUB(two_direction_repeat_factor); - DECL_CONV_STUB(unary_generic_expression); - DECL_CONV_STUB(unary_numeric_expression); - DECL_CONV_STUB(uncertainty_assigned_representation); - DECL_CONV_STUB(uncertainty_measure_with_unit); - DECL_CONV_STUB(uniform_curve); - DECL_CONV_STUB(uniform_resource_identifier); - DECL_CONV_STUB(uniform_surface); - DECL_CONV_STUB(usage_association); - DECL_CONV_STUB(user_defined_curve_font); - DECL_CONV_STUB(user_defined_marker); - DECL_CONV_STUB(user_defined_terminator_symbol); - DECL_CONV_STUB(user_selected_shape_elements); - DECL_CONV_STUB(value_range); - DECL_CONV_STUB(value_representation_item); - DECL_CONV_STUB(variable_semantics); - DECL_CONV_STUB(variational_representation_item); - DECL_CONV_STUB(vector); - DECL_CONV_STUB(vector_style); - DECL_CONV_STUB(velocity_measure_with_unit); - DECL_CONV_STUB(velocity_unit); - DECL_CONV_STUB(vertex); - DECL_CONV_STUB(vertex_loop); - DECL_CONV_STUB(vertex_point); - DECL_CONV_STUB(vertex_shell); - DECL_CONV_STUB(view_volume); - DECL_CONV_STUB(visual_appearance_representation); - DECL_CONV_STUB(volume_measure_with_unit); - DECL_CONV_STUB(volume_unit); - DECL_CONV_STUB(week_of_year_and_day_date); - DECL_CONV_STUB(wire_shell); - DECL_CONV_STUB(year_month); - - -#undef DECL_CONV_STUB - -} //! STEP -} //! Assimp - -#endif // INCLUDED_STEPFILE_READER_GEN_H diff --git a/code/CApi/CInterfaceIOWrapper.cpp b/code/CApi/CInterfaceIOWrapper.cpp index 91dd07f37..9d8b79c5d 100644 --- a/code/CApi/CInterfaceIOWrapper.cpp +++ b/code/CApi/CInterfaceIOWrapper.cpp @@ -45,10 +45,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "CInterfaceIOWrapper.h" -namespace Assimp { +namespace Assimp { -CIOStreamWrapper::~CIOStreamWrapper(void) -{ +CIOStreamWrapper::~CIOStreamWrapper(void) { /* Various places depend on this destructor to close the file */ if (mFile) { mIO->mFileSystem->CloseProc(mIO->mFileSystem, mFile); @@ -57,28 +56,25 @@ CIOStreamWrapper::~CIOStreamWrapper(void) } // ................................................................... -size_t CIOStreamWrapper::Read(void* pvBuffer, - size_t pSize, - size_t pCount -){ +size_t CIOStreamWrapper::Read(void *pvBuffer, + size_t pSize, + size_t pCount) { // need to typecast here as C has no void* - return mFile->ReadProc(mFile,(char*)pvBuffer,pSize,pCount); + return mFile->ReadProc(mFile, (char *)pvBuffer, pSize, pCount); } // ................................................................... -size_t CIOStreamWrapper::Write(const void* pvBuffer, - size_t pSize, - size_t pCount -){ +size_t CIOStreamWrapper::Write(const void *pvBuffer, + size_t pSize, + size_t pCount) { // need to typecast here as C has no void* - return mFile->WriteProc(mFile,(const char*)pvBuffer,pSize,pCount); + return mFile->WriteProc(mFile, (const char *)pvBuffer, pSize, pCount); } // ................................................................... aiReturn CIOStreamWrapper::Seek(size_t pOffset, - aiOrigin pOrigin -){ - return mFile->SeekProc(mFile,pOffset,pOrigin); + aiOrigin pOrigin) { + return mFile->SeekProc(mFile, pOffset, pOrigin); } // ................................................................... @@ -92,16 +88,16 @@ size_t CIOStreamWrapper::FileSize() const { } // ................................................................... -void CIOStreamWrapper::Flush () { +void CIOStreamWrapper::Flush() { return mFile->FlushProc(mFile); } // ------------------------------------------------------------------------------------------------ // Custom IOStream implementation for the C-API -bool CIOSystemWrapper::Exists( const char* pFile) const { - aiFile* p = mFileSystem->OpenProc(mFileSystem,pFile,"rb"); - if (p){ - mFileSystem->CloseProc(mFileSystem,p); +bool CIOSystemWrapper::Exists(const char *pFile) const { + aiFile *p = mFileSystem->OpenProc(mFileSystem, pFile, "rb"); + if (p) { + mFileSystem->CloseProc(mFileSystem, p); return true; } return false; @@ -117,8 +113,8 @@ char CIOSystemWrapper::getOsSeparator() const { } // ................................................................... -IOStream* CIOSystemWrapper::Open(const char* pFile,const char* pMode) { - aiFile* p = mFileSystem->OpenProc(mFileSystem,pFile,pMode); +IOStream *CIOSystemWrapper::Open(const char *pFile, const char *pMode) { + aiFile *p = mFileSystem->OpenProc(mFileSystem, pFile, pMode); if (!p) { return NULL; } @@ -126,11 +122,11 @@ IOStream* CIOSystemWrapper::Open(const char* pFile,const char* pMode) { } // ................................................................... -void CIOSystemWrapper::Close( IOStream* pFile) { +void CIOSystemWrapper::Close(IOStream *pFile) { if (!pFile) { return; } delete pFile; } -} +} // namespace Assimp diff --git a/code/CApi/CInterfaceIOWrapper.h b/code/CApi/CInterfaceIOWrapper.h index 298847494..c899840fc 100644 --- a/code/CApi/CInterfaceIOWrapper.h +++ b/code/CApi/CInterfaceIOWrapper.h @@ -5,8 +5,6 @@ Open Asset Import Library (assimp) Copyright (c) 2006-2020, assimp team - - All rights reserved. Redistribution and use of this software in source and binary forms, @@ -50,50 +48,47 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include -namespace Assimp { +namespace Assimp { class CIOSystemWrapper; // ------------------------------------------------------------------------------------------------ // Custom IOStream implementation for the C-API -class CIOStreamWrapper : public IOStream -{ +class CIOStreamWrapper : public IOStream { public: - explicit CIOStreamWrapper(aiFile* pFile, CIOSystemWrapper* io) - : mFile(pFile), - mIO(io) - {} + explicit CIOStreamWrapper(aiFile *pFile, CIOSystemWrapper *io) : + mFile(pFile), + mIO(io) {} ~CIOStreamWrapper(void); - size_t Read(void* pvBuffer, size_t pSize, size_t pCount); - size_t Write(const void* pvBuffer, size_t pSize, size_t pCount); + size_t Read(void *pvBuffer, size_t pSize, size_t pCount); + size_t Write(const void *pvBuffer, size_t pSize, size_t pCount); aiReturn Seek(size_t pOffset, aiOrigin pOrigin); size_t Tell(void) const; size_t FileSize() const; void Flush(); private: - aiFile* mFile; - CIOSystemWrapper* mIO; + aiFile *mFile; + CIOSystemWrapper *mIO; }; -class CIOSystemWrapper : public IOSystem -{ +class CIOSystemWrapper : public IOSystem { friend class CIOStreamWrapper; -public: - explicit CIOSystemWrapper(aiFileIO* pFile) - : mFileSystem(pFile) - {} - bool Exists( const char* pFile) const; +public: + explicit CIOSystemWrapper(aiFileIO *pFile) : + mFileSystem(pFile) {} + + bool Exists(const char *pFile) const; char getOsSeparator() const; - IOStream* Open(const char* pFile,const char* pMode = "rb"); - void Close( IOStream* pFile); + IOStream *Open(const char *pFile, const char *pMode = "rb"); + void Close(IOStream *pFile); + private: - aiFileIO* mFileSystem; + aiFileIO *mFileSystem; }; -} +} // namespace Assimp #endif - diff --git a/tools/assimp_view/AnimEvaluator.cpp b/tools/assimp_view/AnimEvaluator.cpp index 710950fe2..e97bdf290 100644 --- a/tools/assimp_view/AnimEvaluator.cpp +++ b/tools/assimp_view/AnimEvaluator.cpp @@ -47,10 +47,11 @@ using namespace AssimpView; // ------------------------------------------------------------------------------------------------ // Constructor on a given animation. -AnimEvaluator::AnimEvaluator( const aiAnimation *pAnim ) -: mAnim(pAnim) -, mLastTime(0.0) { - mLastPositions.resize( pAnim->mNumChannels, std::make_tuple( 0, 0, 0)); +AnimEvaluator::AnimEvaluator(const aiAnimation *pAnim) : + mAnim(pAnim), + mLastTime(0.0) { + ai_assert(nullptr != pAnim); + mLastPositions.resize(pAnim->mNumChannels, std::make_tuple(0, 0, 0)); } // ------------------------------------------------------------------------------------------------ @@ -61,7 +62,7 @@ AnimEvaluator::~AnimEvaluator() { // ------------------------------------------------------------------------------------------------ // Evaluates the animation tracks for a given time stamp. -void AnimEvaluator::Evaluate( double pTime ) { +void AnimEvaluator::Evaluate(double pTime) { // extract ticks per second. Assume default value if not given double ticksPerSecond = mAnim->mTicksPerSecond != 0.0 ? mAnim->mTicksPerSecond : 25.0; // every following time calculation happens in ticks @@ -78,16 +79,16 @@ void AnimEvaluator::Evaluate( double pTime ) { } // calculate the transformations for each animation channel - for( unsigned int a = 0; a < mAnim->mNumChannels; ++a ) { - const aiNodeAnim* channel = mAnim->mChannels[a]; + for (unsigned int a = 0; a < mAnim->mNumChannels; ++a) { + const aiNodeAnim *channel = mAnim->mChannels[a]; // ******** Position ***** - aiVector3D presentPosition( 0, 0, 0); - if( channel->mNumPositionKeys > 0) { + aiVector3D presentPosition(0, 0, 0); + if (channel->mNumPositionKeys > 0) { // Look for present frame number. Search from last position if time is after the last time, else from beginning // Should be much quicker than always looking from start for the average use case. unsigned int frame = (time >= mLastTime) ? std::get<0>(mLastPositions[a]) : 0; - while( frame < channel->mNumPositionKeys - 1) { + while (frame < channel->mNumPositionKeys - 1) { if (time < channel->mPositionKeys[frame + 1].mTime) { break; } @@ -96,14 +97,14 @@ void AnimEvaluator::Evaluate( double pTime ) { // interpolate between this frame's value and next frame's value unsigned int nextFrame = (frame + 1) % channel->mNumPositionKeys; - const aiVectorKey& key = channel->mPositionKeys[frame]; - const aiVectorKey& nextKey = channel->mPositionKeys[nextFrame]; + const aiVectorKey &key = channel->mPositionKeys[frame]; + const aiVectorKey &nextKey = channel->mPositionKeys[nextFrame]; double diffTime = nextKey.mTime - key.mTime; if (diffTime < 0.0) { diffTime += mAnim->mDuration; } - if( diffTime > 0) { - float factor = float( (time - key.mTime) / diffTime); + if (diffTime > 0) { + float factor = float((time - key.mTime) / diffTime); presentPosition = key.mValue + (nextKey.mValue - key.mValue) * factor; } else { presentPosition = key.mValue; @@ -113,10 +114,10 @@ void AnimEvaluator::Evaluate( double pTime ) { } // ******** Rotation ********* - aiQuaternion presentRotation( 1, 0, 0, 0); - if( channel->mNumRotationKeys > 0) { + aiQuaternion presentRotation(1, 0, 0, 0); + if (channel->mNumRotationKeys > 0) { unsigned int frame = (time >= mLastTime) ? std::get<1>(mLastPositions[a]) : 0; - while( frame < channel->mNumRotationKeys - 1) { + while (frame < channel->mNumRotationKeys - 1) { if (time < channel->mRotationKeys[frame + 1].mTime) { break; } @@ -125,15 +126,15 @@ void AnimEvaluator::Evaluate( double pTime ) { // interpolate between this frame's value and next frame's value unsigned int nextFrame = (frame + 1) % channel->mNumRotationKeys; - const aiQuatKey& key = channel->mRotationKeys[frame]; - const aiQuatKey& nextKey = channel->mRotationKeys[nextFrame]; + const aiQuatKey &key = channel->mRotationKeys[frame]; + const aiQuatKey &nextKey = channel->mRotationKeys[nextFrame]; double diffTime = nextKey.mTime - key.mTime; if (diffTime < 0.0) { diffTime += mAnim->mDuration; } - if( diffTime > 0) { - float factor = float( (time - key.mTime) / diffTime); - aiQuaternion::Interpolate( presentRotation, key.mValue, nextKey.mValue, factor); + if (diffTime > 0) { + float factor = float((time - key.mTime) / diffTime); + aiQuaternion::Interpolate(presentRotation, key.mValue, nextKey.mValue, factor); } else { presentRotation = key.mValue; } @@ -142,10 +143,10 @@ void AnimEvaluator::Evaluate( double pTime ) { } // ******** Scaling ********** - aiVector3D presentScaling( 1, 1, 1); - if( channel->mNumScalingKeys > 0) { + aiVector3D presentScaling(1, 1, 1); + if (channel->mNumScalingKeys > 0) { unsigned int frame = (time >= mLastTime) ? std::get<2>(mLastPositions[a]) : 0; - while( frame < channel->mNumScalingKeys - 1) { + while (frame < channel->mNumScalingKeys - 1) { if (time < channel->mScalingKeys[frame + 1].mTime) { break; } @@ -158,12 +159,20 @@ void AnimEvaluator::Evaluate( double pTime ) { } // build a transformation matrix from it - aiMatrix4x4& mat = mTransforms[a]; - mat = aiMatrix4x4( presentRotation.GetMatrix()); - mat.a1 *= presentScaling.x; mat.b1 *= presentScaling.x; mat.c1 *= presentScaling.x; - mat.a2 *= presentScaling.y; mat.b2 *= presentScaling.y; mat.c2 *= presentScaling.y; - mat.a3 *= presentScaling.z; mat.b3 *= presentScaling.z; mat.c3 *= presentScaling.z; - mat.a4 = presentPosition.x; mat.b4 = presentPosition.y; mat.c4 = presentPosition.z; + aiMatrix4x4 &mat = mTransforms[a]; + mat = aiMatrix4x4(presentRotation.GetMatrix()); + mat.a1 *= presentScaling.x; + mat.b1 *= presentScaling.x; + mat.c1 *= presentScaling.x; + mat.a2 *= presentScaling.y; + mat.b2 *= presentScaling.y; + mat.c2 *= presentScaling.y; + mat.a3 *= presentScaling.z; + mat.b3 *= presentScaling.z; + mat.c3 *= presentScaling.z; + mat.a4 = presentPosition.x; + mat.b4 = presentPosition.y; + mat.c4 = presentPosition.z; } mLastTime = time; diff --git a/tools/assimp_view/AnimEvaluator.h b/tools/assimp_view/AnimEvaluator.h index 9267853e1..12bb91c30 100644 --- a/tools/assimp_view/AnimEvaluator.h +++ b/tools/assimp_view/AnimEvaluator.h @@ -58,7 +58,7 @@ public: /// the object. /// @param pAnim The animation to calculate poses for. Ownership of the animation object stays /// at the caller, the evaluator just keeps a reference to it as long as it persists. - AnimEvaluator( const aiAnimation* pAnim); + AnimEvaluator(const aiAnimation *pAnim); /// @brief The class destructor. ~AnimEvaluator(); @@ -68,16 +68,16 @@ public: * @param pTime The time for which you want to evaluate the animation, in seconds. Will be mapped into the animation cycle, so * it can be an arbitrary value. Best use with ever-increasing time stamps. */ - void Evaluate( double pTime); + void Evaluate(double pTime); /** Returns the transform matrices calculated at the last Evaluate() call. The array matches the mChannels array of * the aiAnimation. */ - const std::vector& GetTransformations() const { return mTransforms; } + const std::vector &GetTransformations() const { return mTransforms; } protected: - const aiAnimation* mAnim; + const aiAnimation *mAnim; double mLastTime; - std::vector > mLastPositions; + std::vector> mLastPositions; std::vector mTransforms; }; diff --git a/tools/assimp_view/AssetHelper.h b/tools/assimp_view/AssetHelper.h index 7731e44e5..fe3761cfd 100644 --- a/tools/assimp_view/AssetHelper.h +++ b/tools/assimp_view/AssetHelper.h @@ -39,7 +39,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------- */ - #if (!defined AV_ASSET_HELPER_H_INCLUDED) #define AV_ASSET_HELPER_H_INCLUDED @@ -51,200 +50,187 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. namespace AssimpView { - class SceneAnimator; +class SceneAnimator; - //------------------------------------------------------------------------------- - /** \brief Class to wrap ASSIMP's asset output structures +//------------------------------------------------------------------------------- +/** \brief Class to wrap ASSIMP's asset output structures */ - //------------------------------------------------------------------------------- - class AssetHelper - { - public: - enum - { - // the original normal set will be used - ORIGINAL = 0x0u, +//------------------------------------------------------------------------------- +class AssetHelper { +public: + enum { + // the original normal set will be used + ORIGINAL = 0x0u, - // a smoothed normal set will be used - SMOOTH = 0x1u, + // a smoothed normal set will be used + SMOOTH = 0x1u, - // a hard normal set will be used - HARD = 0x2u, - }; + // a hard normal set will be used + HARD = 0x2u, + }; - // default constructor - AssetHelper() - : iNormalSet( ORIGINAL ) - { - mAnimator = NULL; - apcMeshes = NULL; - pcScene = NULL; + // default constructor + AssetHelper() : + iNormalSet(ORIGINAL) { + mAnimator = NULL; + apcMeshes = NULL; + pcScene = NULL; + } + + //--------------------------------------------------------------- + // default vertex data structure + // (even if tangents, bitangents or normals aren't + // required by the shader they will be committed to the GPU) + //--------------------------------------------------------------- + struct Vertex { + aiVector3D vPosition; + aiVector3D vNormal; + + D3DCOLOR dColorDiffuse; + aiVector3D vTangent; + aiVector3D vBitangent; + aiVector2D vTextureUV; + aiVector2D vTextureUV2; + unsigned char mBoneIndices[4]; + unsigned char mBoneWeights[4]; // last Weight not used, calculated inside the vertex shader + + /** Returns the vertex declaration elements to create a declaration from. */ + static D3DVERTEXELEMENT9 *GetDeclarationElements() { + static D3DVERTEXELEMENT9 decl[] = { + { 0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0 }, + { 0, 12, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_NORMAL, 0 }, + { 0, 24, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 0 }, + { 0, 28, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TANGENT, 0 }, + { 0, 40, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_BINORMAL, 0 }, + { 0, 52, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0 }, + { 0, 60, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 1 }, + { 0, 68, D3DDECLTYPE_UBYTE4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_BLENDINDICES, 0 }, + { 0, 72, D3DDECLTYPE_UBYTE4N, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_BLENDWEIGHT, 0 }, + D3DDECL_END() + }; + + return decl; } + }; - //--------------------------------------------------------------- - // default vertex data structure - // (even if tangents, bitangents or normals aren't - // required by the shader they will be committed to the GPU) - //--------------------------------------------------------------- - struct Vertex - { - aiVector3D vPosition; - aiVector3D vNormal; + //--------------------------------------------------------------- + // FVF vertex structure used for normals + //--------------------------------------------------------------- + struct LineVertex { + aiVector3D vPosition; + DWORD dColorDiffuse; - D3DCOLOR dColorDiffuse; - aiVector3D vTangent; - aiVector3D vBitangent; - aiVector2D vTextureUV; - aiVector2D vTextureUV2; - unsigned char mBoneIndices[ 4 ]; - unsigned char mBoneWeights[ 4 ]; // last Weight not used, calculated inside the vertex shader + // retrieves the FVF code of the vertex type + static DWORD GetFVF() { + return D3DFVF_DIFFUSE | D3DFVF_XYZ; + } + }; - /** Returns the vertex declaration elements to create a declaration from. */ - static D3DVERTEXELEMENT9* GetDeclarationElements() - { - static D3DVERTEXELEMENT9 decl[] = - { - { 0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0 }, - { 0, 12, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_NORMAL, 0 }, - { 0, 24, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 0 }, - { 0, 28, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TANGENT, 0 }, - { 0, 40, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_BINORMAL, 0 }, - { 0, 52, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0 }, - { 0, 60, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 1 }, - { 0, 68, D3DDECLTYPE_UBYTE4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_BLENDINDICES, 0 }, - { 0, 72, D3DDECLTYPE_UBYTE4N, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_BLENDWEIGHT, 0 }, - D3DDECL_END() - }; - - return decl; - } - }; - - //--------------------------------------------------------------- - // FVF vertex structure used for normals - //--------------------------------------------------------------- - struct LineVertex - { - aiVector3D vPosition; - DWORD dColorDiffuse; - - // retrieves the FVF code of the vertex type - static DWORD GetFVF() - { - return D3DFVF_DIFFUSE | D3DFVF_XYZ; - } - }; - - //--------------------------------------------------------------- - // Helper class to store GPU related resources created for - // a given aiMesh - //--------------------------------------------------------------- - class MeshHelper - { - public: - - MeshHelper() - : + //--------------------------------------------------------------- + // Helper class to store GPU related resources created for + // a given aiMesh + //--------------------------------------------------------------- + class MeshHelper { + public: + MeshHelper() : eShadingMode(), - piVB( NULL ), - piIB( NULL ), - piVBNormals( NULL ), - piEffect( NULL ), - bSharedFX( false ), - piDiffuseTexture( NULL ), - piSpecularTexture( NULL ), - piAmbientTexture( NULL ), - piEmissiveTexture( NULL ), - piNormalTexture( NULL ), - piOpacityTexture( NULL ), - piShininessTexture( NULL ), - piLightmapTexture( NULL ), + piVB(NULL), + piIB(NULL), + piVBNormals(NULL), + piEffect(NULL), + bSharedFX(false), + piDiffuseTexture(NULL), + piSpecularTexture(NULL), + piAmbientTexture(NULL), + piEmissiveTexture(NULL), + piNormalTexture(NULL), + piOpacityTexture(NULL), + piShininessTexture(NULL), + piLightmapTexture(NULL), fOpacity(), fShininess(), fSpecularStrength(), - twosided( false ), - pvOriginalNormals( NULL ) - {} + twosided(false), + pvOriginalNormals(NULL) {} - ~MeshHelper() - { - // NOTE: This is done in DeleteAssetData() - // TODO: Make this a proper d'tor - } + ~MeshHelper() { + // NOTE: This is done in DeleteAssetData() + // TODO: Make this a proper d'tor + } - // shading mode to use. Either Lambert or otherwise phong - // will be used in every case - aiShadingMode eShadingMode; + // shading mode to use. Either Lambert or otherwise phong + // will be used in every case + aiShadingMode eShadingMode; - // vertex buffer - IDirect3DVertexBuffer9* piVB; + // vertex buffer + IDirect3DVertexBuffer9 *piVB; - // index buffer. For partially transparent meshes - // created with dynamic usage to be able to update - // the buffer contents quickly - IDirect3DIndexBuffer9* piIB; + // index buffer. For partially transparent meshes + // created with dynamic usage to be able to update + // the buffer contents quickly + IDirect3DIndexBuffer9 *piIB; - // vertex buffer to be used to draw vertex normals - // (vertex normals are generated in every case) - IDirect3DVertexBuffer9* piVBNormals; + // vertex buffer to be used to draw vertex normals + // (vertex normals are generated in every case) + IDirect3DVertexBuffer9 *piVBNormals; - // shader to be used - ID3DXEffect* piEffect; - bool bSharedFX; + // shader to be used + ID3DXEffect *piEffect; + bool bSharedFX; - // material textures - IDirect3DTexture9* piDiffuseTexture; - IDirect3DTexture9* piSpecularTexture; - IDirect3DTexture9* piAmbientTexture; - IDirect3DTexture9* piEmissiveTexture; - IDirect3DTexture9* piNormalTexture; - IDirect3DTexture9* piOpacityTexture; - IDirect3DTexture9* piShininessTexture; - IDirect3DTexture9* piLightmapTexture; + // material textures + IDirect3DTexture9 *piDiffuseTexture; + IDirect3DTexture9 *piSpecularTexture; + IDirect3DTexture9 *piAmbientTexture; + IDirect3DTexture9 *piEmissiveTexture; + IDirect3DTexture9 *piNormalTexture; + IDirect3DTexture9 *piOpacityTexture; + IDirect3DTexture9 *piShininessTexture; + IDirect3DTexture9 *piLightmapTexture; - // material colors - D3DXVECTOR4 vDiffuseColor; - D3DXVECTOR4 vSpecularColor; - D3DXVECTOR4 vAmbientColor; - D3DXVECTOR4 vEmissiveColor; + // material colors + D3DXVECTOR4 vDiffuseColor; + D3DXVECTOR4 vSpecularColor; + D3DXVECTOR4 vAmbientColor; + D3DXVECTOR4 vEmissiveColor; - // opacity for the material - float fOpacity; + // opacity for the material + float fOpacity; - // shininess for the material - float fShininess; + // shininess for the material + float fShininess; - // strength of the specular highlight - float fSpecularStrength; + // strength of the specular highlight + float fSpecularStrength; - // two-sided? - bool twosided; + // two-sided? + bool twosided; - // Stores a pointer to the original normal set of the asset - aiVector3D* pvOriginalNormals; - }; - - // One instance per aiMesh in the globally loaded asset - MeshHelper** apcMeshes; - - // Scene wrapper instance - aiScene* pcScene; - - // Animation player to animate the scene if necessary - SceneAnimator* mAnimator; - - // Specifies the normal set to be used - unsigned int iNormalSet; - - // ------------------------------------------------------------------ - // set the normal set to be used - void SetNormalSet( unsigned int iSet ); - - // ------------------------------------------------------------------ - // flip all normal vectors - void FlipNormals(); - void FlipNormalsInt(); + // Stores a pointer to the original normal set of the asset + aiVector3D *pvOriginalNormals; }; -} + + // One instance per aiMesh in the globally loaded asset + MeshHelper **apcMeshes; + + // Scene wrapper instance + aiScene *pcScene; + + // Animation player to animate the scene if necessary + SceneAnimator *mAnimator; + + // Specifies the normal set to be used + unsigned int iNormalSet; + + // ------------------------------------------------------------------ + // set the normal set to be used + void SetNormalSet(unsigned int iSet); + + // ------------------------------------------------------------------ + // flip all normal vectors + void FlipNormals(); + void FlipNormalsInt(); +}; +} // namespace AssimpView #endif // !! IG diff --git a/tools/assimp_view/Background.cpp b/tools/assimp_view/Background.cpp index 3cf0a81e3..fe6e68c09 100644 --- a/tools/assimp_view/Background.cpp +++ b/tools/assimp_view/Background.cpp @@ -118,8 +118,9 @@ CBackgroundPainter CBackgroundPainter::s_cInstance; //------------------------------------------------------------------------------- void CBackgroundPainter::SetColor(D3DCOLOR p_clrNew) { - if (TEXTURE_CUBE == eMode) + if (TEXTURE_CUBE == eMode) { RemoveSBDeps(); + } clrColor = p_clrNew; eMode = SIMPLE_COLOR; diff --git a/tools/assimp_view/MaterialManager.h b/tools/assimp_view/MaterialManager.h index fb3fcb38f..107c4d9f0 100644 --- a/tools/assimp_view/MaterialManager.h +++ b/tools/assimp_view/MaterialManager.h @@ -45,164 +45,154 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "AssetHelper.h" -namespace AssimpView -{ +namespace AssimpView { - //------------------------------------------------------------------------------- - /* Helper class to create, access and destroy materials +//------------------------------------------------------------------------------- +/* Helper class to create, access and destroy materials */ - //------------------------------------------------------------------------------- - class CMaterialManager - { - private: +//------------------------------------------------------------------------------- +class CMaterialManager { +private: + friend class CDisplay; - friend class CDisplay; + // default constructor + CMaterialManager() : + m_iShaderCount(0), sDefaultTexture() {} - // default constructor - CMaterialManager() - : m_iShaderCount( 0 ), sDefaultTexture() {} - - ~CMaterialManager() { - if( sDefaultTexture ) { - sDefaultTexture->Release(); - } - Reset(); + ~CMaterialManager() { + if (sDefaultTexture) { + sDefaultTexture->Release(); } + Reset(); + } - public: +public: + //------------------------------------------------------------------ + // Singleton accessors + static CMaterialManager s_cInstance; + inline static CMaterialManager &Instance() { + return s_cInstance; + } - //------------------------------------------------------------------ - // Singleton accessors - static CMaterialManager s_cInstance; - inline static CMaterialManager& Instance() - { - return s_cInstance; + //------------------------------------------------------------------ + // Delete all resources of a given material + // + // Must be called before CreateMaterial() to prevent memory leaking + void DeleteMaterial(AssetHelper::MeshHelper *pcIn); + + //------------------------------------------------------------------ + // Create the material for a mesh. + // + // The function checks whether an identical shader is already in use. + // A shader is considered to be identical if it has the same input + // signature and takes the same number of texture channels. + int CreateMaterial(AssetHelper::MeshHelper *pcMesh, + const aiMesh *pcSource); + + //------------------------------------------------------------------ + // Setup the material for a given mesh + // pcMesh Mesh to be rendered + // pcProj Projection matrix + // aiMe Current world matrix + // pcCam Camera matrix + // vPos Position of the camera + // TODO: Extract camera position from matrix ... + // + int SetupMaterial(AssetHelper::MeshHelper *pcMesh, + const aiMatrix4x4 &pcProj, + const aiMatrix4x4 &aiMe, + const aiMatrix4x4 &pcCam, + const aiVector3D &vPos); + + //------------------------------------------------------------------ + // End the material for a given mesh + // Called after mesh rendering is complete + // pcMesh Mesh object + int EndMaterial(AssetHelper::MeshHelper *pcMesh); + + //------------------------------------------------------------------ + // Recreate all specular materials depending on the current + // specularity settings + // + // Diffuse-only materials are ignored. + // Must be called after specular highlights have been toggled + int UpdateSpecularMaterials(); + + //------------------------------------------------------------------ + // find a valid path to a texture file + // + // Handle 8.3 syntax correctly, search the environment of the + // executable and the asset for a texture with a name very similar + // to a given one + int FindValidPath(aiString *p_szString); + + //------------------------------------------------------------------ + // Load a texture into memory and create a native D3D texture resource + // + // The function tries to find a valid path for a texture + int LoadTexture(IDirect3DTexture9 **p_ppiOut, aiString *szPath); + + //------------------------------------------------------------------ + // Getter for m_iShaderCount + // + inline unsigned int GetShaderCount() { + return this->m_iShaderCount; + } + + //------------------------------------------------------------------ + // Reset the state of the class + // Called whenever a new asset is loaded + inline void Reset() { + this->m_iShaderCount = 0; + for (TextureCache::iterator it = sCachedTextures.begin(); it != sCachedTextures.end(); ++it) { + (*it).second->Release(); } + sCachedTextures.clear(); + } - //------------------------------------------------------------------ - // Delete all resources of a given material - // - // Must be called before CreateMaterial() to prevent memory leaking - void DeleteMaterial( AssetHelper::MeshHelper* pcIn ); +private: + //------------------------------------------------------------------ + // find a valid path to a texture file + // + // Handle 8.3 syntax correctly, search the environment of the + // executable and the asset for a texture with a name very similar + // to a given one + bool TryLongerPath(char *szTemp, aiString *p_szString); - //------------------------------------------------------------------ - // Create the material for a mesh. - // - // The function checks whether an identical shader is already in use. - // A shader is considered to be identical if it has the same input - // signature and takes the same number of texture channels. - int CreateMaterial( AssetHelper::MeshHelper* pcMesh, - const aiMesh* pcSource ); + //------------------------------------------------------------------ + // Setup the default texture for a texture channel + // + // Generates a default checker pattern for a texture + int SetDefaultTexture(IDirect3DTexture9 **p_ppiOut); - //------------------------------------------------------------------ - // Setup the material for a given mesh - // pcMesh Mesh to be rendered - // pcProj Projection matrix - // aiMe Current world matrix - // pcCam Camera matrix - // vPos Position of the camera - // TODO: Extract camera position from matrix ... - // - int SetupMaterial( AssetHelper::MeshHelper* pcMesh, - const aiMatrix4x4& pcProj, - const aiMatrix4x4& aiMe, - const aiMatrix4x4& pcCam, - const aiVector3D& vPos ); + //------------------------------------------------------------------ + // Convert a height map to a normal map if necessary + // + // The function tries to detect the type of a texture automatically. + // However, this won't work in every case. + void HMtoNMIfNecessary(IDirect3DTexture9 *piTexture, + IDirect3DTexture9 **piTextureOut, + bool bWasOriginallyHM = true); - //------------------------------------------------------------------ - // End the material for a given mesh - // Called after mesh rendering is complete - // pcMesh Mesh object - int EndMaterial( AssetHelper::MeshHelper* pcMesh ); + //------------------------------------------------------------------ + // Search for non-opaque pixels in a texture + // + // A pixel is considered to be non-opaque if its alpha value is + // less than 255 + //------------------------------------------------------------------ + bool HasAlphaPixels(IDirect3DTexture9 *piTexture); - //------------------------------------------------------------------ - // Recreate all specular materials depending on the current - // specularity settings - // - // Diffuse-only materials are ignored. - // Must be called after specular highlights have been toggled - int UpdateSpecularMaterials(); +private: + // + // Specifies the number of different shaders generated for + // the current asset. This number is incremented by CreateMaterial() + // each time a shader isn't found in cache and needs to be created + // + unsigned int m_iShaderCount; + IDirect3DTexture9 *sDefaultTexture; - //------------------------------------------------------------------ - // find a valid path to a texture file - // - // Handle 8.3 syntax correctly, search the environment of the - // executable and the asset for a texture with a name very similar - // to a given one - int FindValidPath( aiString* p_szString ); + typedef std::map TextureCache; + TextureCache sCachedTextures; +}; - //------------------------------------------------------------------ - // Load a texture into memory and create a native D3D texture resource - // - // The function tries to find a valid path for a texture - int LoadTexture( IDirect3DTexture9** p_ppiOut, aiString* szPath ); - - - //------------------------------------------------------------------ - // Getter for m_iShaderCount - // - inline unsigned int GetShaderCount() - { - return this->m_iShaderCount; - } - - //------------------------------------------------------------------ - // Reset the state of the class - // Called whenever a new asset is loaded - inline void Reset() - { - this->m_iShaderCount = 0; - for( TextureCache::iterator it = sCachedTextures.begin(); it != sCachedTextures.end(); ++it ) { - ( *it ).second->Release(); - } - sCachedTextures.clear(); - } - - private: - - //------------------------------------------------------------------ - // find a valid path to a texture file - // - // Handle 8.3 syntax correctly, search the environment of the - // executable and the asset for a texture with a name very similar - // to a given one - bool TryLongerPath( char* szTemp, aiString* p_szString ); - - //------------------------------------------------------------------ - // Setup the default texture for a texture channel - // - // Generates a default checker pattern for a texture - int SetDefaultTexture( IDirect3DTexture9** p_ppiOut ); - - //------------------------------------------------------------------ - // Convert a height map to a normal map if necessary - // - // The function tries to detect the type of a texture automatically. - // However, this won't work in every case. - void HMtoNMIfNecessary( IDirect3DTexture9* piTexture, - IDirect3DTexture9** piTextureOut, - bool bWasOriginallyHM = true ); - - //------------------------------------------------------------------ - // Search for non-opaque pixels in a texture - // - // A pixel is considered to be non-opaque if its alpha value is - // less than 255 - //------------------------------------------------------------------ - bool HasAlphaPixels( IDirect3DTexture9* piTexture ); - - private: - - // - // Specifies the number of different shaders generated for - // the current asset. This number is incremented by CreateMaterial() - // each time a shader isn't found in cache and needs to be created - // - unsigned int m_iShaderCount; - IDirect3DTexture9* sDefaultTexture; - - typedef std::map TextureCache; - TextureCache sCachedTextures; - }; - -} +} // namespace AssimpView diff --git a/tools/assimp_view/SceneAnimator.h b/tools/assimp_view/SceneAnimator.h index 82f3616c5..33b8568a4 100644 --- a/tools/assimp_view/SceneAnimator.h +++ b/tools/assimp_view/SceneAnimator.h @@ -58,8 +58,8 @@ namespace AssimpView { */ struct SceneAnimNode { std::string mName; - SceneAnimNode* mParent; - std::vector mChildren; + SceneAnimNode *mParent; + std::vector mChildren; //! most recently calculated local transform aiMatrix4x4 mLocalTransform; @@ -71,30 +71,20 @@ struct SceneAnimNode { int mChannelIndex; //! Default construction - SceneAnimNode() - : mName() - , mParent(nullptr) - , mChildren() - , mLocalTransform() - , mGlobalTransform() - , mChannelIndex(-1) { + SceneAnimNode() : + mName(), mParent(nullptr), mChildren(), mLocalTransform(), mGlobalTransform(), mChannelIndex(-1) { // empty } //! Construction from a given name - SceneAnimNode( const std::string& pName) - : mName( pName) - , mParent(nullptr) - , mChildren() - , mLocalTransform() - , mGlobalTransform() - , mChannelIndex(-1) { + SceneAnimNode(const std::string &pName) : + mName(pName), mParent(nullptr), mChildren(), mLocalTransform(), mGlobalTransform(), mChannelIndex(-1) { // empty } //! Destruct all children recursively ~SceneAnimNode() { - for (std::vector::iterator it = mChildren.begin(); it != mChildren.end(); ++it) { + for (std::vector::iterator it = mChildren.begin(); it != mChildren.end(); ++it) { delete *it; } } @@ -112,7 +102,6 @@ struct SceneAnimNode { */ class SceneAnimator { public: - // ---------------------------------------------------------------------------- /** Constructor for a given scene. * @@ -122,7 +111,7 @@ public: * @param pAnimIndex [optional] Index of the animation to play. Assumed to * be 0 if not given. */ - SceneAnimator( const aiScene* pScene, size_t pAnimIndex = 0); + SceneAnimator(const aiScene *pScene, size_t pAnimIndex = 0); /** Destructor */ ~SceneAnimator(); @@ -132,14 +121,14 @@ public: * mapping structures, which might take a few cycles. * @param pAnimIndex Index of the animation in the scene's animation array */ - void SetAnimIndex( size_t pAnimIndex); + void SetAnimIndex(size_t pAnimIndex); // ---------------------------------------------------------------------------- /** Calculates the node transformations for the scene. Call this to get * uptodate results before calling one of the getters. * @param pTime Current time. Can be an arbitrary range. */ - void Calculate( double pTime); + void Calculate(double pTime); // ---------------------------------------------------------------------------- /** Retrieves the most recent local transformation matrix for the given node. @@ -154,7 +143,7 @@ public: * @return A reference to the node's most recently calculated local * transformation matrix. */ - const aiMatrix4x4& GetLocalTransform( const aiNode* node) const; + const aiMatrix4x4 &GetLocalTransform(const aiNode *node) const; // ---------------------------------------------------------------------------- /** Retrieves the most recent global transformation matrix for the given node. @@ -169,7 +158,7 @@ public: * @return A reference to the node's most recently calculated global * transformation matrix. */ - const aiMatrix4x4& GetGlobalTransform( const aiNode* node) const; + const aiMatrix4x4 &GetGlobalTransform(const aiNode *node) const; // ---------------------------------------------------------------------------- /** Calculates the bone matrices for the given mesh. @@ -187,8 +176,8 @@ public: * @return A reference to a vector of bone matrices. Stays stable till the * next call to GetBoneMatrices(); */ - const std::vector& GetBoneMatrices( const aiNode* pNode, - size_t pMeshIndex = 0); + const std::vector &GetBoneMatrices(const aiNode *pNode, + size_t pMeshIndex = 0); // ---------------------------------------------------------------------------- /** @brief Get the current animation index @@ -200,44 +189,43 @@ public: // ---------------------------------------------------------------------------- /** @brief Get the current animation or NULL */ - aiAnimation* CurrentAnim() const { - return static_cast( mCurrentAnimIndex ) < mScene->mNumAnimations ? mScene->mAnimations[ mCurrentAnimIndex ] : NULL; + aiAnimation *CurrentAnim() const { + return static_cast(mCurrentAnimIndex) < mScene->mNumAnimations ? mScene->mAnimations[mCurrentAnimIndex] : NULL; } protected: - /** Recursively creates an internal node structure matching the * current scene and animation. */ - SceneAnimNode* CreateNodeTree( aiNode* pNode, SceneAnimNode* pParent); + SceneAnimNode *CreateNodeTree(aiNode *pNode, SceneAnimNode *pParent); /** Recursively updates the internal node transformations from the * given matrix array */ - void UpdateTransforms( SceneAnimNode* pNode, const std::vector& pTransforms); + void UpdateTransforms(SceneAnimNode *pNode, const std::vector &pTransforms); /** Calculates the global transformation matrix for the given internal node */ - void CalculateGlobalTransform( SceneAnimNode* pInternalNode); + void CalculateGlobalTransform(SceneAnimNode *pInternalNode); protected: /** The scene we're operating on */ - const aiScene* mScene; + const aiScene *mScene; /** Current animation index */ int mCurrentAnimIndex; /** The AnimEvaluator we use to calculate the current pose for the current animation */ - AnimEvaluator* mAnimEvaluator; + AnimEvaluator *mAnimEvaluator; /** Root node of the internal scene structure */ - SceneAnimNode* mRootNode; + SceneAnimNode *mRootNode; /** Name to node map to quickly find nodes by their name */ - typedef std::map NodeMap; + typedef std::map NodeMap; NodeMap mNodesByName; /** Name to node map to quickly find nodes for given bones by their name */ - typedef std::map BoneMap; + typedef std::map BoneMap; BoneMap mBoneNodesByName; /** Array to return transformations results inside. */ diff --git a/tools/assimp_view/assimp_view.cpp b/tools/assimp_view/assimp_view.cpp index 79a902b2a..5342f14d0 100644 --- a/tools/assimp_view/assimp_view.cpp +++ b/tools/assimp_view/assimp_view.cpp @@ -5,8 +5,6 @@ Open Asset Import Library (assimp) Copyright (c) 2006-2020, assimp team - - All rights reserved. Redistribution and use of this software in source and binary forms, @@ -41,15 +39,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------- */ - #include "assimp_view.h" #include #include #ifdef __MINGW32__ -# include +#include #else -# include +#include #endif using namespace std; @@ -61,122 +58,118 @@ extern std::string g_szDefaultShader; extern std::string g_szPassThroughShader; //------------------------------------------------------------------------------- -HINSTANCE g_hInstance = nullptr; -HWND g_hDlg = nullptr; -IDirect3D9* g_piD3D = nullptr; -IDirect3DDevice9* g_piDevice = nullptr; -IDirect3DVertexDeclaration9* gDefaultVertexDecl = nullptr; -double g_fFPS = 0.0f; +HINSTANCE g_hInstance = nullptr; +HWND g_hDlg = nullptr; +IDirect3D9 *g_piD3D = nullptr; +IDirect3DDevice9 *g_piDevice = nullptr; +IDirect3DVertexDeclaration9 *gDefaultVertexDecl = nullptr; +double g_fFPS = 0.0f; char g_szFileName[MAX_PATH]; -ID3DXEffect* g_piDefaultEffect = nullptr; -ID3DXEffect* g_piNormalsEffect = nullptr; -ID3DXEffect* g_piPassThroughEffect = nullptr; -ID3DXEffect* g_piPatternEffect = nullptr; -bool g_bMousePressed = false; -bool g_bMousePressedR = false; -bool g_bMousePressedM = false; -bool g_bMousePressedBoth = false; -float g_fElpasedTime = 0.0f; +ID3DXEffect *g_piDefaultEffect = nullptr; +ID3DXEffect *g_piNormalsEffect = nullptr; +ID3DXEffect *g_piPassThroughEffect = nullptr; +ID3DXEffect *g_piPatternEffect = nullptr; +bool g_bMousePressed = false; +bool g_bMousePressedR = false; +bool g_bMousePressedM = false; +bool g_bMousePressedBoth = false; +float g_fElpasedTime = 0.0f; D3DCAPS9 g_sCaps; -bool g_bLoadingFinished = false; -HANDLE g_hThreadHandle = nullptr; -float g_fWheelPos = -10.0f; -bool g_bLoadingCanceled = false; -IDirect3DTexture9* g_pcTexture = nullptr; -bool g_bPlay = false; +bool g_bLoadingFinished = false; +HANDLE g_hThreadHandle = nullptr; +float g_fWheelPos = -10.0f; +bool g_bLoadingCanceled = false; +IDirect3DTexture9 *g_pcTexture = nullptr; +bool g_bPlay = false; double g_dCurrent = 0.; // default pp steps unsigned int ppsteps = aiProcess_CalcTangentSpace | // calculate tangents and bitangents if possible - aiProcess_JoinIdenticalVertices | // join identical vertices/ optimize indexing - aiProcess_ValidateDataStructure | // perform a full validation of the loader's output - aiProcess_ImproveCacheLocality | // improve the cache locality of the output vertices - aiProcess_RemoveRedundantMaterials | // remove redundant materials - aiProcess_FindDegenerates | // remove degenerated polygons from the import - aiProcess_FindInvalidData | // detect invalid model data, such as invalid normal vectors - aiProcess_GenUVCoords | // convert spherical, cylindrical, box and planar mapping to proper UVs - aiProcess_TransformUVCoords | // preprocess UV transformations (scaling, translation ...) - aiProcess_FindInstances | // search for instanced meshes and remove them by references to one master - aiProcess_LimitBoneWeights | // limit bone weights to 4 per vertex - aiProcess_OptimizeMeshes | // join small meshes, if possible; - aiProcess_SplitByBoneCount | // split meshes with too many bones. Necessary for our (limited) hardware skinning shader - 0; + aiProcess_JoinIdenticalVertices | // join identical vertices/ optimize indexing + aiProcess_ValidateDataStructure | // perform a full validation of the loader's output + aiProcess_ImproveCacheLocality | // improve the cache locality of the output vertices + aiProcess_RemoveRedundantMaterials | // remove redundant materials + aiProcess_FindDegenerates | // remove degenerated polygons from the import + aiProcess_FindInvalidData | // detect invalid model data, such as invalid normal vectors + aiProcess_GenUVCoords | // convert spherical, cylindrical, box and planar mapping to proper UVs + aiProcess_TransformUVCoords | // preprocess UV transformations (scaling, translation ...) + aiProcess_FindInstances | // search for instanced meshes and remove them by references to one master + aiProcess_LimitBoneWeights | // limit bone weights to 4 per vertex + aiProcess_OptimizeMeshes | // join small meshes, if possible; + aiProcess_SplitByBoneCount | // split meshes with too many bones. Necessary for our (limited) hardware skinning shader + 0; unsigned int ppstepsdefault = ppsteps; bool nopointslines = false; -extern bool g_bWasFlipped /*= false*/; +extern bool g_bWasFlipped /*= false*/; aiMatrix4x4 g_mWorld; aiMatrix4x4 g_mWorldRotate; -aiVector3D g_vRotateSpeed = aiVector3D(0.5f,0.5f,0.5f); +aiVector3D g_vRotateSpeed = aiVector3D(0.5f, 0.5f, 0.5f); // NOTE: The second light direction is now computed from the first -aiVector3D g_avLightDirs[1] = -{ aiVector3D(-0.5f,0.6f,0.2f) }; +aiVector3D g_avLightDirs[1] = { aiVector3D(-0.5f, 0.6f, 0.2f) }; -D3DCOLOR g_avLightColors[3] = -{ - D3DCOLOR_ARGB(0xFF,0xFF,0xFF,0xFF), - D3DCOLOR_ARGB(0xFF,0xFF,0x00,0x00), - D3DCOLOR_ARGB(0xFF,0x05,0x05,0x05), + D3DCOLOR g_avLightColors[3] = { + D3DCOLOR_ARGB(0xFF, 0xFF, 0xFF, 0xFF), + D3DCOLOR_ARGB(0xFF, 0xFF, 0x00, 0x00), + D3DCOLOR_ARGB(0xFF, 0x05, 0x05, 0x05), }; POINT g_mousePos; POINT g_LastmousePos; -bool g_bFPSView = false; -bool g_bInvert = false; -EClickPos g_eClick = EClickPos_Circle; -unsigned int g_iCurrentColor = 0; +bool g_bFPSView = false; +bool g_bInvert = false; +EClickPos g_eClick = EClickPos_Circle; +unsigned int g_iCurrentColor = 0; -float g_fLightIntensity = 1.0f; -float g_fLightColor = 1.0f; +float g_fLightIntensity = 1.0f; +float g_fLightColor = 1.0f; RenderOptions g_sOptions; Camera g_sCamera; -AssetHelper *g_pcAsset = nullptr; +AssetHelper *g_pcAsset = nullptr; // -// Contains the mask image for the HUD +// Contains the mask image for the HUD // (used to determine the position of a click) // -unsigned char* g_szImageMask = nullptr; +unsigned char *g_szImageMask = nullptr; float g_fLoadTime = 0.0f; - //------------------------------------------------------------------------------- // Entry point for the loader thread // The loader thread loads the asset while the progress dialog displays the // smart progress bar //------------------------------------------------------------------------------- -DWORD WINAPI LoadThreadProc(LPVOID lpParameter) -{ +DWORD WINAPI LoadThreadProc(LPVOID lpParameter) { UNREFERENCED_PARAMETER(lpParameter); // get current time double fCur = (double)timeGetTime(); - aiPropertyStore* props = aiCreatePropertyStore(); - aiSetImportPropertyInteger(props,AI_CONFIG_IMPORT_TER_MAKE_UVS,1); - aiSetImportPropertyFloat(props,AI_CONFIG_PP_GSN_MAX_SMOOTHING_ANGLE,g_smoothAngle); - aiSetImportPropertyInteger(props,AI_CONFIG_PP_SBP_REMOVE,nopointslines ? aiPrimitiveType_LINE | aiPrimitiveType_POINT : 0 ); + aiPropertyStore *props = aiCreatePropertyStore(); + aiSetImportPropertyInteger(props, AI_CONFIG_IMPORT_TER_MAKE_UVS, 1); + aiSetImportPropertyFloat(props, AI_CONFIG_PP_GSN_MAX_SMOOTHING_ANGLE, g_smoothAngle); + aiSetImportPropertyInteger(props, AI_CONFIG_PP_SBP_REMOVE, nopointslines ? aiPrimitiveType_LINE | aiPrimitiveType_POINT : 0); - aiSetImportPropertyInteger(props,AI_CONFIG_GLOB_MEASURE_TIME,1); + aiSetImportPropertyInteger(props, AI_CONFIG_GLOB_MEASURE_TIME, 1); //aiSetImportPropertyInteger(props,AI_CONFIG_PP_PTV_KEEP_HIERARCHY,1); // Call ASSIMPs C-API to load the file - g_pcAsset->pcScene = (aiScene*)aiImportFileExWithProperties(g_szFileName, - ppsteps | /* configurable pp steps */ - aiProcess_GenSmoothNormals | // generate smooth normal vectors if not existing - aiProcess_SplitLargeMeshes | // split large, unrenderable meshes into submeshes - aiProcess_Triangulate | // triangulate polygons with more than 3 edges - aiProcess_ConvertToLeftHanded | // convert everything to D3D left handed space - aiProcess_SortByPType | // make 'clean' meshes which consist of a single typ of primitives - 0, - nullptr, - props); + g_pcAsset->pcScene = (aiScene *)aiImportFileExWithProperties(g_szFileName, + ppsteps | /* configurable pp steps */ + aiProcess_GenSmoothNormals | // generate smooth normal vectors if not existing + aiProcess_SplitLargeMeshes | // split large, unrenderable meshes into submeshes + aiProcess_Triangulate | // triangulate polygons with more than 3 edges + aiProcess_ConvertToLeftHanded | // convert everything to D3D left handed space + aiProcess_SortByPType | // make 'clean' meshes which consist of a single typ of primitives + 0, + nullptr, + props); aiReleasePropertyStore(props); @@ -186,14 +179,13 @@ DWORD WINAPI LoadThreadProc(LPVOID lpParameter) g_bLoadingFinished = true; // check whether the loading process has failed ... - if (nullptr == g_pcAsset->pcScene) - { + if (nullptr == g_pcAsset->pcScene) { CLogDisplay::Instance().AddEntry("[ERROR] Unable to load this asset:", - D3DCOLOR_ARGB(0xFF,0xFF,0,0)); + D3DCOLOR_ARGB(0xFF, 0xFF, 0, 0)); // print ASSIMPs error string to the log display CLogDisplay::Instance().AddEntry(aiGetErrorString(), - D3DCOLOR_ARGB(0xFF,0xFF,0,0)); + D3DCOLOR_ARGB(0xFF, 0xFF, 0, 0)); return 1; } @@ -204,38 +196,36 @@ DWORD WINAPI LoadThreadProc(LPVOID lpParameter) // load the current asset // THe path to the asset is specified in the global path variable //------------------------------------------------------------------------------- -int LoadAsset() -{ +int LoadAsset() { // set the world and world rotation matrices to the identity g_mWorldRotate = aiMatrix4x4(); g_mWorld = aiMatrix4x4(); -// char szTemp[MAX_PATH+64]; -// sprintf(szTemp,"Starting to load %s",g_szFileName); + // char szTemp[MAX_PATH+64]; + // sprintf(szTemp,"Starting to load %s",g_szFileName); CLogWindow::Instance().WriteLine( - "----------------------------------------------------------------------------"); -// CLogWindow::Instance().WriteLine(szTemp); -// CLogWindow::Instance().WriteLine( -// "----------------------------------------------------------------------------"); + "----------------------------------------------------------------------------"); + // CLogWindow::Instance().WriteLine(szTemp); + // CLogWindow::Instance().WriteLine( + // "----------------------------------------------------------------------------"); CLogWindow::Instance().SetAutoUpdate(false); // create a helper thread to load the asset DWORD dwID; g_bLoadingCanceled = false; g_pcAsset = new AssetHelper(); - g_hThreadHandle = CreateThread(nullptr,0,&LoadThreadProc,nullptr,0,&dwID); + g_hThreadHandle = CreateThread(nullptr, 0, &LoadThreadProc, nullptr, 0, &dwID); - if (!g_hThreadHandle) - { + if (!g_hThreadHandle) { CLogDisplay::Instance().AddEntry( - "[ERROR] Unable to create helper thread for loading", - D3DCOLOR_ARGB(0xFF,0xFF,0,0)); + "[ERROR] Unable to create helper thread for loading", + D3DCOLOR_ARGB(0xFF, 0xFF, 0, 0)); return 0; } // show the progress bar dialog - DialogBox(g_hInstance,MAKEINTRESOURCE(IDD_LOADDIALOG), - g_hDlg,&ProgressMessageProc); + DialogBox(g_hInstance, MAKEINTRESOURCE(IDD_LOADDIALOG), + g_hDlg, &ProgressMessageProc); // update the log window CLogWindow::Instance().SetAutoUpdate(true); @@ -243,10 +233,8 @@ int LoadAsset() // now we should have loaded the asset. Check this ... g_bLoadingFinished = false; - if (!g_pcAsset || !g_pcAsset->pcScene) - { - if (g_pcAsset) - { + if (!g_pcAsset || !g_pcAsset->pcScene) { + if (g_pcAsset) { delete g_pcAsset; g_pcAsset = nullptr; } @@ -255,40 +243,38 @@ int LoadAsset() // allocate a new MeshHelper array and build a new instance // for each mesh in the original asset - g_pcAsset->apcMeshes = new AssetHelper::MeshHelper*[g_pcAsset->pcScene->mNumMeshes](); - for (unsigned int i = 0; i < g_pcAsset->pcScene->mNumMeshes;++i) + g_pcAsset->apcMeshes = new AssetHelper::MeshHelper *[g_pcAsset->pcScene->mNumMeshes](); + for (unsigned int i = 0; i < g_pcAsset->pcScene->mNumMeshes; ++i) g_pcAsset->apcMeshes[i] = new AssetHelper::MeshHelper(); - // create animator - g_pcAsset->mAnimator = new SceneAnimator( g_pcAsset->pcScene); + g_pcAsset->mAnimator = new SceneAnimator(g_pcAsset->pcScene); // build a new caption string for the viewer - static const size_t Size = MAX_PATH + 10; - char szOut[Size]; - ai_snprintf(szOut, Size,AI_VIEW_CAPTION_BASE " [%s]",g_szFileName); - SetWindowText(g_hDlg,szOut); + static const size_t Size = MAX_PATH + 10; + char szOut[Size]; + ai_snprintf(szOut, Size, AI_VIEW_CAPTION_BASE " [%s]", g_szFileName); + SetWindowText(g_hDlg, szOut); // scale the asset vertices to fit into the viewer window ScaleAsset(); // reset the camera view to the default position - g_sCamera.vPos = aiVector3D(0.0f,0.0f,-10.0f); - g_sCamera.vLookAt = aiVector3D(0.0f,0.0f,1.0f); - g_sCamera.vUp = aiVector3D(0.0f,1.0f,0.0f); - g_sCamera.vRight = aiVector3D(0.0f,1.0f,0.0f); + g_sCamera.vPos = aiVector3D(0.0f, 0.0f, -10.0f); + g_sCamera.vLookAt = aiVector3D(0.0f, 0.0f, 1.0f); + g_sCamera.vUp = aiVector3D(0.0f, 1.0f, 0.0f); + g_sCamera.vRight = aiVector3D(0.0f, 1.0f, 0.0f); // build native D3D vertex/index buffers, textures, materials - if( 1 != CreateAssetData()) + if (1 != CreateAssetData()) return 0; if (!g_pcAsset->pcScene->HasAnimations()) { - EnableWindow(GetDlgItem(g_hDlg,IDC_PLAY),FALSE); - EnableWindow(GetDlgItem(g_hDlg,IDC_SLIDERANIM),FALSE); - } - else { - EnableWindow(GetDlgItem(g_hDlg,IDC_PLAY),TRUE); - EnableWindow(GetDlgItem(g_hDlg,IDC_SLIDERANIM),TRUE); + EnableWindow(GetDlgItem(g_hDlg, IDC_PLAY), FALSE); + EnableWindow(GetDlgItem(g_hDlg, IDC_SLIDERANIM), FALSE); + } else { + EnableWindow(GetDlgItem(g_hDlg, IDC_PLAY), TRUE); + EnableWindow(GetDlgItem(g_hDlg, IDC_SLIDERANIM), TRUE); } CLogDisplay::Instance().AddEntry("[OK] The asset has been loaded successfully"); @@ -296,7 +282,7 @@ int LoadAsset() CDisplay::Instance().FillAnimList(); CDisplay::Instance().FillDefaultStatistics(); - + // render the scene once CDisplay::Instance().OnRender(); @@ -305,7 +291,6 @@ int LoadAsset() return 1; } - //------------------------------------------------------------------------------- // Delete the loaded asset // The function does nothing is no asset is loaded @@ -320,8 +305,7 @@ int DeleteAsset(void) { // delete everything DeleteAssetData(); - for (unsigned int i = 0; i < g_pcAsset->pcScene->mNumMeshes;++i) - { + for (unsigned int i = 0; i < g_pcAsset->pcScene->mNumMeshes; ++i) { delete g_pcAsset->apcMeshes[i]; } aiReleaseImport(g_pcAsset->pcScene); @@ -331,7 +315,7 @@ int DeleteAsset(void) { g_pcAsset = nullptr; // reset the caption of the viewer window - SetWindowText(g_hDlg,AI_VIEW_CAPTION_BASE); + SetWindowText(g_hDlg, AI_VIEW_CAPTION_BASE); // clear UI CDisplay::Instance().ClearAnimList(); @@ -342,7 +326,6 @@ int DeleteAsset(void) { return 1; } - //------------------------------------------------------------------------------- // Calculate the boundaries of a given node and all of its children // The boundaries are in Worldspace (AABB) @@ -350,7 +333,7 @@ int DeleteAsset(void) { // p_avOut Receives the min/max boundaries. Must point to 2 vec3s // piMatrix Transformation matrix of the graph at this position //------------------------------------------------------------------------------- -int CalculateBounds(aiNode* piNode, aiVector3D* p_avOut, const aiMatrix4x4& piMatrix) { +int CalculateBounds(aiNode *piNode, aiVector3D *p_avOut, const aiMatrix4x4 &piMatrix) { ai_assert(nullptr != piNode); ai_assert(nullptr != p_avOut); @@ -358,28 +341,24 @@ int CalculateBounds(aiNode* piNode, aiVector3D* p_avOut, const aiMatrix4x4& piMa mTemp.Transpose(); aiMatrix4x4 aiMe = mTemp * piMatrix; - for (unsigned int i = 0; i < piNode->mNumMeshes;++i) - { - for( unsigned int a = 0; a < g_pcAsset->pcScene->mMeshes[ - piNode->mMeshes[i]]->mNumVertices;++a) - { - aiVector3D pc =g_pcAsset->pcScene->mMeshes[piNode->mMeshes[i]]->mVertices[a]; + for (unsigned int i = 0; i < piNode->mNumMeshes; ++i) { + for (unsigned int a = 0; a < g_pcAsset->pcScene->mMeshes[piNode->mMeshes[i]]->mNumVertices; ++a) { + aiVector3D pc = g_pcAsset->pcScene->mMeshes[piNode->mMeshes[i]]->mVertices[a]; aiVector3D pc1; - D3DXVec3TransformCoord((D3DXVECTOR3*)&pc1,(D3DXVECTOR3*)&pc, - (D3DXMATRIX*)&aiMe); + D3DXVec3TransformCoord((D3DXVECTOR3 *)&pc1, (D3DXVECTOR3 *)&pc, + (D3DXMATRIX *)&aiMe); - p_avOut[0].x = min( p_avOut[0].x, pc1.x); - p_avOut[0].y = min( p_avOut[0].y, pc1.y); - p_avOut[0].z = min( p_avOut[0].z, pc1.z); - p_avOut[1].x = max( p_avOut[1].x, pc1.x); - p_avOut[1].y = max( p_avOut[1].y, pc1.y); - p_avOut[1].z = max( p_avOut[1].z, pc1.z); + p_avOut[0].x = min(p_avOut[0].x, pc1.x); + p_avOut[0].y = min(p_avOut[0].y, pc1.y); + p_avOut[0].z = min(p_avOut[0].z, pc1.z); + p_avOut[1].x = max(p_avOut[1].x, pc1.x); + p_avOut[1].y = max(p_avOut[1].y, pc1.y); + p_avOut[1].z = max(p_avOut[1].z, pc1.z); } } - for (unsigned int i = 0; i < piNode->mNumChildren;++i) - { - CalculateBounds( piNode->mChildren[i], p_avOut, aiMe ); + for (unsigned int i = 0; i < piNode->mNumChildren; ++i) { + CalculateBounds(piNode->mChildren[i], p_avOut, aiMe); } return 1; } @@ -388,31 +367,29 @@ int CalculateBounds(aiNode* piNode, aiVector3D* p_avOut, const aiMatrix4x4& piMa // The function calculates the boundaries of the mesh and modifies the // global world transformation matrix according to the aset AABB //------------------------------------------------------------------------------- -int ScaleAsset(void) -{ - aiVector3D aiVecs[2] = {aiVector3D( 1e10f, 1e10f, 1e10f), - aiVector3D( -1e10f, -1e10f, -1e10f) }; +int ScaleAsset(void) { + aiVector3D aiVecs[2] = { aiVector3D(1e10f, 1e10f, 1e10f), + aiVector3D(-1e10f, -1e10f, -1e10f) }; - if (g_pcAsset->pcScene->mRootNode) - { + if (g_pcAsset->pcScene->mRootNode) { aiMatrix4x4 m; - CalculateBounds(g_pcAsset->pcScene->mRootNode,aiVecs,m); + CalculateBounds(g_pcAsset->pcScene->mRootNode, aiVecs, m); } - aiVector3D vDelta = aiVecs[1]-aiVecs[0]; - aiVector3D vHalf = aiVecs[0] + (vDelta / 2.0f); + aiVector3D vDelta = aiVecs[1] - aiVecs[0]; + aiVector3D vHalf = aiVecs[0] + (vDelta / 2.0f); float fScale = 10.0f / vDelta.Length(); - g_mWorld = aiMatrix4x4( - 1.0f,0.0f,0.0f,0.0f, - 0.0f,1.0f,0.0f,0.0f, - 0.0f,0.0f,1.0f,0.0f, - -vHalf.x,-vHalf.y,-vHalf.z,1.0f) * - aiMatrix4x4( - fScale,0.0f,0.0f,0.0f, - 0.0f,fScale,0.0f,0.0f, - 0.0f,0.0f,fScale,0.0f, - 0.0f,0.0f,0.0f,1.0f); + g_mWorld = aiMatrix4x4( + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + -vHalf.x, -vHalf.y, -vHalf.z, 1.0f) * + aiMatrix4x4( + fScale, 0.0f, 0.0f, 0.0f, + 0.0f, fScale, 0.0f, 0.0f, + 0.0f, 0.0f, fScale, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f); return 1; } @@ -422,30 +399,27 @@ int ScaleAsset(void) // pcMesh Input mesh // pcSource Source mesh from ASSIMP //------------------------------------------------------------------------------- -int GenerateNormalsAsLineList(AssetHelper::MeshHelper* pcMesh,const aiMesh* pcSource) -{ +int GenerateNormalsAsLineList(AssetHelper::MeshHelper *pcMesh, const aiMesh *pcSource) { ai_assert(nullptr != pcMesh); ai_assert(nullptr != pcSource); - if (!pcSource->mNormals)return 0; + if (!pcSource->mNormals) return 0; // create vertex buffer - if(FAILED( g_piDevice->CreateVertexBuffer(sizeof(AssetHelper::LineVertex) * - pcSource->mNumVertices * 2, - D3DUSAGE_WRITEONLY, - AssetHelper::LineVertex::GetFVF(), - D3DPOOL_DEFAULT, &pcMesh->piVBNormals,nullptr))) - { + if (FAILED(g_piDevice->CreateVertexBuffer(sizeof(AssetHelper::LineVertex) * + pcSource->mNumVertices * 2, + D3DUSAGE_WRITEONLY, + AssetHelper::LineVertex::GetFVF(), + D3DPOOL_DEFAULT, &pcMesh->piVBNormals, nullptr))) { CLogDisplay::Instance().AddEntry("Failed to create vertex buffer for the normal list", - D3DCOLOR_ARGB(0xFF,0xFF,0,0)); + D3DCOLOR_ARGB(0xFF, 0xFF, 0, 0)); return 2; } // now fill the vertex buffer with data - AssetHelper::LineVertex* pbData2; - pcMesh->piVBNormals->Lock(0,0,(void**)&pbData2,0); - for (unsigned int x = 0; x < pcSource->mNumVertices;++x) - { + AssetHelper::LineVertex *pbData2; + pcMesh->piVBNormals->Lock(0, 0, (void **)&pbData2, 0); + for (unsigned int x = 0; x < pcSource->mNumVertices; ++x) { pbData2->vPosition = pcSource->mVertices[x]; ++pbData2; @@ -456,9 +430,9 @@ int GenerateNormalsAsLineList(AssetHelper::MeshHelper* pcMesh,const aiMesh* pcSo // scalo with the inverse of the world scaling to make sure // the normals have equal length in each case // TODO: Check whether this works in every case, I don't think so - vNormal.x /= g_mWorld.a1*4; - vNormal.y /= g_mWorld.b2*4; - vNormal.z /= g_mWorld.c3*4; + vNormal.x /= g_mWorld.a1 * 4; + vNormal.y /= g_mWorld.b2 * 4; + vNormal.z /= g_mWorld.c3 * 4; pbData2->vPosition = pcSource->mVertices[x] + vNormal; @@ -472,32 +446,30 @@ int GenerateNormalsAsLineList(AssetHelper::MeshHelper* pcMesh,const aiMesh* pcSo // Create the native D3D representation of the asset: vertex buffers, // index buffers, materials ... //------------------------------------------------------------------------------- -int CreateAssetData() -{ - if (!g_pcAsset)return 0; +int CreateAssetData() { + if (!g_pcAsset) return 0; // reset all subsystems CMaterialManager::Instance().Reset(); CDisplay::Instance().Reset(); - for (unsigned int i = 0; i < g_pcAsset->pcScene->mNumMeshes;++i) - { - const aiMesh* mesh = g_pcAsset->pcScene->mMeshes[i]; + for (unsigned int i = 0; i < g_pcAsset->pcScene->mNumMeshes; ++i) { + const aiMesh *mesh = g_pcAsset->pcScene->mMeshes[i]; // create the material for the mesh - if (!g_pcAsset->apcMeshes[i]->piEffect) { + if (!g_pcAsset->apcMeshes[i]->piEffect) { CMaterialManager::Instance().CreateMaterial( - g_pcAsset->apcMeshes[i],mesh); + g_pcAsset->apcMeshes[i], mesh); } // create vertex buffer - if(FAILED( g_piDevice->CreateVertexBuffer(sizeof(AssetHelper::Vertex) * - mesh->mNumVertices, - D3DUSAGE_WRITEONLY, - 0, - D3DPOOL_DEFAULT, &g_pcAsset->apcMeshes[i]->piVB,nullptr))) { - MessageBox(g_hDlg,"Failed to create vertex buffer", - "ASSIMP Viewer Utility",MB_OK); + if (FAILED(g_piDevice->CreateVertexBuffer(sizeof(AssetHelper::Vertex) * + mesh->mNumVertices, + D3DUSAGE_WRITEONLY, + 0, + D3DPOOL_DEFAULT, &g_pcAsset->apcMeshes[i]->piVB, nullptr))) { + MessageBox(g_hDlg, "Failed to create vertex buffer", + "ASSIMP Viewer Utility", MB_OK); return 2; } @@ -507,18 +479,18 @@ int CreateAssetData() unsigned int nidx = 0; switch (mesh->mPrimitiveTypes) { - case aiPrimitiveType_POINT: - nidx = 1; - break; - case aiPrimitiveType_LINE: - nidx = 2; - break; - case aiPrimitiveType_TRIANGLE: - nidx = 3; - break; - default: - ai_assert(false); - break; + case aiPrimitiveType_POINT: + nidx = 1; + break; + case aiPrimitiveType_LINE: + nidx = 2; + break; + case aiPrimitiveType_TRIANGLE: + nidx = 3; + break; + default: + ai_assert(false); + break; }; unsigned int numIndices = mesh->mNumFaces * 3; @@ -526,54 +498,47 @@ int CreateAssetData() numIndices = mesh->mNumVertices; } // check whether we can use 16 bit indices - if (numIndices >= 65536) { + if (numIndices >= 65536) { // create 32 bit index buffer - if(FAILED( g_piDevice->CreateIndexBuffer( 4 * - numIndices, - D3DUSAGE_WRITEONLY | dwUsage, - D3DFMT_INDEX32, - D3DPOOL_DEFAULT, - &g_pcAsset->apcMeshes[i]->piIB, - nullptr))) - { - MessageBox(g_hDlg,"Failed to create 32 Bit index buffer", - "ASSIMP Viewer Utility",MB_OK); + if (FAILED(g_piDevice->CreateIndexBuffer(4 * + numIndices, + D3DUSAGE_WRITEONLY | dwUsage, + D3DFMT_INDEX32, + D3DPOOL_DEFAULT, + &g_pcAsset->apcMeshes[i]->piIB, + nullptr))) { + MessageBox(g_hDlg, "Failed to create 32 Bit index buffer", + "ASSIMP Viewer Utility", MB_OK); return 2; } // now fill the index buffer - unsigned int* pbData; - g_pcAsset->apcMeshes[i]->piIB->Lock(0,0,(void**)&pbData,0); - for (unsigned int x = 0; x < mesh->mNumFaces;++x) - { - for (unsigned int a = 0; a < nidx;++a) - { + unsigned int *pbData; + g_pcAsset->apcMeshes[i]->piIB->Lock(0, 0, (void **)&pbData, 0); + for (unsigned int x = 0; x < mesh->mNumFaces; ++x) { + for (unsigned int a = 0; a < nidx; ++a) { *pbData++ = mesh->mFaces[x].mIndices[a]; } } - } - else { + } else { // create 16 bit index buffer - if(FAILED( g_piDevice->CreateIndexBuffer( 2 * - numIndices, - D3DUSAGE_WRITEONLY | dwUsage, - D3DFMT_INDEX16, - D3DPOOL_DEFAULT, - &g_pcAsset->apcMeshes[i]->piIB, - nullptr))) - { - MessageBox(g_hDlg,"Failed to create 16 Bit index buffer", - "ASSIMP Viewer Utility",MB_OK); + if (FAILED(g_piDevice->CreateIndexBuffer(2 * + numIndices, + D3DUSAGE_WRITEONLY | dwUsage, + D3DFMT_INDEX16, + D3DPOOL_DEFAULT, + &g_pcAsset->apcMeshes[i]->piIB, + nullptr))) { + MessageBox(g_hDlg, "Failed to create 16 Bit index buffer", + "ASSIMP Viewer Utility", MB_OK); return 2; } // now fill the index buffer - uint16_t* pbData; - g_pcAsset->apcMeshes[i]->piIB->Lock(0,0,(void**)&pbData,0); - for (unsigned int x = 0; x < mesh->mNumFaces;++x) - { - for (unsigned int a = 0; a < nidx;++a) - { + uint16_t *pbData; + g_pcAsset->apcMeshes[i]->piIB->Lock(0, 0, (void **)&pbData, 0); + for (unsigned int x = 0; x < mesh->mNumFaces; ++x) { + for (unsigned int a = 0; a < nidx; ++a) { *pbData++ = (uint16_t)mesh->mFaces[x].mIndices[a]; } } @@ -581,74 +546,71 @@ int CreateAssetData() g_pcAsset->apcMeshes[i]->piIB->Unlock(); // collect weights on all vertices. Quick and careless - std::vector > weightsPerVertex( mesh->mNumVertices); - for( unsigned int a = 0; a < mesh->mNumBones; a++) { - const aiBone* bone = mesh->mBones[a]; - for( unsigned int b = 0; b < bone->mNumWeights; b++) - weightsPerVertex[bone->mWeights[b].mVertexId].push_back( aiVertexWeight( a, bone->mWeights[b].mWeight)); + std::vector> weightsPerVertex(mesh->mNumVertices); + for (unsigned int a = 0; a < mesh->mNumBones; a++) { + const aiBone *bone = mesh->mBones[a]; + for (unsigned int b = 0; b < bone->mNumWeights; b++) + weightsPerVertex[bone->mWeights[b].mVertexId].push_back(aiVertexWeight(a, bone->mWeights[b].mWeight)); } // now fill the vertex buffer - AssetHelper::Vertex* pbData2; - g_pcAsset->apcMeshes[i]->piVB->Lock(0,0,(void**)&pbData2,0); - for (unsigned int x = 0; x < mesh->mNumVertices;++x) - { + AssetHelper::Vertex *pbData2; + g_pcAsset->apcMeshes[i]->piVB->Lock(0, 0, (void **)&pbData2, 0); + for (unsigned int x = 0; x < mesh->mNumVertices; ++x) { pbData2->vPosition = mesh->mVertices[x]; if (nullptr == mesh->mNormals) - pbData2->vNormal = aiVector3D(0.0f,0.0f,0.0f); - else pbData2->vNormal = mesh->mNormals[x]; + pbData2->vNormal = aiVector3D(0.0f, 0.0f, 0.0f); + else + pbData2->vNormal = mesh->mNormals[x]; - if (nullptr == mesh->mTangents) { - pbData2->vTangent = aiVector3D(0.0f,0.0f,0.0f); - pbData2->vBitangent = aiVector3D(0.0f,0.0f,0.0f); - } - else { + if (nullptr == mesh->mTangents) { + pbData2->vTangent = aiVector3D(0.0f, 0.0f, 0.0f); + pbData2->vBitangent = aiVector3D(0.0f, 0.0f, 0.0f); + } else { pbData2->vTangent = mesh->mTangents[x]; pbData2->vBitangent = mesh->mBitangents[x]; } - if (mesh->HasVertexColors( 0)) { + if (mesh->HasVertexColors(0)) { pbData2->dColorDiffuse = D3DCOLOR_ARGB( - ((unsigned char)max( min( mesh->mColors[0][x].a * 255.0f, 255.0f),0.0f)), - ((unsigned char)max( min( mesh->mColors[0][x].r * 255.0f, 255.0f),0.0f)), - ((unsigned char)max( min( mesh->mColors[0][x].g * 255.0f, 255.0f),0.0f)), - ((unsigned char)max( min( mesh->mColors[0][x].b * 255.0f, 255.0f),0.0f))); - } - else pbData2->dColorDiffuse = D3DCOLOR_ARGB(0xFF,0xff,0xff,0xff); + ((unsigned char)max(min(mesh->mColors[0][x].a * 255.0f, 255.0f), 0.0f)), + ((unsigned char)max(min(mesh->mColors[0][x].r * 255.0f, 255.0f), 0.0f)), + ((unsigned char)max(min(mesh->mColors[0][x].g * 255.0f, 255.0f), 0.0f)), + ((unsigned char)max(min(mesh->mColors[0][x].b * 255.0f, 255.0f), 0.0f))); + } else + pbData2->dColorDiffuse = D3DCOLOR_ARGB(0xFF, 0xff, 0xff, 0xff); // ignore a third texture coordinate component - if (mesh->HasTextureCoords( 0)) { + if (mesh->HasTextureCoords(0)) { pbData2->vTextureUV = aiVector2D( - mesh->mTextureCoords[0][x].x, - mesh->mTextureCoords[0][x].y); - } - else pbData2->vTextureUV = aiVector2D(0.5f,0.5f); + mesh->mTextureCoords[0][x].x, + mesh->mTextureCoords[0][x].y); + } else + pbData2->vTextureUV = aiVector2D(0.5f, 0.5f); - if (mesh->HasTextureCoords( 1)) { + if (mesh->HasTextureCoords(1)) { pbData2->vTextureUV2 = aiVector2D( - mesh->mTextureCoords[1][x].x, - mesh->mTextureCoords[1][x].y); - } - else pbData2->vTextureUV2 = aiVector2D(0.5f,0.5f); + mesh->mTextureCoords[1][x].x, + mesh->mTextureCoords[1][x].y); + } else + pbData2->vTextureUV2 = aiVector2D(0.5f, 0.5f); // Bone indices and weights - if( mesh->HasBones()) { + if (mesh->HasBones()) { unsigned char boneIndices[4] = { 0, 0, 0, 0 }; unsigned char boneWeights[4] = { 0, 0, 0, 0 }; - ai_assert( weightsPerVertex[x].size() <= 4); - for( unsigned int a = 0; a < weightsPerVertex[x].size(); a++) - { + ai_assert(weightsPerVertex[x].size() <= 4); + for (unsigned int a = 0; a < weightsPerVertex[x].size(); a++) { boneIndices[a] = static_cast(weightsPerVertex[x][a].mVertexId); - boneWeights[a] = (unsigned char) (weightsPerVertex[x][a].mWeight * 255.0f); + boneWeights[a] = (unsigned char)(weightsPerVertex[x][a].mWeight * 255.0f); } - memcpy( pbData2->mBoneIndices, boneIndices, sizeof( boneIndices)); - memcpy( pbData2->mBoneWeights, boneWeights, sizeof( boneWeights)); - } else - { - memset( pbData2->mBoneIndices, 0, sizeof( pbData2->mBoneIndices)); - memset( pbData2->mBoneWeights, 0, sizeof( pbData2->mBoneWeights)); + memcpy(pbData2->mBoneIndices, boneIndices, sizeof(boneIndices)); + memcpy(pbData2->mBoneWeights, boneWeights, sizeof(boneWeights)); + } else { + memset(pbData2->mBoneIndices, 0, sizeof(pbData2->mBoneIndices)); + memset(pbData2->mBoneWeights, 0, sizeof(pbData2->mBoneWeights)); } ++pbData2; @@ -656,8 +618,8 @@ int CreateAssetData() g_pcAsset->apcMeshes[i]->piVB->Unlock(); // now generate the second vertex buffer, holding all normals - if (!g_pcAsset->apcMeshes[i]->piVBNormals) { - GenerateNormalsAsLineList(g_pcAsset->apcMeshes[i],mesh); + if (!g_pcAsset->apcMeshes[i]->piVBNormals) { + GenerateNormalsAsLineList(g_pcAsset->apcMeshes[i], mesh); } } return 1; @@ -667,25 +629,20 @@ int CreateAssetData() // Delete all effects, textures, vertex buffers ... associated with // an asset //------------------------------------------------------------------------------- -int DeleteAssetData(bool bNoMaterials) -{ - if (!g_pcAsset)return 0; +int DeleteAssetData(bool bNoMaterials) { + if (!g_pcAsset) return 0; // TODO: Move this to a proper destructor - for (unsigned int i = 0; i < g_pcAsset->pcScene->mNumMeshes;++i) - { - if(g_pcAsset->apcMeshes[i]->piVB) - { + for (unsigned int i = 0; i < g_pcAsset->pcScene->mNumMeshes; ++i) { + if (g_pcAsset->apcMeshes[i]->piVB) { g_pcAsset->apcMeshes[i]->piVB->Release(); g_pcAsset->apcMeshes[i]->piVB = nullptr; } - if(g_pcAsset->apcMeshes[i]->piVBNormals) - { + if (g_pcAsset->apcMeshes[i]->piVBNormals) { g_pcAsset->apcMeshes[i]->piVBNormals->Release(); g_pcAsset->apcMeshes[i]->piVBNormals = nullptr; } - if(g_pcAsset->apcMeshes[i]->piIB) - { + if (g_pcAsset->apcMeshes[i]->piIB) { g_pcAsset->apcMeshes[i]->piIB->Release(); g_pcAsset->apcMeshes[i]->piIB = nullptr; } @@ -698,45 +655,36 @@ int DeleteAssetData(bool bNoMaterials) // delete[] g_pcAsset->apcMeshes[i]->pvOriginalNormals; //} - if (!bNoMaterials) - { - if(g_pcAsset->apcMeshes[i]->piEffect) - { + if (!bNoMaterials) { + if (g_pcAsset->apcMeshes[i]->piEffect) { g_pcAsset->apcMeshes[i]->piEffect->Release(); g_pcAsset->apcMeshes[i]->piEffect = nullptr; } - if(g_pcAsset->apcMeshes[i]->piDiffuseTexture) - { + if (g_pcAsset->apcMeshes[i]->piDiffuseTexture) { g_pcAsset->apcMeshes[i]->piDiffuseTexture->Release(); g_pcAsset->apcMeshes[i]->piDiffuseTexture = nullptr; } - if(g_pcAsset->apcMeshes[i]->piNormalTexture) - { + if (g_pcAsset->apcMeshes[i]->piNormalTexture) { g_pcAsset->apcMeshes[i]->piNormalTexture->Release(); g_pcAsset->apcMeshes[i]->piNormalTexture = nullptr; } - if(g_pcAsset->apcMeshes[i]->piSpecularTexture) - { + if (g_pcAsset->apcMeshes[i]->piSpecularTexture) { g_pcAsset->apcMeshes[i]->piSpecularTexture->Release(); g_pcAsset->apcMeshes[i]->piSpecularTexture = nullptr; } - if(g_pcAsset->apcMeshes[i]->piAmbientTexture) - { + if (g_pcAsset->apcMeshes[i]->piAmbientTexture) { g_pcAsset->apcMeshes[i]->piAmbientTexture->Release(); g_pcAsset->apcMeshes[i]->piAmbientTexture = nullptr; } - if(g_pcAsset->apcMeshes[i]->piEmissiveTexture) - { + if (g_pcAsset->apcMeshes[i]->piEmissiveTexture) { g_pcAsset->apcMeshes[i]->piEmissiveTexture->Release(); g_pcAsset->apcMeshes[i]->piEmissiveTexture = nullptr; } - if(g_pcAsset->apcMeshes[i]->piOpacityTexture) - { + if (g_pcAsset->apcMeshes[i]->piOpacityTexture) { g_pcAsset->apcMeshes[i]->piOpacityTexture->Release(); g_pcAsset->apcMeshes[i]->piOpacityTexture = nullptr; } - if(g_pcAsset->apcMeshes[i]->piShininessTexture) - { + if (g_pcAsset->apcMeshes[i]->piShininessTexture) { g_pcAsset->apcMeshes[i]->piShininessTexture->Release(); g_pcAsset->apcMeshes[i]->piShininessTexture = nullptr; } @@ -745,27 +693,22 @@ int DeleteAssetData(bool bNoMaterials) return 1; } - //------------------------------------------------------------------------------- // Switch between zoom/rotate view and the standard FPS view // g_bFPSView specifies the view mode to setup //------------------------------------------------------------------------------- -int SetupFPSView() -{ - if (!g_bFPSView) - { - g_sCamera.vPos = aiVector3D(0.0f,0.0f,g_fWheelPos); - g_sCamera.vLookAt = aiVector3D(0.0f,0.0f,1.0f); - g_sCamera.vUp = aiVector3D(0.0f,1.0f,0.0f); - g_sCamera.vRight = aiVector3D(0.0f,1.0f,0.0f); - } - else - { +int SetupFPSView() { + if (!g_bFPSView) { + g_sCamera.vPos = aiVector3D(0.0f, 0.0f, g_fWheelPos); + g_sCamera.vLookAt = aiVector3D(0.0f, 0.0f, 1.0f); + g_sCamera.vUp = aiVector3D(0.0f, 1.0f, 0.0f); + g_sCamera.vRight = aiVector3D(0.0f, 1.0f, 0.0f); + } else { g_fWheelPos = g_sCamera.vPos.z; - g_sCamera.vPos = aiVector3D(0.0f,0.0f,-10.0f); - g_sCamera.vLookAt = aiVector3D(0.0f,0.0f,1.0f); - g_sCamera.vUp = aiVector3D(0.0f,1.0f,0.0f); - g_sCamera.vRight = aiVector3D(0.0f,1.0f,0.0f); + g_sCamera.vPos = aiVector3D(0.0f, 0.0f, -10.0f); + g_sCamera.vLookAt = aiVector3D(0.0f, 0.0f, 1.0f); + g_sCamera.vUp = aiVector3D(0.0f, 1.0f, 0.0f); + g_sCamera.vRight = aiVector3D(0.0f, 1.0f, 0.0f); } return 1; } @@ -774,35 +717,29 @@ int SetupFPSView() // Initialize the IDIrect3D interface // Called by the WinMain //------------------------------------------------------------------------------- -int InitD3D(void) -{ - if (nullptr == g_piD3D) - { +int InitD3D(void) { + if (nullptr == g_piD3D) { g_piD3D = Direct3DCreate9(D3D_SDK_VERSION); - if (nullptr == g_piD3D)return 0; + if (nullptr == g_piD3D) return 0; } return 1; } - //------------------------------------------------------------------------------- // Release the IDirect3D interface. // NOTE: Assumes that the device has already been deleted //------------------------------------------------------------------------------- -int ShutdownD3D(void) -{ +int ShutdownD3D(void) { ShutdownDevice(); - if (nullptr != g_piD3D) - { + if (nullptr != g_piD3D) { g_piD3D->Release(); g_piD3D = nullptr; } return 1; } -template -inline -void SafeRelease(TComPtr *&ptr) { +template +inline void SafeRelease(TComPtr *&ptr) { if (nullptr != ptr) { ptr->Release(); ptr = nullptr; @@ -813,8 +750,7 @@ void SafeRelease(TComPtr *&ptr) { // Shutdown the D3D device object and all resources associated with it // NOTE: Assumes that the asset has already been deleted //------------------------------------------------------------------------------- -int ShutdownDevice(void) -{ +int ShutdownDevice(void) { // release other subsystems CBackgroundPainter::Instance().ReleaseNativeResource(); CLogDisplay::Instance().ReleaseNativeResource(); @@ -837,35 +773,32 @@ int ShutdownDevice(void) return 1; } - //------------------------------------------------------------------------------- //------------------------------------------------------------------------------- -int CreateHUDTexture() -{ +int CreateHUDTexture() { // lock the memory resource ourselves - HRSRC res = FindResource(nullptr,MAKEINTRESOURCE(IDR_HUD),RT_RCDATA); - HGLOBAL hg = LoadResource(nullptr,res); - void* pData = LockResource(hg); + HRSRC res = FindResource(nullptr, MAKEINTRESOURCE(IDR_HUD), RT_RCDATA); + HGLOBAL hg = LoadResource(nullptr, res); + void *pData = LockResource(hg); - if(FAILED(D3DXCreateTextureFromFileInMemoryEx(g_piDevice, - pData,SizeofResource(nullptr,res), - D3DX_DEFAULT_NONPOW2, - D3DX_DEFAULT_NONPOW2, - 1, - 0, - D3DFMT_A8R8G8B8, - D3DPOOL_MANAGED, - D3DX_DEFAULT, - D3DX_DEFAULT, - 0, - nullptr, - nullptr, - &g_pcTexture))) - { + if (FAILED(D3DXCreateTextureFromFileInMemoryEx(g_piDevice, + pData, SizeofResource(nullptr, res), + D3DX_DEFAULT_NONPOW2, + D3DX_DEFAULT_NONPOW2, + 1, + 0, + D3DFMT_A8R8G8B8, + D3DPOOL_MANAGED, + D3DX_DEFAULT, + D3DX_DEFAULT, + 0, + nullptr, + nullptr, + &g_pcTexture))) { CLogDisplay::Instance().AddEntry("[ERROR] Unable to load HUD texture", - D3DCOLOR_ARGB(0xFF,0xFF,0,0)); + D3DCOLOR_ARGB(0xFF, 0xFF, 0, 0)); - g_pcTexture = nullptr; + g_pcTexture = nullptr; g_szImageMask = nullptr; FreeResource(hg); @@ -875,32 +808,30 @@ int CreateHUDTexture() FreeResource(hg); D3DSURFACE_DESC sDesc; - g_pcTexture->GetLevelDesc(0,&sDesc); - + g_pcTexture->GetLevelDesc(0, &sDesc); // lock the memory resource ourselves - res = FindResource(nullptr,MAKEINTRESOURCE(IDR_HUDMASK),RT_RCDATA); - hg = LoadResource(nullptr,res); + res = FindResource(nullptr, MAKEINTRESOURCE(IDR_HUDMASK), RT_RCDATA); + hg = LoadResource(nullptr, res); pData = LockResource(hg); - IDirect3DTexture9* pcTex; - if(FAILED(D3DXCreateTextureFromFileInMemoryEx(g_piDevice, - pData,SizeofResource(nullptr,res), - sDesc.Width, - sDesc.Height, - 1, - 0, - D3DFMT_L8, - D3DPOOL_MANAGED, // unnecessary - D3DX_DEFAULT, - D3DX_DEFAULT, - 0, - nullptr, - nullptr, - &pcTex))) - { + IDirect3DTexture9 *pcTex; + if (FAILED(D3DXCreateTextureFromFileInMemoryEx(g_piDevice, + pData, SizeofResource(nullptr, res), + sDesc.Width, + sDesc.Height, + 1, + 0, + D3DFMT_L8, + D3DPOOL_MANAGED, // unnecessary + D3DX_DEFAULT, + D3DX_DEFAULT, + 0, + nullptr, + nullptr, + &pcTex))) { CLogDisplay::Instance().AddEntry("[ERROR] Unable to load HUD mask texture", - D3DCOLOR_ARGB(0xFF,0xFF,0,0)); + D3DCOLOR_ARGB(0xFF, 0xFF, 0, 0)); g_szImageMask = nullptr; FreeResource(hg); @@ -911,15 +842,14 @@ int CreateHUDTexture() // lock the texture and copy it to get a pointer D3DLOCKED_RECT sRect; - pcTex->LockRect(0,&sRect,nullptr,D3DLOCK_READONLY); + pcTex->LockRect(0, &sRect, nullptr, D3DLOCK_READONLY); - unsigned char* szOut = new unsigned char[sDesc.Width * sDesc.Height]; - unsigned char* _szOut = szOut; + unsigned char *szOut = new unsigned char[sDesc.Width * sDesc.Height]; + unsigned char *_szOut = szOut; - unsigned char* szCur = (unsigned char*) sRect.pBits; - for (unsigned int y = 0; y < sDesc.Height;++y) - { - memcpy(_szOut,szCur,sDesc.Width); + unsigned char *szCur = (unsigned char *)sRect.pBits; + for (unsigned int y = 0; y < sDesc.Height; ++y) { + memcpy(_szOut, szCur, sDesc.Width); szCur += sRect.Pitch; _szOut += sDesc.Width; @@ -933,159 +863,141 @@ int CreateHUDTexture() //------------------------------------------------------------------------------- //------------------------------------------------------------------------------- -int CreateDevice (bool p_bMultiSample,bool p_bSuperSample,bool bHW /*= true*/) -{ +int CreateDevice(bool p_bMultiSample, bool p_bSuperSample, bool bHW /*= true*/) { D3DDEVTYPE eType = bHW ? D3DDEVTYPE_HAL : D3DDEVTYPE_REF; // get the client rectangle of the window. RECT sRect; - GetWindowRect(GetDlgItem(g_hDlg,IDC_RT),&sRect); + GetWindowRect(GetDlgItem(g_hDlg, IDC_RT), &sRect); sRect.right -= sRect.left; sRect.bottom -= sRect.top; D3DPRESENT_PARAMETERS sParams; - memset(&sParams,0,sizeof(D3DPRESENT_PARAMETERS)); + memset(&sParams, 0, sizeof(D3DPRESENT_PARAMETERS)); // get the current display mode D3DDISPLAYMODE sMode; - g_piD3D->GetAdapterDisplayMode(0,&sMode); + g_piD3D->GetAdapterDisplayMode(0, &sMode); // fill the presentation parameter structure - sParams.Windowed = TRUE; - sParams.hDeviceWindow = GetDlgItem( g_hDlg, IDC_RT ); - sParams.EnableAutoDepthStencil = TRUE; - sParams.PresentationInterval = D3DPRESENT_INTERVAL_ONE; - sParams.BackBufferWidth = (UINT)sRect.right; - sParams.BackBufferHeight = (UINT)sRect.bottom; - sParams.SwapEffect = D3DSWAPEFFECT_DISCARD; - sParams.BackBufferCount = 1; + sParams.Windowed = TRUE; + sParams.hDeviceWindow = GetDlgItem(g_hDlg, IDC_RT); + sParams.EnableAutoDepthStencil = TRUE; + sParams.PresentationInterval = D3DPRESENT_INTERVAL_ONE; + sParams.BackBufferWidth = (UINT)sRect.right; + sParams.BackBufferHeight = (UINT)sRect.bottom; + sParams.SwapEffect = D3DSWAPEFFECT_DISCARD; + sParams.BackBufferCount = 1; // check whether we can use a D32 depth buffer format - if (SUCCEEDED ( g_piD3D->CheckDepthStencilMatch(0,eType, - D3DFMT_X8R8G8B8,D3DFMT_X8R8G8B8,D3DFMT_D32))) - { + if (SUCCEEDED(g_piD3D->CheckDepthStencilMatch(0, eType, + D3DFMT_X8R8G8B8, D3DFMT_X8R8G8B8, D3DFMT_D32))) { sParams.AutoDepthStencilFormat = D3DFMT_D32; - } - else sParams.AutoDepthStencilFormat = D3DFMT_D24X8; + } else + sParams.AutoDepthStencilFormat = D3DFMT_D24X8; // find the highest multisample type available on this device D3DMULTISAMPLE_TYPE sMS = D3DMULTISAMPLE_2_SAMPLES; D3DMULTISAMPLE_TYPE sMSOut = D3DMULTISAMPLE_NONE; DWORD dwQuality = 0; - if (p_bMultiSample) - { - while ((D3DMULTISAMPLE_TYPE)(D3DMULTISAMPLE_16_SAMPLES + 1) != - (sMS = (D3DMULTISAMPLE_TYPE)(sMS + 1))) - { - if(SUCCEEDED( g_piD3D->CheckDeviceMultiSampleType(0,eType, - sMode.Format,TRUE,sMS,&dwQuality))) - { + if (p_bMultiSample) { + while ((D3DMULTISAMPLE_TYPE)(D3DMULTISAMPLE_16_SAMPLES + 1) != + (sMS = (D3DMULTISAMPLE_TYPE)(sMS + 1))) { + if (SUCCEEDED(g_piD3D->CheckDeviceMultiSampleType(0, eType, + sMode.Format, TRUE, sMS, &dwQuality))) { sMSOut = sMS; } } - if (0 != dwQuality)dwQuality -= 1; - + if (0 != dwQuality) dwQuality -= 1; sParams.MultiSampleQuality = dwQuality; sParams.MultiSampleType = sMSOut; } // get the device capabilities. If the hardware vertex shader is too old, we prefer software vertex processing - g_piD3D->GetDeviceCaps( 0, D3DDEVTYPE_HAL, &g_sCaps); + g_piD3D->GetDeviceCaps(0, D3DDEVTYPE_HAL, &g_sCaps); DWORD creationFlags = D3DCREATE_MULTITHREADED; - if( g_sCaps.VertexShaderVersion >= D3DVS_VERSION( 2, 0)) + if (g_sCaps.VertexShaderVersion >= D3DVS_VERSION(2, 0)) creationFlags |= D3DCREATE_HARDWARE_VERTEXPROCESSING; else creationFlags |= D3DCREATE_SOFTWARE_VERTEXPROCESSING; // create the D3D9 device object. with software-vertexprocessing if VS2.0 isn`t supported in hardware - if(FAILED(g_piD3D->CreateDevice(0,eType, g_hDlg, creationFlags ,&sParams,&g_piDevice))) - { + if (FAILED(g_piD3D->CreateDevice(0, eType, g_hDlg, creationFlags, &sParams, &g_piDevice))) { // if hardware fails use software rendering instead - if (bHW)return CreateDevice(p_bMultiSample,p_bSuperSample,false); + if (bHW) return CreateDevice(p_bMultiSample, p_bSuperSample, false); return 0; } // create a vertex declaration to match the vertex - D3DVERTEXELEMENT9* vdecl = AssetHelper::Vertex::GetDeclarationElements(); - if( FAILED( g_piDevice->CreateVertexDeclaration( vdecl, &gDefaultVertexDecl))) - { - MessageBox( g_hDlg, "Failed to create vertex declaration", "Init", MB_OK); + D3DVERTEXELEMENT9 *vdecl = AssetHelper::Vertex::GetDeclarationElements(); + if (FAILED(g_piDevice->CreateVertexDeclaration(vdecl, &gDefaultVertexDecl))) { + MessageBox(g_hDlg, "Failed to create vertex declaration", "Init", MB_OK); return 0; } - g_piDevice->SetVertexDeclaration( gDefaultVertexDecl); + g_piDevice->SetVertexDeclaration(gDefaultVertexDecl); // get the capabilities of the device object g_piDevice->GetDeviceCaps(&g_sCaps); - if(g_sCaps.PixelShaderVersion < D3DPS_VERSION(3,0)) - { - EnableWindow(GetDlgItem(g_hDlg,IDC_LOWQUALITY),FALSE); + if (g_sCaps.PixelShaderVersion < D3DPS_VERSION(3, 0)) { + EnableWindow(GetDlgItem(g_hDlg, IDC_LOWQUALITY), FALSE); } // compile the default material shader (gray gouraud/phong) - ID3DXBuffer* piBuffer = nullptr; - if(FAILED( D3DXCreateEffect(g_piDevice, - g_szDefaultShader.c_str(), - (UINT)g_szDefaultShader.length(), - nullptr, - nullptr, - AI_SHADER_COMPILE_FLAGS, - nullptr, - &g_piDefaultEffect,&piBuffer))) - { - if( piBuffer) - { - MessageBox(g_hDlg,(LPCSTR)piBuffer->GetBufferPointer(),"HLSL",MB_OK); + ID3DXBuffer *piBuffer = nullptr; + if (FAILED(D3DXCreateEffect(g_piDevice, + g_szDefaultShader.c_str(), + (UINT)g_szDefaultShader.length(), + nullptr, + nullptr, + AI_SHADER_COMPILE_FLAGS, + nullptr, + &g_piDefaultEffect, &piBuffer))) { + if (piBuffer) { + MessageBox(g_hDlg, (LPCSTR)piBuffer->GetBufferPointer(), "HLSL", MB_OK); piBuffer->Release(); } return 0; } - if( piBuffer) - { + if (piBuffer) { piBuffer->Release(); piBuffer = nullptr; } // use Fixed Function effect when working with shaderless cards - if( g_sCaps.PixelShaderVersion < D3DPS_VERSION(2,0)) - g_piDefaultEffect->SetTechnique( "DefaultFXSpecular_FF"); + if (g_sCaps.PixelShaderVersion < D3DPS_VERSION(2, 0)) + g_piDefaultEffect->SetTechnique("DefaultFXSpecular_FF"); // create the shader used to draw the HUD - if(FAILED( D3DXCreateEffect(g_piDevice, - g_szPassThroughShader.c_str(),(UINT)g_szPassThroughShader.length(), - nullptr,nullptr,AI_SHADER_COMPILE_FLAGS,nullptr,&g_piPassThroughEffect,&piBuffer))) - { - if( piBuffer) - { - MessageBox(g_hDlg,(LPCSTR)piBuffer->GetBufferPointer(),"HLSL",MB_OK); + if (FAILED(D3DXCreateEffect(g_piDevice, + g_szPassThroughShader.c_str(), (UINT)g_szPassThroughShader.length(), + nullptr, nullptr, AI_SHADER_COMPILE_FLAGS, nullptr, &g_piPassThroughEffect, &piBuffer))) { + if (piBuffer) { + MessageBox(g_hDlg, (LPCSTR)piBuffer->GetBufferPointer(), "HLSL", MB_OK); piBuffer->Release(); } return 0; } - if( piBuffer) - { + if (piBuffer) { piBuffer->Release(); piBuffer = nullptr; } // use Fixed Function effect when working with shaderless cards - if( g_sCaps.PixelShaderVersion < D3DPS_VERSION(2,0)) - g_piPassThroughEffect->SetTechnique( "PassThrough_FF"); + if (g_sCaps.PixelShaderVersion < D3DPS_VERSION(2, 0)) + g_piPassThroughEffect->SetTechnique("PassThrough_FF"); // create the shader used to visualize normal vectors - if(FAILED( D3DXCreateEffect(g_piDevice, - g_szNormalsShader.c_str(),(UINT)g_szNormalsShader.length(), - nullptr,nullptr,AI_SHADER_COMPILE_FLAGS,nullptr,&g_piNormalsEffect, &piBuffer))) - { - if( piBuffer) - { - MessageBox(g_hDlg,(LPCSTR)piBuffer->GetBufferPointer(),"HLSL",MB_OK); + if (FAILED(D3DXCreateEffect(g_piDevice, + g_szNormalsShader.c_str(), (UINT)g_szNormalsShader.length(), + nullptr, nullptr, AI_SHADER_COMPILE_FLAGS, nullptr, &g_piNormalsEffect, &piBuffer))) { + if (piBuffer) { + MessageBox(g_hDlg, (LPCSTR)piBuffer->GetBufferPointer(), "HLSL", MB_OK); piBuffer->Release(); } return 0; } - if( piBuffer) - { + if (piBuffer) { piBuffer->Release(); piBuffer = nullptr; } @@ -1093,30 +1005,28 @@ int CreateDevice (bool p_bMultiSample,bool p_bSuperSample,bool bHW /*= true*/) //MessageBox( g_hDlg, "Failed to create vertex declaration", "Init", MB_OK); // use Fixed Function effect when working with shaderless cards - if( g_sCaps.PixelShaderVersion < D3DPS_VERSION(2,0)) - g_piNormalsEffect->SetTechnique( "RenderNormals_FF"); + if (g_sCaps.PixelShaderVersion < D3DPS_VERSION(2, 0)) + g_piNormalsEffect->SetTechnique("RenderNormals_FF"); - g_piDevice->SetRenderState(D3DRS_DITHERENABLE,TRUE); + g_piDevice->SetRenderState(D3DRS_DITHERENABLE, TRUE); // create the texture for the HUD CreateHUDTexture(); CBackgroundPainter::Instance().RecreateNativeResource(); CLogDisplay::Instance().RecreateNativeResource(); - g_piPassThroughEffect->SetTexture("TEXTURE_2D",g_pcTexture); + g_piPassThroughEffect->SetTexture("TEXTURE_2D", g_pcTexture); return 1; } //------------------------------------------------------------------------------- -int CreateDevice() -{ +int CreateDevice() { return CreateDevice(g_sOptions.bMultiSample, - g_sOptions.bSuperSample); + g_sOptions.bSuperSample); } //------------------------------------------------------------------------------- -int GetProjectionMatrix (aiMatrix4x4& p_mOut) -{ +int GetProjectionMatrix(aiMatrix4x4 &p_mOut) { const float fFarPlane = 100.0f; const float fNearPlane = 0.1f; const float fFOV = (float)(45.0 * 0.0174532925); @@ -1125,30 +1035,29 @@ int GetProjectionMatrix (aiMatrix4x4& p_mOut) const float Q = fFarPlane / (fFarPlane - fNearPlane); RECT sRect; - GetWindowRect(GetDlgItem(g_hDlg,IDC_RT),&sRect); + GetWindowRect(GetDlgItem(g_hDlg, IDC_RT), &sRect); sRect.right -= sRect.left; sRect.bottom -= sRect.top; const float fAspect = (float)sRect.right / (float)sRect.bottom; p_mOut = aiMatrix4x4( - s / fAspect, 0.0f, 0.0f, 0.0f, - 0.0f, s, 0.0f, 0.0f, - 0.0f, 0.0f, Q, 1.0f, - 0.0f, 0.0f, -Q * fNearPlane, 0.0f); + s / fAspect, 0.0f, 0.0f, 0.0f, + 0.0f, s, 0.0f, 0.0f, + 0.0f, 0.0f, Q, 1.0f, + 0.0f, 0.0f, -Q * fNearPlane, 0.0f); return 1; } //------------------------------------------------------------------------------- -aiVector3D GetCameraMatrix (aiMatrix4x4& p_mOut) -{ +aiVector3D GetCameraMatrix(aiMatrix4x4 &p_mOut) { D3DXMATRIX view; - D3DXMatrixIdentity( &view ); + D3DXMatrixIdentity(&view); - D3DXVec3Normalize( (D3DXVECTOR3*)&g_sCamera.vLookAt, (D3DXVECTOR3*)&g_sCamera.vLookAt ); - D3DXVec3Cross( (D3DXVECTOR3*)&g_sCamera.vRight, (D3DXVECTOR3*)&g_sCamera.vUp, (D3DXVECTOR3*)&g_sCamera.vLookAt ); - D3DXVec3Normalize( (D3DXVECTOR3*)&g_sCamera.vRight, (D3DXVECTOR3*)&g_sCamera.vRight ); - D3DXVec3Cross( (D3DXVECTOR3*)&g_sCamera.vUp, (D3DXVECTOR3*)&g_sCamera.vLookAt, (D3DXVECTOR3*)&g_sCamera.vRight ); - D3DXVec3Normalize( (D3DXVECTOR3*)&g_sCamera.vUp, (D3DXVECTOR3*)&g_sCamera.vUp ); + D3DXVec3Normalize((D3DXVECTOR3 *)&g_sCamera.vLookAt, (D3DXVECTOR3 *)&g_sCamera.vLookAt); + D3DXVec3Cross((D3DXVECTOR3 *)&g_sCamera.vRight, (D3DXVECTOR3 *)&g_sCamera.vUp, (D3DXVECTOR3 *)&g_sCamera.vLookAt); + D3DXVec3Normalize((D3DXVECTOR3 *)&g_sCamera.vRight, (D3DXVECTOR3 *)&g_sCamera.vRight); + D3DXVec3Cross((D3DXVECTOR3 *)&g_sCamera.vUp, (D3DXVECTOR3 *)&g_sCamera.vLookAt, (D3DXVECTOR3 *)&g_sCamera.vRight); + D3DXVec3Normalize((D3DXVECTOR3 *)&g_sCamera.vUp, (D3DXVECTOR3 *)&g_sCamera.vUp); view._11 = g_sCamera.vRight.x; view._12 = g_sCamera.vUp.x; @@ -1165,14 +1074,14 @@ aiVector3D GetCameraMatrix (aiMatrix4x4& p_mOut) view._33 = g_sCamera.vLookAt.z; view._34 = 0.0f; - view._41 = -D3DXVec3Dot( (D3DXVECTOR3*)&g_sCamera.vPos, (D3DXVECTOR3*)&g_sCamera.vRight ); - view._42 = -D3DXVec3Dot( (D3DXVECTOR3*)&g_sCamera.vPos, (D3DXVECTOR3*)&g_sCamera.vUp ); - view._43 = -D3DXVec3Dot( (D3DXVECTOR3*)&g_sCamera.vPos, (D3DXVECTOR3*)&g_sCamera.vLookAt ); - view._44 = 1.0f; + view._41 = -D3DXVec3Dot((D3DXVECTOR3 *)&g_sCamera.vPos, (D3DXVECTOR3 *)&g_sCamera.vRight); + view._42 = -D3DXVec3Dot((D3DXVECTOR3 *)&g_sCamera.vPos, (D3DXVECTOR3 *)&g_sCamera.vUp); + view._43 = -D3DXVec3Dot((D3DXVECTOR3 *)&g_sCamera.vPos, (D3DXVECTOR3 *)&g_sCamera.vLookAt); + view._44 = 1.0f; - memcpy(&p_mOut,&view,sizeof(aiMatrix4x4)); + memcpy(&p_mOut, &view, sizeof(aiMatrix4x4)); return g_sCamera.vPos; } -} +} // namespace AssimpView diff --git a/tools/assimp_view/assimp_view.h b/tools/assimp_view/assimp_view.h index 6c767ccd1..8e04f7117 100644 --- a/tools/assimp_view/assimp_view.h +++ b/tools/assimp_view/assimp_view.h @@ -51,27 +51,27 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "resource.h" #include -#include #include #include -#include #include +#include +#include #include // Include ASSIMP headers (XXX: do we really need all of them?) -#include -#include #include #include +#include #include #include -#include -#include -#include #include +#include +#include +#include +#include -#include "Material/MaterialSystem.h" // aiMaterial class -#include // ASSIMP_stricmp and ASSIMP_strincmp +#include "Material/MaterialSystem.h" // aiMaterial class +#include // ASSIMP_stricmp and ASSIMP_strincmp #include @@ -79,33 +79,31 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define MOVE_SPEED 3.f #include "AssetHelper.h" -#include "Camera.h" -#include "RenderOptions.h" -#include "Shaders.h" #include "Background.h" +#include "Camera.h" +#include "Display.h" #include "LogDisplay.h" #include "LogWindow.h" -#include "Display.h" -#include "MeshRenderer.h" #include "MaterialManager.h" - +#include "MeshRenderer.h" +#include "RenderOptions.h" +#include "Shaders.h" // outside of namespace, to help Intellisense and solve boost::metatype_stuff_miracle #include "AnimEvaluator.h" #include "SceneAnimator.h" -namespace AssimpView -{ +namespace AssimpView { //------------------------------------------------------------------------------- // Function prototypes //------------------------------------------------------------------------------- int InitD3D(void); int ShutdownD3D(void); -int CreateDevice (bool p_bMultiSample,bool p_bSuperSample, bool bHW = true); -int CreateDevice (void); +int CreateDevice(bool p_bMultiSample, bool p_bSuperSample, bool bHW = true); +int CreateDevice(void); int ShutdownDevice(void); -int GetProjectionMatrix (aiMatrix4x4& p_mOut); +int GetProjectionMatrix(aiMatrix4x4 &p_mOut); int LoadAsset(void); int CreateAssetData(void); int DeleteAssetData(bool bNoMaterials = false); @@ -113,26 +111,25 @@ int ScaleAsset(void); int DeleteAsset(void); int SetupFPSView(); -aiVector3D GetCameraMatrix (aiMatrix4x4& p_mOut); -int CreateMaterial(AssetHelper::MeshHelper* pcMesh,const aiMesh* pcSource); - -void HandleMouseInputFPS( void ); -void HandleMouseInputLightRotate( void ); -void HandleMouseInputLocal( void ); -void HandleKeyboardInputFPS( void ); -void HandleMouseInputLightIntensityAndColor( void ); -void HandleMouseInputSkyBox( void ); -void HandleKeyboardInputTextureView( void ); -void HandleMouseInputTextureView( void ); +aiVector3D GetCameraMatrix(aiMatrix4x4 &p_mOut); +int CreateMaterial(AssetHelper::MeshHelper *pcMesh, const aiMesh *pcSource); +void HandleMouseInputFPS(void); +void HandleMouseInputLightRotate(void); +void HandleMouseInputLocal(void); +void HandleKeyboardInputFPS(void); +void HandleMouseInputLightIntensityAndColor(void); +void HandleMouseInputSkyBox(void); +void HandleKeyboardInputTextureView(void); +void HandleMouseInputTextureView(void); //------------------------------------------------------------------------------- // // Dialog procedure for the progress bar window // //------------------------------------------------------------------------------- -INT_PTR CALLBACK ProgressMessageProc(HWND hwndDlg,UINT uMsg, - WPARAM wParam,LPARAM lParam); +INT_PTR CALLBACK ProgressMessageProc(HWND hwndDlg, UINT uMsg, + WPARAM wParam, LPARAM lParam); //------------------------------------------------------------------------------- // Main message procedure of the application @@ -142,25 +139,24 @@ INT_PTR CALLBACK ProgressMessageProc(HWND hwndDlg,UINT uMsg, // NOTE: Due to the impossibility to process WM_CHAR messages in dialogs // properly the code for all hotkeys has been moved to the WndMain //------------------------------------------------------------------------------- -INT_PTR CALLBACK MessageProc(HWND hwndDlg,UINT uMsg, - WPARAM wParam,LPARAM lParam); +INT_PTR CALLBACK MessageProc(HWND hwndDlg, UINT uMsg, + WPARAM wParam, LPARAM lParam); //------------------------------------------------------------------------------- // // Dialog procedure for the about dialog // //------------------------------------------------------------------------------- -INT_PTR CALLBACK AboutMessageProc(HWND hwndDlg,UINT uMsg, - WPARAM wParam,LPARAM lParam); +INT_PTR CALLBACK AboutMessageProc(HWND hwndDlg, UINT uMsg, + WPARAM wParam, LPARAM lParam); //------------------------------------------------------------------------------- // // Dialog procedure for the help dialog // //------------------------------------------------------------------------------- -INT_PTR CALLBACK HelpDialogProc(HWND hwndDlg,UINT uMsg, - WPARAM wParam,LPARAM lParam); - +INT_PTR CALLBACK HelpDialogProc(HWND hwndDlg, UINT uMsg, + WPARAM wParam, LPARAM lParam); //------------------------------------------------------------------------------- // Handle command line parameters @@ -168,24 +164,20 @@ INT_PTR CALLBACK HelpDialogProc(HWND hwndDlg,UINT uMsg, // The function loads an asset specified on the command line as first argument // Other command line parameters are not handled //------------------------------------------------------------------------------- -void HandleCommandLine(char* p_szCommand); - +void HandleCommandLine(char *p_szCommand); //------------------------------------------------------------------------------- template -type clamp(intype in) -{ +type clamp(intype in) { // for unsigned types only ... - intype mask = (0x1u << (sizeof(type)*8))-1; - return (type)std::max((intype)0,std::min(in,mask)); + intype mask = (0x1u << (sizeof(type) * 8)) - 1; + return (type)std::max((intype)0, std::min(in, mask)); } - //------------------------------------------------------------------------------- // Position of the cursor relative to the 3ds max' like control circle //------------------------------------------------------------------------------- -enum EClickPos -{ +enum EClickPos { // The click was inside the inner circle (x,y axis) EClickPos_Circle, // The click was inside one of the vertical snap-ins @@ -197,84 +189,82 @@ enum EClickPos }; #if (!defined AI_VIEW_CAPTION_BASE) -# define AI_VIEW_CAPTION_BASE "Open Asset Import Library : Viewer " +#define AI_VIEW_CAPTION_BASE "Open Asset Import Library : Viewer " #endif // !! AI_VIEW_CAPTION_BASE //------------------------------------------------------------------------------- // Evil globals //------------------------------------------------------------------------------- - extern HINSTANCE g_hInstance /*= NULL*/; - extern HWND g_hDlg /*= NULL*/; - extern IDirect3D9* g_piD3D /*= NULL*/; - extern IDirect3DDevice9* g_piDevice /*= NULL*/; - extern IDirect3DVertexDeclaration9* gDefaultVertexDecl /*= NULL*/; - extern double g_fFPS /*= 0.0f*/; - extern char g_szFileName[MAX_PATH]; - extern ID3DXEffect* g_piDefaultEffect /*= NULL*/; - extern ID3DXEffect* g_piNormalsEffect /*= NULL*/; - extern ID3DXEffect* g_piPassThroughEffect /*= NULL*/; - extern ID3DXEffect* g_piPatternEffect /*= NULL*/; - extern bool g_bMousePressed /*= false*/; - extern bool g_bMousePressedR /*= false*/; - extern bool g_bMousePressedM /*= false*/; - extern bool g_bMousePressedBoth /*= false*/; - extern float g_fElpasedTime /*= 0.0f*/; - extern D3DCAPS9 g_sCaps; - extern bool g_bLoadingFinished /*= false*/; - extern HANDLE g_hThreadHandle /*= NULL*/; - extern float g_fWheelPos /*= -10.0f*/; - extern bool g_bLoadingCanceled /*= false*/; - extern IDirect3DTexture9* g_pcTexture /*= NULL*/; +extern HINSTANCE g_hInstance /*= NULL*/; +extern HWND g_hDlg /*= NULL*/; +extern IDirect3D9 *g_piD3D /*= NULL*/; +extern IDirect3DDevice9 *g_piDevice /*= NULL*/; +extern IDirect3DVertexDeclaration9 *gDefaultVertexDecl /*= NULL*/; +extern double g_fFPS /*= 0.0f*/; +extern char g_szFileName[MAX_PATH]; +extern ID3DXEffect *g_piDefaultEffect /*= NULL*/; +extern ID3DXEffect *g_piNormalsEffect /*= NULL*/; +extern ID3DXEffect *g_piPassThroughEffect /*= NULL*/; +extern ID3DXEffect *g_piPatternEffect /*= NULL*/; +extern bool g_bMousePressed /*= false*/; +extern bool g_bMousePressedR /*= false*/; +extern bool g_bMousePressedM /*= false*/; +extern bool g_bMousePressedBoth /*= false*/; +extern float g_fElpasedTime /*= 0.0f*/; +extern D3DCAPS9 g_sCaps; +extern bool g_bLoadingFinished /*= false*/; +extern HANDLE g_hThreadHandle /*= NULL*/; +extern float g_fWheelPos /*= -10.0f*/; +extern bool g_bLoadingCanceled /*= false*/; +extern IDirect3DTexture9 *g_pcTexture /*= NULL*/; - extern aiMatrix4x4 g_mWorld; - extern aiMatrix4x4 g_mWorldRotate; - extern aiVector3D g_vRotateSpeed /*= aiVector3D(0.5f,0.5f,0.5f)*/; +extern aiMatrix4x4 g_mWorld; +extern aiMatrix4x4 g_mWorldRotate; +extern aiVector3D g_vRotateSpeed /*= aiVector3D(0.5f,0.5f,0.5f)*/; - extern aiVector3D g_avLightDirs[1] /* = +extern aiVector3D g_avLightDirs[1] /* = { aiVector3D(-0.5f,0.6f,0.2f) , - aiVector3D(-0.5f,0.5f,0.5f)} */; + aiVector3D(-0.5f,0.5f,0.5f)} */ + ; +extern POINT g_mousePos /*= {0,0};*/; +extern POINT g_LastmousePos /*= {0,0}*/; +extern bool g_bFPSView /*= false*/; +extern bool g_bInvert /*= false*/; +extern EClickPos g_eClick; +extern unsigned int g_iCurrentColor /*= 0*/; - extern POINT g_mousePos /*= {0,0};*/; - extern POINT g_LastmousePos /*= {0,0}*/; - extern bool g_bFPSView /*= false*/; - extern bool g_bInvert /*= false*/; - extern EClickPos g_eClick; - extern unsigned int g_iCurrentColor /*= 0*/; +// NOTE: The light intensity is separated from the color, it can +// directly be manipulated using the middle mouse button. +// When the user chooses a color from the palette the intensity +// is reset to 1.0 +// index[2] is the ambient color +extern float g_fLightIntensity /*=0.0f*/; +extern D3DCOLOR g_avLightColors[3]; - // NOTE: The light intensity is separated from the color, it can - // directly be manipulated using the middle mouse button. - // When the user chooses a color from the palette the intensity - // is reset to 1.0 - // index[2] is the ambient color - extern float g_fLightIntensity /*=0.0f*/; - extern D3DCOLOR g_avLightColors[3]; +extern RenderOptions g_sOptions; +extern Camera g_sCamera; +extern AssetHelper *g_pcAsset /*= NULL*/; - extern RenderOptions g_sOptions; - extern Camera g_sCamera; - extern AssetHelper *g_pcAsset /*= NULL*/; +// +// Contains the mask image for the HUD +// (used to determine the position of a click) +// +// The size of the image is identical to the size of the main +// HUD texture +// +extern unsigned char *g_szImageMask /*= NULL*/; +extern float g_fACMR /*= 3.0f*/; +extern IDirect3DQuery9 *g_piQuery; - // - // Contains the mask image for the HUD - // (used to determine the position of a click) - // - // The size of the image is identical to the size of the main - // HUD texture - // - extern unsigned char* g_szImageMask /*= NULL*/; +extern bool g_bPlay /*= false*/; +extern double g_dCurrent; +extern float g_smoothAngle /*= 80.f*/; - extern float g_fACMR /*= 3.0f*/; - extern IDirect3DQuery9* g_piQuery; - - extern bool g_bPlay /*= false*/; - - extern double g_dCurrent; - extern float g_smoothAngle /*= 80.f*/; - - extern unsigned int ppsteps,ppstepsdefault; - extern bool nopointslines; - } +extern unsigned int ppsteps, ppstepsdefault; +extern bool nopointslines; +} // namespace AssimpView #endif // !! AV_MAIN_H_INCLUDED From 40e99113cb4bfb11844b1e70f460d03d5d67e6e5 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Thu, 7 May 2020 15:03:35 +0200 Subject: [PATCH 045/115] Fix findings - rename file to cpp - use no hint --- fuzz/{assimp_fuzzer.cc => assimp_fuzzer.cpp} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename fuzz/{assimp_fuzzer.cc => assimp_fuzzer.cpp} (97%) diff --git a/fuzz/assimp_fuzzer.cc b/fuzz/assimp_fuzzer.cpp similarity index 97% rename from fuzz/assimp_fuzzer.cc rename to fuzz/assimp_fuzzer.cpp index c113fefdf..86ffe18ed 100644 --- a/fuzz/assimp_fuzzer.cc +++ b/fuzz/assimp_fuzzer.cpp @@ -48,7 +48,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t dataSize) { Importer importer; const aiScene *sc = importer.ReadFileFromMemory(data, dataSize, - aiProcessPreset_TargetRealtime_Quality, "3ds"); + aiProcessPreset_TargetRealtime_Quality, nullptr ); aiDetachLogStream(&stream); From b990f703a0f7705fb51fdfa72f40911211a95553 Mon Sep 17 00:00:00 2001 From: Kalyan Kumar Date: Thu, 7 May 2020 15:00:21 -0700 Subject: [PATCH 046/115] Add IMPORTED_CONFIGURATIONS property to cmake target. --- assimpTargets-debug.cmake.in | 6 ++++++ assimpTargets-release.cmake.in | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/assimpTargets-debug.cmake.in b/assimpTargets-debug.cmake.in index de6459eaf..b7efe71f9 100644 --- a/assimpTargets-debug.cmake.in +++ b/assimpTargets-debug.cmake.in @@ -73,6 +73,9 @@ else() else() set(sharedLibraryName "libassimp${ASSIMP_LIBRARY_SUFFIX}@CMAKE_DEBUG_POSTFIX@@CMAKE_SHARED_LIBRARY_SUFFIX@.@ASSIMP_VERSION_MAJOR@") endif() + + # Import target "assimp::assimp" for configuration "Debug" + set_property(TARGET assimp::assimp APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) set_target_properties(assimp::assimp PROPERTIES IMPORTED_SONAME_DEBUG "${sharedLibraryName}" IMPORTED_LOCATION_DEBUG "@CMAKE_INSTALL_FULL_LIBDIR@/${sharedLibraryName}" @@ -81,6 +84,9 @@ else() list(APPEND _IMPORT_CHECK_FILES_FOR_assimp::assimp "@CMAKE_INSTALL_FULL_LIBDIR@/${sharedLibraryName}" ) else() set(staticLibraryName "libassimp${ASSIMP_LIBRARY_SUFFIX}@CMAKE_DEBUG_POSTFIX@@CMAKE_STATIC_LIBRARY_SUFFIX@") + + # Import target "assimp::assimp" for configuration "Debug" + set_property(TARGET assimp::assimp APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) set_target_properties(assimp::assimp PROPERTIES IMPORTED_LOCATION_DEBUG "@CMAKE_INSTALL_FULL_LIBDIR@/${staticLibraryName}" ) diff --git a/assimpTargets-release.cmake.in b/assimpTargets-release.cmake.in index 6a5bafcf7..c716006dd 100644 --- a/assimpTargets-release.cmake.in +++ b/assimpTargets-release.cmake.in @@ -73,6 +73,9 @@ else() else() set(sharedLibraryName "libassimp${ASSIMP_LIBRARY_SUFFIX}@CMAKE_SHARED_LIBRARY_SUFFIX@.@ASSIMP_VERSION_MAJOR@") endif() + + # Import target "assimp::assimp" for configuration "Release" + set_property(TARGET assimp::assimp APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) set_target_properties(assimp::assimp PROPERTIES IMPORTED_SONAME_RELEASE "${sharedLibraryName}" IMPORTED_LOCATION_RELEASE "@CMAKE_INSTALL_FULL_LIBDIR@/${sharedLibraryName}" @@ -81,6 +84,9 @@ else() list(APPEND _IMPORT_CHECK_FILES_FOR_assimp::assimp "@CMAKE_INSTALL_FULL_LIBDIR@/${sharedLibraryName}" ) else() set(staticLibraryName "libassimp${ASSIMP_LIBRARY_SUFFIX}@CMAKE_STATIC_LIBRARY_SUFFIX@") + + # Import target "assimp::assimp" for configuration "Release" + set_property(TARGET assimp::assimp APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) set_target_properties(assimp::assimp PROPERTIES IMPORTED_LOCATION_RELEASE "@CMAKE_INSTALL_FULL_LIBDIR@/${staticLibraryName}" ) From 3fdcd0861f45bda4639ff41d148e8a8a5ee9ae91 Mon Sep 17 00:00:00 2001 From: hoshiryu Date: Mon, 27 Apr 2020 18:35:53 +0200 Subject: [PATCH 047/115] Fix fbx rotation ; --- code/AssetLib/FBX/FBXConverter.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/code/AssetLib/FBX/FBXConverter.cpp b/code/AssetLib/FBX/FBXConverter.cpp index 1bf977189..cf50c715b 100644 --- a/code/AssetLib/FBX/FBXConverter.cpp +++ b/code/AssetLib/FBX/FBXConverter.cpp @@ -3315,6 +3315,7 @@ void FBXConverter::InterpolateKeys(aiQuatKey *valOut, const KeyTimeList &keys, c // http://www.3dkingdoms.com/weekly/weekly.php?a=36 if (quat.x * lastq.x + quat.y * lastq.y + quat.z * lastq.z + quat.w * lastq.w < 0) { quat.Conjugate(); + quat.w = -quat.w; } lastq = quat; From aef4ecada533c40d41ae4e885eaa39bfe74601cb Mon Sep 17 00:00:00 2001 From: Jeremy Cytryn Date: Wed, 6 May 2020 23:41:05 -0700 Subject: [PATCH 048/115] Fail gltf/gltf2 export whenever invalid / incomplete JSON is generated This can happen currently for example if NaNs are introduced in accessor bounds as rapidjson cannot write NaN/inf floats (see subsequent commit for fix there) and will halt writing to buffer at this point. Fix here ensures that whenever anything like this happens we throw an exception so this ends up as a registered export failure case, rather than silently exporting the incomplete JSON --- code/AssetLib/glTF/glTFAssetWriter.inl | 12 ++++++++---- code/AssetLib/glTF2/glTF2AssetWriter.inl | 10 ++++++---- .../BoxWithInfinites.glb | Bin 0 -> 1900 bytes test/unit/utglTF2ImportExport.cpp | 10 ++++++++++ 4 files changed, 24 insertions(+), 8 deletions(-) create mode 100644 test/models/glTF2/BoxWithInfinites-glTF-Binary/BoxWithInfinites.glb diff --git a/code/AssetLib/glTF/glTFAssetWriter.inl b/code/AssetLib/glTF/glTFAssetWriter.inl index 5e4416ee9..d8d2556fa 100644 --- a/code/AssetLib/glTF/glTFAssetWriter.inl +++ b/code/AssetLib/glTF/glTFAssetWriter.inl @@ -59,7 +59,7 @@ namespace glTF { namespace { template - inline + inline Value& MakeValue(Value& val, T(&r)[N], MemoryPoolAllocator<>& al) { val.SetArray(); val.Reserve(N, al); @@ -70,7 +70,7 @@ namespace glTF { } template - inline + inline Value& MakeValue(Value& val, const std::vector & r, MemoryPoolAllocator<>& al) { val.SetArray(); val.Reserve(static_cast(r.size()), al); @@ -530,7 +530,9 @@ namespace glTF { StringBuffer docBuffer; PrettyWriter writer(docBuffer); - mDoc.Accept(writer); + if (!mDoc.Accept(writer)) { + throw DeadlyExportError("Failed to write scene data!"); + } if (jsonOutFile->Write(docBuffer.GetString(), docBuffer.GetSize(), 1) != 1) { throw DeadlyExportError("Failed to write scene data!"); @@ -569,7 +571,9 @@ namespace glTF { StringBuffer docBuffer; Writer writer(docBuffer); - mDoc.Accept(writer); + if (!mDoc.Accept(writer)) { + throw DeadlyExportError("Failed to write scene data!"); + } if (outfile->Write(docBuffer.GetString(), docBuffer.GetSize(), 1) != 1) { throw DeadlyExportError("Failed to write scene data!"); diff --git a/code/AssetLib/glTF2/glTF2AssetWriter.inl b/code/AssetLib/glTF2/glTF2AssetWriter.inl index 798f38c1c..361af40cd 100644 --- a/code/AssetLib/glTF2/glTF2AssetWriter.inl +++ b/code/AssetLib/glTF2/glTF2AssetWriter.inl @@ -613,7 +613,9 @@ namespace glTF2 { StringBuffer docBuffer; PrettyWriter writer(docBuffer); - mDoc.Accept(writer); + if (!mDoc.Accept(writer)) { + throw DeadlyExportError("Failed to write scene data!"); + } if (jsonOutFile->Write(docBuffer.GetString(), docBuffer.GetSize(), 1) != 1) { throw DeadlyExportError("Failed to write scene data!"); @@ -664,7 +666,9 @@ namespace glTF2 { StringBuffer docBuffer; Writer writer(docBuffer); - mDoc.Accept(writer); + if (!mDoc.Accept(writer)) { + throw DeadlyExportError("Failed to write scene data!"); + } uint32_t jsonChunkLength = (docBuffer.GetSize() + 3) & ~3; // Round up to next multiple of 4 auto paddingLength = jsonChunkLength - docBuffer.GetSize(); @@ -816,5 +820,3 @@ namespace glTF2 { } } - - diff --git a/test/models/glTF2/BoxWithInfinites-glTF-Binary/BoxWithInfinites.glb b/test/models/glTF2/BoxWithInfinites-glTF-Binary/BoxWithInfinites.glb new file mode 100644 index 0000000000000000000000000000000000000000..ae83f1f06578eb6b6dc74988dc1c52b9dd6477ab GIT binary patch literal 1900 zcmb7ES#R1v5T^HiU$1DNTFFJWfdqI#BuXSIjug`N0Y#ND3#{Y=txcLJLgb(2FZ3U! z-z;lllC-3l@y?8Azi(#t79$)Z%!wi%v&soOarPtT3xAS5EauEy-YFF}HjC~jHZz#x zx;%+5g!QMxA(!6;|HUe%!TQHBZx4rx8m1cpHQ+(Ke>~x=Qnc(1a!vzeW)}<= zD>wVTvz%L z`vxR`uV@D3MSm8(3LGCzU|ZqQ4-t>+!B7Mu<`Gh%wl#P#ipQ+7X`2@lsj=xsU)SXH zWV=*Cp^hBU+UE=94P8MumSO;M%f9I26)ZJ5jb;^SjZ$d&f6OlAHCIx|4RWE@J298S z@m5;Y;RAGK(w9vhJDw-pPBU?o0lW-#sxZ1_W-_<96jB0tBQjGbmk&13Do+ShM8$ZQZ!`yTJ2r2|$O zB6&_r=JRNb<)mYwm%0fL6(WT%VxTWR`U(xLO=?#wA%cOx$-)|eG{$=Mr?fdx?_RrG z->JN@lC{eN<~$Qqn$@>Y4Mm|IZk{=TC}vT==P?m_NDaILG6?1zv?kjIcGdL;WP z?J1YEwqjF%$hd|9lav;z_TP F{RglTzqJ4W literal 0 HcmV?d00001 diff --git a/test/unit/utglTF2ImportExport.cpp b/test/unit/utglTF2ImportExport.cpp index 55cd2ef6a..99481101e 100644 --- a/test/unit/utglTF2ImportExport.cpp +++ b/test/unit/utglTF2ImportExport.cpp @@ -436,6 +436,16 @@ TEST_F(utglTF2ImportExport, error_string_preserved) { ASSERT_NE(error.find("BoxTextured0.bin"), std::string::npos) << "Error string should contain an error about missing .bin file"; } +TEST_F(utglTF2ImportExport, export_bad_accessor_bounds) { + Assimp::Importer importer; + Assimp::Exporter exporter; + const aiScene* scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/glTF2/BoxWithInfinites-glTF-Binary/BoxWithInfinites.glb", aiProcess_ValidateDataStructure); + ASSERT_NE(scene, nullptr); + + EXPECT_EQ(aiReturn_FAILURE, exporter.Export(scene, "glb2", ASSIMP_TEST_MODELS_DIR "/glTF2/BoxWithInfinites-glTF-Binary/BoxWithInfinites_out.glb")); + EXPECT_EQ(aiReturn_FAILURE, exporter.Export(scene, "gltf2", ASSIMP_TEST_MODELS_DIR "/glTF2/BoxWithInfinites-glTF-Binary/BoxWithInfinites_out.gltf")); +} + #endif // ASSIMP_BUILD_NO_EXPORT TEST_F(utglTF2ImportExport, sceneMetadata) { From c5a9fbd47f309cf33e2f8fdef03c952b3e212d63 Mon Sep 17 00:00:00 2001 From: Jeremy Cytryn Date: Wed, 6 May 2020 23:59:48 -0700 Subject: [PATCH 049/115] Gracefully handle NaNs and Infs in gltf2 accessor bound computation --- code/AssetLib/glTF2/glTF2Exporter.cpp | 13 ++++++++++--- test/unit/utglTF2ImportExport.cpp | 4 ++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/code/AssetLib/glTF2/glTF2Exporter.cpp b/code/AssetLib/glTF2/glTF2Exporter.cpp index da6d9ab2e..7ed4f2670 100644 --- a/code/AssetLib/glTF2/glTF2Exporter.cpp +++ b/code/AssetLib/glTF2/glTF2Exporter.cpp @@ -1,4 +1,4 @@ -/* +/* Open Asset Import Library (assimp) ---------------------------------------------------------------------- @@ -172,6 +172,13 @@ void SetAccessorRange(Ref acc, void* data, size_t count, for (unsigned int j = 0 ; j < numCompsOut ; j++) { double valueTmp = buffer_ptr[j]; + // Gracefully tolerate rogue NaN's in buffer data + // Any NaNs/Infs introduced in accessor bounds will end up in + // document and prevent rapidjson from writing out valid JSON + if (!std::isfinite(valueTmp)) { + continue; + } + if (valueTmp < acc->min[j]) { acc->min[j] = valueTmp; } @@ -348,7 +355,7 @@ void glTF2Exporter::GetMatTex(const aiMaterial* mat, Ref& texture, aiTe if (path[0] == '*') { // embedded aiTexture* curTex = mScene->mTextures[atoi(&path[1])]; - + texture->source->name = curTex->mFilename.C_Str(); // The asset has its own buffer, see Image::SetData @@ -762,7 +769,7 @@ void glTF2Exporter::ExportMeshes() for (int i = 0; i < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++i) { if (!aim->HasTextureCoords(i)) continue; - + // Flip UV y coords if (aim -> mNumUVComponents[i] > 1) { for (unsigned int j = 0; j < aim->mNumVertices; ++j) { diff --git a/test/unit/utglTF2ImportExport.cpp b/test/unit/utglTF2ImportExport.cpp index 99481101e..4ba7c69d4 100644 --- a/test/unit/utglTF2ImportExport.cpp +++ b/test/unit/utglTF2ImportExport.cpp @@ -442,8 +442,8 @@ TEST_F(utglTF2ImportExport, export_bad_accessor_bounds) { const aiScene* scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/glTF2/BoxWithInfinites-glTF-Binary/BoxWithInfinites.glb", aiProcess_ValidateDataStructure); ASSERT_NE(scene, nullptr); - EXPECT_EQ(aiReturn_FAILURE, exporter.Export(scene, "glb2", ASSIMP_TEST_MODELS_DIR "/glTF2/BoxWithInfinites-glTF-Binary/BoxWithInfinites_out.glb")); - EXPECT_EQ(aiReturn_FAILURE, exporter.Export(scene, "gltf2", ASSIMP_TEST_MODELS_DIR "/glTF2/BoxWithInfinites-glTF-Binary/BoxWithInfinites_out.gltf")); + EXPECT_EQ(aiReturn_SUCCESS, exporter.Export(scene, "glb2", ASSIMP_TEST_MODELS_DIR "/glTF2/BoxWithInfinites-glTF-Binary/BoxWithInfinites_out.glb")); + EXPECT_EQ(aiReturn_SUCCESS, exporter.Export(scene, "gltf2", ASSIMP_TEST_MODELS_DIR "/glTF2/BoxWithInfinites-glTF-Binary/BoxWithInfinites_out.gltf")); } #endif // ASSIMP_BUILD_NO_EXPORT From c3a21666dadd01f7a2f532d3dc0ecaf2045aa81b Mon Sep 17 00:00:00 2001 From: Jeremy Cytryn Date: Thu, 7 May 2020 01:21:54 -0700 Subject: [PATCH 050/115] Make gltf2 export normal normalization safe This avoids introducing NaNs e.g. when the input mesh has 0-length normals --- code/AssetLib/glTF/glTFExporter.cpp | 2 +- code/AssetLib/glTF2/glTF2Exporter.cpp | 2 +- .../BoxBadNormals-glTF-Binary/BoxBadNormals.glb | Bin 0 -> 1924 bytes test/unit/utglTF2ImportExport.cpp | 15 +++++++++++++++ 4 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 test/models/glTF2/BoxBadNormals-glTF-Binary/BoxBadNormals.glb diff --git a/code/AssetLib/glTF/glTFExporter.cpp b/code/AssetLib/glTF/glTFExporter.cpp index e6c14e7dd..b85affc08 100644 --- a/code/AssetLib/glTF/glTFExporter.cpp +++ b/code/AssetLib/glTF/glTFExporter.cpp @@ -348,7 +348,7 @@ void glTFExporter::GetMatColorOrTex(const aiMaterial* mat, glTF::TexProperty& pr if (path[0] == '*') { // embedded aiTexture* curTex = mScene->mTextures[atoi(&path[1])]; - + prop.texture->source->name = curTex->mFilename.C_Str(); uint8_t *data = reinterpret_cast(curTex->pcData); diff --git a/code/AssetLib/glTF2/glTF2Exporter.cpp b/code/AssetLib/glTF2/glTF2Exporter.cpp index 7ed4f2670..566f95e80 100644 --- a/code/AssetLib/glTF2/glTF2Exporter.cpp +++ b/code/AssetLib/glTF2/glTF2Exporter.cpp @@ -758,7 +758,7 @@ void glTF2Exporter::ExportMeshes() // Normalize all normals as the validator can emit a warning otherwise if ( nullptr != aim->mNormals) { for ( auto i = 0u; i < aim->mNumVertices; ++i ) { - aim->mNormals[ i ].Normalize(); + aim->mNormals[ i ].NormalizeSafe(); } } diff --git a/test/models/glTF2/BoxBadNormals-glTF-Binary/BoxBadNormals.glb b/test/models/glTF2/BoxBadNormals-glTF-Binary/BoxBadNormals.glb new file mode 100644 index 0000000000000000000000000000000000000000..c36727d12ce675125a3f48e1ebeb68fd1a3992b2 GIT binary patch literal 1924 zcmb_d+iu!G5OweO`|TC&Q!6>hHX#XqsYsMaRDe@R`w~T!fdwr2g4QNYgpl&kkLb@- z{ee{KC-uy-OH2}}M2gK}E;~E3GdsH;gnK(T4a4|x&oF-8HjGbguQ_3Un(~af6L!c& z8YD4unNzfw$p$>;!p{-`jW^sks=~zLvnYiT5m|ZLZMoLNI5EVC8w1 zB_yn}Y;RTT)z&;ur!_?~<+f0reOrWaPc|6F5%w2b^Gh?cIejhH| zgZyM?V*|_a#ejOEv|3qH$+R;O^bpW?&Psd1mz;cU-pcE!Ox~NlN)3@)TZ!_F{EUmh z4;RYP;yqMl)DaDy`C%AzTgiAZjM0|V=^a1iTS=IR9ltC48!feA$;Y-Uj#Y6griEAT zwQ`_M(X&GP(mH!;G9Cpu2!~wj_Q`>T_4(mw=r8H z#dDboPltRVj|Mc9hzOz}gZJ5BB)y>+I(NAfLEH;)@NjMrG{b&%#uG?6OCwd;*R#O@$Udv#w_WU_L{iSF8pFg2E>RE;-(`D?m z%?ahBo@Mx}*v|ajz!duK-BOffeEy6(z+C{JLrF=#4?F-K0*@3W`7!VWcnUmIl;r2Y V3*aU2N>P$u18;!0z&k}r{s%56wT%D( literal 0 HcmV?d00001 diff --git a/test/unit/utglTF2ImportExport.cpp b/test/unit/utglTF2ImportExport.cpp index 4ba7c69d4..f0f18d503 100644 --- a/test/unit/utglTF2ImportExport.cpp +++ b/test/unit/utglTF2ImportExport.cpp @@ -446,6 +446,21 @@ TEST_F(utglTF2ImportExport, export_bad_accessor_bounds) { EXPECT_EQ(aiReturn_SUCCESS, exporter.Export(scene, "gltf2", ASSIMP_TEST_MODELS_DIR "/glTF2/BoxWithInfinites-glTF-Binary/BoxWithInfinites_out.gltf")); } +TEST_F(utglTF2ImportExport, export_normalized_normals) { + Assimp::Importer importer; + Assimp::Exporter exporter; + const aiScene* scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/glTF2/BoxBadNormals-glTF-Binary/BoxBadNormals.glb", aiProcess_ValidateDataStructure); + ASSERT_NE(scene, nullptr); + EXPECT_EQ(aiReturn_SUCCESS, exporter.Export(scene, "glb2", ASSIMP_TEST_MODELS_DIR "/glTF2/BoxBadNormals-glTF-Binary/BoxBadNormals_out.glb")); + + // load in again and ensure normal-length normals but no Nan's or Inf's introduced + scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/glTF2/BoxBadNormals-glTF-Binary/BoxBadNormals_out.glb", aiProcess_ValidateDataStructure); + for ( auto i = 0u; i < scene->mMeshes[0]->mNumVertices; ++i ) { + const auto length = scene->mMeshes[0]->mNormals[i].Length(); + EXPECT_TRUE(abs(length) < 1e-6 || abs(length - 1) < 1e-6); + } +} + #endif // ASSIMP_BUILD_NO_EXPORT TEST_F(utglTF2ImportExport, sceneMetadata) { From e9b67cdb89b07ac14d193eb058280df824a26377 Mon Sep 17 00:00:00 2001 From: Yingying Wang Date: Mon, 11 May 2020 14:34:35 -0700 Subject: [PATCH 051/115] gltf2 import sparse accessor --- code/AssetLib/glTF2/glTF2Asset.h | 18 ++++++ code/AssetLib/glTF2/glTF2Asset.inl | 93 +++++++++++++++++++++++++++++- 2 files changed, 109 insertions(+), 2 deletions(-) diff --git a/code/AssetLib/glTF2/glTF2Asset.h b/code/AssetLib/glTF2/glTF2Asset.h index 48dab24a7..bae4c4eca 100644 --- a/code/AssetLib/glTF2/glTF2Asset.h +++ b/code/AssetLib/glTF2/glTF2Asset.h @@ -367,6 +367,7 @@ struct Object { //! An accessor provides a typed view into a BufferView or a subset of a BufferView //! similar to how WebGL's vertexAttribPointer() defines an attribute in a buffer. struct Accessor : public Object { + struct Sparse; Ref bufferView; //!< The ID of the bufferView. (required) size_t byteOffset; //!< The offset relative to the start of the bufferView in bytes. (required) ComponentType componentType; //!< The datatype of components in the attribute. (required) @@ -374,6 +375,7 @@ struct Accessor : public Object { AttribType::Value type; //!< Specifies if the attribute is a scalar, vector, or matrix. (required) std::vector max; //!< Maximum value of each component in this attribute. std::vector min; //!< Minimum value of each component in this attribute. + std::unique_ptr sparse; unsigned int GetNumComponents(); unsigned int GetBytesPerComponent(); @@ -423,6 +425,21 @@ struct Accessor : public Object { Accessor() {} void Read(Value &obj, Asset &r); + + //sparse + struct Sparse { + size_t count; + ComponentType indicesType; + Ref indices; + size_t indicesByteOffset; + Ref values; + size_t valuesByteOffset; + + std::vector data; //!< Actual data, which may be defaulted to an array of zeros or the original data, with the sparse buffer view applied on top of it. + + void PopulateData(size_t numBytes, uint8_t *bytes); + void PatchData(unsigned int elementSize); + }; }; //! A buffer points to binary geometry, animation, or skins. @@ -555,6 +572,7 @@ struct BufferView : public Object { BufferViewTarget target; //! The target that the WebGL buffer should be bound to. void Read(Value &obj, Asset &r); + uint8_t *GetPointer(size_t accOffset); }; struct Camera : public Object { diff --git a/code/AssetLib/glTF2/glTF2Asset.inl b/code/AssetLib/glTF2/glTF2Asset.inl index 881fd4efc..428001e6b 100644 --- a/code/AssetLib/glTF2/glTF2Asset.inl +++ b/code/AssetLib/glTF2/glTF2Asset.inl @@ -550,9 +550,62 @@ inline void BufferView::Read(Value &obj, Asset &r) { byteStride = MemberOrDefault(obj, "byteStride", 0u); } +inline uint8_t *BufferView::GetPointer(size_t accOffset) { + if (!buffer) return 0; + uint8_t *basePtr = buffer->GetPointer(); + if (!basePtr) return 0; + + size_t offset = accOffset + byteOffset; + if (buffer->EncodedRegion_Current != nullptr) { + const size_t begin = buffer->EncodedRegion_Current->Offset; + const size_t end = begin + buffer->EncodedRegion_Current->DecodedData_Length; + if ((offset >= begin) && (offset < end)) + return &buffer->EncodedRegion_Current->DecodedData[offset - begin]; + } + + return basePtr + offset; +} // // struct Accessor // +inline void Accessor::Sparse::PopulateData(size_t numBytes, uint8_t *bytes) { + if (bytes) { + data.assign(bytes, bytes + numBytes); + } else { + data.resize(numBytes, 0x00); + } +} + +inline void Accessor::Sparse::PatchData(unsigned int elementSize) { + uint8_t *pIndices = indices->GetPointer(indicesByteOffset); + const unsigned int indexSize = int(ComponentTypeSize(indicesType)); + uint8_t *indicesEnd = pIndices + count * indexSize; + + uint8_t *pValues = values->GetPointer(valuesByteOffset); + while (pIndices != indicesEnd) { + size_t offset; + switch (indicesType) { + case ComponentType_UNSIGNED_BYTE: + offset = *pIndices; + break; + case ComponentType_UNSIGNED_SHORT: + offset = *reinterpret_cast(pIndices); + break; + case ComponentType_UNSIGNED_INT: + offset = *reinterpret_cast(pIndices); + break; + default: + // have fun with float and negative values from signed types as indices. + throw DeadlyImportError("Unsupported component type in index."); + } + + offset *= elementSize; + std::memcpy(data.data() + offset, pValues, elementSize); + + pValues += elementSize; + pIndices += indexSize; + } +} inline void Accessor::Read(Value &obj, Asset &r) { @@ -566,6 +619,40 @@ inline void Accessor::Read(Value &obj, Asset &r) { const char *typestr; type = ReadMember(obj, "type", typestr) ? AttribType::FromString(typestr) : AttribType::SCALAR; + + if (Value *sparseValue = FindObject(obj, "sparse")) { + sparse.reset(new Sparse); + // count + ReadMember(*sparseValue, "count", sparse->count); + + // indices + if (Value *indicesValue = FindObject(*sparseValue, "indices")) { + //indices bufferView + Value *indiceViewID = FindUInt(*indicesValue, "bufferView"); + sparse->indices = r.bufferViews.Retrieve(indiceViewID->GetUint()); + //indices byteOffset + sparse->indicesByteOffset = MemberOrDefault(*indicesValue, "byteOffset", size_t(0)); + //indices componentType + sparse->indicesType = MemberOrDefault(*indicesValue, "componentType", ComponentType_BYTE); + } + + // value + if (Value *valuesValue = FindObject(*sparseValue, "values")) { + //value bufferView + Value *valueViewID = FindUInt(*valuesValue, "bufferView"); + sparse->values = r.bufferViews.Retrieve(valueViewID->GetUint()); + //value byteOffset + sparse->valuesByteOffset = MemberOrDefault(*valuesValue, "byteOffset", size_t(0)); + } + + // indicesType + sparse->indicesType = MemberOrDefault(*sparseValue, "componentType", ComponentType_UNSIGNED_SHORT); + + const unsigned int elementSize = GetElementSize(); + const size_t dataSize = count * elementSize; + sparse->PopulateData(dataSize, bufferView ? bufferView->GetPointer(byteOffset) : 0); + sparse->PatchData(elementSize); + } } inline unsigned int Accessor::GetNumComponents() { @@ -581,6 +668,9 @@ inline unsigned int Accessor::GetElementSize() { } inline uint8_t *Accessor::GetPointer() { + if (sparse) + return sparse->data.data(); + if (!bufferView || !bufferView->buffer) return 0; uint8_t *basePtr = bufferView->buffer->GetPointer(); if (!basePtr) return 0; @@ -634,8 +724,7 @@ void Accessor::ExtractData(T *&outData) const size_t targetElemSize = sizeof(T); ai_assert(elemSize <= targetElemSize); - - ai_assert(count * stride <= bufferView->byteLength); + ai_assert(count * stride <= (bufferView ? bufferView->byteLength : sparse->data.size())); outData = new T[count]; if (stride == elemSize && targetElemSize == elemSize) { From 7a16a7a7e4b78be8d3887c1288831488edff83f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matias=20Kangasj=C3=A4rvel=C3=A4?= Date: Fri, 15 May 2020 16:48:41 +0300 Subject: [PATCH 052/115] Fix infinite recursion in gltf2 skin parsing Previously parsing a node caused the skin that was attached to it to be parsed, which caused the skins node joints to be parsed, which could cause the skin to be re-parsed leading to infinite or at the very least exponential recursion. The fix is to just get a reference to a temporarily uninitialized skin as they were being parsed after the scene graph just to be safe anyway. This way we avoid the recursion problem and all the references will be valid in the end. --- code/AssetLib/glTF2/glTF2Asset.inl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/AssetLib/glTF2/glTF2Asset.inl b/code/AssetLib/glTF2/glTF2Asset.inl index 5e1cc42d6..e3fff61a7 100644 --- a/code/AssetLib/glTF2/glTF2Asset.inl +++ b/code/AssetLib/glTF2/glTF2Asset.inl @@ -1188,9 +1188,11 @@ inline void Node::Read(Value &obj, Asset &r) { } } + // Do not retrieve a skin here, just take a reference, to avoid infinite recursion + // Skins will be properly loaded later Value *curSkin = FindUInt(obj, "skin"); if (nullptr != curSkin) { - this->skin = r.skins.Retrieve(curSkin->GetUint()); + this->skin = r.skins.Get(curSkin->GetUint()); } Value *curCamera = FindUInt(obj, "camera"); @@ -1481,7 +1483,7 @@ inline void Asset::Load(const std::string &pFile, bool isBinary) { } } - // Force reading of skins since they're not always directly referenced + // Read skins after nodes have been loaded to avoid infinite recursion if (Value *skinsArray = FindArray(doc, "skins")) { for (unsigned int i = 0; i < skinsArray->Size(); ++i) { skins.Retrieve(i); From 6be0ce1ec93a373a1c0f8cf3ab1499e906560fb1 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Thu, 14 May 2020 17:43:31 +0100 Subject: [PATCH 053/115] Initial pass at adding logging --- code/AssetLib/FBX/FBXBinaryTokenizer.cpp | 5 ++- code/AssetLib/FBX/FBXCompileConfig.h | 6 +++ code/AssetLib/FBX/FBXConverter.h | 2 +- code/AssetLib/FBX/FBXDocument.cpp | 5 +++ code/AssetLib/FBX/FBXImporter.cpp | 2 + code/AssetLib/FBX/FBXParser.cpp | 2 + code/AssetLib/FBX/FBXTokenizer.cpp | 4 +- code/AssetLib/glTF2/glTF2Importer.cpp | 33 +++++++++++---- include/assimp/Logger.hpp | 52 ++++++++++++------------ 9 files changed, 72 insertions(+), 39 deletions(-) diff --git a/code/AssetLib/FBX/FBXBinaryTokenizer.cpp b/code/AssetLib/FBX/FBXBinaryTokenizer.cpp index 7faa0518b..dd84196f1 100644 --- a/code/AssetLib/FBX/FBXBinaryTokenizer.cpp +++ b/code/AssetLib/FBX/FBXBinaryTokenizer.cpp @@ -53,6 +53,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include +#include namespace Assimp { namespace FBX { @@ -426,7 +427,8 @@ bool ReadScope(TokenList& output_tokens, const char* input, const char*& cursor, // TODO: Test FBX Binary files newer than the 7500 version to check if the 64 bits address behaviour is consistent void TokenizeBinary(TokenList& output_tokens, const char* input, size_t length) { - ai_assert(input); + ai_assert(input); + ASSIMP_FBX_LOG_DEBUG("Tokenizing binary FBX file"); if(length < 0x1b) { TokenizeError("file is too short",0); @@ -451,6 +453,7 @@ void TokenizeBinary(TokenList& output_tokens, const char* input, size_t length) /*Result ignored*/ ReadByte(input, cursor, input + length); /*Result ignored*/ ReadByte(input, cursor, input + length); const uint32_t version = ReadWord(input, cursor, input + length); + ASSIMP_FBX_LOG_DEBUG_F("FBX version: ", version); const bool is64bits = version >= 7500; const char *end = input + length; while (cursor < end ) { diff --git a/code/AssetLib/FBX/FBXCompileConfig.h b/code/AssetLib/FBX/FBXCompileConfig.h index 5cdaa6960..31c8a5fdd 100644 --- a/code/AssetLib/FBX/FBXCompileConfig.h +++ b/code/AssetLib/FBX/FBXCompileConfig.h @@ -75,4 +75,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # endif #endif +#ifndef ASSIMP_FBX_LOG_DEBUG +// These require the DefaultLogger header. +#define ASSIMP_FBX_LOG_DEBUG ASSIMP_LOG_DEBUG +#define ASSIMP_FBX_LOG_DEBUG_F ASSIMP_LOG_DEBUG_F +#endif + #endif // INCLUDED_AI_FBX_COMPILECONFIG_H diff --git a/code/AssetLib/FBX/FBXConverter.h b/code/AssetLib/FBX/FBXConverter.h index d4f75820f..c24434c34 100644 --- a/code/AssetLib/FBX/FBXConverter.h +++ b/code/AssetLib/FBX/FBXConverter.h @@ -412,7 +412,7 @@ private: // ------------------------------------------------------------------------------------------------ // FBX file could have embedded textures not connected to anything - void ConvertOrphantEmbeddedTextures(); + void ConvertOrphanedEmbeddedTextures(); private: // 0: not assigned yet, others: index is value - 1 diff --git a/code/AssetLib/FBX/FBXDocument.cpp b/code/AssetLib/FBX/FBXDocument.cpp index 5940f3cfa..063ad677c 100644 --- a/code/AssetLib/FBX/FBXDocument.cpp +++ b/code/AssetLib/FBX/FBXDocument.cpp @@ -55,6 +55,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "FBXDocumentUtil.h" #include "FBXProperties.h" +#include + #include #include #include @@ -264,6 +266,8 @@ Document::Document(const Parser& parser, const ImportSettings& settings) : settings(settings) , parser(parser) { + ASSIMP_FBX_LOG_DEBUG("Creating FBX Document"); + // Cannot use array default initialization syntax because vc8 fails on it for (auto &timeStamp : creationTimeStamp) { timeStamp = 0; @@ -308,6 +312,7 @@ void Document::ReadHeader() { const Scope& shead = *ehead->Compound(); fbxVersion = ParseTokenAsInt(GetRequiredToken(GetRequiredElement(shead,"FBXVersion",ehead),0)); + ASSIMP_FBX_LOG_DEBUG_F("FBX Version: ", fbxVersion); // While we may have some success with newer files, we don't support // the older 6.n fbx format diff --git a/code/AssetLib/FBX/FBXImporter.cpp b/code/AssetLib/FBX/FBXImporter.cpp index 11c1503d8..232f78c13 100644 --- a/code/AssetLib/FBX/FBXImporter.cpp +++ b/code/AssetLib/FBX/FBXImporter.cpp @@ -146,6 +146,8 @@ void FBXImporter::InternReadFile(const std::string &pFile, aiScene *pScene, IOSy ThrowException("Could not open file for reading"); } + ASSIMP_FBX_LOG_DEBUG("Reading FBX file"); + // read entire file into memory - no streaming for this, fbx // files can grow large, but the assimp output data structure // then becomes very large, too. Assimp doesn't support diff --git a/code/AssetLib/FBX/FBXParser.cpp b/code/AssetLib/FBX/FBXParser.cpp index aef59d60c..04c58f70c 100644 --- a/code/AssetLib/FBX/FBXParser.cpp +++ b/code/AssetLib/FBX/FBXParser.cpp @@ -59,6 +59,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include +#include #include @@ -220,6 +221,7 @@ Parser::Parser (const TokenList& tokens, bool is_binary) , cursor(tokens.begin()) , is_binary(is_binary) { + ASSIMP_FBX_LOG_DEBUG("Parsing FBX tokens"); root.reset(new Scope(*this,true)); } diff --git a/code/AssetLib/FBX/FBXTokenizer.cpp b/code/AssetLib/FBX/FBXTokenizer.cpp index 831c40061..1fe39a175 100644 --- a/code/AssetLib/FBX/FBXTokenizer.cpp +++ b/code/AssetLib/FBX/FBXTokenizer.cpp @@ -54,6 +54,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "FBXTokenizer.h" #include "FBXUtil.h" #include +#include namespace Assimp { namespace FBX { @@ -134,7 +135,8 @@ void ProcessDataToken( TokenList& output_tokens, const char*& start, const char* // ------------------------------------------------------------------------------------------------ void Tokenize(TokenList& output_tokens, const char* input) { - ai_assert(input); + ai_assert(input); + ASSIMP_FBX_LOG_DEBUG("Tokenizing ascii FBX file"); // line and column numbers numbers are one-based unsigned int line = 1; diff --git a/code/AssetLib/glTF2/glTF2Importer.cpp b/code/AssetLib/glTF2/glTF2Importer.cpp index 10d0bc83b..ee6a1b298 100644 --- a/code/AssetLib/glTF2/glTF2Importer.cpp +++ b/code/AssetLib/glTF2/glTF2Importer.cpp @@ -286,6 +286,7 @@ static aiMaterial *ImportMaterial(std::vector &embeddedTexIdxs, Asset &r, M void glTF2Importer::ImportMaterials(glTF2::Asset &r) { const unsigned int numImportedMaterials = unsigned(r.materials.Size()); + ASSIMP_GLTF_LOG_DEBUG_F("Importing ", numImportedMaterials, " materials"); Material defaultMaterial; mScene->mNumMaterials = numImportedMaterials + 1; @@ -333,6 +334,7 @@ static inline bool CheckValidFacesIndices(aiFace *faces, unsigned nFaces, unsign #endif // ASSIMP_BUILD_DEBUG void glTF2Importer::ImportMeshes(glTF2::Asset &r) { + ASSIMP_GLTF_LOG_DEBUG_F("Importing ", r.meshes.Size(), " meshes"); std::vector meshes; unsigned int k = 0; @@ -662,10 +664,12 @@ void glTF2Importer::ImportMeshes(glTF2::Asset &r) { void glTF2Importer::ImportCameras(glTF2::Asset &r) { if (!r.cameras.Size()) return; - mScene->mNumCameras = r.cameras.Size(); - mScene->mCameras = new aiCamera *[r.cameras.Size()]; + const unsigned int numCameras = r.cameras.Size(); + ASSIMP_GLTF_LOG_DEBUG_F("Importing ", numCameras, " cameras"); + mScene->mNumCameras = numCameras; + mScene->mCameras = new aiCamera *[numCameras]; - for (size_t i = 0; i < r.cameras.Size(); ++i) { + for (size_t i = 0; i < numCameras; ++i) { Camera &cam = r.cameras[i]; aiCamera *aicam = mScene->mCameras[i] = new aiCamera(); @@ -696,10 +700,12 @@ void glTF2Importer::ImportLights(glTF2::Asset &r) { if (!r.lights.Size()) return; - mScene->mNumLights = r.lights.Size(); - mScene->mLights = new aiLight *[r.lights.Size()]; + const unsigned int numLights = r.lights.Size(); + ASSIMP_GLTF_LOG_DEBUG_F("Importing ", numLights, " lights"); + mScene->mNumLights = numLights; + mScene->mLights = new aiLight *[numLights]; - for (size_t i = 0; i < r.lights.Size(); ++i) { + for (size_t i = 0; i < numLights; ++i) { Light &light = r.lights[i]; aiLight *ail = mScene->mLights[i] = new aiLight(); @@ -958,6 +964,7 @@ void glTF2Importer::ImportNodes(glTF2::Asset &r) { if (!r.scene) { throw DeadlyImportError("GLTF: No scene"); } + ASSIMP_GLTF_LOG_DEBUG("Importing nodes"); std::vector> rootNodes = r.scene->nodes; @@ -1137,13 +1144,15 @@ std::unordered_map GatherSamplers(Animation &an void glTF2Importer::ImportAnimations(glTF2::Asset &r) { if (!r.scene) return; - mScene->mNumAnimations = r.animations.Size(); + const unsigned numAnimations = r.animations.Size(); + ASSIMP_GLTF_LOG_DEBUG_F("Importing ", numAnimations, " animations"); + mScene->mNumAnimations = numAnimations; if (mScene->mNumAnimations == 0) { return; } - mScene->mAnimations = new aiAnimation *[mScene->mNumAnimations]; - for (unsigned int i = 0; i < r.animations.Size(); ++i) { + mScene->mAnimations = new aiAnimation *[numAnimations]; + for (unsigned int i = 0; i < numAnimations; ++i) { Animation &anim = r.animations[i]; aiAnimation *ai_anim = new aiAnimation(); @@ -1249,6 +1258,8 @@ void glTF2Importer::ImportEmbeddedTextures(glTF2::Asset &r) { if (numEmbeddedTexs == 0) return; + ASSIMP_GLTF_LOG_DEBUG_F("Importing ", numEmbeddedTexs, " embedded textures"); + mScene->mTextures = new aiTexture *[numEmbeddedTexs]; // Add the embedded textures @@ -1288,6 +1299,7 @@ void glTF2Importer::ImportEmbeddedTextures(glTF2::Asset &r) { } void glTF2Importer::ImportCommonMetadata(glTF2::Asset& a) { + ASSIMP_GLTF_LOG_DEBUG("Importing metadata"); ai_assert(mScene->mMetaData == nullptr); const bool hasVersion = !a.asset.version.empty(); const bool hasGenerator = !a.asset.generator.empty(); @@ -1307,6 +1319,9 @@ void glTF2Importer::ImportCommonMetadata(glTF2::Asset& a) { } void glTF2Importer::InternReadFile(const std::string &pFile, aiScene *pScene, IOSystem *pIOHandler) { + + ASSIMP_GLTF_LOG_DEBUG("Reading GLTF file"); + // clean all member arrays meshOffsets.clear(); embeddedTexIdxs.clear(); diff --git a/include/assimp/Logger.hpp b/include/assimp/Logger.hpp index a0b798564..f32c3edc2 100644 --- a/include/assimp/Logger.hpp +++ b/include/assimp/Logger.hpp @@ -273,33 +273,31 @@ void Logger::info(const std::string &message) { return info(message.c_str()); } -// ------------------------------------------------------------------------------------------------ -#define ASSIMP_LOG_WARN_F(string,...)\ - DefaultLogger::get()->warn((Formatter::format(string),__VA_ARGS__)) - -#define ASSIMP_LOG_ERROR_F(string,...)\ - DefaultLogger::get()->error((Formatter::format(string),__VA_ARGS__)) - -#define ASSIMP_LOG_DEBUG_F(string,...)\ - DefaultLogger::get()->debug((Formatter::format(string),__VA_ARGS__)) - -#define ASSIMP_LOG_INFO_F(string,...)\ - DefaultLogger::get()->info((Formatter::format(string),__VA_ARGS__)) - - -#define ASSIMP_LOG_WARN(string)\ - DefaultLogger::get()->warn(string) - -#define ASSIMP_LOG_ERROR(string)\ - DefaultLogger::get()->error(string) - -#define ASSIMP_LOG_DEBUG(string)\ - DefaultLogger::get()->debug(string) - -#define ASSIMP_LOG_INFO(string)\ - DefaultLogger::get()->info(string) - - } // Namespace Assimp +// ------------------------------------------------------------------------------------------------ +#define ASSIMP_LOG_WARN_F(string, ...) \ + Assimp::DefaultLogger::get()->warn((Assimp::Formatter::format(string), __VA_ARGS__)) + +#define ASSIMP_LOG_ERROR_F(string, ...) \ + Assimp::DefaultLogger::get()->error((Assimp::Formatter::format(string), __VA_ARGS__)) + +#define ASSIMP_LOG_DEBUG_F(string, ...) \ + Assimp::DefaultLogger::get()->debug((Assimp::Formatter::format(string), __VA_ARGS__)) + +#define ASSIMP_LOG_INFO_F(string, ...) \ + Assimp::DefaultLogger::get()->info((Assimp::Formatter::format(string), __VA_ARGS__)) + +#define ASSIMP_LOG_WARN(string) \ + Assimp::DefaultLogger::get()->warn(string) + +#define ASSIMP_LOG_ERROR(string) \ + Assimp::DefaultLogger::get()->error(string) + +#define ASSIMP_LOG_DEBUG(string) \ + Assimp::DefaultLogger::get()->debug(string) + +#define ASSIMP_LOG_INFO(string) \ + Assimp::DefaultLogger::get()->info(string) + #endif // !! INCLUDED_AI_LOGGER_H From bcca3a0d794e9aded4f4d1d42be2d4219f16bd35 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Thu, 14 May 2020 17:46:33 +0100 Subject: [PATCH 054/115] No need for bespoke macros --- code/AssetLib/FBX/FBXBinaryTokenizer.cpp | 4 ++-- code/AssetLib/FBX/FBXCompileConfig.h | 6 ------ code/AssetLib/FBX/FBXDocument.cpp | 4 ++-- code/AssetLib/FBX/FBXImporter.cpp | 2 +- code/AssetLib/FBX/FBXParser.cpp | 2 +- code/AssetLib/FBX/FBXTokenizer.cpp | 2 +- code/AssetLib/glTF2/glTF2Importer.cpp | 18 +++++++++--------- 7 files changed, 16 insertions(+), 22 deletions(-) diff --git a/code/AssetLib/FBX/FBXBinaryTokenizer.cpp b/code/AssetLib/FBX/FBXBinaryTokenizer.cpp index dd84196f1..719b928bc 100644 --- a/code/AssetLib/FBX/FBXBinaryTokenizer.cpp +++ b/code/AssetLib/FBX/FBXBinaryTokenizer.cpp @@ -428,7 +428,7 @@ bool ReadScope(TokenList& output_tokens, const char* input, const char*& cursor, void TokenizeBinary(TokenList& output_tokens, const char* input, size_t length) { ai_assert(input); - ASSIMP_FBX_LOG_DEBUG("Tokenizing binary FBX file"); + ASSIMP_LOG_DEBUG("Tokenizing binary FBX file"); if(length < 0x1b) { TokenizeError("file is too short",0); @@ -453,7 +453,7 @@ void TokenizeBinary(TokenList& output_tokens, const char* input, size_t length) /*Result ignored*/ ReadByte(input, cursor, input + length); /*Result ignored*/ ReadByte(input, cursor, input + length); const uint32_t version = ReadWord(input, cursor, input + length); - ASSIMP_FBX_LOG_DEBUG_F("FBX version: ", version); + ASSIMP_LOG_DEBUG_F("FBX version: ", version); const bool is64bits = version >= 7500; const char *end = input + length; while (cursor < end ) { diff --git a/code/AssetLib/FBX/FBXCompileConfig.h b/code/AssetLib/FBX/FBXCompileConfig.h index 31c8a5fdd..5cdaa6960 100644 --- a/code/AssetLib/FBX/FBXCompileConfig.h +++ b/code/AssetLib/FBX/FBXCompileConfig.h @@ -75,10 +75,4 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # endif #endif -#ifndef ASSIMP_FBX_LOG_DEBUG -// These require the DefaultLogger header. -#define ASSIMP_FBX_LOG_DEBUG ASSIMP_LOG_DEBUG -#define ASSIMP_FBX_LOG_DEBUG_F ASSIMP_LOG_DEBUG_F -#endif - #endif // INCLUDED_AI_FBX_COMPILECONFIG_H diff --git a/code/AssetLib/FBX/FBXDocument.cpp b/code/AssetLib/FBX/FBXDocument.cpp index 063ad677c..bab3707d2 100644 --- a/code/AssetLib/FBX/FBXDocument.cpp +++ b/code/AssetLib/FBX/FBXDocument.cpp @@ -266,7 +266,7 @@ Document::Document(const Parser& parser, const ImportSettings& settings) : settings(settings) , parser(parser) { - ASSIMP_FBX_LOG_DEBUG("Creating FBX Document"); + ASSIMP_LOG_DEBUG("Creating FBX Document"); // Cannot use array default initialization syntax because vc8 fails on it for (auto &timeStamp : creationTimeStamp) { @@ -312,7 +312,7 @@ void Document::ReadHeader() { const Scope& shead = *ehead->Compound(); fbxVersion = ParseTokenAsInt(GetRequiredToken(GetRequiredElement(shead,"FBXVersion",ehead),0)); - ASSIMP_FBX_LOG_DEBUG_F("FBX Version: ", fbxVersion); + ASSIMP_LOG_DEBUG_F("FBX Version: ", fbxVersion); // While we may have some success with newer files, we don't support // the older 6.n fbx format diff --git a/code/AssetLib/FBX/FBXImporter.cpp b/code/AssetLib/FBX/FBXImporter.cpp index 232f78c13..8c908be40 100644 --- a/code/AssetLib/FBX/FBXImporter.cpp +++ b/code/AssetLib/FBX/FBXImporter.cpp @@ -146,7 +146,7 @@ void FBXImporter::InternReadFile(const std::string &pFile, aiScene *pScene, IOSy ThrowException("Could not open file for reading"); } - ASSIMP_FBX_LOG_DEBUG("Reading FBX file"); + ASSIMP_LOG_DEBUG("Reading FBX file"); // read entire file into memory - no streaming for this, fbx // files can grow large, but the assimp output data structure diff --git a/code/AssetLib/FBX/FBXParser.cpp b/code/AssetLib/FBX/FBXParser.cpp index 04c58f70c..c47f36150 100644 --- a/code/AssetLib/FBX/FBXParser.cpp +++ b/code/AssetLib/FBX/FBXParser.cpp @@ -221,7 +221,7 @@ Parser::Parser (const TokenList& tokens, bool is_binary) , cursor(tokens.begin()) , is_binary(is_binary) { - ASSIMP_FBX_LOG_DEBUG("Parsing FBX tokens"); + ASSIMP_LOG_DEBUG("Parsing FBX tokens"); root.reset(new Scope(*this,true)); } diff --git a/code/AssetLib/FBX/FBXTokenizer.cpp b/code/AssetLib/FBX/FBXTokenizer.cpp index 1fe39a175..4117a7d3c 100644 --- a/code/AssetLib/FBX/FBXTokenizer.cpp +++ b/code/AssetLib/FBX/FBXTokenizer.cpp @@ -136,7 +136,7 @@ void ProcessDataToken( TokenList& output_tokens, const char*& start, const char* void Tokenize(TokenList& output_tokens, const char* input) { ai_assert(input); - ASSIMP_FBX_LOG_DEBUG("Tokenizing ascii FBX file"); + ASSIMP_LOG_DEBUG("Tokenizing ascii FBX file"); // line and column numbers numbers are one-based unsigned int line = 1; diff --git a/code/AssetLib/glTF2/glTF2Importer.cpp b/code/AssetLib/glTF2/glTF2Importer.cpp index ee6a1b298..aca86d9c5 100644 --- a/code/AssetLib/glTF2/glTF2Importer.cpp +++ b/code/AssetLib/glTF2/glTF2Importer.cpp @@ -286,7 +286,7 @@ static aiMaterial *ImportMaterial(std::vector &embeddedTexIdxs, Asset &r, M void glTF2Importer::ImportMaterials(glTF2::Asset &r) { const unsigned int numImportedMaterials = unsigned(r.materials.Size()); - ASSIMP_GLTF_LOG_DEBUG_F("Importing ", numImportedMaterials, " materials"); + ASSIMP_LOG_DEBUG_F("Importing ", numImportedMaterials, " materials"); Material defaultMaterial; mScene->mNumMaterials = numImportedMaterials + 1; @@ -334,7 +334,7 @@ static inline bool CheckValidFacesIndices(aiFace *faces, unsigned nFaces, unsign #endif // ASSIMP_BUILD_DEBUG void glTF2Importer::ImportMeshes(glTF2::Asset &r) { - ASSIMP_GLTF_LOG_DEBUG_F("Importing ", r.meshes.Size(), " meshes"); + ASSIMP_LOG_DEBUG_F("Importing ", r.meshes.Size(), " meshes"); std::vector meshes; unsigned int k = 0; @@ -665,7 +665,7 @@ void glTF2Importer::ImportCameras(glTF2::Asset &r) { if (!r.cameras.Size()) return; const unsigned int numCameras = r.cameras.Size(); - ASSIMP_GLTF_LOG_DEBUG_F("Importing ", numCameras, " cameras"); + ASSIMP_LOG_DEBUG_F("Importing ", numCameras, " cameras"); mScene->mNumCameras = numCameras; mScene->mCameras = new aiCamera *[numCameras]; @@ -701,7 +701,7 @@ void glTF2Importer::ImportLights(glTF2::Asset &r) { return; const unsigned int numLights = r.lights.Size(); - ASSIMP_GLTF_LOG_DEBUG_F("Importing ", numLights, " lights"); + ASSIMP_LOG_DEBUG_F("Importing ", numLights, " lights"); mScene->mNumLights = numLights; mScene->mLights = new aiLight *[numLights]; @@ -964,7 +964,7 @@ void glTF2Importer::ImportNodes(glTF2::Asset &r) { if (!r.scene) { throw DeadlyImportError("GLTF: No scene"); } - ASSIMP_GLTF_LOG_DEBUG("Importing nodes"); + ASSIMP_LOG_DEBUG("Importing nodes"); std::vector> rootNodes = r.scene->nodes; @@ -1145,7 +1145,7 @@ void glTF2Importer::ImportAnimations(glTF2::Asset &r) { if (!r.scene) return; const unsigned numAnimations = r.animations.Size(); - ASSIMP_GLTF_LOG_DEBUG_F("Importing ", numAnimations, " animations"); + ASSIMP_LOG_DEBUG_F("Importing ", numAnimations, " animations"); mScene->mNumAnimations = numAnimations; if (mScene->mNumAnimations == 0) { return; @@ -1258,7 +1258,7 @@ void glTF2Importer::ImportEmbeddedTextures(glTF2::Asset &r) { if (numEmbeddedTexs == 0) return; - ASSIMP_GLTF_LOG_DEBUG_F("Importing ", numEmbeddedTexs, " embedded textures"); + ASSIMP_LOG_DEBUG_F("Importing ", numEmbeddedTexs, " embedded textures"); mScene->mTextures = new aiTexture *[numEmbeddedTexs]; @@ -1299,7 +1299,7 @@ void glTF2Importer::ImportEmbeddedTextures(glTF2::Asset &r) { } void glTF2Importer::ImportCommonMetadata(glTF2::Asset& a) { - ASSIMP_GLTF_LOG_DEBUG("Importing metadata"); + ASSIMP_LOG_DEBUG("Importing metadata"); ai_assert(mScene->mMetaData == nullptr); const bool hasVersion = !a.asset.version.empty(); const bool hasGenerator = !a.asset.generator.empty(); @@ -1320,7 +1320,7 @@ void glTF2Importer::ImportCommonMetadata(glTF2::Asset& a) { void glTF2Importer::InternReadFile(const std::string &pFile, aiScene *pScene, IOSystem *pIOHandler) { - ASSIMP_GLTF_LOG_DEBUG("Reading GLTF file"); + ASSIMP_LOG_DEBUG("Reading GLTF file"); // clean all member arrays meshOffsets.clear(); From 2ffd1cb8db5988009cd9ad8d67ae450f6f0c7f6d Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Fri, 15 May 2020 09:29:20 +0100 Subject: [PATCH 055/115] nits --- code/AssetLib/FBX/FBXTokenizer.cpp | 2 +- code/AssetLib/glTF2/glTF2Importer.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/AssetLib/FBX/FBXTokenizer.cpp b/code/AssetLib/FBX/FBXTokenizer.cpp index 4117a7d3c..23c238d1f 100644 --- a/code/AssetLib/FBX/FBXTokenizer.cpp +++ b/code/AssetLib/FBX/FBXTokenizer.cpp @@ -136,7 +136,7 @@ void ProcessDataToken( TokenList& output_tokens, const char*& start, const char* void Tokenize(TokenList& output_tokens, const char* input) { ai_assert(input); - ASSIMP_LOG_DEBUG("Tokenizing ascii FBX file"); + ASSIMP_LOG_DEBUG("Tokenizing ASCII FBX file"); // line and column numbers numbers are one-based unsigned int line = 1; diff --git a/code/AssetLib/glTF2/glTF2Importer.cpp b/code/AssetLib/glTF2/glTF2Importer.cpp index aca86d9c5..83f022e8f 100644 --- a/code/AssetLib/glTF2/glTF2Importer.cpp +++ b/code/AssetLib/glTF2/glTF2Importer.cpp @@ -1320,7 +1320,7 @@ void glTF2Importer::ImportCommonMetadata(glTF2::Asset& a) { void glTF2Importer::InternReadFile(const std::string &pFile, aiScene *pScene, IOSystem *pIOHandler) { - ASSIMP_LOG_DEBUG("Reading GLTF file"); + ASSIMP_LOG_DEBUG("Reading GLTF2 file"); // clean all member arrays meshOffsets.clear(); From 5e0136d737ebaa6f2547c20c72dc24edb8e3d3d4 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Fri, 15 May 2020 12:47:27 +0100 Subject: [PATCH 056/115] Add concept of verboseDebug --- code/Common/Assimp.cpp | 4 ++-- code/Common/DefaultLogger.cpp | 29 +++++++++++++++++++++++++++-- include/assimp/DefaultLogger.hpp | 11 +++++++---- include/assimp/Logger.hpp | 32 ++++++++++++++++++++++++++++++-- include/assimp/NullLogger.hpp | 7 ++++++- 5 files changed, 72 insertions(+), 11 deletions(-) diff --git a/code/Common/Assimp.cpp b/code/Common/Assimp.cpp index 67f1c3af2..86ddb92c1 100644 --- a/code/Common/Assimp.cpp +++ b/code/Common/Assimp.cpp @@ -392,7 +392,7 @@ ASSIMP_API aiReturn aiDetachLogStream(const aiLogStream *stream) { if (it == gActiveLogStreams.end()) { return AI_FAILURE; } - DefaultLogger::get()->detatchStream(it->second); + DefaultLogger::get()->detachStream( it->second ); delete it->second; gActiveLogStreams.erase(it); @@ -416,7 +416,7 @@ ASSIMP_API void aiDetachAllLogStreams(void) { } for (LogStreamMap::iterator it = gActiveLogStreams.begin(); it != gActiveLogStreams.end(); ++it) { - logger->detatchStream(it->second); + logger->detachStream( it->second ); delete it->second; } gActiveLogStreams.clear(); diff --git a/code/Common/DefaultLogger.cpp b/code/Common/DefaultLogger.cpp index adb9ba160..6b2f9252b 100644 --- a/code/Common/DefaultLogger.cpp +++ b/code/Common/DefaultLogger.cpp @@ -177,6 +177,18 @@ void Logger::debug(const char* message) { return OnDebug(message); } +// ---------------------------------------------------------------------------------- +void Logger::verboseDebug(const char *message) { + + // SECURITY FIX: otherwise it's easy to produce overruns since + // sometimes importers will include data from the input file + // (i.e. node names) in their messages. + if (strlen(message) > MAX_LOG_MESSAGE_LENGTH) { + return; + } + return OnVerboseDebug(message); +} + // ---------------------------------------------------------------------------------- void Logger::info(const char* message) { @@ -251,7 +263,7 @@ void DefaultLogger::kill() { // ---------------------------------------------------------------------------------- // Debug message void DefaultLogger::OnDebug( const char* message ) { - if ( m_Severity == Logger::NORMAL ) { + if ( m_Severity < Logger::DEBUG ) { return; } @@ -262,6 +274,19 @@ void DefaultLogger::OnDebug( const char* message ) { WriteToStreams( msg, Logger::Debugging ); } +// Verbose debug message +void DefaultLogger::OnVerboseDebug(const char *message) { + if (m_Severity < Logger::VERBOSE) { + return; + } + + static const size_t Size = MAX_LOG_MESSAGE_LENGTH + 16; + char msg[Size]; + ai_snprintf(msg, Size, "Debug, T%u: %s", GetThreadID(), message); + + WriteToStreams(msg, Logger::Debugging); +} + // ---------------------------------------------------------------------------------- // Logs an info void DefaultLogger::OnInfo( const char* message ){ @@ -320,7 +345,7 @@ bool DefaultLogger::attachStream( LogStream *pStream, unsigned int severity ) { // ---------------------------------------------------------------------------------- // Detach a stream -bool DefaultLogger::detatchStream( LogStream *pStream, unsigned int severity ) { +bool DefaultLogger::detachStream( LogStream *pStream, unsigned int severity ) { if ( nullptr == pStream ) { return false; } diff --git a/include/assimp/DefaultLogger.hpp b/include/assimp/DefaultLogger.hpp index 789072a7c..229ace87b 100644 --- a/include/assimp/DefaultLogger.hpp +++ b/include/assimp/DefaultLogger.hpp @@ -80,7 +80,7 @@ public: /** @brief Creates a logging instance. * @param name Name for log file. Only valid in combination * with the aiDefaultLogStream_FILE flag. - * @param severity Log severity, VERBOSE turns on debug messages + * @param severity Log severity, DEBUG turns on debug messages and VERBOSE turns on all messages. * @param defStreams Default log streams to be attached. Any bitwise * combination of the aiDefaultLogStream enumerated values. * If #aiDefaultLogStream_FILE is specified but an empty string is @@ -127,8 +127,8 @@ public: unsigned int severity); // ---------------------------------------------------------------------- - /** @copydoc Logger::detatchStream */ - bool detatchStream(LogStream *pStream, + /** @copydoc Logger::detachStream */ + bool detachStream(LogStream *pStream, unsigned int severity); private: @@ -141,9 +141,12 @@ private: /** @briefDestructor */ ~DefaultLogger(); - /** @brief Logs debug infos, only been written when severity level VERBOSE is set */ + /** @brief Logs debug infos, only been written when severity level DEBUG is set */ void OnDebug(const char* message); + /** @brief Logs debug infos, only been written when severity level VERBOSE is set */ + void OnVerboseDebug(const char *message); + /** @brief Logs an info message */ void OnInfo(const char* message); diff --git a/include/assimp/Logger.hpp b/include/assimp/Logger.hpp index f32c3edc2..1e5a61eee 100644 --- a/include/assimp/Logger.hpp +++ b/include/assimp/Logger.hpp @@ -74,7 +74,8 @@ public: */ enum LogSeverity { NORMAL, //!< Normal granularity of logging - VERBOSE //!< Debug infos will be logged, too + DEBUG, //!< Debug messages will be logged, but not verbose debug messages. + VERBOSE //!< All messages will be logged }; // ---------------------------------------------------------------------- @@ -103,6 +104,12 @@ public: void debug(const char* message); void debug(const std::string &message); + // ---------------------------------------------------------------------- + /** @brief Writes a debug message + * @param message Debug message*/ + void verboseDebug(const char *message); + void verboseDebug(const std::string &message); + // ---------------------------------------------------------------------- /** @brief Writes a info message * @param message Info message*/ @@ -154,7 +161,7 @@ public: * if the result is 0 the stream is detached from the Logger and * the caller retakes the possession of the stream. * @return true if the stream has been detached, false otherwise.*/ - virtual bool detatchStream(LogStream *pStream, + virtual bool detachStream(LogStream *pStream, unsigned int severity = Debugging | Err | Warn | Info) = 0; protected: @@ -178,6 +185,16 @@ protected: */ virtual void OnDebug(const char* message)= 0; + // ---------------------------------------------------------------------- + /** + * @brief Called as a request to write a specific verbose debug message + * @param message Debug message. Never longer than + * MAX_LOG_MESSAGE_LENGTH characters (excluding the '0'). + * @note The message string is only valid until the scope of + * the function is left. + */ + virtual void OnVerboseDebug(const char *message) = 0; + // ---------------------------------------------------------------------- /** * @brief Called as a request to write a specific info message @@ -255,6 +272,11 @@ void Logger::debug(const std::string &message) { return debug(message.c_str()); } +// ---------------------------------------------------------------------------------- +inline void Logger::verboseDebug(const std::string &message) { + return verboseDebug(message.c_str()); +} + // ---------------------------------------------------------------------------------- inline void Logger::error(const std::string &message) { @@ -285,6 +307,9 @@ void Logger::info(const std::string &message) { #define ASSIMP_LOG_DEBUG_F(string, ...) \ Assimp::DefaultLogger::get()->debug((Assimp::Formatter::format(string), __VA_ARGS__)) +#define ASSIMP_LOG_VERBOSE_DEBUG_F(string, ...) \ + Assimp::DefaultLogger::get()->verboseDebug((Assimp::Formatter::format(string), __VA_ARGS__)) + #define ASSIMP_LOG_INFO_F(string, ...) \ Assimp::DefaultLogger::get()->info((Assimp::Formatter::format(string), __VA_ARGS__)) @@ -297,6 +322,9 @@ void Logger::info(const std::string &message) { #define ASSIMP_LOG_DEBUG(string) \ Assimp::DefaultLogger::get()->debug(string) +#define ASSIMP_LOG_VERBOSE_DEBUG(string) \ + Assimp::DefaultLogger::get()->verboseDebug(string) + #define ASSIMP_LOG_INFO(string) \ Assimp::DefaultLogger::get()->info(string) diff --git a/include/assimp/NullLogger.hpp b/include/assimp/NullLogger.hpp index 7effca83a..e7a01ed78 100644 --- a/include/assimp/NullLogger.hpp +++ b/include/assimp/NullLogger.hpp @@ -66,6 +66,11 @@ public: (void)message; //this avoids compiler warnings } + /** @brief Logs a verbose debug message */ + void OnVerboseDebug(const char *message) { + (void)message; //this avoids compiler warnings + } + /** @brief Logs an info message */ void OnInfo(const char* message) { (void)message; //this avoids compiler warnings @@ -88,7 +93,7 @@ public: } /** @brief Detach a still attached stream from logger */ - bool detatchStream(LogStream *pStream, unsigned int severity) { + bool detachStream(LogStream *pStream, unsigned int severity) { (void)pStream; (void)severity; //this avoids compiler warnings return false; } From e11d78596fe26f4f28e6ca56c473fc595cd7c7c4 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Fri, 15 May 2020 12:59:48 +0100 Subject: [PATCH 057/115] Use verbose debug logging in certain places --- code/Common/SceneCombiner.cpp | 2 +- code/Common/ScenePreprocessor.cpp | 8 ++++---- code/Common/Subdivision.cpp | 6 +++--- code/PostProcessing/ArmaturePopulate.cpp | 8 ++++---- code/PostProcessing/ConvertToLHProcess.cpp | 2 +- code/PostProcessing/FindDegenerates.cpp | 2 +- code/PostProcessing/ImproveCacheLocality.cpp | 2 +- code/PostProcessing/JoinVerticesProcess.cpp | 2 +- code/PostProcessing/RemoveRedundantMaterials.cpp | 2 +- include/assimp/DefaultLogger.hpp | 2 +- 10 files changed, 18 insertions(+), 18 deletions(-) diff --git a/code/Common/SceneCombiner.cpp b/code/Common/SceneCombiner.cpp index 4d2a411f2..eb802dd8b 100644 --- a/code/Common/SceneCombiner.cpp +++ b/code/Common/SceneCombiner.cpp @@ -75,7 +75,7 @@ void PrefixString(aiString& string,const char* prefix, unsigned int len) { return; if (len+string.length>=MAXLEN-1) { - ASSIMP_LOG_DEBUG("Can't add an unique prefix because the string is too long"); + ASSIMP_LOG_VERBOSE_DEBUG("Can't add an unique prefix because the string is too long"); ai_assert(false); return; } diff --git a/code/Common/ScenePreprocessor.cpp b/code/Common/ScenePreprocessor.cpp index 606590519..0cb833302 100644 --- a/code/Common/ScenePreprocessor.cpp +++ b/code/Common/ScenePreprocessor.cpp @@ -225,7 +225,7 @@ void ScenePreprocessor::ProcessAnimation (aiAnimation* anim) q.mTime = 0.; q.mValue = rotation; - ASSIMP_LOG_DEBUG("ScenePreprocessor: Dummy rotation track has been generated"); + ASSIMP_LOG_VERBOSE_DEBUG("ScenePreprocessor: Dummy rotation track has been generated"); } else { ai_assert(channel->mRotationKeys); } @@ -240,7 +240,7 @@ void ScenePreprocessor::ProcessAnimation (aiAnimation* anim) q.mTime = 0.; q.mValue = scaling; - ASSIMP_LOG_DEBUG("ScenePreprocessor: Dummy scaling track has been generated"); + ASSIMP_LOG_VERBOSE_DEBUG("ScenePreprocessor: Dummy scaling track has been generated"); } else { ai_assert(channel->mScalingKeys); } @@ -255,7 +255,7 @@ void ScenePreprocessor::ProcessAnimation (aiAnimation* anim) q.mTime = 0.; q.mValue = position; - ASSIMP_LOG_DEBUG("ScenePreprocessor: Dummy position track has been generated"); + ASSIMP_LOG_VERBOSE_DEBUG("ScenePreprocessor: Dummy position track has been generated"); } else { ai_assert(channel->mPositionKeys); } @@ -264,7 +264,7 @@ void ScenePreprocessor::ProcessAnimation (aiAnimation* anim) } if (anim->mDuration == -1.) { - ASSIMP_LOG_DEBUG("ScenePreprocessor: Setting animation duration"); + ASSIMP_LOG_VERBOSE_DEBUG("ScenePreprocessor: Setting animation duration"); anim->mDuration = last - std::min( first, 0. ); } } diff --git a/code/Common/Subdivision.cpp b/code/Common/Subdivision.cpp index 2b376695e..ca7749891 100644 --- a/code/Common/Subdivision.cpp +++ b/code/Common/Subdivision.cpp @@ -181,7 +181,7 @@ void CatmullClarkSubdivider::Subdivide ( aiMesh* i = smesh[s]; // FIX - mPrimitiveTypes might not yet be initialized if (i->mPrimitiveTypes && (i->mPrimitiveTypes & (aiPrimitiveType_LINE|aiPrimitiveType_POINT))==i->mPrimitiveTypes) { - ASSIMP_LOG_DEBUG("Catmull-Clark Subdivider: Skipping pure line/point mesh"); + ASSIMP_LOG_VERBOSE_DEBUG("Catmull-Clark Subdivider: Skipping pure line/point mesh"); if (discard_input) { out[s] = i; @@ -346,7 +346,7 @@ void CatmullClarkSubdivider::InternSubdivide ( // Report the number of bad edges. bad edges are referenced by less than two // faces in the mesh. They occur at outer model boundaries in non-closed // shapes. - ASSIMP_LOG_DEBUG_F("Catmull-Clark Subdivider: got ", bad_cnt, " bad edges touching only one face (totally ", + ASSIMP_LOG_VERBOSE_DEBUG_F("Catmull-Clark Subdivider: got ", bad_cnt, " bad edges touching only one face (totally ", static_cast(edges.size()), " edges). "); }} @@ -405,7 +405,7 @@ void CatmullClarkSubdivider::InternSubdivide ( } ai_assert(haveit); if (!haveit) { - ASSIMP_LOG_DEBUG("Catmull-Clark Subdivider: Index not used"); + ASSIMP_LOG_VERBOSE_DEBUG("Catmull-Clark Subdivider: Index not used"); } break; } diff --git a/code/PostProcessing/ArmaturePopulate.cpp b/code/PostProcessing/ArmaturePopulate.cpp index 9065177b6..c6efeee58 100644 --- a/code/PostProcessing/ArmaturePopulate.cpp +++ b/code/PostProcessing/ArmaturePopulate.cpp @@ -82,7 +82,7 @@ void ArmaturePopulate::Execute(aiScene *out) { for (std::pair kvp : bone_stack) { aiBone *bone = kvp.first; aiNode *bone_node = kvp.second; - ASSIMP_LOG_DEBUG_F("active node lookup: ", bone->mName.C_Str()); + ASSIMP_LOG_VERBOSE_DEBUG_F("active node lookup: ", bone->mName.C_Str()); // lcl transform grab - done in generate_nodes :) // bone->mOffsetMatrix = bone_node->mTransformation; @@ -178,7 +178,7 @@ void ArmaturePopulate::BuildBoneStack(aiNode *, if (node == nullptr) { node_stack.clear(); BuildNodeList(root_node, node_stack); - ASSIMP_LOG_DEBUG_F("Resetting bone stack: nullptr element ", bone->mName.C_Str()); + ASSIMP_LOG_VERBOSE_DEBUG_F("Resetting bone stack: nullptr element ", bone->mName.C_Str()); node = GetNodeFromStack(bone->mName, node_stack); @@ -188,7 +188,7 @@ void ArmaturePopulate::BuildBoneStack(aiNode *, } } - ASSIMP_LOG_DEBUG_F("Successfully added bone[", bone->mName.C_Str(), "] to stack and bone node is: ", node->mName.C_Str()); + ASSIMP_LOG_VERBOSE_DEBUG_F("Successfully added bone[", bone->mName.C_Str(), "] to stack and bone node is: ", node->mName.C_Str()); bone_stack.insert(std::pair(bone, node)); } @@ -202,7 +202,7 @@ aiNode *ArmaturePopulate::GetArmatureRoot(aiNode *bone_node, std::vector &bone_list) { while (bone_node) { if (!IsBoneNode(bone_node->mName, bone_list)) { - ASSIMP_LOG_DEBUG_F("GetArmatureRoot() Found valid armature: ", bone_node->mName.C_Str()); + ASSIMP_LOG_VERBOSE_DEBUG_F("GetArmatureRoot() Found valid armature: ", bone_node->mName.C_Str()); return bone_node; } diff --git a/code/PostProcessing/ConvertToLHProcess.cpp b/code/PostProcessing/ConvertToLHProcess.cpp index 6ca73f10e..29c2d6a26 100644 --- a/code/PostProcessing/ConvertToLHProcess.cpp +++ b/code/PostProcessing/ConvertToLHProcess.cpp @@ -299,7 +299,7 @@ void FlipUVsProcess::ProcessMaterial (aiMaterial* _mat) for (unsigned int a = 0; a < mat->mNumProperties;++a) { aiMaterialProperty* prop = mat->mProperties[a]; if( !prop ) { - ASSIMP_LOG_DEBUG( "Property is null" ); + ASSIMP_LOG_VERBOSE_DEBUG( "Property is null" ); continue; } diff --git a/code/PostProcessing/FindDegenerates.cpp b/code/PostProcessing/FindDegenerates.cpp index dfdfec6cc..e5defdeb0 100644 --- a/code/PostProcessing/FindDegenerates.cpp +++ b/code/PostProcessing/FindDegenerates.cpp @@ -289,7 +289,7 @@ evil_jump_outside: if (!mesh->mNumFaces) { //The whole mesh consists of degenerated faces //signal upward, that this mesh should be deleted. - ASSIMP_LOG_DEBUG("FindDegeneratesProcess removed a mesh full of degenerated primitives"); + ASSIMP_LOG_VERBOSE_DEBUG("FindDegeneratesProcess removed a mesh full of degenerated primitives"); return true; } } diff --git a/code/PostProcessing/ImproveCacheLocality.cpp b/code/PostProcessing/ImproveCacheLocality.cpp index d72d15d3a..bab1754cd 100644 --- a/code/PostProcessing/ImproveCacheLocality.cpp +++ b/code/PostProcessing/ImproveCacheLocality.cpp @@ -355,7 +355,7 @@ ai_real ImproveCacheLocalityProcess::ProcessMesh( aiMesh* pMesh, unsigned int me // very intense verbose logging ... prepare for much text if there are many meshes if ( DefaultLogger::get()->getLogSeverity() == Logger::VERBOSE) { - ASSIMP_LOG_DEBUG_F("Mesh %u | ACMR in: ", meshNum, " out: ", fACMR, " | ~", fACMR2, ((fACMR - fACMR2) / fACMR) * 100.f); + ASSIMP_LOG_VERBOSE_DEBUG_F("Mesh %u | ACMR in: ", meshNum, " out: ", fACMR, " | ~", fACMR2, ((fACMR - fACMR2) / fACMR) * 100.f); } fACMR2 *= pMesh->mNumFaces; diff --git a/code/PostProcessing/JoinVerticesProcess.cpp b/code/PostProcessing/JoinVerticesProcess.cpp index 070c9636f..4a6362e3e 100644 --- a/code/PostProcessing/JoinVerticesProcess.cpp +++ b/code/PostProcessing/JoinVerticesProcess.cpp @@ -373,7 +373,7 @@ int JoinVerticesProcess::ProcessMesh( aiMesh* pMesh, unsigned int meshIndex) } if (!DefaultLogger::isNullLogger() && DefaultLogger::get()->getLogSeverity() == Logger::VERBOSE) { - ASSIMP_LOG_DEBUG_F( + ASSIMP_LOG_VERBOSE_DEBUG_F( "Mesh ",meshIndex, " (", (pMesh->mName.length ? pMesh->mName.data : "unnamed"), diff --git a/code/PostProcessing/RemoveRedundantMaterials.cpp b/code/PostProcessing/RemoveRedundantMaterials.cpp index 0c4280410..7f8b77d20 100644 --- a/code/PostProcessing/RemoveRedundantMaterials.cpp +++ b/code/PostProcessing/RemoveRedundantMaterials.cpp @@ -122,7 +122,7 @@ void RemoveRedundantMatsProcess::Execute( aiScene* pScene) // Keep this material even if no mesh references it abReferenced[i] = true; - ASSIMP_LOG_DEBUG_F( "Found positive match in exclusion list: \'", name.data, "\'"); + ASSIMP_LOG_VERBOSE_DEBUG_F( "Found positive match in exclusion list: \'", name.data, "\'"); } } } diff --git a/include/assimp/DefaultLogger.hpp b/include/assimp/DefaultLogger.hpp index 229ace87b..c405a7409 100644 --- a/include/assimp/DefaultLogger.hpp +++ b/include/assimp/DefaultLogger.hpp @@ -141,7 +141,7 @@ private: /** @briefDestructor */ ~DefaultLogger(); - /** @brief Logs debug infos, only been written when severity level DEBUG is set */ + /** @brief Logs debug infos, only been written when severity level DEBUG or higher is set */ void OnDebug(const char* message); /** @brief Logs debug infos, only been written when severity level VERBOSE is set */ From 434c5e3d37478d438698fae591382e1f4a561ffa Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Fri, 15 May 2020 16:59:42 +0100 Subject: [PATCH 058/115] More verbose logging --- code/AssetLib/3DS/3DSConverter.cpp | 4 ++-- code/AssetLib/AC/ACLoader.cpp | 4 ++-- code/AssetLib/ASE/ASELoader.cpp | 2 +- code/AssetLib/Blender/BlenderDNA.cpp | 2 +- code/AssetLib/COB/COBLoader.cpp | 2 +- code/AssetLib/Collada/ColladaParser.cpp | 2 +- code/AssetLib/DXF/DXFHelper.h | 2 +- code/AssetLib/DXF/DXFLoader.cpp | 6 +++--- code/AssetLib/FBX/FBXMaterial.cpp | 2 +- code/AssetLib/LWO/LWOLoader.cpp | 2 +- code/AssetLib/LWO/LWOMaterial.cpp | 2 +- code/AssetLib/LWS/LWSLoader.cpp | 2 +- code/AssetLib/MD3/MD3Loader.cpp | 2 +- code/AssetLib/Ogre/OgreBinarySerializer.cpp | 14 +++++++------- 14 files changed, 24 insertions(+), 24 deletions(-) diff --git a/code/AssetLib/3DS/3DSConverter.cpp b/code/AssetLib/3DS/3DSConverter.cpp index 1004c74a5..ef37e03de 100644 --- a/code/AssetLib/3DS/3DSConverter.cpp +++ b/code/AssetLib/3DS/3DSConverter.cpp @@ -539,7 +539,7 @@ void Discreet3DSImporter::AddNodeToGraph(aiScene *pcSOut, aiNode *pcOut, ai_assert(nullptr != anim); if (pcIn->aCameraRollKeys.size() > 1) { - ASSIMP_LOG_DEBUG("3DS: Converting camera roll track ..."); + ASSIMP_LOG_VERBOSE_DEBUG("3DS: Converting camera roll track ..."); // Camera roll keys - in fact they're just rotations // around the camera's z axis. The angles are given @@ -558,7 +558,7 @@ void Discreet3DSImporter::AddNodeToGraph(aiScene *pcSOut, aiNode *pcOut, #if 0 if (pcIn->aTargetPositionKeys.size() > 1) { - ASSIMP_LOG_DEBUG("3DS: Converting target track ..."); + ASSIMP_LOG_VERBOSE_DEBUG("3DS: Converting target track ..."); // Camera or spot light - need to convert the separate // target position channel to our representation diff --git a/code/AssetLib/AC/ACLoader.cpp b/code/AssetLib/AC/ACLoader.cpp index 40ff8dc86..2b8b7f087 100644 --- a/code/AssetLib/AC/ACLoader.cpp +++ b/code/AssetLib/AC/ACLoader.cpp @@ -207,7 +207,7 @@ void AC3DImporter::LoadObjectSection(std::vector &objects) { light->mName.length = ::ai_snprintf(light->mName.data, MAXLEN, "ACLight_%i", static_cast(mLights->size()) - 1); obj.name = std::string(light->mName.data); - ASSIMP_LOG_DEBUG("AC3D: Light source encountered"); + ASSIMP_LOG_VERBOSE_DEBUG("AC3D: Light source encountered"); obj.type = Object::Light; } else if (!ASSIMP_strincmp(buffer, "group", 5)) { obj.type = Object::Group; @@ -294,7 +294,7 @@ void AC3DImporter::LoadObjectSection(std::vector &objects) { // example writes no surf chunks if (!Q3DWorkAround) { ASSIMP_LOG_WARN("AC3D: SURF token was expected"); - ASSIMP_LOG_DEBUG("Continuing with Quick3D Workaround enabled"); + ASSIMP_LOG_VERBOSE_DEBUG("Continuing with Quick3D Workaround enabled"); } --buffer; // make sure the line is processed a second time // break; --- see fix notes above diff --git a/code/AssetLib/ASE/ASELoader.cpp b/code/AssetLib/ASE/ASELoader.cpp index 47b357248..a27767229 100644 --- a/code/AssetLib/ASE/ASELoader.cpp +++ b/code/AssetLib/ASE/ASELoader.cpp @@ -614,7 +614,7 @@ void ASEImporter::AddNodes(const std::vector &nodes, node->mNumChildren++; // What we did is so great, it is at least worth a debug message - ASSIMP_LOG_DEBUG("ASE: Generating separate target node (" + snode->mName + ")"); + ASSIMP_LOG_VERBOSE_DEBUG("ASE: Generating separate target node (" + snode->mName + ")"); } } diff --git a/code/AssetLib/Blender/BlenderDNA.cpp b/code/AssetLib/Blender/BlenderDNA.cpp index 69f139ec5..920362f24 100644 --- a/code/AssetLib/Blender/BlenderDNA.cpp +++ b/code/AssetLib/Blender/BlenderDNA.cpp @@ -353,7 +353,7 @@ void SectionParser ::Next() { } #ifdef ASSIMP_BUILD_BLENDER_DEBUG - ASSIMP_LOG_DEBUG(current.id); + ASSIMP_LOG_VERBOSE_DEBUG(current.id); #endif } diff --git a/code/AssetLib/COB/COBLoader.cpp b/code/AssetLib/COB/COBLoader.cpp index d66fb4f4c..52273d9e1 100644 --- a/code/AssetLib/COB/COBLoader.cpp +++ b/code/AssetLib/COB/COBLoader.cpp @@ -290,7 +290,7 @@ aiNode *COBImporter::BuildNodes(const Node &root, const Scene &scin, aiScene *fi } std::unique_ptr defmat; if (!min) { - ASSIMP_LOG_DEBUG(format() << "Could not resolve material index " + ASSIMP_LOG_VERBOSE_DEBUG(format() << "Could not resolve material index " << reflist.first << " - creating default material for this slot"); defmat.reset(min = new Material()); diff --git a/code/AssetLib/Collada/ColladaParser.cpp b/code/AssetLib/Collada/ColladaParser.cpp index d83980929..de3bcd47a 100644 --- a/code/AssetLib/Collada/ColladaParser.cpp +++ b/code/AssetLib/Collada/ColladaParser.cpp @@ -284,7 +284,7 @@ void ColladaParser::ReadContents() { ReadStructure(); } else { - ASSIMP_LOG_DEBUG_F("Ignoring global element <", mReader->getNodeName(), ">."); + ASSIMP_LOG_VERBOSE_DEBUG_F("Ignoring global element <", mReader->getNodeName(), ">."); SkipElement(); } } else { diff --git a/code/AssetLib/DXF/DXFHelper.h b/code/AssetLib/DXF/DXFHelper.h index 8140d00c6..d11addc0a 100644 --- a/code/AssetLib/DXF/DXFHelper.h +++ b/code/AssetLib/DXF/DXFHelper.h @@ -135,7 +135,7 @@ public: for(;splitter->length() && splitter->at(0) != '}'; splitter++, cnt++); splitter++; - ASSIMP_LOG_DEBUG((Formatter::format("DXF: skipped over control group ("),cnt," lines)")); + ASSIMP_LOG_VERBOSE_DEBUG((Formatter::format("DXF: skipped over control group ("),cnt," lines)")); } } catch(std::logic_error&) { ai_assert(!splitter); diff --git a/code/AssetLib/DXF/DXFLoader.cpp b/code/AssetLib/DXF/DXFLoader.cpp index bd5c23c7b..97b0d19dd 100644 --- a/code/AssetLib/DXF/DXFLoader.cpp +++ b/code/AssetLib/DXF/DXFLoader.cpp @@ -241,7 +241,7 @@ void DXFImporter::ConvertMeshes(aiScene* pScene, DXF::FileData& output) { } } - ASSIMP_LOG_DEBUG_F("DXF: Unexpanded polycount is ", icount, ", vertex count is ", vcount); + ASSIMP_LOG_VERBOSE_DEBUG_F("DXF: Unexpanded polycount is ", icount, ", vertex count is ", vcount); } if (! output.blocks.size() ) { @@ -473,7 +473,7 @@ void DXFImporter::ParseBlocks(DXF::LineReader& reader, DXF::FileData& output) { ++reader; } - ASSIMP_LOG_DEBUG_F("DXF: got ", output.blocks.size()," entries in BLOCKS" ); + ASSIMP_LOG_VERBOSE_DEBUG_F("DXF: got ", output.blocks.size()," entries in BLOCKS" ); } // ------------------------------------------------------------------------------------------------ @@ -549,7 +549,7 @@ void DXFImporter::ParseEntities(DXF::LineReader& reader, DXF::FileData& output) ++reader; } - ASSIMP_LOG_DEBUG_F( "DXF: got ", block.lines.size()," polylines and ", block.insertions.size(), + ASSIMP_LOG_VERBOSE_DEBUG_F( "DXF: got ", block.lines.size()," polylines and ", block.insertions.size(), " inserted blocks in ENTITIES" ); } diff --git a/code/AssetLib/FBX/FBXMaterial.cpp b/code/AssetLib/FBX/FBXMaterial.cpp index 6de44bd23..9679e62a5 100644 --- a/code/AssetLib/FBX/FBXMaterial.cpp +++ b/code/AssetLib/FBX/FBXMaterial.cpp @@ -383,7 +383,7 @@ Video::Video(uint64_t id, const Element& element, const Document& doc, const std } catch (const runtime_error& runtimeError) { //we don't need the content data for contents that has already been loaded - ASSIMP_LOG_DEBUG_F("Caught exception in FBXMaterial (likely because content was already loaded): ", + ASSIMP_LOG_VERBOSE_DEBUG_F("Caught exception in FBXMaterial (likely because content was already loaded): ", runtimeError.what()); } } diff --git a/code/AssetLib/LWO/LWOLoader.cpp b/code/AssetLib/LWO/LWOLoader.cpp index 7a9738228..c0431c2d9 100644 --- a/code/AssetLib/LWO/LWOLoader.cpp +++ b/code/AssetLib/LWO/LWOLoader.cpp @@ -422,7 +422,7 @@ void LWOImporter::InternReadFile(const std::string &pFile, // So we use a separate implementation. ComputeNormals(mesh, smoothingGroups, _mSurfaces[j]); } else { - ASSIMP_LOG_DEBUG("LWO2: No need to compute normals, they're already there"); + ASSIMP_LOG_VERBOSE_DEBUG("LWO2: No need to compute normals, they're already there"); } ++p; } diff --git a/code/AssetLib/LWO/LWOMaterial.cpp b/code/AssetLib/LWO/LWOMaterial.cpp index 65fcebddb..d7b08011f 100644 --- a/code/AssetLib/LWO/LWOMaterial.cpp +++ b/code/AssetLib/LWO/LWOMaterial.cpp @@ -154,7 +154,7 @@ bool LWOImporter::HandleTextures(aiMaterial *pcMat, const TextureList &in, aiTex static_assert(sizeof(aiUVTransform) / sizeof(ai_real) == 5, "sizeof(aiUVTransform)/sizeof(ai_real) == 5"); pcMat->AddProperty(&trafo, 1, AI_MATKEY_UVTRANSFORM(type, cur)); } - ASSIMP_LOG_DEBUG("LWO2: Setting up non-UV mapping"); + ASSIMP_LOG_VERBOSE_DEBUG("LWO2: Setting up non-UV mapping"); } // The older LWOB format does not use indirect references to clips. diff --git a/code/AssetLib/LWS/LWSLoader.cpp b/code/AssetLib/LWS/LWSLoader.cpp index baa90d786..6e4d759ac 100644 --- a/code/AssetLib/LWS/LWSLoader.cpp +++ b/code/AssetLib/LWS/LWSLoader.cpp @@ -101,7 +101,7 @@ void LWS::Element::Parse(const char *&buffer) { SkipSpaces(&buffer); if (children.back().tokens[0] == "Plugin") { - ASSIMP_LOG_DEBUG("LWS: Skipping over plugin-specific data"); + ASSIMP_LOG_VERBOSE_DEBUG("LWS: Skipping over plugin-specific data"); // strange stuff inside Plugin/Endplugin blocks. Needn't // follow LWS syntax, so we skip over it diff --git a/code/AssetLib/MD3/MD3Loader.cpp b/code/AssetLib/MD3/MD3Loader.cpp index 30be0276e..e8176865c 100644 --- a/code/AssetLib/MD3/MD3Loader.cpp +++ b/code/AssetLib/MD3/MD3Loader.cpp @@ -888,7 +888,7 @@ void MD3Importer::InternReadFile( const std::string& pFile, aiScene* pScene, IOS if (it != skins.textures.end()) { texture_name = &*( _texture_name = (*it).second).begin(); - ASSIMP_LOG_DEBUG_F("MD3: Assigning skin texture ", (*it).second, " to surface ", pcSurfaces->NAME); + ASSIMP_LOG_VERBOSE_DEBUG_F("MD3: Assigning skin texture ", (*it).second, " to surface ", pcSurfaces->NAME); (*it).resolved = true; // mark entry as resolved } diff --git a/code/AssetLib/Ogre/OgreBinarySerializer.cpp b/code/AssetLib/Ogre/OgreBinarySerializer.cpp index bc12b6403..ce412d791 100644 --- a/code/AssetLib/Ogre/OgreBinarySerializer.cpp +++ b/code/AssetLib/Ogre/OgreBinarySerializer.cpp @@ -168,7 +168,7 @@ void OgreBinarySerializer::RollbackHeader() { void OgreBinarySerializer::SkipBytes(size_t numBytes) { #if (OGRE_BINARY_SERIALIZER_DEBUG == 1) - ASSIMP_LOG_DEBUG_F("Skipping ", numBytes, " bytes"); + ASSIMP_LOG_VERBOSE_DEBUG_F("Skipping ", numBytes, " bytes"); #endif m_reader->IncPtr(numBytes); @@ -207,8 +207,8 @@ Mesh *OgreBinarySerializer::ImportMesh(MemoryStreamReader *stream) { void OgreBinarySerializer::ReadMesh(Mesh *mesh) { mesh->hasSkeletalAnimations = Read(); - ASSIMP_LOG_DEBUG("Reading Mesh"); - ASSIMP_LOG_DEBUG_F(" - Skeletal animations: ", mesh->hasSkeletalAnimations ? "true" : "false"); + ASSIMP_LOG_VERBOSE_DEBUG("Reading Mesh"); + ASSIMP_LOG_VERBOSE_DEBUG_F(" - Skeletal animations: ", mesh->hasSkeletalAnimations ? "true" : "false"); if (!AtEnd()) { uint16_t id = ReadHeader(); @@ -364,9 +364,9 @@ void OgreBinarySerializer::ReadSubMesh(Mesh *mesh) { submesh->indexData->faceCount = static_cast(submesh->indexData->count / 3); submesh->indexData->is32bit = Read(); - ASSIMP_LOG_DEBUG_F("Reading SubMesh ", mesh->subMeshes.size()); - ASSIMP_LOG_DEBUG_F(" - Material: '", submesh->materialRef, "'"); - ASSIMP_LOG_DEBUG_F(" - Uses shared geometry: ", submesh->usesSharedVertexData ? "true" : "false"); + ASSIMP_LOG_VERBOSE_DEBUG_F("Reading SubMesh ", mesh->subMeshes.size()); + ASSIMP_LOG_VERBOSE_DEBUG_F(" - Material: '", submesh->materialRef, "'"); + ASSIMP_LOG_VERBOSE_DEBUG_F(" - Uses shared geometry: ", submesh->usesSharedVertexData ? "true" : "false"); // Index buffer if (submesh->indexData->count > 0) { @@ -374,7 +374,7 @@ void OgreBinarySerializer::ReadSubMesh(Mesh *mesh) { uint8_t *indexBuffer = ReadBytes(numBytes); submesh->indexData->buffer = MemoryStreamPtr(new Assimp::MemoryIOStream(indexBuffer, numBytes, true)); - ASSIMP_LOG_DEBUG_F(" - ", submesh->indexData->faceCount, + ASSIMP_LOG_VERBOSE_DEBUG_F(" - ", submesh->indexData->faceCount, " faces from ", submesh->indexData->count, (submesh->indexData->is32bit ? " 32bit" : " 16bit"), " indexes of ", numBytes, " bytes"); } From 90cdbd9d9ac915732f538fa30319b64fc4ad008a Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Fri, 15 May 2020 17:46:50 +0100 Subject: [PATCH 059/115] Fix ups --- code/AssetLib/FBX/FBXConverter.cpp | 4 ++-- code/AssetLib/glTF2/glTF2Asset.inl | 4 +++- code/PostProcessing/ArmaturePopulate.cpp | 6 +++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/code/AssetLib/FBX/FBXConverter.cpp b/code/AssetLib/FBX/FBXConverter.cpp index cf50c715b..de0ed7745 100644 --- a/code/AssetLib/FBX/FBXConverter.cpp +++ b/code/AssetLib/FBX/FBXConverter.cpp @@ -1542,10 +1542,10 @@ void FBXConverter::ConvertCluster(std::vector &local_mesh_bones, const aiBone *bone = nullptr; if (bone_map.count(deformer_name)) { - ASSIMP_LOG_DEBUG_F("retrieved bone from lookup ", bone_name.C_Str(), ". Deformer:", deformer_name); + ASSIMP_LOG_VERBOSE_DEBUG_F("retrieved bone from lookup ", bone_name.C_Str(), ". Deformer:", deformer_name); bone = bone_map[deformer_name]; } else { - ASSIMP_LOG_DEBUG_F("created new bone ", bone_name.C_Str(), ". Deformer: ", deformer_name); + ASSIMP_LOG_VERBOSE_DEBUG_F("created new bone ", bone_name.C_Str(), ". Deformer: ", deformer_name); bone = new aiBone(); bone->mName = bone_name; diff --git a/code/AssetLib/glTF2/glTF2Asset.inl b/code/AssetLib/glTF2/glTF2Asset.inl index 5e1cc42d6..2735d0dc6 100644 --- a/code/AssetLib/glTF2/glTF2Asset.inl +++ b/code/AssetLib/glTF2/glTF2Asset.inl @@ -1337,6 +1337,7 @@ inline void AssetMetadata::Read(Document &doc) { // inline void Asset::ReadBinaryHeader(IOStream &stream, std::vector &sceneData) { + ASSIMP_LOG_DEBUG("Reading GLTF2 binary"); GLB_Header header; if (stream.Read(&header, sizeof(header), 1) != 1) { throw DeadlyImportError("GLTF: Unable to read the file header"); @@ -1400,6 +1401,7 @@ inline void Asset::ReadBinaryHeader(IOStream &stream, std::vector &sceneDa } inline void Asset::Load(const std::string &pFile, bool isBinary) { + ASSIMP_LOG_DEBUG("Loading GLTF2 asset"); mCurrentAssetDir.clear(); /*int pos = std::max(int(pFile.rfind('/')), int(pFile.rfind('\\'))); if (pos != int(std::string::npos)) */ @@ -1431,7 +1433,7 @@ inline void Asset::Load(const std::string &pFile, bool isBinary) { } // parse the JSON document - + ASSIMP_LOG_DEBUG("Parsing GLTF2 JSON"); Document doc; doc.ParseInsitu(&sceneData[0]); diff --git a/code/PostProcessing/ArmaturePopulate.cpp b/code/PostProcessing/ArmaturePopulate.cpp index c6efeee58..97feca31c 100644 --- a/code/PostProcessing/ArmaturePopulate.cpp +++ b/code/PostProcessing/ArmaturePopulate.cpp @@ -178,7 +178,7 @@ void ArmaturePopulate::BuildBoneStack(aiNode *, if (node == nullptr) { node_stack.clear(); BuildNodeList(root_node, node_stack); - ASSIMP_LOG_VERBOSE_DEBUG_F("Resetting bone stack: nullptr element ", bone->mName.C_Str()); + ASSIMP_LOG_VERBOSE_DEBUG_F("Resetting bone stack: nullptr element ", bone->mName.C_Str()); node = GetNodeFromStack(bone->mName, node_stack); @@ -188,7 +188,7 @@ void ArmaturePopulate::BuildBoneStack(aiNode *, } } - ASSIMP_LOG_VERBOSE_DEBUG_F("Successfully added bone[", bone->mName.C_Str(), "] to stack and bone node is: ", node->mName.C_Str()); + ASSIMP_LOG_VERBOSE_DEBUG_F("Successfully added bone[", bone->mName.C_Str(), "] to stack and bone node is: ", node->mName.C_Str()); bone_stack.insert(std::pair(bone, node)); } @@ -202,7 +202,7 @@ aiNode *ArmaturePopulate::GetArmatureRoot(aiNode *bone_node, std::vector &bone_list) { while (bone_node) { if (!IsBoneNode(bone_node->mName, bone_list)) { - ASSIMP_LOG_VERBOSE_DEBUG_F("GetArmatureRoot() Found valid armature: ", bone_node->mName.C_Str()); + ASSIMP_LOG_VERBOSE_DEBUG_F("GetArmatureRoot() Found valid armature: ", bone_node->mName.C_Str()); return bone_node; } From d70685d37fe7a00a01ea5fa5fe69371f05708836 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Fri, 15 May 2020 17:50:48 +0100 Subject: [PATCH 060/115] Fix typo --- code/AssetLib/FBX/FBXConverter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/AssetLib/FBX/FBXConverter.cpp b/code/AssetLib/FBX/FBXConverter.cpp index de0ed7745..fff617683 100644 --- a/code/AssetLib/FBX/FBXConverter.cpp +++ b/code/AssetLib/FBX/FBXConverter.cpp @@ -105,7 +105,7 @@ FBXConverter::FBXConverter(aiScene *out, const Document &doc, bool removeEmptyBo // The idea here is to traverse all objects to find these Textures and convert them, // so later during material conversion it will find converted texture in the textures_converted array. if (doc.Settings().readTextures) { - ConvertOrphantEmbeddedTextures(); + ConvertOrphanedEmbeddedTextures(); } ConvertRootNode(); @@ -3467,7 +3467,7 @@ void FBXConverter::TransferDataToScene() { } } -void FBXConverter::ConvertOrphantEmbeddedTextures() { +void FBXConverter::ConvertOrphanedEmbeddedTextures() { // in C++14 it could be: // for (auto&& [id, object] : objects) for (auto &&id_and_object : doc.Objects()) { From 87a7662bee8378ce9afc84bdec242cd3ae9ba212 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Mon, 18 May 2020 11:45:00 +0100 Subject: [PATCH 061/115] More thinks using VERBOSE_DEBUG --- code/AssetLib/3MF/D3MFOpcPackage.cpp | 2 +- code/AssetLib/Ogre/OgreBinarySerializer.cpp | 18 +++++------ code/AssetLib/Ogre/OgreMaterial.cpp | 18 +++++------ code/AssetLib/Ogre/OgreXmlSerializer.cpp | 34 ++++++++++----------- code/AssetLib/Ply/PlyParser.cpp | 28 ++++++++--------- code/PostProcessing/TriangulateProcess.cpp | 2 +- 6 files changed, 51 insertions(+), 51 deletions(-) diff --git a/code/AssetLib/3MF/D3MFOpcPackage.cpp b/code/AssetLib/3MF/D3MFOpcPackage.cpp index 565790656..64300ed83 100644 --- a/code/AssetLib/3MF/D3MFOpcPackage.cpp +++ b/code/AssetLib/3MF/D3MFOpcPackage.cpp @@ -147,7 +147,7 @@ D3MFOpcPackage::D3MFOpcPackage(IOSystem* pIOHandler, const std::string& rFile) } } - ASSIMP_LOG_DEBUG(rootFile); + ASSIMP_LOG_VERBOSE_DEBUG(rootFile); mZipArchive->Close(fileStream); diff --git a/code/AssetLib/Ogre/OgreBinarySerializer.cpp b/code/AssetLib/Ogre/OgreBinarySerializer.cpp index ce412d791..360da898f 100644 --- a/code/AssetLib/Ogre/OgreBinarySerializer.cpp +++ b/code/AssetLib/Ogre/OgreBinarySerializer.cpp @@ -475,7 +475,7 @@ void OgreBinarySerializer::ReadSubMeshNames(Mesh *mesh) { } submesh->name = ReadLine(); - ASSIMP_LOG_DEBUG_F(" - SubMesh ", submesh->index, " name '", submesh->name, "'"); + ASSIMP_LOG_VERBOSE_DEBUG_F(" - SubMesh ", submesh->index, " name '", submesh->name, "'"); if (!AtEnd()) id = ReadHeader(); @@ -488,7 +488,7 @@ void OgreBinarySerializer::ReadSubMeshNames(Mesh *mesh) { void OgreBinarySerializer::ReadGeometry(VertexData *dest) { dest->count = Read(); - ASSIMP_LOG_DEBUG_F(" - Reading geometry of ", dest->count, " vertices"); + ASSIMP_LOG_VERBOSE_DEBUG_F(" - Reading geometry of ", dest->count, " vertices"); if (!AtEnd()) { uint16_t id = ReadHeader(); @@ -536,7 +536,7 @@ void OgreBinarySerializer::ReadGeometryVertexElement(VertexData *dest) { element.offset = Read(); element.index = Read(); - ASSIMP_LOG_DEBUG_F(" - Vertex element ", element.SemanticToString(), " of type ", + ASSIMP_LOG_VERBOSE_DEBUG_F(" - Vertex element ", element.SemanticToString(), " of type ", element.TypeToString(), " index=", element.index, " source=", element.source); dest->vertexElements.push_back(element); @@ -557,7 +557,7 @@ void OgreBinarySerializer::ReadGeometryVertexBuffer(VertexData *dest) { uint8_t *vertexBuffer = ReadBytes(numBytes); dest->vertexBindings[bindIndex] = MemoryStreamPtr(new Assimp::MemoryIOStream(vertexBuffer, numBytes, true)); - ASSIMP_LOG_DEBUG_F(" - Read vertex buffer for source ", bindIndex, " of ", numBytes, " bytes"); + ASSIMP_LOG_VERBOSE_DEBUG_F(" - Read vertex buffer for source ", bindIndex, " of ", numBytes, " bytes"); } void OgreBinarySerializer::ReadEdgeList(Mesh * /*mesh*/) { @@ -807,7 +807,7 @@ void OgreBinarySerializer::ReadSkeleton(Skeleton *skeleton) { << " Supported versions: " << SKELETON_VERSION_1_8 << " and " << SKELETON_VERSION_1_1); } - ASSIMP_LOG_DEBUG("Reading Skeleton"); + ASSIMP_LOG_VERBOSE_DEBUG("Reading Skeleton"); bool firstBone = true; bool firstAnim = true; @@ -821,7 +821,7 @@ void OgreBinarySerializer::ReadSkeleton(Skeleton *skeleton) { } case SKELETON_BONE: { if (firstBone) { - ASSIMP_LOG_DEBUG(" - Bones"); + ASSIMP_LOG_VERBOSE_DEBUG(" - Bones"); firstBone = false; } @@ -834,7 +834,7 @@ void OgreBinarySerializer::ReadSkeleton(Skeleton *skeleton) { } case SKELETON_ANIMATION: { if (firstAnim) { - ASSIMP_LOG_DEBUG(" - Animations"); + ASSIMP_LOG_VERBOSE_DEBUG(" - Animations"); firstAnim = false; } @@ -874,7 +874,7 @@ void OgreBinarySerializer::ReadBone(Skeleton *skeleton) { throw DeadlyImportError(Formatter::format() << "Ogre Skeleton bone indexes not contiguous. Error at bone index " << bone->id); } - ASSIMP_LOG_DEBUG_F(" ", bone->id, " ", bone->name); + ASSIMP_LOG_VERBOSE_DEBUG_F(" ", bone->id, " ", bone->name); skeleton->bones.push_back(bone); } @@ -919,7 +919,7 @@ void OgreBinarySerializer::ReadSkeletonAnimation(Skeleton *skeleton) { skeleton->animations.push_back(anim); - ASSIMP_LOG_DEBUG_F(" ", anim->name, " (", anim->length, " sec, ", anim->tracks.size(), " tracks)"); + ASSIMP_LOG_VERBOSE_DEBUG_F(" ", anim->name, " (", anim->length, " sec, ", anim->tracks.size(), " tracks)"); } void OgreBinarySerializer::ReadSkeletonAnimationTrack(Skeleton * /*skeleton*/, Animation *dest) { diff --git a/code/AssetLib/Ogre/OgreMaterial.cpp b/code/AssetLib/Ogre/OgreMaterial.cpp index f79206406..74e5eb760 100644 --- a/code/AssetLib/Ogre/OgreMaterial.cpp +++ b/code/AssetLib/Ogre/OgreMaterial.cpp @@ -175,7 +175,7 @@ aiMaterial* OgreImporter::ReadMaterial(const std::string &pFile, Assimp::IOSyste if (materialFile) { break; } - ASSIMP_LOG_DEBUG_F( "Source file for material '", materialName, "' ", potentialFiles[i], " does not exist"); + ASSIMP_LOG_VERBOSE_DEBUG_F( "Source file for material '", materialName, "' ", potentialFiles[i], " does not exist"); } if (!materialFile) { @@ -201,7 +201,7 @@ aiMaterial* OgreImporter::ReadMaterial(const std::string &pFile, Assimp::IOSyste ss << &data[0]; } - ASSIMP_LOG_DEBUG_F("Reading material '", materialName, "'"); + ASSIMP_LOG_VERBOSE_DEBUG_F("Reading material '", materialName, "'"); aiMaterial *material = new aiMaterial(); m_textures.clear(); @@ -245,7 +245,7 @@ aiMaterial* OgreImporter::ReadMaterial(const std::string &pFile, Assimp::IOSyste return material; } - ASSIMP_LOG_DEBUG_F("material '", materialName, "'"); + ASSIMP_LOG_VERBOSE_DEBUG_F("material '", materialName, "'"); while(linePart != partBlockEnd) { @@ -353,7 +353,7 @@ bool OgreImporter::ReadTechnique(const std::string &techniqueName, stringstream return false; } - ASSIMP_LOG_DEBUG_F(" technique '", techniqueName, "'"); + ASSIMP_LOG_VERBOSE_DEBUG_F(" technique '", techniqueName, "'"); const string partPass = "pass"; @@ -389,7 +389,7 @@ bool OgreImporter::ReadPass(const std::string &passName, stringstream &ss, aiMat return false; } - ASSIMP_LOG_DEBUG_F(" pass '", passName, "'"); + ASSIMP_LOG_VERBOSE_DEBUG_F(" pass '", passName, "'"); const string partAmbient = "ambient"; const string partDiffuse = "diffuse"; @@ -416,7 +416,7 @@ bool OgreImporter::ReadPass(const std::string &passName, stringstream &ss, aiMat ss >> r >> g >> b; const aiColor3D color(r, g, b); - ASSIMP_LOG_DEBUG_F( " ", linePart, " ", r, " ", g, " ", b); + ASSIMP_LOG_VERBOSE_DEBUG_F( " ", linePart, " ", r, " ", g, " ", b); if (linePart == partAmbient) { @@ -455,7 +455,7 @@ bool OgreImporter::ReadTextureUnit(const std::string &textureUnitName, stringstr return false; } - ASSIMP_LOG_DEBUG_F(" texture_unit '", textureUnitName, "'"); + ASSIMP_LOG_VERBOSE_DEBUG_F(" texture_unit '", textureUnitName, "'"); const string partTexture = "texture"; const string partTextCoordSet = "tex_coord_set"; @@ -490,7 +490,7 @@ bool OgreImporter::ReadTextureUnit(const std::string &textureUnitName, stringstr if (posSuffix != string::npos && posUnderscore != string::npos && posSuffix > posUnderscore) { string identifier = Ogre::ToLower(textureRef.substr(posUnderscore, posSuffix - posUnderscore)); - ASSIMP_LOG_DEBUG_F( "Detecting texture type from filename postfix '", identifier, "'"); + ASSIMP_LOG_VERBOSE_DEBUG_F( "Detecting texture type from filename postfix '", identifier, "'"); if (identifier == "_n" || identifier == "_nrm" || identifier == "_nrml" || identifier == "_normal" || identifier == "_normals" || identifier == "_normalmap") { @@ -580,7 +580,7 @@ bool OgreImporter::ReadTextureUnit(const std::string &textureUnitName, stringstr unsigned int textureTypeIndex = m_textures[textureType]; m_textures[textureType]++; - ASSIMP_LOG_DEBUG_F( " texture '", textureRef, "' type ", textureType, + ASSIMP_LOG_VERBOSE_DEBUG_F( " texture '", textureRef, "' type ", textureType, " index ", textureTypeIndex, " UV ", uvCoord); aiString assimpTextureRef(textureRef); diff --git a/code/AssetLib/Ogre/OgreXmlSerializer.cpp b/code/AssetLib/Ogre/OgreXmlSerializer.cpp index 406220a9d..31c2ee74e 100644 --- a/code/AssetLib/Ogre/OgreXmlSerializer.cpp +++ b/code/AssetLib/Ogre/OgreXmlSerializer.cpp @@ -268,7 +268,7 @@ void OgreXmlSerializer::ReadMesh(MeshXml *mesh) { throw DeadlyImportError("Root node is <" + m_currentNodeName + "> expecting "); } - ASSIMP_LOG_DEBUG("Reading Mesh"); + ASSIMP_LOG_VERBOSE_DEBUG("Reading Mesh"); NextNode(); @@ -294,7 +294,7 @@ void OgreXmlSerializer::ReadMesh(MeshXml *mesh) { ReadBoneAssignments(mesh->sharedVertexData); } else if (m_currentNodeName == nnSkeletonLink) { mesh->skeletonRef = ReadAttribute("name"); - ASSIMP_LOG_DEBUG_F("Read skeleton link ", mesh->skeletonRef); + ASSIMP_LOG_VERBOSE_DEBUG_F("Read skeleton link ", mesh->skeletonRef); NextNode(); } // Assimp incompatible/ignored nodes @@ -305,7 +305,7 @@ void OgreXmlSerializer::ReadMesh(MeshXml *mesh) { void OgreXmlSerializer::ReadGeometry(VertexDataXml *dest) { dest->count = ReadAttribute("vertexcount"); - ASSIMP_LOG_DEBUG_F(" - Reading geometry of ", dest->count, " vertices"); + ASSIMP_LOG_VERBOSE_DEBUG_F(" - Reading geometry of ", dest->count, " vertices"); NextNode(); while (m_currentNodeName == nnVertexBuffer) { @@ -325,19 +325,19 @@ void OgreXmlSerializer::ReadGeometryVertexBuffer(VertexDataXml *dest) { } if (positions) { - ASSIMP_LOG_DEBUG(" - Contains positions"); + ASSIMP_LOG_VERBOSE_DEBUG(" - Contains positions"); dest->positions.reserve(dest->count); } if (normals) { - ASSIMP_LOG_DEBUG(" - Contains normals"); + ASSIMP_LOG_VERBOSE_DEBUG(" - Contains normals"); dest->normals.reserve(dest->count); } if (tangents) { - ASSIMP_LOG_DEBUG(" - Contains tangents"); + ASSIMP_LOG_VERBOSE_DEBUG(" - Contains tangents"); dest->tangents.reserve(dest->count); } if (uvs > 0) { - ASSIMP_LOG_DEBUG_F(" - Contains ", uvs, " texture coords"); + ASSIMP_LOG_VERBOSE_DEBUG_F(" - Contains ", uvs, " texture coords"); dest->uvs.resize(uvs); for (size_t i = 0, len = dest->uvs.size(); i < len; ++i) { dest->uvs[i].reserve(dest->count); @@ -464,9 +464,9 @@ void OgreXmlSerializer::ReadSubMesh(MeshXml *mesh) { submesh->usesSharedVertexData = ReadAttribute(anUseSharedVertices); } - ASSIMP_LOG_DEBUG_F("Reading SubMesh ", mesh->subMeshes.size()); - ASSIMP_LOG_DEBUG_F(" - Material: '", submesh->materialRef, "'"); - ASSIMP_LOG_DEBUG_F(" - Uses shared geometry: ", (submesh->usesSharedVertexData ? "true" : "false")); + ASSIMP_LOG_VERBOSE_DEBUG_F("Reading SubMesh ", mesh->subMeshes.size()); + ASSIMP_LOG_VERBOSE_DEBUG_F(" - Material: '", submesh->materialRef, "'"); + ASSIMP_LOG_VERBOSE_DEBUG_F(" - Uses shared geometry: ", (submesh->usesSharedVertexData ? "true" : "false")); // TODO: maybe we have always just 1 faces and 1 geometry and always in this order. this loop will only work correct, when the order // of faces and geometry changed, and not if we have more than one of one @@ -505,7 +505,7 @@ void OgreXmlSerializer::ReadSubMesh(MeshXml *mesh) { } if (submesh->indexData->faces.size() == submesh->indexData->faceCount) { - ASSIMP_LOG_DEBUG_F(" - Faces ", submesh->indexData->faceCount); + ASSIMP_LOG_VERBOSE_DEBUG_F(" - Faces ", submesh->indexData->faceCount); } else { throw DeadlyImportError(Formatter::format() << "Read only " << submesh->indexData->faces.size() << " faces when should have read " << submesh->indexData->faceCount); } @@ -571,7 +571,7 @@ void OgreXmlSerializer::ReadBoneAssignments(VertexDataXml *dest) { } } - ASSIMP_LOG_DEBUG_F(" - ", dest->boneAssignments.size(), " bone assignments"); + ASSIMP_LOG_VERBOSE_DEBUG_F(" - ", dest->boneAssignments.size(), " bone assignments"); } // Skeleton @@ -648,7 +648,7 @@ void OgreXmlSerializer::ReadSkeleton(Skeleton *skeleton) { throw DeadlyImportError("Root node is <" + m_currentNodeName + "> expecting "); } - ASSIMP_LOG_DEBUG("Reading Skeleton"); + ASSIMP_LOG_VERBOSE_DEBUG("Reading Skeleton"); // Optional blend mode from root node if (HasAttribute("blendmode")) { @@ -678,7 +678,7 @@ void OgreXmlSerializer::ReadAnimations(Skeleton *skeleton) { throw DeadlyImportError("Cannot read for a Skeleton without bones"); } - ASSIMP_LOG_DEBUG(" - Animations"); + ASSIMP_LOG_VERBOSE_DEBUG(" - Animations"); NextNode(); while (m_currentNodeName == nnAnimation) { @@ -693,7 +693,7 @@ void OgreXmlSerializer::ReadAnimations(Skeleton *skeleton) { ReadAnimationTracks(anim); skeleton->animations.push_back(anim); - ASSIMP_LOG_DEBUG_F(" ", anim->name, " (", anim->length, " sec, ", anim->tracks.size(), " tracks)"); + ASSIMP_LOG_VERBOSE_DEBUG_F(" ", anim->name, " (", anim->length, " sec, ", anim->tracks.size(), " tracks)"); } } @@ -793,7 +793,7 @@ static bool BoneCompare(Bone *a, Bone *b) { } void OgreXmlSerializer::ReadBones(Skeleton *skeleton) { - ASSIMP_LOG_DEBUG(" - Bones"); + ASSIMP_LOG_VERBOSE_DEBUG(" - Bones"); NextNode(); while (m_currentNodeName == nnBone) { @@ -851,7 +851,7 @@ void OgreXmlSerializer::ReadBones(Skeleton *skeleton) { as per the Ogre skeleton spec. It might be more that other (later) code in this imported does not break. */ for (size_t i = 0, len = skeleton->bones.size(); i < len; ++i) { Bone *b = skeleton->bones[i]; - ASSIMP_LOG_DEBUG_F(" ", b->id, " ", b->name); + ASSIMP_LOG_VERBOSE_DEBUG_F(" ", b->id, " ", b->name); if (b->id != static_cast(i)) { throw DeadlyImportError(Formatter::format() << "Bone ids are not in sequence starting from 0. Missing index " << i); diff --git a/code/AssetLib/Ply/PlyParser.cpp b/code/AssetLib/Ply/PlyParser.cpp index d47ca5b6f..1b885fb9c 100644 --- a/code/AssetLib/Ply/PlyParser.cpp +++ b/code/AssetLib/Ply/PlyParser.cpp @@ -514,7 +514,7 @@ bool PLY::DOM::SkipComments(std::vector &buffer) // ------------------------------------------------------------------------------------------------ bool PLY::DOM::ParseHeader(IOStreamBuffer &streamBuffer, std::vector &buffer, bool isBinary) { - ASSIMP_LOG_DEBUG("PLY::DOM::ParseHeader() begin"); + ASSIMP_LOG_VERBOSE_DEBUG("PLY::DOM::ParseHeader() begin"); // parse all elements while (!buffer.empty()) @@ -543,14 +543,14 @@ bool PLY::DOM::ParseHeader(IOStreamBuffer &streamBuffer, std::vector if (!isBinary) // it would occur an error, if binary data start with values as space or line end. SkipSpacesAndLineEnd(buffer); - ASSIMP_LOG_DEBUG("PLY::DOM::ParseHeader() succeeded"); + ASSIMP_LOG_VERBOSE_DEBUG("PLY::DOM::ParseHeader() succeeded"); return true; } // ------------------------------------------------------------------------------------------------ bool PLY::DOM::ParseElementInstanceLists(IOStreamBuffer &streamBuffer, std::vector &buffer, PLYImporter* loader) { - ASSIMP_LOG_DEBUG("PLY::DOM::ParseElementInstanceLists() begin"); + ASSIMP_LOG_VERBOSE_DEBUG("PLY::DOM::ParseElementInstanceLists() begin"); alElementData.resize(alElements.size()); std::vector::const_iterator i = alElements.begin(); @@ -571,7 +571,7 @@ bool PLY::DOM::ParseElementInstanceLists(IOStreamBuffer &streamBuffer, std } } - ASSIMP_LOG_DEBUG("PLY::DOM::ParseElementInstanceLists() succeeded"); + ASSIMP_LOG_VERBOSE_DEBUG("PLY::DOM::ParseElementInstanceLists() succeeded"); return true; } @@ -582,7 +582,7 @@ bool PLY::DOM::ParseElementInstanceListsBinary(IOStreamBuffer &streamBuffe PLYImporter* loader, bool p_bBE) { - ASSIMP_LOG_DEBUG("PLY::DOM::ParseElementInstanceListsBinary() begin"); + ASSIMP_LOG_VERBOSE_DEBUG("PLY::DOM::ParseElementInstanceListsBinary() begin"); alElementData.resize(alElements.size()); std::vector::const_iterator i = alElements.begin(); @@ -602,7 +602,7 @@ bool PLY::DOM::ParseElementInstanceListsBinary(IOStreamBuffer &streamBuffe } } - ASSIMP_LOG_DEBUG("PLY::DOM::ParseElementInstanceListsBinary() succeeded"); + ASSIMP_LOG_VERBOSE_DEBUG("PLY::DOM::ParseElementInstanceListsBinary() succeeded"); return true; } @@ -615,11 +615,11 @@ bool PLY::DOM::ParseInstanceBinary(IOStreamBuffer &streamBuffer, DOM* p_pc std::vector buffer; streamBuffer.getNextLine(buffer); - ASSIMP_LOG_DEBUG("PLY::DOM::ParseInstanceBinary() begin"); + ASSIMP_LOG_VERBOSE_DEBUG("PLY::DOM::ParseInstanceBinary() begin"); if (!p_pcOut->ParseHeader(streamBuffer, buffer, true)) { - ASSIMP_LOG_DEBUG("PLY::DOM::ParseInstanceBinary() failure"); + ASSIMP_LOG_VERBOSE_DEBUG("PLY::DOM::ParseInstanceBinary() failure"); return false; } @@ -628,10 +628,10 @@ bool PLY::DOM::ParseInstanceBinary(IOStreamBuffer &streamBuffer, DOM* p_pc const char* pCur = (char*)&buffer[0]; if (!p_pcOut->ParseElementInstanceListsBinary(streamBuffer, buffer, pCur, bufferSize, loader, p_bBE)) { - ASSIMP_LOG_DEBUG("PLY::DOM::ParseInstanceBinary() failure"); + ASSIMP_LOG_VERBOSE_DEBUG("PLY::DOM::ParseInstanceBinary() failure"); return false; } - ASSIMP_LOG_DEBUG("PLY::DOM::ParseInstanceBinary() succeeded"); + ASSIMP_LOG_VERBOSE_DEBUG("PLY::DOM::ParseInstanceBinary() succeeded"); return true; } @@ -644,11 +644,11 @@ bool PLY::DOM::ParseInstance(IOStreamBuffer &streamBuffer, DOM* p_pcOut, P std::vector buffer; streamBuffer.getNextLine(buffer); - ASSIMP_LOG_DEBUG("PLY::DOM::ParseInstance() begin"); + ASSIMP_LOG_VERBOSE_DEBUG("PLY::DOM::ParseInstance() begin"); if (!p_pcOut->ParseHeader(streamBuffer, buffer, false)) { - ASSIMP_LOG_DEBUG("PLY::DOM::ParseInstance() failure"); + ASSIMP_LOG_VERBOSE_DEBUG("PLY::DOM::ParseInstance() failure"); return false; } @@ -656,10 +656,10 @@ bool PLY::DOM::ParseInstance(IOStreamBuffer &streamBuffer, DOM* p_pcOut, P streamBuffer.getNextLine(buffer); if (!p_pcOut->ParseElementInstanceLists(streamBuffer, buffer, loader)) { - ASSIMP_LOG_DEBUG("PLY::DOM::ParseInstance() failure"); + ASSIMP_LOG_VERBOSE_DEBUG("PLY::DOM::ParseInstance() failure"); return false; } - ASSIMP_LOG_DEBUG("PLY::DOM::ParseInstance() succeeded"); + ASSIMP_LOG_VERBOSE_DEBUG("PLY::DOM::ParseInstance() succeeded"); return true; } diff --git a/code/PostProcessing/TriangulateProcess.cpp b/code/PostProcessing/TriangulateProcess.cpp index 3fd7eea21..cd9be0d21 100644 --- a/code/PostProcessing/TriangulateProcess.cpp +++ b/code/PostProcessing/TriangulateProcess.cpp @@ -490,7 +490,7 @@ bool TriangulateProcess::TriangulateMesh( aiMesh* pMesh) // drop dumb 0-area triangles - deactivated for now: //FindDegenerates post processing step can do the same thing //if (std::fabs(GetArea2D(temp_verts[i[0]],temp_verts[i[1]],temp_verts[i[2]])) < 1e-5f) { - // ASSIMP_LOG_DEBUG("Dropping triangle with area 0"); + // ASSIMP_LOG_VERBOSE_DEBUG("Dropping triangle with area 0"); // --curOut; // delete[] f->mIndices; From df2630d0e889393ce9a3f3bc202639cf14064cfa Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Mon, 18 May 2020 11:45:13 +0100 Subject: [PATCH 062/115] Change in comment. --- include/assimp/LineSplitter.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/assimp/LineSplitter.h b/include/assimp/LineSplitter.h index 869585d92..6dfeac7eb 100644 --- a/include/assimp/LineSplitter.h +++ b/include/assimp/LineSplitter.h @@ -72,7 +72,7 @@ for(LineSplitter splitter(stream);splitter;++splitter) { if (strtol(splitter[2]) > 5) { .. } } - ASSIMP_LOG_DEBUG_F("Current line is: ", splitter.get_index()); + ASSIMP_LOG_VERBOSE_DEBUG_F("Current line is: ", splitter.get_index()); } @endcode */ From 14692368d5e8541cf748008694561ca35074060e Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Mon, 18 May 2020 11:55:14 +0100 Subject: [PATCH 063/115] Same for LogDebug -> LogVerboseDebug --- code/AssetLib/FBX/FBXConverter.cpp | 2 +- code/AssetLib/IFC/IFCBoolean.cpp | 6 +++--- code/AssetLib/IFC/IFCCurve.cpp | 2 +- code/AssetLib/IFC/IFCGeometry.cpp | 6 +++--- code/AssetLib/IFC/IFCLoader.cpp | 8 ++++---- code/AssetLib/IFC/IFCOpenings.cpp | 2 +- code/AssetLib/IFC/IFCUtil.cpp | 4 ++-- include/assimp/LogAux.h | 12 ++++++++++++ 8 files changed, 27 insertions(+), 15 deletions(-) diff --git a/code/AssetLib/FBX/FBXConverter.cpp b/code/AssetLib/FBX/FBXConverter.cpp index fff617683..eb995f429 100644 --- a/code/AssetLib/FBX/FBXConverter.cpp +++ b/code/AssetLib/FBX/FBXConverter.cpp @@ -2719,7 +2719,7 @@ void FBXConverter::GenerateNodeAnimations(std::vector &node_anims, if (doc.Settings().optimizeEmptyAnimationCurves && IsRedundantAnimationData(target, comp, (chain[i]->second))) { - FBXImporter::LogDebug("dropping redundant animation channel for node " + target.Name()); + FBXImporter::LogVerboseDebug("dropping redundant animation channel for node " + target.Name()); continue; } diff --git a/code/AssetLib/IFC/IFCBoolean.cpp b/code/AssetLib/IFC/IFCBoolean.cpp index 2c9f6cf8f..22fbaa01d 100644 --- a/code/AssetLib/IFC/IFCBoolean.cpp +++ b/code/AssetLib/IFC/IFCBoolean.cpp @@ -221,7 +221,7 @@ void ProcessBooleanHalfSpaceDifference(const Schema_2x3::IfcHalfSpaceSolid *hs, result.mVerts.pop_back(); } } - IFCImporter::LogDebug("generating CSG geometry by plane clipping (IfcBooleanClippingResult)"); + IFCImporter::LogVerboseDebug("generating CSG geometry by plane clipping (IfcBooleanClippingResult)"); } // ------------------------------------------------------------------------------------------------ @@ -658,7 +658,7 @@ void ProcessPolygonalBoundedBooleanHalfSpaceDifference(const Schema_2x3::IfcPoly } } } - IFCImporter::LogDebug("generating CSG geometry by plane clipping with polygonal bounding (IfcBooleanClippingResult)"); + IFCImporter::LogVerboseDebug("generating CSG geometry by plane clipping with polygonal bounding (IfcBooleanClippingResult)"); } // ------------------------------------------------------------------------------------------------ @@ -706,7 +706,7 @@ void ProcessBooleanExtrudedAreaSolidDifference(const Schema_2x3::IfcExtrudedArea vit += pcount; } - IFCImporter::LogDebug("generating CSG geometry by geometric difference to a solid (IfcExtrudedAreaSolid)"); + IFCImporter::LogVerboseDebug("generating CSG geometry by geometric difference to a solid (IfcExtrudedAreaSolid)"); } // ------------------------------------------------------------------------------------------------ diff --git a/code/AssetLib/IFC/IFCCurve.cpp b/code/AssetLib/IFC/IFCCurve.cpp index ba2b1eaf1..4643574a8 100644 --- a/code/AssetLib/IFC/IFCCurve.cpp +++ b/code/AssetLib/IFC/IFCCurve.cpp @@ -223,7 +223,7 @@ public: } if ( (std::string)curveSegment.Transition != "CONTINUOUS" ) { - IFCImporter::LogDebug("ignoring transition code on composite curve segment, only continuous transitions are supported"); + IFCImporter::LogVerboseDebug("ignoring transition code on composite curve segment, only continuous transitions are supported"); } curves.push_back( CurveEntry(bc,IsTrue(curveSegment.SameSense)) ); diff --git a/code/AssetLib/IFC/IFCGeometry.cpp b/code/AssetLib/IFC/IFCGeometry.cpp index 781f01964..f996c8753 100644 --- a/code/AssetLib/IFC/IFCGeometry.cpp +++ b/code/AssetLib/IFC/IFCGeometry.cpp @@ -319,7 +319,7 @@ void ProcessRevolvedAreaSolid(const Schema_2x3::IfcRevolvedAreaSolid& solid, Tem ConvertAxisPlacement(trafo, solid.Position); result.Transform(trafo); - IFCImporter::LogDebug("generate mesh procedurally by radial extrusion (IfcRevolvedAreaSolid)"); + IFCImporter::LogVerboseDebug("generate mesh procedurally by radial extrusion (IfcRevolvedAreaSolid)"); } // ------------------------------------------------------------------------------------------------ @@ -457,7 +457,7 @@ void ProcessSweptDiskSolid(const Schema_2x3::IfcSweptDiskSolid &solid, TempMesh& } } - IFCImporter::LogDebug("generate mesh procedurally by sweeping a disk along a curve (IfcSweptDiskSolid)"); + IFCImporter::LogVerboseDebug("generate mesh procedurally by sweeping a disk along a curve (IfcSweptDiskSolid)"); } // ------------------------------------------------------------------------------------------------ @@ -660,7 +660,7 @@ void ProcessExtrudedArea(const Schema_2x3::IfcExtrudedAreaSolid& solid, const Te IFCImporter::LogWarn("failed to resolve all openings, presumably their topology is not supported by Assimp"); } - IFCImporter::LogDebug("generate mesh procedurally by extrusion (IfcExtrudedAreaSolid)"); + IFCImporter::LogVerboseDebug("generate mesh procedurally by extrusion (IfcExtrudedAreaSolid)"); // If this is an opening element, store both the extruded mesh and the 2D profile mesh // it was created from. Return an empty mesh to the caller. diff --git a/code/AssetLib/IFC/IFCLoader.cpp b/code/AssetLib/IFC/IFCLoader.cpp index b96733c68..9ec377d21 100644 --- a/code/AssetLib/IFC/IFCLoader.cpp +++ b/code/AssetLib/IFC/IFCLoader.cpp @@ -641,14 +641,14 @@ aiNode *ProcessSpatialStructure(aiNode *parent, const Schema_2x3::IfcProduct &el bool skipGeometry = false; if (conv.settings.skipSpaceRepresentations) { if (el.ToPtr()) { - IFCImporter::LogDebug("skipping IfcSpace entity due to importer settings"); + IFCImporter::LogVerboseDebug("skipping IfcSpace entity due to importer settings"); skipGeometry = true; } } if (conv.settings.skipAnnotations) { if (el.ToPtr()) { - IFCImporter::LogDebug("skipping IfcAnnotation entity due to importer settings"); + IFCImporter::LogVerboseDebug("skipping IfcAnnotation entity due to importer settings"); return nullptr; } } @@ -856,7 +856,7 @@ void ProcessSpatialStructures(ConversionData &conv) { if (!prod) { continue; } - IFCImporter::LogDebug("looking at spatial structure `" + (prod->Name ? prod->Name.Get() : "unnamed") + "`" + (prod->ObjectType ? " which is of type " + prod->ObjectType.Get() : "")); + IFCImporter::LogVerboseDebug("looking at spatial structure `" + (prod->Name ? prod->Name.Get() : "unnamed") + "`" + (prod->ObjectType ? " which is of type " + prod->ObjectType.Get() : "")); // the primary sites are referenced by an IFCRELAGGREGATES element which assigns them to the IFCPRODUCT const STEP::DB::RefMap &refs = conv.db.GetRefs(); @@ -868,7 +868,7 @@ void ProcessSpatialStructures(ConversionData &conv) { // comparing pointer values is not sufficient, we would need to cast them to the same type first // as there is multiple inheritance in the game. if (def.GetID() == prod->GetID()) { - IFCImporter::LogDebug("selecting this spatial structure as root structure"); + IFCImporter::LogVerboseDebug("selecting this spatial structure as root structure"); // got it, this is one primary site. nodes.push_back(ProcessSpatialStructure(NULL, *prod, conv, NULL)); } diff --git a/code/AssetLib/IFC/IFCOpenings.cpp b/code/AssetLib/IFC/IFCOpenings.cpp index f77f33faf..e15691957 100644 --- a/code/AssetLib/IFC/IFCOpenings.cpp +++ b/code/AssetLib/IFC/IFCOpenings.cpp @@ -1359,7 +1359,7 @@ bool GenerateOpenings(std::vector& openings, break; } else { - IFCImporter::LogDebug("merging overlapping openings"); + IFCImporter::LogVerboseDebug("merging overlapping openings"); ExtractVerticesFromClipper(poly[0].outer, temp_contour, false); // Generate the union of the bounding boxes diff --git a/code/AssetLib/IFC/IFCUtil.cpp b/code/AssetLib/IFC/IFCUtil.cpp index 2620160df..e7c04bd89 100644 --- a/code/AssetLib/IFC/IFCUtil.cpp +++ b/code/AssetLib/IFC/IFCUtil.cpp @@ -162,7 +162,7 @@ void TempMesh::RemoveDegenerates() } if(drop) { - IFCImporter::LogDebug("removing degenerate faces"); + IFCImporter::LogVerboseDebug("removing degenerate faces"); } } @@ -437,7 +437,7 @@ void TempMesh::RemoveAdjacentDuplicates() { base += cnt; } if(drop) { - IFCImporter::LogDebug("removing duplicate vertices"); + IFCImporter::LogVerboseDebug("removing duplicate vertices"); } } diff --git a/include/assimp/LogAux.h b/include/assimp/LogAux.h index 2265ff19c..330c5e93e 100644 --- a/include/assimp/LogAux.h +++ b/include/assimp/LogAux.h @@ -94,6 +94,12 @@ public: } } + static void LogVerboseDebug(const Formatter::format& message) { + if (!DefaultLogger::isNullLogger()) { + ASSIMP_LOG_VERBOSE_DEBUG(Prefix()+(std::string)message); + } + } + // https://sourceforge.net/tracker/?func=detail&atid=1067632&aid=3358562&group_id=226462 #if !defined(__GNUC__) || !defined(__APPLE__) || __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) @@ -125,6 +131,12 @@ public: } } + // ------------------------------------------------------------------------------------------------ + static void LogVerboseDebug (const char* message) { + if (!DefaultLogger::isNullLogger()) { + LogVerboseDebug(Formatter::format(message)); + } + } #endif private: From e9a3cc2c8a2806ceee2124ea0664c75f92b3933f Mon Sep 17 00:00:00 2001 From: Kevin Shepherd Date: Mon, 18 May 2020 16:07:46 +0100 Subject: [PATCH 064/115] Fixed rotation order bug in BVH Loader This bug has been present since after the 4.10 release. It fixes the issue "play the bvh error" #2187 Almost all bvh files are affected, such as any of the CMU library. The bug is caused by the introduction of channelMap in the BVHLoader.cpp - function void BVHLoader::CreateAnimation(aiScene *pScene). The channelMap loses the rotation order present oin the BVH file, and always applies the rotations in X,Y,Z order. --- code/AssetLib/BVH/BVHLoader.cpp | 51 ++++++++++++++------------------- 1 file changed, 22 insertions(+), 29 deletions(-) diff --git a/code/AssetLib/BVH/BVHLoader.cpp b/code/AssetLib/BVH/BVHLoader.cpp index 9c22879d2..348c30337 100644 --- a/code/AssetLib/BVH/BVHLoader.cpp +++ b/code/AssetLib/BVH/BVHLoader.cpp @@ -493,37 +493,30 @@ void BVHLoader::CreateAnimation(aiScene *pScene) { for (unsigned int fr = 0; fr < mAnimNumFrames; ++fr) { aiMatrix4x4 temp; aiMatrix3x3 rotMatrix; - for (BVHLoader::ChannelType channel = Channel_RotationX; channel <= Channel_RotationZ; channel = (BVHLoader::ChannelType)(channel + 1)) { - //Find channel in node - std::map::iterator mapIter = channelMap.find(channel); - - if (mapIter == channelMap.end()) - throw DeadlyImportError("Missing rotation channel in node " + nodeName); - else { - int channelIdx = mapIter->second; - // translate ZXY euler angels into a quaternion + for (unsigned int channelIdx = 0; channelIdx < node.mChannels.size(); ++ channelIdx) { + switch (node.mChannels[channelIdx]) { + case Channel_RotationX: + { const float angle = node.mChannelValues[fr * node.mChannels.size() + channelIdx] * float(AI_MATH_PI) / 180.0f; - - // Compute rotation transformations in the right order - switch (channel) { - case Channel_RotationX: - aiMatrix4x4::RotationX(angle, temp); - rotMatrix *= aiMatrix3x3(temp); - break; - case Channel_RotationY: - aiMatrix4x4::RotationY(angle, temp); - rotMatrix *= aiMatrix3x3(temp); - break; - case Channel_RotationZ: - aiMatrix4x4::RotationZ(angle, temp); - rotMatrix *= aiMatrix3x3(temp); - break; - default: - break; + aiMatrix4x4::RotationX( angle, temp); rotMatrix *= aiMatrix3x3( temp); } - } - } - + break; + case Channel_RotationY: + { + const float angle = node.mChannelValues[fr * node.mChannels.size() + channelIdx] * float(AI_MATH_PI) / 180.0f; + aiMatrix4x4::RotationY( angle, temp); rotMatrix *= aiMatrix3x3( temp); + } + break; + case Channel_RotationZ: + { + const float angle = node.mChannelValues[fr * node.mChannels.size() + channelIdx] * float(AI_MATH_PI) / 180.0f; + aiMatrix4x4::RotationZ( angle, temp); rotMatrix *= aiMatrix3x3( temp); + } + break; + default: + break; + } + } rotkey->mTime = double(fr); rotkey->mValue = aiQuaternion(rotMatrix); ++rotkey; From 0897c4c7be31880e36f6bac249698b1dc4fc5b2f Mon Sep 17 00:00:00 2001 From: Yingying Wang Date: Mon, 18 May 2020 11:31:44 -0700 Subject: [PATCH 065/115] merge --- code/AssetLib/glTF2/glTF2Asset.h | 10 ++++-- code/AssetLib/glTF2/glTF2Asset.inl | 55 ++++++++++++++++++++++++++++-- 2 files changed, 60 insertions(+), 5 deletions(-) diff --git a/code/AssetLib/glTF2/glTF2Asset.h b/code/AssetLib/glTF2/glTF2Asset.h index 9fc85c548..0d3b5d8b8 100644 --- a/code/AssetLib/glTF2/glTF2Asset.h +++ b/code/AssetLib/glTF2/glTF2Asset.h @@ -1,4 +1,4 @@ -/* +/* Open Asset Import Library (assimp) ---------------------------------------------------------------------- @@ -370,7 +370,8 @@ struct Object { //! An accessor provides a typed view into a BufferView or a subset of a BufferView //! similar to how WebGL's vertexAttribPointer() defines an attribute in a buffer. struct Accessor : public Object { - struct Sparse; + struct Sparse; //wangyi 0506 + Ref bufferView; //!< The ID of the bufferView. (required) size_t byteOffset; //!< The offset relative to the start of the bufferView in bytes. (required) ComponentType componentType; //!< The datatype of components in the attribute. (required) @@ -378,7 +379,7 @@ struct Accessor : public Object { AttribType::Value type; //!< Specifies if the attribute is a scalar, vector, or matrix. (required) std::vector max; //!< Maximum value of each component in this attribute. std::vector min; //!< Minimum value of each component in this attribute. - std::unique_ptr sparse; + std::unique_ptr sparse; //wangyi 0506 unsigned int GetNumComponents(); unsigned int GetBytesPerComponent(); @@ -390,6 +391,7 @@ struct Accessor : public Object { void ExtractData(T *&outData); void WriteData(size_t count, const void *src_buffer, size_t src_stride); + //wangyi 0506 void WriteSparseValues(size_t count, const void *src_data, size_t src_dataStride); void WriteSparseIndices(size_t count, const void *src_idx, size_t src_idxStride); @@ -430,6 +432,7 @@ struct Accessor : public Object { Accessor() {} void Read(Value &obj, Asset &r); + //wangyi 0506 //sparse struct Sparse { size_t count; @@ -580,6 +583,7 @@ struct BufferView : public Object { BufferViewTarget target; //! The target that the WebGL buffer should be bound to. void Read(Value &obj, Asset &r); + //wangyi 0506 uint8_t *GetPointer(size_t accOffset); }; diff --git a/code/AssetLib/glTF2/glTF2Asset.inl b/code/AssetLib/glTF2/glTF2Asset.inl index 75ff0b6fc..29d745234 100644 --- a/code/AssetLib/glTF2/glTF2Asset.inl +++ b/code/AssetLib/glTF2/glTF2Asset.inl @@ -1,22 +1,30 @@ /* Open Asset Import Library (assimp) ---------------------------------------------------------------------- + Copyright (c) 2006-2020, 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 @@ -28,6 +36,7 @@ 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. + ---------------------------------------------------------------------- */ @@ -547,6 +556,7 @@ inline void BufferView::Read(Value &obj, Asset &r) { byteStride = MemberOrDefault(obj, "byteStride", 0u); } +//wangyi 0506 inline uint8_t *BufferView::GetPointer(size_t accOffset) { if (!buffer) return 0; uint8_t *basePtr = buffer->GetPointer(); @@ -566,7 +576,7 @@ inline uint8_t *BufferView::GetPointer(size_t accOffset) { // // struct Accessor // - +//wangyi 0506 inline void Accessor::Sparse::PopulateData(size_t numBytes, uint8_t *bytes) { if (bytes) { data.assign(bytes, bytes + numBytes); @@ -605,7 +615,22 @@ inline void Accessor::Sparse::PatchData(unsigned int elementSize) { pIndices += indexSize; } } +/* old +inline void Accessor::Read(Value &obj, Asset &r) { + if (Value *bufferViewVal = FindUInt(obj, "bufferView")) { + bufferView = r.bufferViews.Retrieve(bufferViewVal->GetUint()); + } + + byteOffset = MemberOrDefault(obj, "byteOffset", size_t(0)); + componentType = MemberOrDefault(obj, "componentType", ComponentType_BYTE); + count = MemberOrDefault(obj, "count", size_t(0)); + + const char *typestr; + type = ReadMember(obj, "type", typestr) ? AttribType::FromString(typestr) : AttribType::SCALAR; +}*/ + +// wangyi 0506 inline void Accessor::Read(Value &obj, Asset &r) { if (Value *bufferViewVal = FindUInt(obj, "bufferView")) { @@ -619,6 +644,7 @@ inline void Accessor::Read(Value &obj, Asset &r) { const char *typestr; type = ReadMember(obj, "type", typestr) ? AttribType::FromString(typestr) : AttribType::SCALAR; + //wangyi 0506 if (Value *sparseValue = FindObject(obj, "sparse")) { sparse.reset(new Sparse); // count @@ -668,6 +694,27 @@ inline unsigned int Accessor::GetElementSize() { return GetNumComponents() * GetBytesPerComponent(); } +/* +inline uint8_t *Accessor::GetPointer() { + if (!bufferView || !bufferView->buffer) return 0; + uint8_t *basePtr = bufferView->buffer->GetPointer(); + if (!basePtr) return 0; + + size_t offset = byteOffset + bufferView->byteOffset; + + // Check if region is encoded. + if (bufferView->buffer->EncodedRegion_Current != nullptr) { + const size_t begin = bufferView->buffer->EncodedRegion_Current->Offset; + const size_t end = begin + bufferView->buffer->EncodedRegion_Current->DecodedData_Length; + + if ((offset >= begin) && (offset < end)) + return &bufferView->buffer->EncodedRegion_Current->DecodedData[offset - begin]; + } + + return basePtr + offset; +}*/ + +// wangyi 0506 inline uint8_t *Accessor::GetPointer() { if (sparse) return sparse->data.data(); @@ -724,6 +771,8 @@ void Accessor::ExtractData(T *&outData) { const size_t targetElemSize = sizeof(T); ai_assert(elemSize <= targetElemSize); + + //wangyi 0506 ai_assert(count * stride <= (bufferView ? bufferView->byteLength : sparse->data.size())); outData = new T[count]; @@ -749,6 +798,7 @@ inline void Accessor::WriteData(size_t _count, const void *src_buffer, size_t sr CopyData(_count, src, src_stride, dst, dst_stride); } +//wangyi 0506 inline void Accessor::WriteSparseValues(size_t _count, const void *src_data, size_t src_dataStride) { if (!sparse) return; @@ -763,6 +813,7 @@ inline void Accessor::WriteSparseValues(size_t _count, const void *src_data, siz CopyData(_count, value_src, src_dataStride, value_dst, value_dst_stride); } +//wangyi 0506 inline void Accessor::WriteSparseIndices(size_t _count, const void *src_idx, size_t src_idxStride) { if (!sparse) return; @@ -1673,4 +1724,4 @@ inline std::string Asset::FindUniqueID(const std::string &str, const char *suffi #pragma warning(pop) #endif // _WIN32 -} // namespace glTF2 \ No newline at end of file +} // namespace glTF2 From e39c6328097ce3cd8ff7c872f62611aac6c8009f Mon Sep 17 00:00:00 2001 From: Yingying Wang Date: Mon, 18 May 2020 11:50:51 -0700 Subject: [PATCH 066/115] cleanup --- code/AssetLib/glTF2/glTF2Asset.h | 9 +--- code/AssetLib/glTF2/glTF2Asset.inl | 70 ------------------------------ 2 files changed, 2 insertions(+), 77 deletions(-) diff --git a/code/AssetLib/glTF2/glTF2Asset.h b/code/AssetLib/glTF2/glTF2Asset.h index 0d3b5d8b8..99bcaf072 100644 --- a/code/AssetLib/glTF2/glTF2Asset.h +++ b/code/AssetLib/glTF2/glTF2Asset.h @@ -370,7 +370,7 @@ struct Object { //! An accessor provides a typed view into a BufferView or a subset of a BufferView //! similar to how WebGL's vertexAttribPointer() defines an attribute in a buffer. struct Accessor : public Object { - struct Sparse; //wangyi 0506 + struct Sparse; Ref bufferView; //!< The ID of the bufferView. (required) size_t byteOffset; //!< The offset relative to the start of the bufferView in bytes. (required) @@ -379,7 +379,7 @@ struct Accessor : public Object { AttribType::Value type; //!< Specifies if the attribute is a scalar, vector, or matrix. (required) std::vector max; //!< Maximum value of each component in this attribute. std::vector min; //!< Minimum value of each component in this attribute. - std::unique_ptr sparse; //wangyi 0506 + std::unique_ptr sparse; unsigned int GetNumComponents(); unsigned int GetBytesPerComponent(); @@ -391,9 +391,6 @@ struct Accessor : public Object { void ExtractData(T *&outData); void WriteData(size_t count, const void *src_buffer, size_t src_stride); - //wangyi 0506 - void WriteSparseValues(size_t count, const void *src_data, size_t src_dataStride); - void WriteSparseIndices(size_t count, const void *src_idx, size_t src_idxStride); //! Helper class to iterate the data class Indexer { @@ -432,7 +429,6 @@ struct Accessor : public Object { Accessor() {} void Read(Value &obj, Asset &r); - //wangyi 0506 //sparse struct Sparse { size_t count; @@ -583,7 +579,6 @@ struct BufferView : public Object { BufferViewTarget target; //! The target that the WebGL buffer should be bound to. void Read(Value &obj, Asset &r); - //wangyi 0506 uint8_t *GetPointer(size_t accOffset); }; diff --git a/code/AssetLib/glTF2/glTF2Asset.inl b/code/AssetLib/glTF2/glTF2Asset.inl index 29d745234..9f852ebf8 100644 --- a/code/AssetLib/glTF2/glTF2Asset.inl +++ b/code/AssetLib/glTF2/glTF2Asset.inl @@ -556,7 +556,6 @@ inline void BufferView::Read(Value &obj, Asset &r) { byteStride = MemberOrDefault(obj, "byteStride", 0u); } -//wangyi 0506 inline uint8_t *BufferView::GetPointer(size_t accOffset) { if (!buffer) return 0; uint8_t *basePtr = buffer->GetPointer(); @@ -576,7 +575,6 @@ inline uint8_t *BufferView::GetPointer(size_t accOffset) { // // struct Accessor // -//wangyi 0506 inline void Accessor::Sparse::PopulateData(size_t numBytes, uint8_t *bytes) { if (bytes) { data.assign(bytes, bytes + numBytes); @@ -615,22 +613,7 @@ inline void Accessor::Sparse::PatchData(unsigned int elementSize) { pIndices += indexSize; } } -/* old -inline void Accessor::Read(Value &obj, Asset &r) { - if (Value *bufferViewVal = FindUInt(obj, "bufferView")) { - bufferView = r.bufferViews.Retrieve(bufferViewVal->GetUint()); - } - - byteOffset = MemberOrDefault(obj, "byteOffset", size_t(0)); - componentType = MemberOrDefault(obj, "componentType", ComponentType_BYTE); - count = MemberOrDefault(obj, "count", size_t(0)); - - const char *typestr; - type = ReadMember(obj, "type", typestr) ? AttribType::FromString(typestr) : AttribType::SCALAR; -}*/ - -// wangyi 0506 inline void Accessor::Read(Value &obj, Asset &r) { if (Value *bufferViewVal = FindUInt(obj, "bufferView")) { @@ -644,7 +627,6 @@ inline void Accessor::Read(Value &obj, Asset &r) { const char *typestr; type = ReadMember(obj, "type", typestr) ? AttribType::FromString(typestr) : AttribType::SCALAR; - //wangyi 0506 if (Value *sparseValue = FindObject(obj, "sparse")) { sparse.reset(new Sparse); // count @@ -694,27 +676,6 @@ inline unsigned int Accessor::GetElementSize() { return GetNumComponents() * GetBytesPerComponent(); } -/* -inline uint8_t *Accessor::GetPointer() { - if (!bufferView || !bufferView->buffer) return 0; - uint8_t *basePtr = bufferView->buffer->GetPointer(); - if (!basePtr) return 0; - - size_t offset = byteOffset + bufferView->byteOffset; - - // Check if region is encoded. - if (bufferView->buffer->EncodedRegion_Current != nullptr) { - const size_t begin = bufferView->buffer->EncodedRegion_Current->Offset; - const size_t end = begin + bufferView->buffer->EncodedRegion_Current->DecodedData_Length; - - if ((offset >= begin) && (offset < end)) - return &bufferView->buffer->EncodedRegion_Current->DecodedData[offset - begin]; - } - - return basePtr + offset; -}*/ - -// wangyi 0506 inline uint8_t *Accessor::GetPointer() { if (sparse) return sparse->data.data(); @@ -771,8 +732,6 @@ void Accessor::ExtractData(T *&outData) { const size_t targetElemSize = sizeof(T); ai_assert(elemSize <= targetElemSize); - - //wangyi 0506 ai_assert(count * stride <= (bufferView ? bufferView->byteLength : sparse->data.size())); outData = new T[count]; @@ -798,35 +757,6 @@ inline void Accessor::WriteData(size_t _count, const void *src_buffer, size_t sr CopyData(_count, src, src_stride, dst, dst_stride); } -//wangyi 0506 -inline void Accessor::WriteSparseValues(size_t _count, const void *src_data, size_t src_dataStride) { - if (!sparse) - return; - - // values - uint8_t *value_buffer_ptr = sparse->values->buffer->GetPointer(); - size_t value_offset = sparse->valuesByteOffset + sparse->values->byteOffset; - size_t value_dst_stride = GetNumComponents() * GetBytesPerComponent(); - const uint8_t *value_src = reinterpret_cast(src_data); - uint8_t *value_dst = reinterpret_cast(value_buffer_ptr + value_offset); - ai_assert(value_dst + _count * value_dst_stride <= value_buffer_ptr + sparse->values->buffer->byteLength); - CopyData(_count, value_src, src_dataStride, value_dst, value_dst_stride); -} - -//wangyi 0506 -inline void Accessor::WriteSparseIndices(size_t _count, const void *src_idx, size_t src_idxStride) { - if (!sparse) - return; - - // indices - uint8_t *indices_buffer_ptr = sparse->indices->buffer->GetPointer(); - size_t indices_offset = sparse->indicesByteOffset + sparse->indices->byteOffset; - size_t indices_dst_stride = 1 * sizeof(unsigned short); - const uint8_t *indices_src = reinterpret_cast(src_idx); - uint8_t *indices_dst = reinterpret_cast(indices_buffer_ptr + indices_offset); - ai_assert(indices_dst + _count * indices_dst_stride <= indices_buffer_ptr + sparse->indices->buffer->byteLength); - CopyData(_count, indices_src, src_idxStride, indices_dst, indices_dst_stride); -} inline Accessor::Indexer::Indexer(Accessor &acc) : accessor(acc), data(acc.GetPointer()), From 193deb34411264227787774cf351ea73d03eafd6 Mon Sep 17 00:00:00 2001 From: Yingying Wang Date: Mon, 18 May 2020 12:01:09 -0700 Subject: [PATCH 067/115] cleanup --- code/AssetLib/glTF2/glTF2Asset.inl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/code/AssetLib/glTF2/glTF2Asset.inl b/code/AssetLib/glTF2/glTF2Asset.inl index 9f852ebf8..328c57e38 100644 --- a/code/AssetLib/glTF2/glTF2Asset.inl +++ b/code/AssetLib/glTF2/glTF2Asset.inl @@ -1169,10 +1169,10 @@ inline void Camera::Read(Value &obj, Asset & /*r*/) { cameraProperties.perspective.zfar = MemberOrDefault(*it, "zfar", 100.f); cameraProperties.perspective.znear = MemberOrDefault(*it, "znear", 0.01f); } else { - cameraProperties.ortographic.xmag = MemberOrDefault(obj, "xmag", 1.f); - cameraProperties.ortographic.ymag = MemberOrDefault(obj, "ymag", 1.f); - cameraProperties.ortographic.zfar = MemberOrDefault(obj, "zfar", 100.f); - cameraProperties.ortographic.znear = MemberOrDefault(obj, "znear", 0.01f); + cameraProperties.ortographic.xmag = MemberOrDefault(*it, "xmag", 1.f); + cameraProperties.ortographic.ymag = MemberOrDefault(*it, "ymag", 1.f); + cameraProperties.ortographic.zfar = MemberOrDefault(*it, "zfar", 100.f); + cameraProperties.ortographic.znear = MemberOrDefault(*it, "znear", 0.01f); } } @@ -1248,7 +1248,7 @@ inline void Node::Read(Value &obj, Asset &r) { Value *curSkin = FindUInt(obj, "skin"); if (nullptr != curSkin) { - this->skin = r.skins.Retrieve(curSkin->GetUint()); + this->skin = r.skins.Get(curSkin->GetUint()); } Value *curCamera = FindUInt(obj, "camera"); @@ -1539,7 +1539,7 @@ inline void Asset::Load(const std::string &pFile, bool isBinary) { } } - // Force reading of skins since they're not always directly referenced + // Read skins after nodes have been loaded to avoid infinite recursion if (Value *skinsArray = FindArray(doc, "skins")) { for (unsigned int i = 0; i < skinsArray->Size(); ++i) { skins.Retrieve(i); From c4055d04b4c960b6db02c587f9c87744052294dc Mon Sep 17 00:00:00 2001 From: Ryan Styrczula Date: Tue, 19 May 2020 14:38:10 -0400 Subject: [PATCH 068/115] Fix double free caused in FindInvalidDataProcess In debug builds, there's no issues, but in release, an invalid mesh that is deleted in FindInvalidDataProcess will be double free'd when the parent scene is destroyed. --- code/PostProcessing/FindInvalidDataProcess.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/PostProcessing/FindInvalidDataProcess.cpp b/code/PostProcessing/FindInvalidDataProcess.cpp index 99be52fa4..3ad2446b3 100644 --- a/code/PostProcessing/FindInvalidDataProcess.cpp +++ b/code/PostProcessing/FindInvalidDataProcess.cpp @@ -124,7 +124,7 @@ void FindInvalidDataProcess::Execute(aiScene *pScene) { if (2 == result) { // remove this mesh delete pScene->mMeshes[a]; - AI_DEBUG_INVALIDATE_PTR(pScene->mMeshes[a]); + pScene->mMeshes[a] = NULL; meshMapping[a] = UINT_MAX; continue; From e33ed9e7a1b3307683a105b5821c6c8fd2e2252c Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Mon, 25 May 2020 20:30:18 +0200 Subject: [PATCH 069/115] File is duplicated closes https://github.com/assimp/assimp/issues/3238 --- code/Collada/ColladaExporter.cpp | 1704 ------------------------------ 1 file changed, 1704 deletions(-) delete mode 100644 code/Collada/ColladaExporter.cpp diff --git a/code/Collada/ColladaExporter.cpp b/code/Collada/ColladaExporter.cpp deleted file mode 100644 index 05df6fc94..000000000 --- a/code/Collada/ColladaExporter.cpp +++ /dev/null @@ -1,1704 +0,0 @@ -/* -Open Asset Import Library (assimp) ----------------------------------------------------------------------- - -Copyright (c) 2006-2020, 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. - ----------------------------------------------------------------------- -*/ - -#ifndef ASSIMP_BUILD_NO_EXPORT -#ifndef ASSIMP_BUILD_NO_COLLADA_EXPORTER - -#include "ColladaExporter.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include - -using namespace Assimp; - -namespace Assimp { - -// ------------------------------------------------------------------------------------------------ -// Worker function for exporting a scene to Collada. Prototyped and registered in Exporter.cpp -void ExportSceneCollada(const char* pFile, IOSystem* pIOSystem, const aiScene* pScene, const ExportProperties* /*pProperties*/) { - std::string path = DefaultIOSystem::absolutePath(std::string(pFile)); - std::string file = DefaultIOSystem::completeBaseName(std::string(pFile)); - - // invoke the exporter - ColladaExporter iDoTheExportThing( pScene, pIOSystem, path, file); - - if (iDoTheExportThing.mOutput.fail()) { - throw DeadlyExportError("output data creation failed. Most likely the file became too large: " + std::string(pFile)); - } - - // we're still here - export successfully completed. Write result to the given IOSYstem - std::unique_ptr outfile (pIOSystem->Open(pFile,"wt")); - if(outfile == NULL) { - throw DeadlyExportError("could not open output .dae file: " + std::string(pFile)); - } - - // XXX maybe use a small wrapper around IOStream that behaves like std::stringstream in order to avoid the extra copy. - outfile->Write( iDoTheExportThing.mOutput.str().c_str(), static_cast(iDoTheExportThing.mOutput.tellp()),1); -} - -} // end of namespace Assimp - -// ------------------------------------------------------------------------------------------------ -// Encodes a string into a valid XML ID using the xsd:ID schema qualifications. -static const std::string XMLIDEncode(const std::string& name) { - const char XML_ID_CHARS[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_-."; - const unsigned int XML_ID_CHARS_COUNT = sizeof(XML_ID_CHARS) / sizeof(char); - - if (name.length() == 0) { - return name; - } - - std::stringstream idEncoded; - - // xsd:ID must start with letter or underscore - if (!((name[0] >= 'A' && name[0] <= 'z') || name[0] == '_')) { - idEncoded << '_'; - } - - for (std::string::const_iterator it = name.begin(); it != name.end(); ++it) { - // xsd:ID can only contain letters, digits, underscores, hyphens and periods - if (strchr(XML_ID_CHARS, *it) != nullptr) { - idEncoded << *it; - } else { - // Select placeholder character based on invalid character to prevent name collisions - idEncoded << XML_ID_CHARS[(*it) % XML_ID_CHARS_COUNT]; - } - } - - return idEncoded.str(); -} - -// ------------------------------------------------------------------------------------------------ -// Constructor for a specific scene to export -ColladaExporter::ColladaExporter( const aiScene* pScene, IOSystem* pIOSystem, const std::string& path, const std::string& file) -: mIOSystem(pIOSystem) -, mPath(path) -, mFile(file) { - // make sure that all formatting happens using the standard, C locale and not the user's current locale - mOutput.imbue( std::locale("C") ); - mOutput.precision(ASSIMP_AI_REAL_TEXT_PRECISION); - - mScene = pScene; - mSceneOwned = false; - - // set up strings - endstr = "\n"; - - // start writing the file - WriteFile(); -} - -// ------------------------------------------------------------------------------------------------ -// Destructor -ColladaExporter::~ColladaExporter() { - if ( mSceneOwned ) { - delete mScene; - } -} - -// ------------------------------------------------------------------------------------------------ -// Starts writing the contents -void ColladaExporter::WriteFile() { - // write the DTD - mOutput << "" << endstr; - // COLLADA element start - mOutput << "" << endstr; - PushTag(); - - WriteTextures(); - WriteHeader(); - - WriteCamerasLibrary(); - WriteLightsLibrary(); - WriteMaterials(); - WriteGeometryLibrary(); - WriteControllerLibrary(); - - WriteSceneLibrary(); - - // customized, Writes the animation library - WriteAnimationsLibrary(); - - // useless Collada fu at the end, just in case we haven't had enough indirections, yet. - mOutput << startstr << "" << endstr; - PushTag(); - mOutput << startstr << "mRootNode->mName.C_Str()) + "\" />" << endstr; - PopTag(); - mOutput << startstr << "" << endstr; - PopTag(); - mOutput << "" << endstr; -} - -// ------------------------------------------------------------------------------------------------ -// Writes the asset header -void ColladaExporter::WriteHeader() { - static const ai_real epsilon = Math::getEpsilon(); - static const aiQuaternion x_rot(aiMatrix3x3( - 0, -1, 0, - 1, 0, 0, - 0, 0, 1)); - static const aiQuaternion y_rot(aiMatrix3x3( - 1, 0, 0, - 0, 1, 0, - 0, 0, 1)); - static const aiQuaternion z_rot(aiMatrix3x3( - 1, 0, 0, - 0, 0, 1, - 0, -1, 0)); - - static const unsigned int date_nb_chars = 20; - char date_str[date_nb_chars]; - std::time_t date = std::time(NULL); - std::strftime(date_str, date_nb_chars, "%Y-%m-%dT%H:%M:%S", std::localtime(&date)); - - aiVector3D scaling; - aiQuaternion rotation; - aiVector3D position; - mScene->mRootNode->mTransformation.Decompose(scaling, rotation, position); - rotation.Normalize(); - - bool add_root_node = false; - - ai_real scale = 1.0; - if(std::abs(scaling.x - scaling.y) <= epsilon && std::abs(scaling.x - scaling.z) <= epsilon && std::abs(scaling.y - scaling.z) <= epsilon) { - scale = (ai_real) ((((double) scaling.x) + ((double) scaling.y) + ((double) scaling.z)) / 3.0); - } else { - add_root_node = true; - } - - std::string up_axis = "Y_UP"; - if(rotation.Equal(x_rot, epsilon)) { - up_axis = "X_UP"; - } else if(rotation.Equal(y_rot, epsilon)) { - up_axis = "Y_UP"; - } else if(rotation.Equal(z_rot, epsilon)) { - up_axis = "Z_UP"; - } else { - add_root_node = true; - } - - if(! position.Equal(aiVector3D(0, 0, 0))) { - add_root_node = true; - } - - if(mScene->mRootNode->mNumChildren == 0) { - add_root_node = true; - } - - if(add_root_node) { - aiScene* scene; - SceneCombiner::CopyScene(&scene, mScene); - - aiNode* root = new aiNode("Scene"); - - root->mNumChildren = 1; - root->mChildren = new aiNode*[root->mNumChildren]; - - root->mChildren[0] = scene->mRootNode; - scene->mRootNode->mParent = root; - scene->mRootNode = root; - - mScene = scene; - mSceneOwned = true; - - up_axis = "Y_UP"; - scale = 1.0; - } - - mOutput << startstr << "" << endstr; - PushTag(); - mOutput << startstr << "" << endstr; - PushTag(); - - // If no Scene metadata, use root node metadata - aiMetadata* meta = mScene->mMetaData; - if (nullptr == meta) { - meta = mScene->mRootNode->mMetaData; - } - - aiString value; - if (!meta || !meta->Get("Author", value)) { - mOutput << startstr << "" << "Assimp" << "" << endstr; - } else { - mOutput << startstr << "" << XMLEscape(value.C_Str()) << "" << endstr; - } - - if (nullptr == meta || !meta->Get(AI_METADATA_SOURCE_GENERATOR, value)) { - mOutput << startstr << "" << "Assimp Exporter" << "" << endstr; - } else { - mOutput << startstr << "" << XMLEscape(value.C_Str()) << "" << endstr; - } - - if (meta) { - if (meta->Get("Comments", value)) { - mOutput << startstr << "" << XMLEscape(value.C_Str()) << "" << endstr; - } - if (meta->Get(AI_METADATA_SOURCE_COPYRIGHT, value)) { - mOutput << startstr << "" << XMLEscape(value.C_Str()) << "" << endstr; - } - if (meta->Get("SourceData", value)) { - mOutput << startstr << "" << XMLEscape(value.C_Str()) << "" << endstr; - } - } - - PopTag(); - mOutput << startstr << "" << endstr; - - if (nullptr == meta || !meta->Get("Created", value)) { - mOutput << startstr << "" << date_str << "" << endstr; - } else { - mOutput << startstr << "" << XMLEscape(value.C_Str()) << "" << endstr; - } - - // Modified date is always the date saved - mOutput << startstr << "" << date_str << "" << endstr; - - if (meta) { - if (meta->Get("Keywords", value)) { - mOutput << startstr << "" << XMLEscape(value.C_Str()) << "" << endstr; - } - if (meta->Get("Revision", value)) { - mOutput << startstr << "" << XMLEscape(value.C_Str()) << "" << endstr; - } - if (meta->Get("Subject", value)) { - mOutput << startstr << "" << XMLEscape(value.C_Str()) << "" << endstr; - } - if (meta->Get("Title", value)) { - mOutput << startstr << "" << XMLEscape(value.C_Str()) << "" << endstr; - } - } - - mOutput << startstr << "" << endstr; - mOutput << startstr << "" << up_axis << "" << endstr; - PopTag(); - mOutput << startstr << "" << endstr; -} - -// ------------------------------------------------------------------------------------------------ -// Write the embedded textures -void ColladaExporter::WriteTextures() { - static const unsigned int buffer_size = 1024; - char str[buffer_size]; - - if (mScene->HasTextures()) { - for(unsigned int i = 0; i < mScene->mNumTextures; i++) { - // It would be great to be able to create a directory in portable standard C++, but it's not the case, - // so we just write the textures in the current directory. - - aiTexture* texture = mScene->mTextures[i]; - if ( nullptr == texture ) { - continue; - } - - ASSIMP_itoa10(str, buffer_size, i + 1); - - std::string name = mFile + "_texture_" + (i < 1000 ? "0" : "") + (i < 100 ? "0" : "") + (i < 10 ? "0" : "") + str + "." + ((const char*) texture->achFormatHint); - - std::unique_ptr outfile(mIOSystem->Open(mPath + mIOSystem->getOsSeparator() + name, "wb")); - if(outfile == NULL) { - throw DeadlyExportError("could not open output texture file: " + mPath + name); - } - - if(texture->mHeight == 0) { - outfile->Write((void*) texture->pcData, texture->mWidth, 1); - } else { - Bitmap::Save(texture, outfile.get()); - } - - outfile->Flush(); - - textures.insert(std::make_pair(i, name)); - } - } -} - -// ------------------------------------------------------------------------------------------------ -// Write the embedded textures -void ColladaExporter::WriteCamerasLibrary() { - if(mScene->HasCameras()) { - - mOutput << startstr << "" << endstr; - PushTag(); - - for( size_t a = 0; a < mScene->mNumCameras; ++a) - WriteCamera( a); - - PopTag(); - mOutput << startstr << "" << endstr; - - } -} - -void ColladaExporter::WriteCamera(size_t pIndex){ - - const aiCamera *cam = mScene->mCameras[pIndex]; - const std::string cameraName = XMLEscape(cam->mName.C_Str()); - const std::string cameraId = XMLIDEncode(cam->mName.C_Str()); - - mOutput << startstr << "" << endstr; - PushTag(); - mOutput << startstr << "" << endstr; - PushTag(); - mOutput << startstr << "" << endstr; - PushTag(); - //assimp doesn't support the import of orthographic cameras! se we write - //always perspective - mOutput << startstr << "" << endstr; - PushTag(); - mOutput << startstr << ""<< - AI_RAD_TO_DEG(cam->mHorizontalFOV) - <<"" << endstr; - mOutput << startstr << "" - << cam->mAspect - << "" << endstr; - mOutput << startstr << "" - << cam->mClipPlaneNear - << "" << endstr; - mOutput << startstr << "" - << cam->mClipPlaneFar - << "" << endstr; - PopTag(); - mOutput << startstr << "" << endstr; - PopTag(); - mOutput << startstr << "" << endstr; - PopTag(); - mOutput << startstr << "" << endstr; - PopTag(); - mOutput << startstr << "" << endstr; - -} - - -// ------------------------------------------------------------------------------------------------ -// Write the embedded textures -void ColladaExporter::WriteLightsLibrary() { - if(mScene->HasLights()) { - - mOutput << startstr << "" << endstr; - PushTag(); - - for( size_t a = 0; a < mScene->mNumLights; ++a) - WriteLight( a); - - PopTag(); - mOutput << startstr << "" << endstr; - - } -} - -void ColladaExporter::WriteLight(size_t pIndex){ - - const aiLight *light = mScene->mLights[pIndex]; - const std::string lightName = XMLEscape(light->mName.C_Str()); - const std::string lightId = XMLIDEncode(light->mName.C_Str()); - - mOutput << startstr << "" << endstr; - PushTag(); - mOutput << startstr << "" << endstr; - PushTag(); - switch(light->mType){ - case aiLightSource_AMBIENT: - WriteAmbienttLight(light); - break; - case aiLightSource_DIRECTIONAL: - WriteDirectionalLight(light); - break; - case aiLightSource_POINT: - WritePointLight(light); - break; - case aiLightSource_SPOT: - WriteSpotLight(light); - break; - case aiLightSource_AREA: - case aiLightSource_UNDEFINED: - case _aiLightSource_Force32Bit: - break; - } - PopTag(); - mOutput << startstr << "" << endstr; - - PopTag(); - mOutput << startstr << "" << endstr; - -} - -void ColladaExporter::WritePointLight(const aiLight *const light){ - const aiColor3D &color= light->mColorDiffuse; - mOutput << startstr << "" << endstr; - PushTag(); - mOutput << startstr << "" - << color.r<<" "<" << endstr; - mOutput << startstr << "" - << light->mAttenuationConstant - <<"" << endstr; - mOutput << startstr << "" - << light->mAttenuationLinear - <<"" << endstr; - mOutput << startstr << "" - << light->mAttenuationQuadratic - <<"" << endstr; - - PopTag(); - mOutput << startstr << "" << endstr; - -} - -void ColladaExporter::WriteDirectionalLight(const aiLight *const light){ - const aiColor3D &color= light->mColorDiffuse; - mOutput << startstr << "" << endstr; - PushTag(); - mOutput << startstr << "" - << color.r<<" "<" << endstr; - - PopTag(); - mOutput << startstr << "" << endstr; - -} - -void ColladaExporter::WriteSpotLight(const aiLight *const light){ - - const aiColor3D &color= light->mColorDiffuse; - mOutput << startstr << "" << endstr; - PushTag(); - mOutput << startstr << "" - << color.r<<" "<" << endstr; - mOutput << startstr << "" - << light->mAttenuationConstant - <<"" << endstr; - mOutput << startstr << "" - << light->mAttenuationLinear - <<"" << endstr; - mOutput << startstr << "" - << light->mAttenuationQuadratic - <<"" << endstr; - - const ai_real fallOffAngle = AI_RAD_TO_DEG(light->mAngleInnerCone); - mOutput << startstr <<"" - << fallOffAngle - <<"" << endstr; - double temp = light->mAngleOuterCone-light->mAngleInnerCone; - - temp = std::cos(temp); - temp = std::log(temp)/std::log(0.1); - temp = 1/temp; - mOutput << startstr << "" - << temp - <<"" << endstr; - - - PopTag(); - mOutput << startstr << "" << endstr; - -} - -void ColladaExporter::WriteAmbienttLight(const aiLight *const light){ - - const aiColor3D &color= light->mColorAmbient; - mOutput << startstr << "" << endstr; - PushTag(); - mOutput << startstr << "" - << color.r<<" "<" << endstr; - - PopTag(); - mOutput << startstr << "" << endstr; -} - -// ------------------------------------------------------------------------------------------------ -// Reads a single surface entry from the given material keys -void ColladaExporter::ReadMaterialSurface( Surface& poSurface, const aiMaterial* pSrcMat, - aiTextureType pTexture, const char* pKey, size_t pType, size_t pIndex) { - if( pSrcMat->GetTextureCount( pTexture) > 0 ) { - aiString texfile; - unsigned int uvChannel = 0; - pSrcMat->GetTexture( pTexture, 0, &texfile, NULL, &uvChannel); - - std::string index_str(texfile.C_Str()); - - if(index_str.size() != 0 && index_str[0] == '*') { - unsigned int index; - - index_str = index_str.substr(1, std::string::npos); - - try { - index = (unsigned int) strtoul10_64(index_str.c_str()); - } catch(std::exception& error) { - throw DeadlyExportError(error.what()); - } - - std::map::const_iterator name = textures.find(index); - - if(name != textures.end()) { - poSurface.texture = name->second; - } else { - throw DeadlyExportError("could not find embedded texture at index " + index_str); - } - } else { - poSurface.texture = texfile.C_Str(); - } - - poSurface.channel = uvChannel; - poSurface.exist = true; - } else { - if( pKey ) - poSurface.exist = pSrcMat->Get( pKey, static_cast(pType), static_cast(pIndex), poSurface.color) == aiReturn_SUCCESS; - } -} - -static bool isalnum_C(char c) { - return ( nullptr != strchr("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",c) ); -} - -// ------------------------------------------------------------------------------------------------ -// Writes an image entry for the given surface -void ColladaExporter::WriteImageEntry( const Surface& pSurface, const std::string& pNameAdd) { - if( !pSurface.texture.empty() ) - { - mOutput << startstr << "" << endstr; - PushTag(); - mOutput << startstr << ""; - - // URL encode image file name first, then XML encode on top - std::stringstream imageUrlEncoded; - for( std::string::const_iterator it = pSurface.texture.begin(); it != pSurface.texture.end(); ++it ) - { - if( isalnum_C( (unsigned char) *it) || *it == ':' || *it == '_' || *it == '-' || *it == '.' || *it == '/' || *it == '\\' ) - imageUrlEncoded << *it; - else - imageUrlEncoded << '%' << std::hex << size_t( (unsigned char) *it) << std::dec; - } - mOutput << XMLEscape(imageUrlEncoded.str()); - mOutput << "" << endstr; - PopTag(); - mOutput << startstr << "" << endstr; - } -} - -// ------------------------------------------------------------------------------------------------ -// Writes a color-or-texture entry into an effect definition -void ColladaExporter::WriteTextureColorEntry( const Surface& pSurface, const std::string& pTypeName, const std::string& pImageName) -{ - if(pSurface.exist) { - mOutput << startstr << "<" << pTypeName << ">" << endstr; - PushTag(); - if( pSurface.texture.empty() ) - { - mOutput << startstr << "" << pSurface.color.r << " " << pSurface.color.g << " " << pSurface.color.b << " " << pSurface.color.a << "" << endstr; - } - else - { - mOutput << startstr << "" << endstr; - } - PopTag(); - mOutput << startstr << "" << endstr; - } -} - -// ------------------------------------------------------------------------------------------------ -// Writes the two parameters necessary for referencing a texture in an effect entry -void ColladaExporter::WriteTextureParamEntry( const Surface& pSurface, const std::string& pTypeName, const std::string& pMatName) -{ - // if surface is a texture, write out the sampler and the surface parameters necessary to reference the texture - if( !pSurface.texture.empty() ) - { - mOutput << startstr << "" << endstr; - PushTag(); - mOutput << startstr << "" << endstr; - PushTag(); - mOutput << startstr << "" << XMLIDEncode(pMatName) << "-" << pTypeName << "-image" << endstr; - PopTag(); - mOutput << startstr << "" << endstr; - PopTag(); - mOutput << startstr << "" << endstr; - - mOutput << startstr << "" << endstr; - PushTag(); - mOutput << startstr << "" << endstr; - PushTag(); - mOutput << startstr << "" << XMLIDEncode(pMatName) << "-" << pTypeName << "-surface" << endstr; - PopTag(); - mOutput << startstr << "" << endstr; - PopTag(); - mOutput << startstr << "" << endstr; - } -} - -// ------------------------------------------------------------------------------------------------ -// Writes a scalar property -void ColladaExporter::WriteFloatEntry( const Property& pProperty, const std::string& pTypeName) -{ - if(pProperty.exist) { - mOutput << startstr << "<" << pTypeName << ">" << endstr; - PushTag(); - mOutput << startstr << "" << pProperty.value << "" << endstr; - PopTag(); - mOutput << startstr << "" << endstr; - } -} - -// ------------------------------------------------------------------------------------------------ -// Writes the material setup -void ColladaExporter::WriteMaterials() -{ - materials.resize( mScene->mNumMaterials); - - /// collect all materials from the scene - size_t numTextures = 0; - for( size_t a = 0; a < mScene->mNumMaterials; ++a ) - { - const aiMaterial* mat = mScene->mMaterials[a]; - - aiString name; - if( mat->Get( AI_MATKEY_NAME, name) != aiReturn_SUCCESS ) { - name = "mat"; - materials[a].name = std::string( "m") + to_string(a) + name.C_Str(); - } else { - // try to use the material's name if no other material has already taken it, else append # - std::string testName = name.C_Str(); - size_t materialCountWithThisName = 0; - for( size_t i = 0; i < a; i ++ ) { - if( materials[i].name == testName ) { - materialCountWithThisName ++; - } - } - if( materialCountWithThisName == 0 ) { - materials[a].name = name.C_Str(); - } else { - materials[a].name = std::string(name.C_Str()) + to_string(materialCountWithThisName); - } - } - - aiShadingMode shading = aiShadingMode_Flat; - materials[a].shading_model = "phong"; - if(mat->Get( AI_MATKEY_SHADING_MODEL, shading) == aiReturn_SUCCESS) { - if(shading == aiShadingMode_Phong) { - materials[a].shading_model = "phong"; - } else if(shading == aiShadingMode_Blinn) { - materials[a].shading_model = "blinn"; - } else if(shading == aiShadingMode_NoShading) { - materials[a].shading_model = "constant"; - } else if(shading == aiShadingMode_Gouraud) { - materials[a].shading_model = "lambert"; - } - } - - ReadMaterialSurface( materials[a].ambient, mat, aiTextureType_AMBIENT, AI_MATKEY_COLOR_AMBIENT); - if( !materials[a].ambient.texture.empty() ) numTextures++; - ReadMaterialSurface( materials[a].diffuse, mat, aiTextureType_DIFFUSE, AI_MATKEY_COLOR_DIFFUSE); - if( !materials[a].diffuse.texture.empty() ) numTextures++; - ReadMaterialSurface( materials[a].specular, mat, aiTextureType_SPECULAR, AI_MATKEY_COLOR_SPECULAR); - if( !materials[a].specular.texture.empty() ) numTextures++; - ReadMaterialSurface( materials[a].emissive, mat, aiTextureType_EMISSIVE, AI_MATKEY_COLOR_EMISSIVE); - if( !materials[a].emissive.texture.empty() ) numTextures++; - ReadMaterialSurface( materials[a].reflective, mat, aiTextureType_REFLECTION, AI_MATKEY_COLOR_REFLECTIVE); - if( !materials[a].reflective.texture.empty() ) numTextures++; - ReadMaterialSurface( materials[a].transparent, mat, aiTextureType_OPACITY, AI_MATKEY_COLOR_TRANSPARENT); - if( !materials[a].transparent.texture.empty() ) numTextures++; - ReadMaterialSurface( materials[a].normal, mat, aiTextureType_NORMALS, NULL, 0, 0); - if( !materials[a].normal.texture.empty() ) numTextures++; - - materials[a].shininess.exist = mat->Get( AI_MATKEY_SHININESS, materials[a].shininess.value) == aiReturn_SUCCESS; - materials[a].transparency.exist = mat->Get( AI_MATKEY_OPACITY, materials[a].transparency.value) == aiReturn_SUCCESS; - materials[a].index_refraction.exist = mat->Get( AI_MATKEY_REFRACTI, materials[a].index_refraction.value) == aiReturn_SUCCESS; - } - - // output textures if present - if( numTextures > 0 ) - { - mOutput << startstr << "" << endstr; - PushTag(); - for( std::vector::const_iterator it = materials.begin(); it != materials.end(); ++it ) - { - const Material& mat = *it; - WriteImageEntry( mat.ambient, mat.name + "-ambient-image"); - WriteImageEntry( mat.diffuse, mat.name + "-diffuse-image"); - WriteImageEntry( mat.specular, mat.name + "-specular-image"); - WriteImageEntry( mat.emissive, mat.name + "-emission-image"); - WriteImageEntry( mat.reflective, mat.name + "-reflective-image"); - WriteImageEntry( mat.transparent, mat.name + "-transparent-image"); - WriteImageEntry( mat.normal, mat.name + "-normal-image"); - } - PopTag(); - mOutput << startstr << "" << endstr; - } - - // output effects - those are the actual carriers of information - if( !materials.empty() ) - { - mOutput << startstr << "" << endstr; - PushTag(); - for( std::vector::const_iterator it = materials.begin(); it != materials.end(); ++it ) - { - const Material& mat = *it; - // this is so ridiculous it must be right - mOutput << startstr << "" << endstr; - PushTag(); - mOutput << startstr << "" << endstr; - PushTag(); - - // write sampler- and surface params for the texture entries - WriteTextureParamEntry( mat.emissive, "emission", mat.name); - WriteTextureParamEntry( mat.ambient, "ambient", mat.name); - WriteTextureParamEntry( mat.diffuse, "diffuse", mat.name); - WriteTextureParamEntry( mat.specular, "specular", mat.name); - WriteTextureParamEntry( mat.reflective, "reflective", mat.name); - WriteTextureParamEntry( mat.transparent, "transparent", mat.name); - WriteTextureParamEntry( mat.normal, "normal", mat.name); - - mOutput << startstr << "" << endstr; - PushTag(); - mOutput << startstr << "<" << mat.shading_model << ">" << endstr; - PushTag(); - - WriteTextureColorEntry( mat.emissive, "emission", mat.name + "-emission-sampler"); - WriteTextureColorEntry( mat.ambient, "ambient", mat.name + "-ambient-sampler"); - WriteTextureColorEntry( mat.diffuse, "diffuse", mat.name + "-diffuse-sampler"); - WriteTextureColorEntry( mat.specular, "specular", mat.name + "-specular-sampler"); - WriteFloatEntry(mat.shininess, "shininess"); - WriteTextureColorEntry( mat.reflective, "reflective", mat.name + "-reflective-sampler"); - WriteTextureColorEntry( mat.transparent, "transparent", mat.name + "-transparent-sampler"); - WriteFloatEntry(mat.transparency, "transparency"); - WriteFloatEntry(mat.index_refraction, "index_of_refraction"); - - if(! mat.normal.texture.empty()) { - WriteTextureColorEntry( mat.normal, "bump", mat.name + "-normal-sampler"); - } - - PopTag(); - mOutput << startstr << "" << endstr; - PopTag(); - mOutput << startstr << "" << endstr; - PopTag(); - mOutput << startstr << "" << endstr; - PopTag(); - mOutput << startstr << "" << endstr; - } - PopTag(); - mOutput << startstr << "" << endstr; - - // write materials - they're just effect references - mOutput << startstr << "" << endstr; - PushTag(); - for( std::vector::const_iterator it = materials.begin(); it != materials.end(); ++it ) - { - const Material& mat = *it; - mOutput << startstr << "" << endstr; - PushTag(); - mOutput << startstr << "" << endstr; - PopTag(); - mOutput << startstr << "" << endstr; - } - PopTag(); - mOutput << startstr << "" << endstr; - } -} - -// ------------------------------------------------------------------------------------------------ -// Writes the controller library -void ColladaExporter::WriteControllerLibrary() -{ - mOutput << startstr << "" << endstr; - PushTag(); - - for( size_t a = 0; a < mScene->mNumMeshes; ++a) { - WriteController( a); - } - - PopTag(); - mOutput << startstr << "" << endstr; -} - -// ------------------------------------------------------------------------------------------------ -// Writes a skin controller of the given mesh -void ColladaExporter::WriteController( size_t pIndex) -{ - const aiMesh* mesh = mScene->mMeshes[pIndex]; - const std::string idstr = mesh->mName.length == 0 ? GetMeshId(pIndex) : mesh->mName.C_Str(); - const std::string idstrEscaped = XMLIDEncode(idstr); - - if ( mesh->mNumFaces == 0 || mesh->mNumVertices == 0 ) - return; - - if ( mesh->mNumBones == 0 ) - return; - - mOutput << startstr << ""<< endstr; - PushTag(); - - mOutput << startstr << "" << endstr; - PushTag(); - - // bind pose matrix - mOutput << startstr << "" << endstr; - PushTag(); - - // I think it is identity in general cases. - aiMatrix4x4 mat; - mOutput << startstr << mat.a1 << " " << mat.a2 << " " << mat.a3 << " " << mat.a4 << endstr; - mOutput << startstr << mat.b1 << " " << mat.b2 << " " << mat.b3 << " " << mat.b4 << endstr; - mOutput << startstr << mat.c1 << " " << mat.c2 << " " << mat.c3 << " " << mat.c4 << endstr; - mOutput << startstr << mat.d1 << " " << mat.d2 << " " << mat.d3 << " " << mat.d4 << endstr; - - PopTag(); - mOutput << startstr << "" << endstr; - - mOutput << startstr << "" << endstr; - PushTag(); - - mOutput << startstr << "mNumBones << "\">"; - - for( size_t i = 0; i < mesh->mNumBones; ++i ) - mOutput << XMLIDEncode(mesh->mBones[i]->mName.C_Str()) << " "; - - mOutput << "" << endstr; - - mOutput << startstr << "" << endstr; - PushTag(); - - mOutput << startstr << "mNumBones << "\" stride=\"" << 1 << "\">" << endstr; - PushTag(); - - mOutput << startstr << "" << endstr; - - PopTag(); - mOutput << startstr << "" << endstr; - - PopTag(); - mOutput << startstr << "" << endstr; - - PopTag(); - mOutput << startstr << "" << endstr; - - std::vector bind_poses; - bind_poses.reserve(mesh->mNumBones * 16); - for(unsigned int i = 0; i < mesh->mNumBones; ++i) - for( unsigned int j = 0; j < 4; ++j) - bind_poses.insert(bind_poses.end(), mesh->mBones[i]->mOffsetMatrix[j], mesh->mBones[i]->mOffsetMatrix[j] + 4); - - WriteFloatArray( idstr + "-skin-bind_poses", FloatType_Mat4x4, (const ai_real*) bind_poses.data(), bind_poses.size() / 16); - - bind_poses.clear(); - - std::vector skin_weights; - skin_weights.reserve(mesh->mNumVertices * mesh->mNumBones); - for( size_t i = 0; i < mesh->mNumBones; ++i) - for( size_t j = 0; j < mesh->mBones[i]->mNumWeights; ++j) - skin_weights.push_back(mesh->mBones[i]->mWeights[j].mWeight); - - WriteFloatArray( idstr + "-skin-weights", FloatType_Weight, (const ai_real*) skin_weights.data(), skin_weights.size()); - - skin_weights.clear(); - - mOutput << startstr << "" << endstr; - PushTag(); - - mOutput << startstr << "" << endstr; - mOutput << startstr << "" << endstr; - - PopTag(); - mOutput << startstr << "" << endstr; - - mOutput << startstr << "mNumVertices << "\">" << endstr; - PushTag(); - - mOutput << startstr << "" << endstr; - mOutput << startstr << "" << endstr; - - mOutput << startstr << ""; - - std::vector num_influences(mesh->mNumVertices, (ai_uint)0); - for( size_t i = 0; i < mesh->mNumBones; ++i) - for( size_t j = 0; j < mesh->mBones[i]->mNumWeights; ++j) - ++num_influences[mesh->mBones[i]->mWeights[j].mVertexId]; - - for( size_t i = 0; i < mesh->mNumVertices; ++i) - mOutput << num_influences[i] << " "; - - mOutput << "" << endstr; - - mOutput << startstr << ""; - - ai_uint joint_weight_indices_length = 0; - std::vector accum_influences; - accum_influences.reserve(num_influences.size()); - for( size_t i = 0; i < num_influences.size(); ++i) - { - accum_influences.push_back(joint_weight_indices_length); - joint_weight_indices_length += num_influences[i]; - } - - ai_uint weight_index = 0; - std::vector joint_weight_indices(2 * joint_weight_indices_length, (ai_int)-1); - for( unsigned int i = 0; i < mesh->mNumBones; ++i) - for( unsigned j = 0; j < mesh->mBones[i]->mNumWeights; ++j) - { - unsigned int vId = mesh->mBones[i]->mWeights[j].mVertexId; - for( ai_uint k = 0; k < num_influences[vId]; ++k) - { - if (joint_weight_indices[2 * (accum_influences[vId] + k)] == -1) - { - joint_weight_indices[2 * (accum_influences[vId] + k)] = i; - joint_weight_indices[2 * (accum_influences[vId] + k) + 1] = weight_index; - break; - } - } - ++weight_index; - } - - for( size_t i = 0; i < joint_weight_indices.size(); ++i) - mOutput << joint_weight_indices[i] << " "; - - num_influences.clear(); - accum_influences.clear(); - joint_weight_indices.clear(); - - mOutput << "" << endstr; - - PopTag(); - mOutput << startstr << "" << endstr; - - PopTag(); - mOutput << startstr << "" << endstr; - - PopTag(); - mOutput << startstr << "" << endstr; -} - -// ------------------------------------------------------------------------------------------------ -// Writes the geometry library -void ColladaExporter::WriteGeometryLibrary() -{ - mOutput << startstr << "" << endstr; - PushTag(); - - for( size_t a = 0; a < mScene->mNumMeshes; ++a) - WriteGeometry( a); - - PopTag(); - mOutput << startstr << "" << endstr; -} - -// ------------------------------------------------------------------------------------------------ -// Writes the given mesh -void ColladaExporter::WriteGeometry( size_t pIndex) -{ - const aiMesh* mesh = mScene->mMeshes[pIndex]; - const std::string idstr = mesh->mName.length == 0 ? GetMeshId(pIndex) : mesh->mName.C_Str(); - const std::string geometryName = XMLEscape(idstr); - const std::string geometryId = XMLIDEncode(idstr); - - if ( mesh->mNumFaces == 0 || mesh->mNumVertices == 0 ) - return; - - // opening tag - mOutput << startstr << "" << endstr; - PushTag(); - - mOutput << startstr << "" << endstr; - PushTag(); - - // Positions - WriteFloatArray( idstr + "-positions", FloatType_Vector, (ai_real*) mesh->mVertices, mesh->mNumVertices); - // Normals, if any - if( mesh->HasNormals() ) - WriteFloatArray( idstr + "-normals", FloatType_Vector, (ai_real*) mesh->mNormals, mesh->mNumVertices); - - // texture coords - for( size_t a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++a) - { - if( mesh->HasTextureCoords(static_cast(a)) ) - { - WriteFloatArray( idstr + "-tex" + to_string(a), mesh->mNumUVComponents[a] == 3 ? FloatType_TexCoord3 : FloatType_TexCoord2, - (ai_real*) mesh->mTextureCoords[a], mesh->mNumVertices); - } - } - - // vertex colors - for( size_t a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++a) - { - if( mesh->HasVertexColors(static_cast(a)) ) - WriteFloatArray( idstr + "-color" + to_string(a), FloatType_Color, (ai_real*) mesh->mColors[a], mesh->mNumVertices); - } - - // assemble vertex structure - // Only write input for POSITION since we will write other as shared inputs in polygon definition - mOutput << startstr << "" << endstr; - PushTag(); - mOutput << startstr << "" << endstr; - PopTag(); - mOutput << startstr << "" << endstr; - - // count the number of lines, triangles and polygon meshes - int countLines = 0; - int countPoly = 0; - for( size_t a = 0; a < mesh->mNumFaces; ++a ) - { - if (mesh->mFaces[a].mNumIndices == 2) countLines++; - else if (mesh->mFaces[a].mNumIndices >= 3) countPoly++; - } - - // lines - if (countLines) - { - mOutput << startstr << "" << endstr; - PushTag(); - mOutput << startstr << "" << endstr; - if( mesh->HasNormals() ) - mOutput << startstr << "" << endstr; - for( size_t a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++a ) - { - if( mesh->HasTextureCoords(static_cast(a)) ) - mOutput << startstr << "" << endstr; - } - for( size_t a = 0; a < AI_MAX_NUMBER_OF_COLOR_SETS; ++a ) - { - if( mesh->HasVertexColors(static_cast(a) ) ) - mOutput << startstr << "" << endstr; - } - - mOutput << startstr << "

"; - for( size_t a = 0; a < mesh->mNumFaces; ++a ) - { - const aiFace& face = mesh->mFaces[a]; - if (face.mNumIndices != 2) continue; - for( size_t b = 0; b < face.mNumIndices; ++b ) - mOutput << face.mIndices[b] << " "; - } - mOutput << "

" << endstr; - PopTag(); - mOutput << startstr << "
" << endstr; - } - - // triangle - don't use it, because compatibility problems - - // polygons - if (countPoly) - { - mOutput << startstr << "" << endstr; - PushTag(); - mOutput << startstr << "" << endstr; - if( mesh->HasNormals() ) - mOutput << startstr << "" << endstr; - for( size_t a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++a ) - { - if( mesh->HasTextureCoords(static_cast(a)) ) - mOutput << startstr << "" << endstr; - } - for( size_t a = 0; a < AI_MAX_NUMBER_OF_COLOR_SETS; ++a ) - { - if( mesh->HasVertexColors(static_cast(a) ) ) - mOutput << startstr << "" << endstr; - } - - mOutput << startstr << ""; - for( size_t a = 0; a < mesh->mNumFaces; ++a ) - { - if (mesh->mFaces[a].mNumIndices < 3) continue; - mOutput << mesh->mFaces[a].mNumIndices << " "; - } - mOutput << "" << endstr; - - mOutput << startstr << "

"; - for( size_t a = 0; a < mesh->mNumFaces; ++a ) - { - const aiFace& face = mesh->mFaces[a]; - if (face.mNumIndices < 3) continue; - for( size_t b = 0; b < face.mNumIndices; ++b ) - mOutput << face.mIndices[b] << " "; - } - mOutput << "

" << endstr; - PopTag(); - mOutput << startstr << "
" << endstr; - } - - // closing tags - PopTag(); - mOutput << startstr << "
" << endstr; - PopTag(); - mOutput << startstr << "
" << endstr; -} - -// ------------------------------------------------------------------------------------------------ -// Writes a float array of the given type -void ColladaExporter::WriteFloatArray( const std::string& pIdString, FloatDataType pType, const ai_real* pData, size_t pElementCount) -{ - size_t floatsPerElement = 0; - switch( pType ) - { - case FloatType_Vector: floatsPerElement = 3; break; - case FloatType_TexCoord2: floatsPerElement = 2; break; - case FloatType_TexCoord3: floatsPerElement = 3; break; - case FloatType_Color: floatsPerElement = 3; break; - case FloatType_Mat4x4: floatsPerElement = 16; break; - case FloatType_Weight: floatsPerElement = 1; break; - case FloatType_Time: floatsPerElement = 1; break; - default: - return; - } - - std::string arrayId = XMLIDEncode(pIdString) + "-array"; - - mOutput << startstr << "" << endstr; - PushTag(); - - // source array - mOutput << startstr << " "; - PushTag(); - - if( pType == FloatType_TexCoord2 ) - { - for( size_t a = 0; a < pElementCount; ++a ) - { - mOutput << pData[a*3+0] << " "; - mOutput << pData[a*3+1] << " "; - } - } - else if( pType == FloatType_Color ) - { - for( size_t a = 0; a < pElementCount; ++a ) - { - mOutput << pData[a*4+0] << " "; - mOutput << pData[a*4+1] << " "; - mOutput << pData[a*4+2] << " "; - } - } - else - { - for( size_t a = 0; a < pElementCount * floatsPerElement; ++a ) - mOutput << pData[a] << " "; - } - mOutput << "" << endstr; - PopTag(); - - // the usual Collada fun. Let's bloat it even more! - mOutput << startstr << "" << endstr; - PushTag(); - mOutput << startstr << "" << endstr; - PushTag(); - - switch( pType ) - { - case FloatType_Vector: - mOutput << startstr << "" << endstr; - mOutput << startstr << "" << endstr; - mOutput << startstr << "" << endstr; - break; - - case FloatType_TexCoord2: - mOutput << startstr << "" << endstr; - mOutput << startstr << "" << endstr; - break; - - case FloatType_TexCoord3: - mOutput << startstr << "" << endstr; - mOutput << startstr << "" << endstr; - mOutput << startstr << "" << endstr; - break; - - case FloatType_Color: - mOutput << startstr << "" << endstr; - mOutput << startstr << "" << endstr; - mOutput << startstr << "" << endstr; - break; - - case FloatType_Mat4x4: - mOutput << startstr << "" << endstr; - break; - - case FloatType_Weight: - mOutput << startstr << "" << endstr; - break; - - // customized, add animation related - case FloatType_Time: - mOutput << startstr << "" << endstr; - break; - - } - - PopTag(); - mOutput << startstr << "" << endstr; - PopTag(); - mOutput << startstr << "" << endstr; - PopTag(); - mOutput << startstr << "" << endstr; -} - -// ------------------------------------------------------------------------------------------------ -// Writes the scene library -void ColladaExporter::WriteSceneLibrary() -{ - const std::string sceneName = XMLEscape(mScene->mRootNode->mName.C_Str()); - const std::string sceneId = XMLIDEncode(mScene->mRootNode->mName.C_Str()); - - mOutput << startstr << "" << endstr; - PushTag(); - mOutput << startstr << "" << endstr; - PushTag(); - - // start recursive write at the root node - for( size_t a = 0; a < mScene->mRootNode->mNumChildren; ++a ) - WriteNode( mScene, mScene->mRootNode->mChildren[a]); - - PopTag(); - mOutput << startstr << "" << endstr; - PopTag(); - mOutput << startstr << "" << endstr; -} -// ------------------------------------------------------------------------------------------------ -void ColladaExporter::WriteAnimationLibrary(size_t pIndex) -{ - static const float kSecondsFromMilliseconds = .001f; - - const aiAnimation * anim = mScene->mAnimations[pIndex]; - - if ( anim->mNumChannels == 0 && anim->mNumMeshChannels == 0 && anim->mNumMorphMeshChannels ==0 ) { - return; - } - - const std::string animation_name_escaped = XMLEscape( anim->mName.C_Str() ); - std::string idstr = anim->mName.C_Str(); - std::string ending = std::string( "AnimId" ) + to_string(pIndex); - if (idstr.length() >= ending.length()) { - if (0 != idstr.compare (idstr.length() - ending.length(), ending.length(), ending)) { - idstr = idstr + ending; - } - } else { - idstr = idstr + ending; - } - - const std::string idstrEscaped = XMLIDEncode(idstr); - - mOutput << startstr << "" << endstr; - PushTag(); - - std::string cur_node_idstr; - for (size_t a = 0; a < anim->mNumChannels; ++a) { - const aiNodeAnim * nodeAnim = anim->mChannels[a]; - - // sanity check - if (nodeAnim->mNumPositionKeys != nodeAnim->mNumScalingKeys || nodeAnim->mNumPositionKeys != nodeAnim->mNumRotationKeys) { - continue; - } - - { - cur_node_idstr.clear(); - cur_node_idstr += nodeAnim->mNodeName.data; - cur_node_idstr += std::string("_matrix-input"); - - std::vector frames; - for( size_t i = 0; i < nodeAnim->mNumPositionKeys; ++i) { - frames.push_back(static_cast(nodeAnim->mPositionKeys[i].mTime) * kSecondsFromMilliseconds); - } - - WriteFloatArray(cur_node_idstr, FloatType_Time, (const ai_real *)frames.data(), frames.size()); - frames.clear(); - } - - { - cur_node_idstr.clear(); - - cur_node_idstr += nodeAnim->mNodeName.data; - cur_node_idstr += std::string("_matrix-output"); - - std::vector keyframes; - keyframes.reserve(nodeAnim->mNumPositionKeys * 16); - for( size_t i = 0; i < nodeAnim->mNumPositionKeys; ++i) { - aiVector3D Scaling = nodeAnim->mScalingKeys[i].mValue; - aiMatrix4x4 ScalingM; // identity - ScalingM[0][0] = Scaling.x; ScalingM[1][1] = Scaling.y; ScalingM[2][2] = Scaling.z; - - aiQuaternion RotationQ = nodeAnim->mRotationKeys[i].mValue; - aiMatrix4x4 s = aiMatrix4x4( RotationQ.GetMatrix() ); - aiMatrix4x4 RotationM(s.a1, s.a2, s.a3, 0, s.b1, s.b2, s.b3, 0, s.c1, s.c2, s.c3, 0, 0, 0, 0, 1); - - aiVector3D Translation = nodeAnim->mPositionKeys[i].mValue; - aiMatrix4x4 TranslationM; // identity - TranslationM[0][3] = Translation.x; TranslationM[1][3] = Translation.y; TranslationM[2][3] = Translation.z; - - // Combine the above transformations - aiMatrix4x4 mat = TranslationM * RotationM * ScalingM; - - for( unsigned int j = 0; j < 4; ++j) { - keyframes.insert(keyframes.end(), mat[j], mat[j] + 4); - } - } - - WriteFloatArray(cur_node_idstr, FloatType_Mat4x4, (const ai_real *)keyframes.data(), keyframes.size() / 16); - } - - { - std::vector names; - for ( size_t i = 0; i < nodeAnim->mNumPositionKeys; ++i) { - if ( nodeAnim->mPreState == aiAnimBehaviour_DEFAULT - || nodeAnim->mPreState == aiAnimBehaviour_LINEAR - || nodeAnim->mPreState == aiAnimBehaviour_REPEAT - ) { - names.push_back( "LINEAR" ); - } else if (nodeAnim->mPostState == aiAnimBehaviour_CONSTANT) { - names.push_back( "STEP" ); - } - } - - const std::string cur_node_idstr2 = nodeAnim->mNodeName.data + std::string("_matrix-interpolation"); - std::string arrayId = XMLIDEncode(cur_node_idstr2) + "-array"; - - mOutput << startstr << "" << endstr; - PushTag(); - - // source array - mOutput << startstr << " "; - for( size_t aa = 0; aa < names.size(); ++aa ) { - mOutput << names[aa] << " "; - } - mOutput << "" << endstr; - - mOutput << startstr << "" << endstr; - PushTag(); - - mOutput << startstr << "" << endstr; - PushTag(); - - mOutput << startstr << "" << endstr; - - PopTag(); - mOutput << startstr << "" << endstr; - - PopTag(); - mOutput << startstr << "" << endstr; - - PopTag(); - mOutput << startstr << "" << endstr; - } - } - - for (size_t a = 0; a < anim->mNumChannels; ++a) { - const aiNodeAnim * nodeAnim = anim->mChannels[a]; - - { - // samplers - const std::string node_idstr = nodeAnim->mNodeName.data + std::string("_matrix-sampler"); - mOutput << startstr << "" << endstr; - PushTag(); - - mOutput << startstr << "mNodeName.data + std::string("_matrix-input") ) << "\"/>" << endstr; - mOutput << startstr << "mNodeName.data + std::string("_matrix-output") ) << "\"/>" << endstr; - mOutput << startstr << "mNodeName.data + std::string("_matrix-interpolation") ) << "\"/>" << endstr; - - PopTag(); - mOutput << startstr << "" << endstr; - } - } - - for (size_t a = 0; a < anim->mNumChannels; ++a) { - const aiNodeAnim * nodeAnim = anim->mChannels[a]; - - { - // channels - mOutput << startstr << "mNodeName.data + std::string("_matrix-sampler") ) << "\" target=\"" << XMLIDEncode(nodeAnim->mNodeName.data) << "/matrix\"/>" << endstr; - } - } - - PopTag(); - mOutput << startstr << "" << endstr; - -} -// ------------------------------------------------------------------------------------------------ -void ColladaExporter::WriteAnimationsLibrary() -{ - if ( mScene->mNumAnimations > 0 ) { - mOutput << startstr << "" << endstr; - PushTag(); - - // start recursive write at the root node - for( size_t a = 0; a < mScene->mNumAnimations; ++a) - WriteAnimationLibrary( a ); - - PopTag(); - mOutput << startstr << "" << endstr; - } -} -// ------------------------------------------------------------------------------------------------ -// Helper to find a bone by name in the scene -aiBone* findBone( const aiScene* scene, const char * name) { - for (size_t m=0; mmNumMeshes; m++) { - aiMesh * mesh = scene->mMeshes[m]; - for (size_t b=0; bmNumBones; b++) { - aiBone * bone = mesh->mBones[b]; - if (0 == strcmp(name, bone->mName.C_Str())) { - return bone; - } - } - } - return NULL; -} - -// ------------------------------------------------------------------------------------------------ -const aiNode * findBoneNode( const aiNode* aNode, const aiBone* bone) -{ - if ( aNode && bone && aNode->mName == bone->mName ) { - return aNode; - } - - if ( aNode && bone ) { - for (unsigned int i=0; i < aNode->mNumChildren; ++i) { - aiNode * aChild = aNode->mChildren[i]; - const aiNode * foundFromChild = 0; - if ( aChild ) { - foundFromChild = findBoneNode( aChild, bone ); - if ( foundFromChild ) return foundFromChild; - } - } - } - - return NULL; -} - -const aiNode * findSkeletonRootNode( const aiScene* scene, const aiMesh * mesh) -{ - std::set topParentBoneNodes; - if ( mesh && mesh->mNumBones > 0 ) { - for (unsigned int i=0; i < mesh->mNumBones; ++i) { - aiBone * bone = mesh->mBones[i]; - - const aiNode * node = findBoneNode( scene->mRootNode, bone); - if ( node ) { - while ( node->mParent && findBone(scene, node->mParent->mName.C_Str() ) != 0 ) { - node = node->mParent; - } - topParentBoneNodes.insert( node ); - } - } - } - - if ( !topParentBoneNodes.empty() ) { - const aiNode * parentBoneNode = *topParentBoneNodes.begin(); - if ( topParentBoneNodes.size() == 1 ) { - return parentBoneNode; - } else { - for (auto it : topParentBoneNodes) { - if ( it->mParent ) return it->mParent; - } - return parentBoneNode; - } - } - - return NULL; -} - -// ------------------------------------------------------------------------------------------------ -// Recursively writes the given node -void ColladaExporter::WriteNode( const aiScene* pScene, aiNode* pNode) -{ - // the node must have a name - if (pNode->mName.length == 0) - { - std::stringstream ss; - ss << "Node_" << pNode; - pNode->mName.Set(ss.str()); - } - - // If the node is associated with a bone, it is a joint node (JOINT) - // otherwise it is a normal node (NODE) - const char * node_type; - bool is_joint, is_skeleton_root = false; - if (nullptr == findBone(pScene, pNode->mName.C_Str())) { - node_type = "NODE"; - is_joint = false; - } else { - node_type = "JOINT"; - is_joint = true; - if (!pNode->mParent || nullptr == findBone(pScene, pNode->mParent->mName.C_Str())) { - is_skeleton_root = true; - } - } - - const std::string node_id = XMLIDEncode(pNode->mName.data); - const std::string node_name = XMLEscape(pNode->mName.data); - mOutput << startstr << "" << endstr; - PushTag(); - - // write transformation - we can directly put the matrix there - // TODO: (thom) decompose into scale - rot - quad to allow addressing it by animations afterwards - aiMatrix4x4 mat = pNode->mTransformation; - - // If this node is a Camera node, the camera coordinate system needs to be multiplied in. - // When importing from Collada, the mLookAt is set to 0, 0, -1, and the node transform is unchanged. - // When importing from a different format, mLookAt is set to 0, 0, 1. Therefore, the local camera - // coordinate system must be changed to matche the Collada specification. - for (size_t i = 0; imNumCameras; i++){ - if (mScene->mCameras[i]->mName == pNode->mName){ - aiMatrix4x4 sourceView; - mScene->mCameras[i]->GetCameraMatrix(sourceView); - - aiMatrix4x4 colladaView; - colladaView.a1 = colladaView.c3 = -1; // move into -z space. - mat *= (sourceView * colladaView); - break; - } - } - - // customized, sid should be 'matrix' to match with loader code. - //mOutput << startstr << ""; - mOutput << startstr << ""; - - mOutput << mat.a1 << " " << mat.a2 << " " << mat.a3 << " " << mat.a4 << " "; - mOutput << mat.b1 << " " << mat.b2 << " " << mat.b3 << " " << mat.b4 << " "; - mOutput << mat.c1 << " " << mat.c2 << " " << mat.c3 << " " << mat.c4 << " "; - mOutput << mat.d1 << " " << mat.d2 << " " << mat.d3 << " " << mat.d4; - mOutput << "" << endstr; - - if(pNode->mNumMeshes==0){ - //check if it is a camera node - for(size_t i=0; imNumCameras; i++){ - if(mScene->mCameras[i]->mName == pNode->mName){ - mOutput << startstr <<"" << endstr; - break; - } - } - //check if it is a light node - for(size_t i=0; imNumLights; i++){ - if(mScene->mLights[i]->mName == pNode->mName){ - mOutput << startstr <<"" << endstr; - break; - } - } - - }else - // instance every geometry - for( size_t a = 0; a < pNode->mNumMeshes; ++a ) - { - const aiMesh* mesh = mScene->mMeshes[pNode->mMeshes[a]]; - // do not instantiate mesh if empty. I wonder how this could happen - if( mesh->mNumFaces == 0 || mesh->mNumVertices == 0 ) - continue; - - const std::string meshName = mesh->mName.length == 0 ? GetMeshId(pNode->mMeshes[a]) : mesh->mName.C_Str(); - - if( mesh->mNumBones == 0 ) - { - mOutput << startstr << "" << endstr; - PushTag(); - } - else - { - mOutput << startstr - << "" - << endstr; - PushTag(); - - // note! this mFoundSkeletonRootNodeID some how affects animation, it makes the mesh attaches to armature skeleton root node. - // use the first bone to find skeleton root - const aiNode * skeletonRootBoneNode = findSkeletonRootNode( pScene, mesh ); - if ( skeletonRootBoneNode ) { - mFoundSkeletonRootNodeID = XMLIDEncode( skeletonRootBoneNode->mName.C_Str() ); - } - mOutput << startstr << "#" << mFoundSkeletonRootNodeID << "" << endstr; - } - mOutput << startstr << "" << endstr; - PushTag(); - mOutput << startstr << "" << endstr; - PushTag(); - mOutput << startstr << "mMaterialIndex].name) << "\">" << endstr; - PushTag(); - for( size_t aa = 0; aa < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++aa ) - { - if( mesh->HasTextureCoords( static_cast(aa) ) ) - // semantic as in - // input_semantic as in - // input_set as in - mOutput << startstr << "" << endstr; - } - PopTag(); - mOutput << startstr << "" << endstr; - PopTag(); - mOutput << startstr << "" << endstr; - PopTag(); - mOutput << startstr << "" << endstr; - - PopTag(); - if( mesh->mNumBones == 0) - mOutput << startstr << "" << endstr; - else - mOutput << startstr << "" << endstr; - } - - // recurse into subnodes - for( size_t a = 0; a < pNode->mNumChildren; ++a ) - WriteNode( pScene, pNode->mChildren[a]); - - PopTag(); - mOutput << startstr << "" << endstr; -} - -#endif -#endif From c82f8c0b8f39b26304a590f24e91b097849c5d1c Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Mon, 25 May 2020 20:38:12 +0200 Subject: [PATCH 070/115] Remove duplicated code closes https://github.com/assimp/assimp/issues/3183 --- tools/assimp_view/Display.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/assimp_view/Display.cpp b/tools/assimp_view/Display.cpp index 9fa157c41..1f6bb89eb 100644 --- a/tools/assimp_view/Display.cpp +++ b/tools/assimp_view/Display.cpp @@ -462,7 +462,7 @@ int CDisplay::AddTextureToDisplayList(unsigned int iType, TVINSERTSTRUCT sNew; tvi.pszText = chTemp; tvi.cchTextMax = (int)strlen(chTemp); - tvi.mask = TVIF_TEXT | TVIF_SELECTEDIMAGE | TVIF_IMAGE | TVIF_HANDLE | TVIF_HANDLE; + tvi.mask = TVIF_TEXT | TVIF_SELECTEDIMAGE | TVIF_IMAGE | TVIF_HANDLE; tvi.lParam = (LPARAM)20; // find out whether this is the default texture or not From c94ed5c7b1edda974bd0613f26af675e6f53b3ec Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Mon, 25 May 2020 20:40:19 +0200 Subject: [PATCH 071/115] Update utRemoveComponent.cpp closes https://github.com/assimp/assimp/issues/3183 --- test/unit/utRemoveComponent.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/test/unit/utRemoveComponent.cpp b/test/unit/utRemoveComponent.cpp index d3c102cfb..622a582d6 100644 --- a/test/unit/utRemoveComponent.cpp +++ b/test/unit/utRemoveComponent.cpp @@ -98,13 +98,6 @@ void RemoveVCProcessTest::SetUp() { pScene->mCameras = new aiCamera *[pScene->mNumCameras = 2]; pScene->mCameras[0] = new aiCamera(); pScene->mCameras[1] = new aiCamera(); - - // COMPILE TEST: aiMaterial may no add any extra members, - // so we don't need a virtual destructor - char check[sizeof(aiMaterial) == sizeof(aiMaterial) ? 10 : -1]; - check[0] = 0; - // to remove compiler warning - EXPECT_EQ(0, check[0]); } // ------------------------------------------------------------------------------------------------ From d40a3026dbacb24e1a1eab65ce0ea2b31dc8b2fd Mon Sep 17 00:00:00 2001 From: kimkulling Date: Thu, 28 May 2020 21:02:13 +0200 Subject: [PATCH 072/115] closes https://github.com/assimp/assimp/issues/3165: fix gcc build. --- code/AssetLib/STL/STLLoader.cpp | 14 ++++++++++++-- code/AssetLib/glTF/glTFAsset.h | 5 +++-- code/AssetLib/glTF2/glTF2Asset.h | 4 +++- code/Common/SceneCombiner.cpp | 5 ++++- code/Common/SpatialSort.cpp | 12 ++++-------- test/unit/utFindInvalidData.cpp | 8 ++++++-- 6 files changed, 32 insertions(+), 16 deletions(-) diff --git a/code/AssetLib/STL/STLLoader.cpp b/code/AssetLib/STL/STLLoader.cpp index 702f4fe5d..7d7fdb7c9 100644 --- a/code/AssetLib/STL/STLLoader.cpp +++ b/code/AssetLib/STL/STLLoader.cpp @@ -370,13 +370,23 @@ void STLImporter::LoadASCIIFile(aiNode *root) { pMesh->mNumFaces = static_cast(positionBuffer.size() / 3); pMesh->mNumVertices = static_cast(positionBuffer.size()); pMesh->mVertices = new aiVector3D[pMesh->mNumVertices]; - memcpy(pMesh->mVertices, &positionBuffer[0].x, pMesh->mNumVertices * sizeof(aiVector3D)); + for (size_t i=0; imNumVertices; ++i ) { + pMesh->mVertices[i].x = positionBuffer[i].x; + pMesh->mVertices[i].y = positionBuffer[i].y; + pMesh->mVertices[i].z = positionBuffer[i].z; + } + //memcpy(pMesh->mVertices, &positionBuffer[0].x, pMesh->mNumVertices * sizeof(aiVector3D)); positionBuffer.clear(); } // also only process normalBuffer when filled, else exception when accessing with index operator if (!normalBuffer.empty()) { pMesh->mNormals = new aiVector3D[pMesh->mNumVertices]; - memcpy(pMesh->mNormals, &normalBuffer[0].x, pMesh->mNumVertices * sizeof(aiVector3D)); + for (size_t i=0; imNumVertices; ++i ) { + pMesh->mNormals[i].x = normalBuffer[i].x; + pMesh->mNormals[i].y = normalBuffer[i].y; + pMesh->mNormals[i].z = normalBuffer[i].z; + } +// memcpy(pMesh->mNormals, &normalBuffer[0].x, pMesh->mNumVertices * sizeof(aiVector3D)); normalBuffer.clear(); } diff --git a/code/AssetLib/glTF/glTFAsset.h b/code/AssetLib/glTF/glTFAsset.h index 4c7aaa908..56cf18527 100644 --- a/code/AssetLib/glTF/glTFAsset.h +++ b/code/AssetLib/glTF/glTFAsset.h @@ -4,7 +4,6 @@ Open Asset Import Library (assimp) Copyright (c) 2006-2020, assimp team - All rights reserved. Redistribution and use of this software in source and binary forms, @@ -62,10 +61,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #define RAPIDJSON_HAS_STDSTRING 1 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wclass-memaccess" #include #include #include - +#pragma GCC diagnostic pop #ifdef ASSIMP_API # include # include diff --git a/code/AssetLib/glTF2/glTF2Asset.h b/code/AssetLib/glTF2/glTF2Asset.h index bfd4e4342..ed5f4318a 100644 --- a/code/AssetLib/glTF2/glTF2Asset.h +++ b/code/AssetLib/glTF2/glTF2Asset.h @@ -64,10 +64,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #define RAPIDJSON_HAS_STDSTRING 1 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wclass-memaccess" #include #include #include - +#pragma GCC diagnostic pop #ifdef ASSIMP_API #include #include diff --git a/code/Common/SceneCombiner.cpp b/code/Common/SceneCombiner.cpp index 4d2a411f2..2aa855989 100644 --- a/code/Common/SceneCombiner.cpp +++ b/code/Common/SceneCombiner.cpp @@ -978,7 +978,10 @@ void GetArrayCopy(Type*& dest, ai_uint num ) { Type* old = dest; dest = new Type[num]; - ::memcpy(dest, old, sizeof(Type) * num); + for ( size_t i=0; imNormals, 0, mMesh->mNumVertices * sizeof(aiVector3D)); - ::memset(mMesh->mBitangents, 0, mMesh->mNumVertices * sizeof(aiVector3D)); + for ( size_t i=0; imNumVertices; ++i ) { + mMesh->mNormals[i].x = mMesh->mNormals[i].y = mMesh->mNormals[i].z =0; + mMesh->mBitangents[i].x = mMesh->mBitangents[i].y = mMesh->mBitangents[i].z = 0; + } + //::memset(mMesh->mNormals, 0, mMesh->mNumVertices * sizeof(aiVector3D)); + //::memset(mMesh->mBitangents, 0, mMesh->mNumVertices * sizeof(aiVector3D)); mMesh->mTextureCoords[2][455] = aiVector3D(std::numeric_limits::quiet_NaN()); From d4ca91f408a3e8e10de029cfb8bc9bad7a72d155 Mon Sep 17 00:00:00 2001 From: Hanif Bin Ariffin Date: Thu, 28 May 2020 19:20:54 -0400 Subject: [PATCH 073/115] Evaluated the following expressions to either values. --- contrib/Open3DGC/o3dgcSC3DMCDecoder.inl | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/contrib/Open3DGC/o3dgcSC3DMCDecoder.inl b/contrib/Open3DGC/o3dgcSC3DMCDecoder.inl index 326297426..c965fcd50 100644 --- a/contrib/Open3DGC/o3dgcSC3DMCDecoder.inl +++ b/contrib/Open3DGC/o3dgcSC3DMCDecoder.inl @@ -72,9 +72,12 @@ namespace o3dgc unsigned char mask = bstream.ReadUChar(m_iterator, m_streamType); ifs.SetCCW ((mask & 1) == 1); - ifs.SetSolid ((mask & 2) == 1); - ifs.SetConvex ((mask & 4) == 1); - ifs.SetIsTriangularMesh((mask & 8) == 1); + // (mask & 2) == 1 + ifs.SetSolid (false); + // (mask & 4) == 1 + ifs.SetConvex (false); + // (mask & 8) == 1 + ifs.SetIsTriangularMesh(false); //bool markerBit0 = (mask & 16 ) == 1; //bool markerBit1 = (mask & 32 ) == 1; //bool markerBit2 = (mask & 64 ) == 1; From eceb8aeed1b8fdef84cf98ddc2618dc24bdf0604 Mon Sep 17 00:00:00 2001 From: Hanif Bin Ariffin Date: Thu, 28 May 2020 19:22:06 -0400 Subject: [PATCH 074/115] Cleaned up implicit conversion and code. --- test/unit/utMatrix3x3.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/test/unit/utMatrix3x3.cpp b/test/unit/utMatrix3x3.cpp index 50fa66c50..12a84e0fa 100644 --- a/test/unit/utMatrix3x3.cpp +++ b/test/unit/utMatrix3x3.cpp @@ -73,9 +73,21 @@ TEST_F(utMatrix3x3Test, FromToMatrixTest) { aiVector3D from, to; + auto random_ratio = []() -> float { + return static_cast(rand() / RAND_MAX); + }; + for (int i = 0; i < NUM_SAMPLES; ++i) { - from = aiVector3D(1.f * rand() / RAND_MAX, 1.f * rand() / RAND_MAX, 1.f * rand() / RAND_MAX).Normalize(); - to = aiVector3D(1.f * rand() / RAND_MAX, 1.f * rand() / RAND_MAX, 1.f * rand() / RAND_MAX).Normalize(); + from = aiVector3D( + 1.f * random_ratio(), + 1.f * random_ratio(), + 1.f * random_ratio()) + .Normalize(); + to = aiVector3D( + 1.f * random_ratio(), + 1.f * random_ratio(), + 1.f * random_ratio()) + .Normalize(); aiMatrix3x3::FromToMatrix(from, to, trafo); res = trafo * from; From 7db6475592ef1c0d34227c2a7c682c3d4a63cac2 Mon Sep 17 00:00:00 2001 From: Hanif Bin Ariffin Date: Fri, 29 May 2020 11:59:28 -0400 Subject: [PATCH 075/115] Change from (int division -> cast) to (cast -> float division) --- test/unit/utMatrix3x3.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit/utMatrix3x3.cpp b/test/unit/utMatrix3x3.cpp index 12a84e0fa..3905b1d35 100644 --- a/test/unit/utMatrix3x3.cpp +++ b/test/unit/utMatrix3x3.cpp @@ -74,7 +74,7 @@ TEST_F(utMatrix3x3Test, FromToMatrixTest) { aiVector3D from, to; auto random_ratio = []() -> float { - return static_cast(rand() / RAND_MAX); + return static_cast(rand()) / static_cast(RAND_MAX); }; for (int i = 0; i < NUM_SAMPLES; ++i) { From 4e34853ac717f2718eade04888b0cb8b9ada5f1e Mon Sep 17 00:00:00 2001 From: Yingying Wang Date: Fri, 5 Jun 2020 12:17:27 -0700 Subject: [PATCH 076/115] gltf2 export target names for blendshapes --- code/AssetLib/glTF2/glTF2AssetWriter.inl | 16 ++++++++++++++++ code/AssetLib/glTF2/glTF2Exporter.cpp | 5 +++++ 2 files changed, 21 insertions(+) diff --git a/code/AssetLib/glTF2/glTF2AssetWriter.inl b/code/AssetLib/glTF2/glTF2AssetWriter.inl index 361af40cd..d5b478e35 100644 --- a/code/AssetLib/glTF2/glTF2AssetWriter.inl +++ b/code/AssetLib/glTF2/glTF2AssetWriter.inl @@ -468,6 +468,22 @@ namespace glTF2 { } obj.AddMember("primitives", primitives, w.mAl); + // targetNames + if (m.targetNames.size() > 0) { + Value extras; + extras.SetObject(); + Value targetNames; + targetNames.SetArray(); + targetNames.Reserve(unsigned(m.targetNames.size()), w.mAl); + for (unsigned int n = 0; n < m.targetNames.size(); ++n) { + std::string name = m.targetNames[n]; + Value tname; + tname.SetString(name.c_str(), w.mAl); + targetNames.PushBack(tname, w.mAl); + } + extras.AddMember("targetNames", targetNames, w.mAl); + obj.AddMember("extras", extras, w.mAl); + } } inline void Write(Value& obj, Node& n, AssetWriter& w) diff --git a/code/AssetLib/glTF2/glTF2Exporter.cpp b/code/AssetLib/glTF2/glTF2Exporter.cpp index 566f95e80..2359851f1 100644 --- a/code/AssetLib/glTF2/glTF2Exporter.cpp +++ b/code/AssetLib/glTF2/glTF2Exporter.cpp @@ -824,9 +824,14 @@ void glTF2Exporter::ExportMeshes() /*************** Targets for blendshapes ****************/ if (aim->mNumAnimMeshes > 0) { + bool bExportTargetNames = this->mProperties->HasPropertyBool("GLTF2_TARGETNAMES_EXP") && + this->mProperties->GetPropertyBool("GLTF2_TARGETNAMES_EXP"); + p.targets.resize(aim->mNumAnimMeshes); for (unsigned int am = 0; am < aim->mNumAnimMeshes; ++am) { aiAnimMesh *pAnimMesh = aim->mAnimMeshes[am]; + if (bExportTargetNames) + m->targetNames.push_back(pAnimMesh->mName.data); // position if (pAnimMesh->HasPositions()) { From 62273b63e5dff9c9b120e1f7345616ff82695811 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sat, 6 Jun 2020 12:22:01 +0200 Subject: [PATCH 077/115] closes https://github.com/assimp/assimp/issues/3256: Remove redundand code --- code/AssetLib/M3D/m3d.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/AssetLib/M3D/m3d.h b/code/AssetLib/M3D/m3d.h index 75bcdfeb7..3d7a2564c 100644 --- a/code/AssetLib/M3D/m3d.h +++ b/code/AssetLib/M3D/m3d.h @@ -5071,7 +5071,7 @@ unsigned char *m3d_save(m3d_t *model, int quality, int flags, unsigned int *size ptr += sprintf(ptr, "\r\n"); } /* mathematical shapes face */ - if (model->numshape && model->numshape && !(flags & M3D_EXP_NOFACE)) { + if (model->numshape !(flags & M3D_EXP_NOFACE)) { for (j = 0; j < model->numshape; j++) { sn = _m3d_safestr(model->shape[j].name, 0); if (!sn) { From 2c0df39ef30621b330f988afc70f1e3ac85b536b Mon Sep 17 00:00:00 2001 From: Alec Date: Sat, 6 Jun 2020 14:33:41 +0200 Subject: [PATCH 078/115] Added rapidjson define to avoid warnings in c++17 --- code/AssetLib/glTF/glTFAsset.h | 1 + code/AssetLib/glTF/glTFCommon.h | 1 + code/AssetLib/glTF2/glTF2Asset.h | 1 + 3 files changed, 3 insertions(+) diff --git a/code/AssetLib/glTF/glTFAsset.h b/code/AssetLib/glTF/glTFAsset.h index 4c7aaa908..f0333ad0c 100644 --- a/code/AssetLib/glTF/glTFAsset.h +++ b/code/AssetLib/glTF/glTFAsset.h @@ -62,6 +62,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #define RAPIDJSON_HAS_STDSTRING 1 +#define RAPIDJSON_NOMEMBERITERATORCLASS #include #include #include diff --git a/code/AssetLib/glTF/glTFCommon.h b/code/AssetLib/glTF/glTFCommon.h index d161e8cd6..b151918b6 100644 --- a/code/AssetLib/glTF/glTFCommon.h +++ b/code/AssetLib/glTF/glTFCommon.h @@ -53,6 +53,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #define RAPIDJSON_HAS_STDSTRING 1 +#define RAPIDJSON_NOMEMBERITERATORCLASS #include #include #include diff --git a/code/AssetLib/glTF2/glTF2Asset.h b/code/AssetLib/glTF2/glTF2Asset.h index 99bcaf072..fc0fe1544 100644 --- a/code/AssetLib/glTF2/glTF2Asset.h +++ b/code/AssetLib/glTF2/glTF2Asset.h @@ -64,6 +64,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #define RAPIDJSON_HAS_STDSTRING 1 +#define RAPIDJSON_NOMEMBERITERATORCLASS #include #include #include From b37d42f6b548a42732abdee2fab84c322021443e Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sun, 7 Jun 2020 18:03:47 +0200 Subject: [PATCH 079/115] Perform sanity check only in debug closes https://github.com/assimp/assimp/issues/3255 --- code/AssetLib/Blender/BlenderDNA.inl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/AssetLib/Blender/BlenderDNA.inl b/code/AssetLib/Blender/BlenderDNA.inl index a41ceab7f..e59adab1d 100644 --- a/code/AssetLib/Blender/BlenderDNA.inl +++ b/code/AssetLib/Blender/BlenderDNA.inl @@ -4,7 +4,6 @@ Open Asset Import Library (assimp) Copyright (c) 2006-2020, assimp team - All rights reserved. Redistribution and use of this software in source and binary forms, @@ -239,11 +238,13 @@ bool Structure :: ReadFieldPtr(TOUT (&out)[N], const char* name, try { f = &(*this)[name]; +#ifdef _DEBUG // sanity check, should never happen if the genblenddna script is right if ((FieldFlag_Pointer|FieldFlag_Pointer) != (f->flags & (FieldFlag_Pointer|FieldFlag_Pointer))) { throw Error((Formatter::format(),"Field `",name,"` of structure `", this->name,"` ought to be a pointer AND an array")); } +#endif // _DEBUG db.reader->IncPtr(f->offset); From 26421aebc99fadf30334571f70b48f677296c77e Mon Sep 17 00:00:00 2001 From: Yingying Wang Date: Mon, 8 Jun 2020 13:33:16 -0700 Subject: [PATCH 080/115] support channel name in blendshape name --- code/AssetLib/FBX/FBXConverter.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/AssetLib/FBX/FBXConverter.cpp b/code/AssetLib/FBX/FBXConverter.cpp index eb995f429..261567e48 100644 --- a/code/AssetLib/FBX/FBXConverter.cpp +++ b/code/AssetLib/FBX/FBXConverter.cpp @@ -1163,7 +1163,8 @@ unsigned int FBXConverter::ConvertMeshSingleMaterial(const MeshGeometry &mesh, c const std::vector &curVertices = shapeGeometry->GetVertices(); const std::vector &curNormals = shapeGeometry->GetNormals(); const std::vector &curIndices = shapeGeometry->GetIndices(); - animMesh->mName.Set(FixAnimMeshName(shapeGeometry->Name())); + //losing channel name if using shapeGeometry->Name() + animMesh->mName.Set(FixAnimMeshName(blendShapeChannel->Name())); for (size_t j = 0; j < curIndices.size(); j++) { const unsigned int curIndex = curIndices.at(j); aiVector3D vertex = curVertices.at(j); From 9e46f9751fc81d75791aad02f00b6c1bf104261f Mon Sep 17 00:00:00 2001 From: Paul Arden Date: Tue, 9 Jun 2020 15:49:38 +1000 Subject: [PATCH 081/115] Check for invalid texture coordinate accessor. Fixes #3269. --- code/AssetLib/glTF2/glTF2Importer.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/AssetLib/glTF2/glTF2Importer.cpp b/code/AssetLib/glTF2/glTF2Importer.cpp index 83f022e8f..a957d9d9b 100644 --- a/code/AssetLib/glTF2/glTF2Importer.cpp +++ b/code/AssetLib/glTF2/glTF2Importer.cpp @@ -416,6 +416,10 @@ void glTF2Importer::ImportMeshes(glTF2::Asset &r) { attr.color[c]->ExtractData(aim->mColors[c]); } for (size_t tc = 0; tc < attr.texcoord.size() && tc < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++tc) { + if (!attr.texcoord[tc]) { + throw DeadlyImportError("GLTF: Texture coordinate accessor not found or non-contiguous texture coordinate sets"); + } + if (attr.texcoord[tc]->count != aim->mNumVertices) { DefaultLogger::get()->warn("Texcoord stream size in mesh \"" + mesh.name + "\" does not match the vertex count"); From efbabf3b0daccb976639a3734fa9018c4b3e13fa Mon Sep 17 00:00:00 2001 From: David Date: Tue, 9 Jun 2020 08:32:59 +0200 Subject: [PATCH 082/115] Implement contextmanager for load --- port/PyAssimp/pyassimp/core.py | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/port/PyAssimp/pyassimp/core.py b/port/PyAssimp/pyassimp/core.py index 85cfe8233..37beac886 100644 --- a/port/PyAssimp/pyassimp/core.py +++ b/port/PyAssimp/pyassimp/core.py @@ -14,10 +14,13 @@ if sys.version_info >= (3,0): xrange = range -try: import numpy -except ImportError: numpy = None +try: + import numpy +except ImportError: + numpy = None import logging import ctypes +from contextlib import contextmanager logger = logging.getLogger("pyassimp") # attach default null handler to logger so it doesn't complain # even if you don't attach another handler to logger @@ -272,6 +275,13 @@ def recur_pythonize(node, scene): for c in node.children: recur_pythonize(c, scene) +def release(scene): + ''' + Release resources of a loaded scene. + ''' + _assimp_lib.release(ctypes.pointer(scene)) + +@contextmanager def load(filename, file_type = None, processing = postprocess.aiProcess_Triangulate): @@ -319,7 +329,10 @@ def load(filename, raise AssimpError('Could not import file!') scene = _init(model.contents) recur_pythonize(scene.rootnode, scene) - return scene + try: + yield scene + finally: + release(scene) def export(scene, filename, @@ -373,9 +386,6 @@ def export_blob(scene, raise AssimpError('Could not export scene to blob!') return exportBlobPtr -def release(scene): - _assimp_lib.release(ctypes.pointer(scene)) - def _finalize_texture(tex, target): setattr(target, "achformathint", tex.achFormatHint) if numpy: From b84dbb68ecf4d6e30c535c715ebaa88646dbe5db Mon Sep 17 00:00:00 2001 From: David Date: Tue, 9 Jun 2020 08:33:09 +0200 Subject: [PATCH 083/115] Update READMEs --- port/PyAssimp/README.md | 25 ++++++++++--------------- port/PyAssimp/README.rst | 23 ++++++++++------------- 2 files changed, 20 insertions(+), 28 deletions(-) diff --git a/port/PyAssimp/README.md b/port/PyAssimp/README.md index d64d72763..c9944f717 100644 --- a/port/PyAssimp/README.md +++ b/port/PyAssimp/README.md @@ -42,17 +42,14 @@ substituted by assertions ...): ```python -from pyassimp import * -scene = load('hello.3ds') +from pyassimp import load +with load('hello.3ds') as scene: -assert len(scene.meshes) -mesh = scene.meshes[0] + assert len(scene.meshes) + mesh = scene.meshes[0] -assert len(mesh.vertices) -print(mesh.vertices[0]) - -# don't forget this one, or you will leak! -release(scene) + assert len(mesh.vertices) + print(mesh.vertices[0]) ``` @@ -61,13 +58,11 @@ scene: ```python -from pyassimp import * -scene = load('hello.3ds') +from pyassimp import load +with load('hello.3ds') as scene: -for c in scene.rootnode.children: - print(str(c)) - -release(scene) + for c in scene.rootnode.children: + print(str(c)) ``` diff --git a/port/PyAssimp/README.rst b/port/PyAssimp/README.rst index f909e2cd0..03b7968f1 100644 --- a/port/PyAssimp/README.rst +++ b/port/PyAssimp/README.rst @@ -49,30 +49,27 @@ substituted by assertions ...): .. code:: python - from pyassimp import * - scene = load('hello.3ds') + from pyassimp import load + with load('hello.3ds') as scene: - assert len(scene.meshes) - mesh = scene.meshes[0] + assert len(scene.meshes) + mesh = scene.meshes[0] - assert len(mesh.vertices) - print(mesh.vertices[0]) + assert len(mesh.vertices) + print(mesh.vertices[0]) - # don't forget this one, or you will leak! - release(scene) Another example to list the 'top nodes' in a scene: .. code:: python - from pyassimp import * - scene = load('hello.3ds') + from pyassimp import load + with load('hello.3ds') as scene: - for c in scene.rootnode.children: - print(str(c)) + for c in scene.rootnode.children: + print(str(c)) - release(scene) INSTALL ------- From 5c7bed01f1133956d63419220f918577e49dbc03 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Tue, 9 Jun 2020 10:06:50 +0200 Subject: [PATCH 084/115] remove dead code. --- code/AssetLib/STL/STLLoader.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/code/AssetLib/STL/STLLoader.cpp b/code/AssetLib/STL/STLLoader.cpp index 7d7fdb7c9..00cfe4b4d 100644 --- a/code/AssetLib/STL/STLLoader.cpp +++ b/code/AssetLib/STL/STLLoader.cpp @@ -5,8 +5,6 @@ Open Asset Import Library (assimp) Copyright (c) 2006-2020, assimp team - - All rights reserved. Redistribution and use of this software in source and binary forms, @@ -101,11 +99,13 @@ static bool IsAsciiSTL(const char *buffer, unsigned int fileSize) { const char *bufferEnd = buffer + fileSize; - if (!SkipSpaces(&buffer)) + if (!SkipSpaces(&buffer)) { return false; + } - if (buffer + 5 >= bufferEnd) + if (buffer + 5 >= bufferEnd) { return false; + } bool isASCII(strncmp(buffer, "solid", 5) == 0); if (isASCII) { @@ -386,7 +386,6 @@ void STLImporter::LoadASCIIFile(aiNode *root) { pMesh->mNormals[i].y = normalBuffer[i].y; pMesh->mNormals[i].z = normalBuffer[i].z; } -// memcpy(pMesh->mNormals, &normalBuffer[0].x, pMesh->mNumVertices * sizeof(aiVector3D)); normalBuffer.clear(); } From 35fb4c93703790d19aa4407016297fe6c0f873eb Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Tue, 9 Jun 2020 10:07:25 +0200 Subject: [PATCH 085/115] Remove dead code --- code/AssetLib/STL/STLLoader.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/code/AssetLib/STL/STLLoader.cpp b/code/AssetLib/STL/STLLoader.cpp index 00cfe4b4d..2d710b084 100644 --- a/code/AssetLib/STL/STLLoader.cpp +++ b/code/AssetLib/STL/STLLoader.cpp @@ -375,7 +375,6 @@ void STLImporter::LoadASCIIFile(aiNode *root) { pMesh->mVertices[i].y = positionBuffer[i].y; pMesh->mVertices[i].z = positionBuffer[i].z; } - //memcpy(pMesh->mVertices, &positionBuffer[0].x, pMesh->mNumVertices * sizeof(aiVector3D)); positionBuffer.clear(); } // also only process normalBuffer when filled, else exception when accessing with index operator From 42afc40d168b0dfdd26794de4b076156e61ad081 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Tue, 9 Jun 2020 10:13:43 +0200 Subject: [PATCH 086/115] Disable warning only for gcc 8.0 or greater --- code/AssetLib/glTF/glTFAsset.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/code/AssetLib/glTF/glTFAsset.h b/code/AssetLib/glTF/glTFAsset.h index 56cf18527..50d977603 100644 --- a/code/AssetLib/glTF/glTFAsset.h +++ b/code/AssetLib/glTF/glTFAsset.h @@ -60,13 +60,23 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include +#ifndef RAPIDJSON_HAS_STDSTRING #define RAPIDJSON_HAS_STDSTRING 1 +#endif + +#if (__GNUC__ == 8 && __GNUC_MINOR__ >= 0) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wclass-memaccess" +#endif + #include #include #include + +#if (__GNUC__ == 8 && __GNUC_MINOR__ >= 0) #pragma GCC diagnostic pop +#endif + #ifdef ASSIMP_API # include # include From 620bebb999e16fcf9dfa2c561b12c261e579b204 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Tue, 9 Jun 2020 10:14:57 +0200 Subject: [PATCH 087/115] diable warning only for gcc 8.0 or greater --- code/AssetLib/glTF2/glTF2Asset.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/code/AssetLib/glTF2/glTF2Asset.h b/code/AssetLib/glTF2/glTF2Asset.h index 9c1938123..f70421ef2 100644 --- a/code/AssetLib/glTF2/glTF2Asset.h +++ b/code/AssetLib/glTF2/glTF2Asset.h @@ -4,7 +4,6 @@ Open Asset Import Library (assimp) Copyright (c) 2006-2020, assimp team - All rights reserved. Redistribution and use of this software in source and binary forms, @@ -63,13 +62,23 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include +#ifndef RAPIDJSON_HAS_STDSTRING #define RAPIDJSON_HAS_STDSTRING 1 +#endif + +#if (__GNUC__ == 8 && __GNUC_MINOR__ >= 0) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wclass-memaccess" +#endif + #include #include #include + +#if (__GNUC__ == 8 && __GNUC_MINOR__ >= 0) #pragma GCC diagnostic pop +#endif + #ifdef ASSIMP_API #include #include From 88c1509d69994a8433da53c337c2beeb0a28d232 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Tue, 9 Jun 2020 10:15:35 +0200 Subject: [PATCH 088/115] Remove dead code --- code/Common/SceneCombiner.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/code/Common/SceneCombiner.cpp b/code/Common/SceneCombiner.cpp index 2b3b701d5..4f262192b 100644 --- a/code/Common/SceneCombiner.cpp +++ b/code/Common/SceneCombiner.cpp @@ -981,7 +981,6 @@ void GetArrayCopy(Type*& dest, ai_uint num ) { for ( size_t i=0; i Date: Tue, 9 Jun 2020 10:16:05 +0200 Subject: [PATCH 089/115] Remove dead code. --- test/unit/utFindInvalidData.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/unit/utFindInvalidData.cpp b/test/unit/utFindInvalidData.cpp index a31479af7..17a9c0379 100644 --- a/test/unit/utFindInvalidData.cpp +++ b/test/unit/utFindInvalidData.cpp @@ -110,8 +110,6 @@ TEST_F(utFindInvalidDataProcess, testStepNegativeResult) { mMesh->mNormals[i].x = mMesh->mNormals[i].y = mMesh->mNormals[i].z =0; mMesh->mBitangents[i].x = mMesh->mBitangents[i].y = mMesh->mBitangents[i].z = 0; } - //::memset(mMesh->mNormals, 0, mMesh->mNumVertices * sizeof(aiVector3D)); - //::memset(mMesh->mBitangents, 0, mMesh->mNumVertices * sizeof(aiVector3D)); mMesh->mTextureCoords[2][455] = aiVector3D(std::numeric_limits::quiet_NaN()); From 1b0b4d8d1a33f46e9edfca0b9f1758e194c68d28 Mon Sep 17 00:00:00 2001 From: kimkulling Date: Fri, 12 Jun 2020 11:43:31 +0200 Subject: [PATCH 090/115] add a unittest. --- .../glTF2/issue_3269/texcoord_crash.gltf | 610 ++++++++++++++++++ test/unit/utglTF2ImportExport.cpp | 6 + 2 files changed, 616 insertions(+) create mode 100644 test/models/glTF2/issue_3269/texcoord_crash.gltf diff --git a/test/models/glTF2/issue_3269/texcoord_crash.gltf b/test/models/glTF2/issue_3269/texcoord_crash.gltf new file mode 100644 index 000000000..bc5d13f31 --- /dev/null +++ b/test/models/glTF2/issue_3269/texcoord_crash.gltf @@ -0,0 +1,610 @@ +{ + "accessors" : [ + { + "bufferView" : 0, + "componentType" : 5121, + "count" : 6, + "max" : [ + 3 + ], + "min" : [ + 0 + ], + "type" : "SCALAR" + }, + { + "bufferView" : 1, + "componentType" : 5126, + "count" : 4, + "max" : [ + 1.2000000476837158, + 1.2000001668930054, + -5.205485820169997e-08 + ], + "min" : [ + 0.19999980926513672, + 0.20000004768371582, + -1.5933926533762133e-07 + ], + "type" : "VEC3" + }, + { + "bufferView" : 2, + "componentType" : 5126, + "count" : 4, + "max" : [ + -2.1316282072803006e-14, + 1.0728441424134871e-07, + 1.0 + ], + "min" : [ + -2.1316282072803006e-14, + 1.0728441424134871e-07, + 1.0 + ], + "type" : "VEC3" + }, + { + "name": "TopRight_TEXCOORD_0", + "bufferView" : 3, + "componentType" : 5126, + "count" : 4, + "max" : [ + 1.0, + 0.3999999761581421 + ], + "min" : [ + 0.6000000238418579, + 0.0 + ], + "type" : "VEC2" + }, + { + "bufferView" : 4, + "componentType" : 5121, + "count" : 6, + "max" : [ + 3 + ], + "min" : [ + 0 + ], + "type" : "SCALAR" + }, + { + "bufferView" : 5, + "componentType" : 5126, + "count" : 4, + "max" : [ + -0.20000006258487701, + 1.2000000476837158, + 1.2601539367551595e-07 + ], + "min" : [ + -1.2000001668930054, + 0.19999974966049194, + -3.3740951721483725e-07 + ], + "type" : "VEC3" + }, + { + "bufferView" : 6, + "componentType" : 5126, + "count" : 4, + "max" : [ + 1.7807019503379706e-07, + 2.853547016457014e-07, + 1.0 + ], + "min" : [ + 1.7807019503379706e-07, + 2.853547016457014e-07, + 1.0 + ], + "type" : "VEC3" + }, + { + "name": "TopLeft_TEXCOORD_0", + "bufferView" : 7, + "componentType" : 5126, + "count" : 4, + "max" : [ + 0.3999999463558197, + 0.3999999761581421 + ], + "min" : [ + 7.915305388905836e-08, + 0.0 + ], + "type" : "VEC2" + }, + { + "bufferView" : 8, + "componentType" : 5121, + "count" : 6, + "max" : [ + 3 + ], + "min" : [ + 0 + ], + "type" : "SCALAR" + }, + { + "bufferView" : 9, + "componentType" : 5126, + "count" : 4, + "max" : [ + 1.2000001668930054, + -0.1999996304512024, + 5.255118367131217e-07 + ], + "min" : [ + 0.2000000923871994, + -1.2000000476837158, + 6.20869826661874e-08 + ], + "type" : "VEC3" + }, + { + "bufferView" : 10, + "componentType" : 5126, + "count" : 4, + "max" : [ + -1.7807025187721592e-07, + 2.853545879588637e-07, + 1.0 + ], + "min" : [ + -1.7807025187721592e-07, + 2.853545879588637e-07, + 1.0 + ], + "type" : "VEC3" + }, + { + "name": "BottomRight_TEXCOORD_0", + "bufferView" : 11, + "componentType" : 5126, + "count" : 4, + "max" : [ + 0.9999998807907104, + 1.0 + ], + "min" : [ + 0.6000000834465027, + 0.599999874830246 + ], + "type" : "VEC2" + }, + { + "bufferView" : 12, + "componentType" : 5121, + "count" : 6, + "max" : [ + 3 + ], + "min" : [ + 0 + ], + "type" : "SCALAR" + }, + { + "bufferView" : 13, + "componentType" : 5126, + "count" : 4, + "max" : [ + 1.0000001192092896, + 1.0000001192092896, + -0.052591003477573395 + ], + "min" : [ + -1.0000001192092896, + -1.0000001192092896, + -0.05259115248918533 + ], + "type" : "VEC3" + }, + { + "bufferView" : 14, + "componentType" : 5126, + "count" : 4, + "max" : [ + 1.0658142730467397e-14, + -7.450581307466564e-08, + -1.0 + ], + "min" : [ + 1.0658142730467397e-14, + -7.450581307466564e-08, + -1.0 + ], + "type" : "VEC3" + }, + { + "bufferView" : 15, + "componentType" : 5121, + "count" : 6, + "max" : [ + 3 + ], + "min" : [ + 0 + ], + "type" : "SCALAR" + }, + { + "bufferView" : 16, + "componentType" : 5126, + "count" : 4, + "max" : [ + -0.19999969005584717, + -0.2000000774860382, + 5.255118367131217e-07 + ], + "min" : [ + -1.2000000476837158, + -1.2000001668930054, + 6.208701108789683e-08 + ], + "type" : "VEC3" + }, + { + "bufferView" : 17, + "componentType" : 5126, + "count" : 4, + "max" : [ + -8.526512829121202e-14, + 4.6342486825778906e-07, + 1.0 + ], + "min" : [ + -8.526512829121202e-14, + 4.6342486825778906e-07, + 1.0 + ], + "type" : "VEC3" + }, + { + "name": "BottomLeft_TEXCOORD_0", + "bufferView" : 18, + "componentType" : 5126, + "count" : 4, + "max" : [ + 0.40000009536743164, + 0.9999999208469248 + ], + "min" : [ + 0.0, + 0.6000000536441803 + ], + "type" : "VEC2" + } + ], + "asset" : { + "copyright" : "Copyright 2017-2018 Analytical Graphics, Inc., CC-BY 4.0 https://creativecommons.org/licenses/by/4.0/ - Mesh and textures by Ed Mackey.", + "generator" : "Khronos Blender glTF 2.0 exporter, plus hand-edits", + "version" : "2.0" + }, + "bufferViews" : [ + { + "buffer" : 0, + "byteLength" : 6, + "byteOffset" : 0, + "target" : 34963 + }, + { + "buffer" : 0, + "byteLength" : 48, + "byteOffset" : 8, + "target" : 34962 + }, + { + "buffer" : 0, + "byteLength" : 48, + "byteOffset" : 56, + "target" : 34962 + }, + { + "buffer" : 0, + "byteLength" : 32, + "byteOffset" : 104, + "target" : 34962 + }, + { + "buffer" : 0, + "byteLength" : 6, + "byteOffset" : 136, + "target" : 34963 + }, + { + "buffer" : 0, + "byteLength" : 48, + "byteOffset" : 144, + "target" : 34962 + }, + { + "buffer" : 0, + "byteLength" : 48, + "byteOffset" : 192, + "target" : 34962 + }, + { + "buffer" : 0, + "byteLength" : 32, + "byteOffset" : 240, + "target" : 34962 + }, + { + "buffer" : 0, + "byteLength" : 6, + "byteOffset" : 272, + "target" : 34963 + }, + { + "buffer" : 0, + "byteLength" : 48, + "byteOffset" : 280, + "target" : 34962 + }, + { + "buffer" : 0, + "byteLength" : 48, + "byteOffset" : 328, + "target" : 34962 + }, + { + "buffer" : 0, + "byteLength" : 32, + "byteOffset" : 376, + "target" : 34962 + }, + { + "buffer" : 0, + "byteLength" : 6, + "byteOffset" : 408, + "target" : 34963 + }, + { + "buffer" : 0, + "byteLength" : 48, + "byteOffset" : 416, + "target" : 34962 + }, + { + "buffer" : 0, + "byteLength" : 48, + "byteOffset" : 464, + "target" : 34962 + }, + { + "buffer" : 0, + "byteLength" : 6, + "byteOffset" : 512, + "target" : 34963 + }, + { + "buffer" : 0, + "byteLength" : 48, + "byteOffset" : 520, + "target" : 34962 + }, + { + "buffer" : 0, + "byteLength" : 48, + "byteOffset" : 568, + "target" : 34962 + }, + { + "buffer" : 0, + "byteLength" : 32, + "byteOffset" : 616, + "target" : 34962 + } + ], + "buffers" : [ + { + "byteLength" : 648, + "uri" : "data:application/octet-stream;base64,AAECAwEAAACamZk/2sxMPuySX7PAzEw+mZmZP9gWK7TKzEw+0MxMPuySX7OYmZk/m5mZP9gWK7QAAMCoO2TmMwAAgD8AAMCoO2TmMwAAgD8AAMCoO2TmMwAAgD8AAMCoO2TmMwAAgD8AAIA/zMzMPpqZGT8AAAAAmpkZP8zMzD4AAIA/AAAAAAABAgMBAAAA0cxMvsnMTD7okl+zm5mZv5iZmT/aFiu0mZmZv7zMTD7ZTgc03sxMvpqZmT82JbW0kDM/NNoymTQAAIA/kDM/NNoymTQAAIA/kDM/NNoymTQAAIA/kDM/NNoymTQAAIA/y8zMPszMzD7a+qkzAAAAANr6qTPMzMw+y8zMPgAAAAAAAQIDAQAAAJuZmT+YmZm/5hANNdPMTD7HzEy+rlSFM+bMTD6amZm/Boi6NJmZmT+0zEy+8u6ANJQzP7TWMpk0AACAP5QzP7TWMpk0AACAP5QzP7TWMpk0AACAP5QzP7TWMpk0AACAP/3/fz8AAIA/m5kZP5iZGT+cmRk/AACAP/7/fz+YmRk/AAECAAMBAAABAIC//f9/P9JpV70BAIA//f9/v6ppV739/3+/AQCAv6ppV739/38/AQCAP9JpV70CAEAoAQCgswAAgL8CAEAoAQCgswAAgL8CAEAoAQCgswAAgL8CAEAoAQCgswAAgL8AAQIDAQAAALjMTL6ZmZm/5hANNZqZmb/izEy+uFSFM5iZmb+bmZm/5hANNcjMTL7SzEy+slSFMwAAwKmhzPg0AACAPwAAwKmhzPg0AACAPwAAwKmhzPg0AACAPwAAwKmhzPg0AACAP9DMzD7//38/AACAM5qZGT8AAAAA//9/P83MzD6amRk/" + } + ], + "images" : [ + { + "uri" : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4QYcDhkW4QlOQwAAHBNJREFUeNrt3XuMlNX9P/DP4u7OLkshVEGkgKyVWzTNsloTbYtGaIgmRGM1tRq1TbVSaqm2qdREwbSJoQlQGm9NiNSmCSyRRhNtm0YTTUyq1jWhtFDF2lKrqcKuCsJegfP74/vbDbC3mZ2Zvcy8Xslkk5lnn3l2zjPn8z7nuWxFSikFAFBWJvgIAEAAAAAEAABAAAAABAAAQAAAAAQAAEAAAAAEAABg9FRmu2BFRUVWy7mxIAAUXqHrcOVY/kOECQBKvWiPVq2rLPUPV4gAQH0pwQBQzAYWHgD08aWq0u5R2J1KaADQ7woADLrj2mkBfaO+UQCg3y+DLwKgP0MA4JQvlC8ToE9iuNwIqIS+hNleIwqgn0EAKPFU7ssK6EPot41TgedsCnmnokLcQCGf6ziHc/lILmepZnPyy2DH0Pqbeut5LqUUFRUVpuSAvPrznr6kv35msD4pm/4sl75xOP1uPn18IepLIWtdtusyA0BRdhZAH0LpcBKgLyyAfkUAwJcSQN8jAOCLBqC/EgDwZQHQ5wkA2MEB9KMCgJ0QAH21AGDHAEB9EAA0DgACxDgNAIW66xEAkFvdLHQNdidAAChDAgAACAAAgAAAAAgAAIAAAAAIAACAAAAAjFk53QgomxsMuFkQAORmNGqnGQAAKEMCAAAIAACAAAAACAAAgAAAAAgAAIAAAACMWZW5/sJQNytwkx8AyE0hbrSXa/01AwAAZUgAAAABAAAQAAAAAQAASklFRUVW/4lPAGDEHTt2LNatWxf19fWRyWRizpw5PhQg74KX7WO0ty+TycTnPve5uP7666O5uXlUC3iphYWKlON1A6N9GWCuH/5IX5bYs32Fet/169fHfffd1+dvKvT7AOUTAMZDH9qfqqqqeOaZZ+Lqq68uWJ+by++Pdr876pcBppQGfYy1NDnePfnkkxERsXXr1ujo6FDwgbz0129n89pobWdHR0f8/e9/j69//evR3d3d74CoVPrFoernUPU3VxPsvGPb/v37o6qqKr75zW9GJpPRewEjpru7OzZt2hSNjY1RV1cXdXV10djYGJs3b45jx471W7w+/PDDWLlyZcyYMSNqa2vjS1/6Urz22mvD3oZMJhMXXHBBPPLIIxERsW/fvn7f92Tt7e2xdu3aqK+vj6qqqpg7d2488MADMWnSpAEHou+++27ceuutMXXq1JgxY0bcdddd0dHR0e/ou2QGtqnAImLQRzEMtO6urq60cePGtHjx4jRx4sQ0ceLEtHjx4vSLX/widXd397uODz74IN15553p7LPPTjU1Nemyyy5Lr776at7bcrqdO3emZcuWpalTp6aqqqp07rnnptWrV6eWlpZBP8uhPmOAQvShXV1dadmyZQP2NcuXLz+lH+15fsqUKX2WraurS2+//XZefeg//vGPFBGpvr5+0OW7urrSV77ylaz7yZ7nzjzzzD7LrVu3LqvaNl7rZ8kGgLG2857sjjvuGHC75s+fnz755BMBABjVALBhw4YUEWn69OmpqakptbS0pJaWlrRt27Y0bdq0FBFp06ZNfdZx/fXXp1dffTW1t7en3bt3p8bGxhQR6dvf/vawtuXQoUPpxRdf7F3P2rVrB13+l7/8Ze92P/300+nw4cPp4MGDaefOnYMGgMsvvzzt2rUrHTp0KK1ZsyZFRJo3b96wBngCwCgHgLGy857uySefTBGRZs2alXbs2JEOHDiQ2traUnNzc7riiitSRKT77rtvyPUp+EAx+9CGhoYUEempp57qs3xTU1OKiLR48eIh+6SXX36535H7cGrIddddlzo6Ogbd9osvvjhFRNq+fXtWf2fPc8ePH+997sMPP0wRkTKZjAAwHgPAaO+8A7n00ktTRKTm5uY+r/33v/9NEZEWLVokAACjGgBqa2tTRKTW1tY+y7e0tKSISBMnThyyT/r0009TRKTq6uq8asj69euz2va6uroUEengwYM5BYCTdXd3Z73seK6fJXsfgLfeeisiIq688so+ry1btuyUZQbT0NAQERHvv/9+QbZr9+7dERFx8cUX9zmRZPbs2RER8e9//9vZR8CYOfE6m+cG0nMiXVVV1bBO+H700UcjImLz5s2xf//+IX+vq6srIiJqa2uH/TdXVlaWRdtOsPMWZ+cdyIkTJ7J+T4DRMn/+/IiIeP755/u89sILL0RExIIFC4Zcz0svvRQREYsWLRrWdqxatSruueee+OCDD+Kqq66Kjz76aNDlZ86cecpgqxg6OzvLNwCM5HWK433nPd3ChQsjIuKdd94pyOdUKjsiMLbccsstERGxevXqaGpqitbW1mhtbY2mpqZYvXr1Kcuc7Pe//3188sknceTIkXjuued6l73pppuGvS0bNmyIa6+9Nt5888245pprBu33emZ977777tizZ08cPXo0mpub47bbbsv7M+kJFw899FC0tbUVZcCahnmfneG+YUGPU4y1M1inTZuWtm/f3nsS4Pbt2wc9CfC5555LH3/8cfr000/Ts88+m84555w+y+ZzDsBjjz2WIiLNnj07PfHEE+k///lPam9vT21tbWnPnj3p0UcfTRdddNGQ65s5c2bvGbFHjx51EBMoaB/a1dWVli5dmvOVVP09LrvsstTZ2ZlXH3r06NHeE/xuuOGGdOLEiX6X37dvX5o0aVKfbaiurs7puH5/z69cuXJU616ha2/JBoDR3nkHehw/fjx961vfyvpkj4E+19HeEYHSDgA9/ejGjRtTQ0NDqq2tTbW1tamhoSFt2rRpwHuprFmzJn3+859PmUwmzZo1K/34xz9OR44cyXtbUkrpf//7X5ozZ06KiHT33XcPuPzrr7+elixZkmpqatLkyZPTihUr0htvvJEiItXU1Aw7ABw5ciTde++96bzzzkuZTCZNmTIlXXLJJeM2AOT8vwB6DgHkcsy92Aa6P3N3d3c8/PDD8dvf/rb3hL8FCxbErbfeGt///vdPOdGjZx1r1qyJnTt3xnvvvRfTpk2Lb3zjG7Fu3bqoq6vL+7M5eRv/+Mc/xhNPPBGvvfZaHDhwICoqKqK+vj6WLl0aN954Y3z5y18e9G87evRo/PSnP42dO3fG+++/HzU1NbFgwYK87rgFUOh+eKzYs2dPXHjhhTFv3rw+dxMcb59xoWpvSQSActh5AfShuevu7o69e/fGqlWr4s9//nPcdddd8fDDDwsAAoAAAFBqfehANWrGjBnxxhtv9J7MV+4BYILdFoBSsmLFipg9e3bU1tZGdXV1zJ07N+688854/fXXx23xL0qgSAWOa+N1dsAMAAClNsofTKWPe+yHEwAoNIcAAEAAAAAEAABAAAAABAAAYJwa9lUAA12q4Gx6ABiewWpooeuuGQAAKEMCAAAIAACAAAAACAAAQGkY9lUAA5116OoAABi+kaqjZgAAoAwJAAAgAAAAAgAAIAAAAKWhMp9f7u9MRWf7A8Dw5XKVXT411wwAAJQhAQAABAAAQAAAAEpSXicB9nfygRMDASA/I1FLzQAAQBkSAABAAAAABAAAoCRV5ruC009UcMIfAOQnm5Ps8623ZgAAoAwJAAAgAAAA5SDvcwBOPwbhnAAAyF+x66kZAAAoQwIAAAgAAEA5qCzESk4+TuGYPwDkb7Bz7ApRa80AAEAZEgAAoAwV5BDAyVMRDgcAQGEUs6aaAQCAMiQAAEAZqizUinqmKUz7A0Bh9HeIvVB11gwAAJgByD+lmAkAgMIpVl01AwAAZgDyTylG/gBQOCfPsBeyxk4o9Eae/u8LAYCxN8CeMNY3EADMAhR+gF2RVGwAKDtOAgQAAQAAEAAAAAEAABAAAAABAAAQAAAAAQAAEAAAAAEAABAAAAABAAAQAAAAAQAAEAAAAAEAABAAAAABAAAEAABAAAAABAAAQAAAAAQAAEAAAAAEAABAAAAABAAAQAAAAAQAAEAAAAAEAABAAAAABAAAQAAAAAQAABAAAAABAAAQAAAAAQAAEAAAAAEAABAAAAABAAAQAAAAAQAAEAAAAAEAABAAAAABAAAQAAAAAQAAEAAAQAAAAAQAAEAAAAAEAABAAAAABAAAQAAAAAQAAEAAAAAEAABAAAAAiqTSRwBDq6io6Pf5lJIPR7uAGQAolwKT6zJoFxAAYBwVmWxGkiklxUa7gAAApSLbApJtQUK7gAAARppoFxAAwEgT7QICABhpol1AAAAjTbQLCABgpKldtAsIAGCkqV20CwgAYKSpXbQLCABgpKldAAEAjDS1CyAAgJGmdgEBAMpg5Jjrz1xHmrn+RLuAAABFLjI9BSHXn6O5bu2iXaBo379kjgyyHqX2N8pEu4AAAOOoSIwV5foV1C4wuhwCAAABAAAQAAAAAQAAEAAAgHHKVQCQzRfF5WbaBcwAwPgtFMW4M1wx161dtAsIAJCH4d4RLpdbzhZj3dpFu0DRArhDADD4KHKw28MqGtoFzABAiRaZbEeaaBcQAKAE+Lez2gUEADDSNNLULiAAgJGmkaZ2AQEAjDSNNLULCABgpIl2AQEAjDTRLiAAgJEm2gUEADDSRLuAAABGmmgXEADASBPtAgIAGGmiXUAAgBEpNoVYBu0CY43/BggAZgAAAAEAABAAAAABAAAQAAAAAQAAEAAAAAEAABAAAAABAAAQAAAAAQAAEAAAAAEAABAAAAABAAAQAABAAAAABAAAQAAAAAQAAEAAAAAEAABAAAAABAAAQAAAAAQAAEAAAAAEAABAAAAABAAAQAAAAAQAAEAAAAABAAAQAAAAAQAAEAAAAAEAABAAAAABAAAQAAAAAQAAEAAAAAEAABAAAAABAAAQAAAAAQAAEAAAAAEAAAQAAEAAAAAEAABAAAAABAAAQAAAAAQAAEAAAAAEAABAAAAARkaljwCGVlFR0e/zKSUfjnYBMwBQLgUm12XQLiAAwDgqMtmMJFNKio12AQEASkW2BSTbgoR2AQEAjDTRLiAAgJEm2gUEADDSRLuAAABGmmgXEADASFO7aBcQAMBIU7toFxAAwEhTu2gXEADASFO7AAIAGGlqF0AAACNN7QICAJTByDHXn7mONHP9iXYBAQCKXGR6CkKuP0dz3dpFu0DRvn/JHBlkPUrtb5SJdgEBAMZRkRgryvUrqF1gdDkEAAACAAAgAAAAAgAAIAAAAOOUqwAgmy+Ky820C5gBgPFbKIpxZ7hirlu7aBcQACAPw70jXC63nC3GurWLdoGiBXCHAGDwUeRgt4dVNLQLmAGAEi0y2Y400S4gAEAJ8G9ntQsIAGCkaaSpXUAAACNNI03tAgIAGGkaaWoXEADASBPtAgIAGGmiXUAAACNNtAsIAGCkiXYBAQCMNNEuIACAkSbaBQQAMNJEu4AAACNSbAqxDNoFxhr/DRAAzAAAAAIAACAAAAACAAAgAAAAAgAAIAAAAAIAACAAAAACAAAgAAAAAgAAIAAAAAIAACAAAAACAAAgAACAAAAACAAAgAAAAAgAAIAAAAAIAACAAAAACAAAgAAAAAgAAIAAAAAIAACAAAAACAAAgAAAAAgAAIAAAAACAAAgAAAAAgAAIAAAAAIAACAAAAACAAAgAAAAAgAAIAAAAAIAACAAAAACAAAgAAAAAgAAIAAAAAIAAAgAAIAAAAAIAACAAAAACAAAgAAAAAgAAIAAAAAIAACAAAAACAAAgAAAAIzJAFBRUeETBYAiKHSNLWgASCkJAQBQhOKfUhrbMwCF3kAAKHfFGGBXFmsDBQEAKMzguhh11UmAAFCGCjYDYOQPAIXXU1cLXWfNAACAGYDCJRSzAQCQn2LWVDMAAFCGBAAAKEMFOQRg2h8ACu/kmlroWmsGAADKkAAAAGWoIIcABpqiOP01ACA7xa6nZgAAoAwJAAAgAAAA5SDvcwAc8weAwju9nha63poBAIAyJAAAgAAAAJSDvM8BGOoYRX/LAAADG4laagYAAMqQAAAAAgAAIAAAACUpr5MAnfAHAIXXXy0tdM01AwAAZUgAAAABAAAQAACAkpTXSYDZnqQw0LIAwOjUUTMAAFCGBAAAEAAAAAFgDKqoqDjlUVNTE+eff3786Ec/ikOHDuW93lxfA0AfPS7bKhX4rIJin7wwWCNfc8018cwzz+S13sFObHQiI4A+erQ+wzFzEuDpKa/nkVLq91FoKaU4ceJEfPrpp/H4449HRMSf/vQn3z6AMUAfnd9n199joLo74gFgrKSkSZMmxc033xwREdOnTz/l9e7u7ti0aVM0NjZGXV1d1NXVRWNjY2zevDmOHTvWb9oa7MPt7/ls3+P0dezevTuuvfbamDx5ckyePDluuumm+Pjjj+Oll16K5cuXx2c+85mYMWNGrFy5Mtrb230jAH20PrrgSWNYIqLfR7Gd/j6HDx9O999/f4qItGXLlt7nu7q60rJlywbczuXLl6fu7u5B/5ahHrm8x+nbP2HChD7Lz507t9/13H///QlgPNBHF/+zLVTdHbcB4PRHY2Njev/993uX27BhQ4qINH369NTU1JRaWlpSS0tL2rZtW5o2bVqKiLRp06YBd9rBdujhvsfJ61qyZEnatWtX6ujoSA8++GC/z69duzZFRDr//PP1KsC4CgD6aAFgxD6AiEhTp05Nu3btSiml1NDQkCIiPfXUU33W0dTUlCIiLV68OK+dK9f3OHldx48f733uwIEDKSJSVVXVKc9/+OGHKSJSJpPRqwDjOgDoowWAgk8vdXV1pf3796fbb7+9d0onpZRqa2tTRKTW1tY+62hpaUkRkSZOnJjXzpXrewy0rmPHjuX0PMBYDwD66LEfACbkce5ATmcpFusazaqqqjj33HNj48aNERHx6quvDnnZRCrwVQn5vscZZ5yR0/MA44U+OvcTJ0fqKruSuRPg4cOHT2nU+fPnR0TE888/32fZF154ISIiFixY0Oe1zs7OAd/j9NeG+x4A5UYfPfaM+wDQ1dUVu3fvjttvvz0iIpYsWRIREbfccktERKxevTqampqitbU1Wltbo6mpKVavXn3KMhERM2fOjIiIhx56KNra2k55j4Fey/U9AMqNPnoMG8kTQIq9/smTJ6e//e1vvcedli5dmvXlHytXrhxwmwd6Ldf3GOxYVa7PA4y3kwD10aNfQwtyEuBYCQBnnHFGOuecc9LNN9+c3n777VOW7erqShs3bkwNDQ2ptrY21dbWpoaGhrRp06Y+jX7kyJF07733pvPOOy9lMpk0ZcqUdMkllwz5Wi7vIQAA5RYA9NFjNwCM2P8COPnYDwAwujXUvwMGgDJUaZQPAGPDYDW00LXXDAAAlCEBAAAEAABAAAAABAAAQAAoCceOHYt169ZFfX19ZDKZmDNnjr0CoAwV8x/Xjcm/dyRvBBSR/2WCPesv1GavX78+7rvvvj7bWOj3ASC/elJdXR1nnXVWXHrppfGTn/wkLr744oLWh1x+vxg1otj1UwA4zcKFC+Ott96KrVu3xk033RSZTKZojQtAYepJVVVVPPPMM3H11VcLAALA8NTU1MSJEyeis7PzlG0XAADGRgDo6Yc7Ozvjn//8Z/zsZz+LHTt2xBe+8IX461//WrT3K/UAULLnAPzud7+Lr371q/HZz342qqurY+7cufGDH/wgWltbT/mwOzs7o7u7OyZMmND74Z8eBE5+ADA6MplMXHDBBfHII49ERMS+ffv6FNDT++n29vZYu3Zt1NfXR1VVVcydOzceeOCBmDRp0oB9+rvvvhu33nprTJ06NWbMmBF33XVXdHR09Fuox3ONKMkZgO985zuxZcuWfl+bP39+/OUvf4kpU6b0u60nH/8fiQQGQG79/ZtvvhmLFi2K+vr6+Ne//jXg8t3d3bF06dJ4+eWXs+rTe37/zDPPPGWwGBGxbt26ePDBB4esc/nUCDMAefrNb34TW7ZsiVmzZsWOHTviwIED0dbWFs3NzXHFFVfEvn374uc//3mfD/P//2vkAZ8/+XUARt7hw4fjpZdeiptvvjkiIm655ZZBl3/88cfj5ZdfjunTp8fTTz8dhw8fjoMHD8bOnTsH/b0LL7wwdu3aFYcOHYo1a9ZERMS2bdv6LcTjuUaU3AzAZZddFq+88ko0NzfHRRdddMpr7733XsyePTsWLVoUe/fuHXR9zgEAGBszAP257rrrYtu2bb0nbvfXb3/xi1+M5ubm2L59e9x4441D9vE9zx0/fjwmTPi/8fGBAwfi7LPPjkwm0+9hACcBjqEAMGnSpDh69Oig66ipqYn29nYBAGAcBoD169f3jswH67d76sHBgwfjrLPOyjoAnPzcsWPHoqqqKqtlx1sAmDCcDRzscfp0yEhPj5w4cWLIZU5OcQCMbT3149FHH42IiM2bN8f+/fuH/L2urq6IiKitrR32e1dWVo743znQY6j6W/QAMNYtXLgwIiLeeeedggSRzs5O3z6AMWDVqlVxzz33xAcffBBXXXVVfPTRR4MuP3PmzIiI2L17d9G2aTzXiJILAHfccUdERFxxxRWxdevWePfdd6OjoyPa29tj79698dhjj/W5e9RgO85DDz0UbW1tvnkAY8CGDRvi2muvjTfffDOuueaaQQvwlVdeGRERd999d+zZsyeOHj0azc3Ncdttt+W9HaVQI3I+B2Ckj1Hk+v7Hjx+P22+/PX79619ntZ0DHcf57ne/G7/61a9G/O8DIAbtn9va2uLyyy+P5ubmuOGGG2LHjh2nTIP3LP/2229HY2NjHDly5JTfr66u7j08kM1x/f6eH40aUej6W3IzABMmTIitW7fGH/7wh/ja174Ws2bNiurq6shkMrFw4cL43ve+N+g1oSenzHvvvTfOO++8yGQyMWXKlLjkkkt8IwFG2cSJE+PZZ5+NOXPmxFNPPRU//OEP+11u3rx58eKLL8aSJUuipqYmJk+eHCtWrIhXXnklIv7vhPB8ZiLGe40YdzMAAJCPPXv2xIUXXhjz5s3rczfB8TAjUqj6W2lXAKAcdHd3x969e2PVqlUREbF8+fKy/jzMAABQukVugJo1Y8aMeOONN3pP5ivHGYCczwHI9zpF/1AHgJGyYsWKmD17dtTW1vb+Y7g777wzXn/99TFV/LOpnYW+z86I3wnQLAEAjH7tnOBjB4DyIwAAgAAAAAgAAIAAAAAIAACAAAAAjBc53QrYNf4AUHjZ1M5C12AzAABQhgQAABAAAAABAAAQAAAAAQAAEAAAAAEAABizcroRUKFuVJDtugCg1I1W3awc7x+KIAGAGlViAWAkGkiAAFDAy7E+VNoFhrdzCA4A+moBgCF3RDshgH5UAGDAndwODujzEADo84XxZQH0VwgAvmy+aIC+h2FxI6AS/GJme00pgH5FAKDEUzqAPoSTVRZ6R8h2OqhQN1DI9zrO4V4+kutZqtme/DLUMbSBpt56nu95rqKiIlJKvT8Bci3+p/chp/czg/VJ2fRnufSNw+l38+njC1FfClnrilGHzQCUqJ4dQPEH9CHkNQPA+PiyAuhnEAB8AQH0SQgAvkwA+jMEAF8EAH2jAICdFkC/KwDYoQDQxwsAGhcA4UEA8MECwLiudRVJJQaAsuNOgAAgAAAAAgAAIAAAAAIAACAAAAACAAAgAAAAAgAAMIr+HyP6AtxN3EzKAAAAAElFTkSuQmCC" + } + ], + "materials" : [ + { + "name" : "BackPlaneMat", + "doubleSided": true, + "pbrMetallicRoughness" : { + "baseColorFactor" : [ + 0.16000001668930075, + 0.16000001668930075, + 0.16000001668930075, + 1.0 + ], + "metallicFactor" : 0.0 + } + }, + { + "name" : "BottomLeftMat", + "doubleSided": true, + "pbrMetallicRoughness" : { + "baseColorFactor" : [ + 0.0, + 0.16000000476837162, + 0.800000011920929, + 1.0 + ], + "baseColorTexture" : { + "index" : 0 + }, + "metallicFactor" : 0.0 + } + }, + { + "name" : "BottomRightMat", + "doubleSided": true, + "pbrMetallicRoughness" : { + "baseColorFactor" : [ + 0.0, + 0.800000011920929, + 0.0, + 1.0 + ], + "baseColorTexture" : { + "index" : 0 + }, + "metallicFactor" : 0.0 + } + }, + { + "name" : "TopLeftMat", + "doubleSided": true, + "pbrMetallicRoughness" : { + "baseColorFactor" : [ + 0.800000011920929, + 0.800000011920929, + 0.0, + 1.0 + ], + "baseColorTexture" : { + "index" : 0 + }, + "metallicFactor" : 0.0 + } + }, + { + "name" : "TopRightMat", + "doubleSided": true, + "pbrMetallicRoughness" : { + "baseColorFactor" : [ + 0.800000011920929, + 0.08000000238418581, + 0.0, + 1.0 + ], + "baseColorTexture" : { + "index" : 0 + }, + "metallicFactor" : 0.0 + } + } + ], + "meshes" : [ + { + "name" : "TopRightMesh", + "primitives" : [ + { + "attributes" : { + "NORMAL" : 2, + "POSITION" : 1, + "TEXCOORD_1" : 3 + }, + "indices" : 0, + "material" : 4 + } + ] + }, + { + "name" : "TopLeftMesh", + "primitives" : [ + { + "attributes" : { + "NORMAL" : 6, + "POSITION" : 5, + "TEXCOORD_0" : 7 + }, + "indices" : 4, + "material" : 3 + } + ] + }, + { + "name" : "BottomRightMesh", + "primitives" : [ + { + "attributes" : { + "NORMAL" : 10, + "POSITION" : 9, + "TEXCOORD_0" : 11 + }, + "indices" : 8, + "material" : 2 + } + ] + }, + { + "name" : "BackPlaneMesh", + "primitives" : [ + { + "attributes" : { + "NORMAL" : 14, + "POSITION" : 13 + }, + "indices" : 12, + "material" : 0 + } + ] + }, + { + "name" : "BottomLeftMesh", + "primitives" : [ + { + "attributes" : { + "NORMAL" : 17, + "POSITION" : 16, + "TEXCOORD_0" : 18 + }, + "indices" : 15, + "material" : 1 + } + ] + } + ], + "nodes" : [ + { + "mesh" : 3, + "name" : "BackPlane" + }, + { + "mesh" : 4, + "name" : "BottomLeftObj" + }, + { + "mesh" : 2, + "name" : "BottomRightObj" + }, + { + "mesh" : 1, + "name" : "TopLeftObj" + }, + { + "mesh" : 0, + "name" : "TopRightObj" + } + ], + "samplers" : [ + {} + ], + "scene" : 0, + "scenes" : [ + { + "name" : "Scene", + "nodes" : [ + 0, + 2, + 1, + 4, + 3 + ] + } + ], + "textures" : [ + { + "sampler" : 0, + "source" : 0 + } + ] +} diff --git a/test/unit/utglTF2ImportExport.cpp b/test/unit/utglTF2ImportExport.cpp index f0f18d503..8fa5e08ce 100644 --- a/test/unit/utglTF2ImportExport.cpp +++ b/test/unit/utglTF2ImportExport.cpp @@ -534,3 +534,9 @@ TEST_F(utglTF2ImportExport, norootnode_scenewithoutnodes) { ASSERT_NE(scene, nullptr); ASSERT_NE(scene->mRootNode, nullptr); } + +TEST_F(utglTF2ImportExport, norootnode_issue_3269) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/glTF2/issue_3269/texcoord_crash.gltf", aiProcess_ValidateDataStructure); + ASSERT_NE(scene, nullptr); +} From ad62e6e863d7b144d0c6118701be42add4874cf6 Mon Sep 17 00:00:00 2001 From: kimkulling Date: Fri, 12 Jun 2020 12:29:51 +0200 Subject: [PATCH 091/115] fix unittest check - cannot work, just crash shall not occurr any more. --- code/AssetLib/glTF2/glTF2Asset.inl | 2 +- test/unit/utglTF2ImportExport.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/code/AssetLib/glTF2/glTF2Asset.inl b/code/AssetLib/glTF2/glTF2Asset.inl index 80207a4be..5a99525b2 100644 --- a/code/AssetLib/glTF2/glTF2Asset.inl +++ b/code/AssetLib/glTF2/glTF2Asset.inl @@ -722,7 +722,7 @@ template void Accessor::ExtractData(T *&outData) { uint8_t *data = GetPointer(); if (!data) { - throw DeadlyImportError("GLTF: data is NULL"); + throw DeadlyImportError("GLTF2: data is nullptr."); } const size_t elemSize = GetElementSize(); diff --git a/test/unit/utglTF2ImportExport.cpp b/test/unit/utglTF2ImportExport.cpp index 8fa5e08ce..6791d5f89 100644 --- a/test/unit/utglTF2ImportExport.cpp +++ b/test/unit/utglTF2ImportExport.cpp @@ -535,8 +535,9 @@ TEST_F(utglTF2ImportExport, norootnode_scenewithoutnodes) { ASSERT_NE(scene->mRootNode, nullptr); } +// Shall not crash! TEST_F(utglTF2ImportExport, norootnode_issue_3269) { Assimp::Importer importer; const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/glTF2/issue_3269/texcoord_crash.gltf", aiProcess_ValidateDataStructure); - ASSERT_NE(scene, nullptr); + ASSERT_EQ(scene, nullptr); } From f938a6b744bf9a951f60016dd982520fc3a41d4f Mon Sep 17 00:00:00 2001 From: kimkulling Date: Fri, 12 Jun 2020 14:52:02 +0200 Subject: [PATCH 092/115] fix leak: just ignore broken texture coordinates. --- code/AssetLib/glTF2/glTF2Importer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/AssetLib/glTF2/glTF2Importer.cpp b/code/AssetLib/glTF2/glTF2Importer.cpp index a957d9d9b..1c044e7ce 100644 --- a/code/AssetLib/glTF2/glTF2Importer.cpp +++ b/code/AssetLib/glTF2/glTF2Importer.cpp @@ -417,7 +417,8 @@ void glTF2Importer::ImportMeshes(glTF2::Asset &r) { } for (size_t tc = 0; tc < attr.texcoord.size() && tc < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++tc) { if (!attr.texcoord[tc]) { - throw DeadlyImportError("GLTF: Texture coordinate accessor not found or non-contiguous texture coordinate sets"); + DefaultLogger::get()->warn("Texture coordinate accessor not found or non-contiguous texture coordinate sets."); + continue; } if (attr.texcoord[tc]->count != aim->mNumVertices) { From f0f6612b81c1eec1ba2ebc8bcdfb227252223174 Mon Sep 17 00:00:00 2001 From: kimkulling Date: Mon, 15 Jun 2020 20:52:11 +0200 Subject: [PATCH 093/115] disable warning for radjson. --- contrib/rapidjson/include/rapidjson/document.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/contrib/rapidjson/include/rapidjson/document.h b/contrib/rapidjson/include/rapidjson/document.h index 93b091f64..473d846e3 100644 --- a/contrib/rapidjson/include/rapidjson/document.h +++ b/contrib/rapidjson/include/rapidjson/document.h @@ -17,6 +17,11 @@ /*! \file document.h */ +#if (__GNUC__ >= 8 && __GNUC_MINOR__ >= 0) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wclass-memaccess" +#endif + #include "reader.h" #include "internal/meta.h" #include "internal/strfunc.h" @@ -2610,4 +2615,8 @@ private: RAPIDJSON_NAMESPACE_END RAPIDJSON_DIAG_POP +#if (__GNUC__ == 8 && __GNUC_MINOR__ >= 0) +#pragma GCC diagnostic pop +#endif + #endif // RAPIDJSON_DOCUMENT_H_ From 524e2e4728a6b62d6fc6e33239031b30f7fc7a6c Mon Sep 17 00:00:00 2001 From: kimkulling Date: Mon, 15 Jun 2020 21:34:49 +0200 Subject: [PATCH 094/115] fix warning, hopefully ... --- code/Common/SceneCombiner.cpp | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/code/Common/SceneCombiner.cpp b/code/Common/SceneCombiner.cpp index 4f262192b..5d49baaf4 100644 --- a/code/Common/SceneCombiner.cpp +++ b/code/Common/SceneCombiner.cpp @@ -66,6 +66,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. namespace Assimp { +#if (__GNUC__ >= 8 && __GNUC_MINOR__ >= 0) +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wclass-memaccess" +#endif + // ------------------------------------------------------------------------------------------------ // Add a prefix to a string inline @@ -75,7 +80,7 @@ void PrefixString(aiString& string,const char* prefix, unsigned int len) { return; if (len+string.length>=MAXLEN-1) { - ASSIMP_LOG_VERBOSE_DEBUG("Can't add an unique prefix because the string is too long"); + ASSIMP_LOG_VERBOSE_DEBUG("Can't add an unique prefix because the string is too long"); ai_assert(false); return; } @@ -98,8 +103,9 @@ void SceneCombiner::AddNodeHashes(aiNode* node, std::set& hashes) } // Process all children recursively - for (unsigned int i = 0; i < node->mNumChildren;++i) + for (unsigned int i = 0; i < node->mNumChildren;++i) { AddNodeHashes(node->mChildren[i],hashes); + } } // ------------------------------------------------------------------------------------------------ @@ -978,9 +984,7 @@ void GetArrayCopy(Type*& dest, ai_uint num ) { Type* old = dest; dest = new Type[num]; - for ( size_t i=0; imBitangents, dest->mNumVertices ); unsigned int n = 0; - while (dest->HasTextureCoords(n)) - GetArrayCopy( dest->mTextureCoords[n++], dest->mNumVertices ); + while (dest->HasTextureCoords(n)) { + GetArrayCopy( dest->mTextureCoords[n++], dest->mNumVertices ); + } n = 0; - while (dest->HasVertexColors(n)) - GetArrayCopy( dest->mColors[n++], dest->mNumVertices ); + while (dest->HasVertexColors(n)) { + GetArrayCopy( dest->mColors[n++], dest->mNumVertices ); + } // make a deep copy of all bones CopyPtrArray(dest->mBones,dest->mBones,dest->mNumBones); @@ -1343,5 +1349,9 @@ void SceneCombiner::Copy(aiMetadata** _dest, const aiMetadata* src) { } } +#if (__GNUC__ >= 8 && __GNUC_MINOR__ >= 0) +# pragma GCC diagnostic pop +#endif + } // Namespace Assimp From bb613df5431dfa4cbc0ccc5396d768e08a8ae076 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Tue, 16 Jun 2020 16:31:47 +0200 Subject: [PATCH 095/115] Update issue templates To make our life easier --- .github/ISSUE_TEMPLATE/bug_report.md | 38 +++++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 20 ++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 000000000..dd84ea782 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,38 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + - OS: [e.g. iOS] + - Browser [e.g. chrome, safari] + - Version [e.g. 22] + +**Smartphone (please complete the following information):** + - Device: [e.g. iPhone6] + - OS: [e.g. iOS8.1] + - Browser [e.g. stock browser, safari] + - Version [e.g. 22] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 000000000..bbcbbe7d6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. From b3af5c5a14e4e54abf531c76a0f103eb57b1688d Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Wed, 17 Jun 2020 20:37:39 +0200 Subject: [PATCH 096/115] closes https://github.com/assimp/assimp/issues/3253 : remove useless code --- code/AssetLib/Obj/ObjFileParser.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/code/AssetLib/Obj/ObjFileParser.cpp b/code/AssetLib/Obj/ObjFileParser.cpp index a825b96ca..ecf51240b 100644 --- a/code/AssetLib/Obj/ObjFileParser.cpp +++ b/code/AssetLib/Obj/ObjFileParser.cpp @@ -253,7 +253,6 @@ static bool isDataDefinitionEnd(const char *tmp) { if (*tmp == '\\') { tmp++; if (IsLineEnd(*tmp)) { - tmp++; return true; } } From 6acaaee80f51fa43e62f55a8728bdfb26d364be2 Mon Sep 17 00:00:00 2001 From: Kota Iguchi Date: Sat, 20 Jun 2020 15:27:28 +0900 Subject: [PATCH 097/115] Check invalid vertex id for bone weight --- code/PostProcessing/LimitBoneWeightsProcess.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/PostProcessing/LimitBoneWeightsProcess.cpp b/code/PostProcessing/LimitBoneWeightsProcess.cpp index 5b8934159..b4f0b48d8 100644 --- a/code/PostProcessing/LimitBoneWeightsProcess.cpp +++ b/code/PostProcessing/LimitBoneWeightsProcess.cpp @@ -114,6 +114,10 @@ void LimitBoneWeightsProcess::ProcessMesh(aiMesh* pMesh) for (unsigned int w = 0; w < bone->mNumWeights; ++w) { const aiVertexWeight& vw = bone->mWeights[w]; + + if (vertexWeights.size() <= vw.mVertexId) + continue; + vertexWeights[vw.mVertexId].push_back(Weight(b, vw.mWeight)); maxVertexWeights = std::max(maxVertexWeights, vertexWeights[vw.mVertexId].size()); } From 6397bfbf904415d75b55c7389cb66a9958359a04 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sun, 21 Jun 2020 12:03:38 +0200 Subject: [PATCH 098/115] replace NULL by nullptr on loadFile. --- code/AMF/AMFImporter.cpp | 4 +++- code/BVH/BVHLoader.cpp | 10 ++++++---- code/CSM/CSMLoader.cpp | 2 +- code/HMP/HMPLoader.cpp | 5 +++-- code/Irr/IRRMeshLoader.cpp | 5 +++-- code/LWS/LWSLoader.cpp | 2 +- code/MD2/MD2Loader.cpp | 11 ++++++----- code/MD3/MD3Loader.cpp | 5 +++-- code/MD5/MD5Loader.cpp | 11 +++++------ code/MDL/HalfLife/HL1MDLLoader.h | 6 ++++-- code/Raw/RawLoader.cpp | 2 +- code/X/XFileImporter.cpp | 2 +- include/assimp/irrXMLWrapper.h | 2 +- 13 files changed, 38 insertions(+), 29 deletions(-) diff --git a/code/AMF/AMFImporter.cpp b/code/AMF/AMFImporter.cpp index df4324d4d..d93ca54cf 100644 --- a/code/AMF/AMFImporter.cpp +++ b/code/AMF/AMFImporter.cpp @@ -407,7 +407,9 @@ void AMFImporter::ParseFile(const std::string& pFile, IOSystem* pIOHandler) std::unique_ptr file(pIOHandler->Open(pFile, "rb")); // Check whether we can read from the file - if(file.get() == NULL) throw DeadlyImportError("Failed to open AMF file " + pFile + "."); + if (file.get() == nullptr) { + throw DeadlyImportError("Failed to open AMF file " + pFile + "."); + } // generate a XML reader for it std::unique_ptr mIOWrapper(new CIrrXML_IOStreamReader(file.get())); diff --git a/code/BVH/BVHLoader.cpp b/code/BVH/BVHLoader.cpp index 1110754c2..5d335d233 100644 --- a/code/BVH/BVHLoader.cpp +++ b/code/BVH/BVHLoader.cpp @@ -124,12 +124,14 @@ void BVHLoader::InternReadFile( const std::string& pFile, aiScene* pScene, IOSys // read file into memory std::unique_ptr file( pIOHandler->Open( pFile)); - if( file.get() == NULL) - throw DeadlyImportError( "Failed to open file " + pFile + "."); + if (file.get() == nullptr) { + throw DeadlyImportError("Failed to open file " + pFile + "."); + } size_t fileSize = file->FileSize(); - if( fileSize == 0) - throw DeadlyImportError( "File is too small."); + if (fileSize == 0) { + throw DeadlyImportError("File is too small."); + } mBuffer.resize( fileSize); file->Read( &mBuffer.front(), 1, fileSize); diff --git a/code/CSM/CSMLoader.cpp b/code/CSM/CSMLoader.cpp index fbabea12e..47563feb1 100644 --- a/code/CSM/CSMLoader.cpp +++ b/code/CSM/CSMLoader.cpp @@ -127,7 +127,7 @@ void CSMImporter::InternReadFile( const std::string& pFile, std::unique_ptr file( pIOHandler->Open( pFile, "rb")); // Check whether we can read from the file - if( file.get() == NULL) { + if( file.get() == nullptr) { throw DeadlyImportError( "Failed to open CSM file " + pFile + "."); } diff --git a/code/HMP/HMPLoader.cpp b/code/HMP/HMPLoader.cpp index 0dea09ee0..45f45d022 100644 --- a/code/HMP/HMPLoader.cpp +++ b/code/HMP/HMPLoader.cpp @@ -122,8 +122,9 @@ void HMPImporter::InternReadFile( const std::string& pFile, std::unique_ptr file(mIOHandler->Open(pFile)); // Check whether we can read from the file - if( file.get() == nullptr) - throw DeadlyImportError( "Failed to open HMP file " + pFile + "."); + if (file.get() == nullptr) { + throw DeadlyImportError("Failed to open HMP file " + pFile + "."); + } // Check whether the HMP file is large enough to contain // at least the file header diff --git a/code/Irr/IRRMeshLoader.cpp b/code/Irr/IRRMeshLoader.cpp index 13db70e91..d07ff87ea 100644 --- a/code/Irr/IRRMeshLoader.cpp +++ b/code/Irr/IRRMeshLoader.cpp @@ -139,8 +139,9 @@ void IRRMeshImporter::InternReadFile( const std::string& pFile, std::unique_ptr file( pIOHandler->Open( pFile)); // Check whether we can read from the file - if( file.get() == NULL) - throw DeadlyImportError( "Failed to open IRRMESH file " + pFile + ""); + if (file.get() == nullptr) { + throw DeadlyImportError("Failed to open IRRMESH file " + pFile + "."); + } // Construct the irrXML parser CIrrXML_IOStreamReader st(file.get()); diff --git a/code/LWS/LWSLoader.cpp b/code/LWS/LWSLoader.cpp index 952c3ccbc..d02d24ea3 100644 --- a/code/LWS/LWSLoader.cpp +++ b/code/LWS/LWSLoader.cpp @@ -501,7 +501,7 @@ void LWSImporter::InternReadFile(const std::string &pFile, aiScene *pScene, std::unique_ptr file(pIOHandler->Open(pFile, "rb")); // Check whether we can read from the file - if (file.get() == NULL) { + if (file.get() == nullptr) { throw DeadlyImportError("Failed to open LWS file " + pFile + "."); } diff --git a/code/MD2/MD2Loader.cpp b/code/MD2/MD2Loader.cpp index 473ab99bc..abc5f06ff 100644 --- a/code/MD2/MD2Loader.cpp +++ b/code/MD2/MD2Loader.cpp @@ -221,20 +221,21 @@ void MD2Importer::InternReadFile( const std::string& pFile, std::unique_ptr file( pIOHandler->Open( pFile)); // Check whether we can read from the file - if( file.get() == NULL) - throw DeadlyImportError( "Failed to open MD2 file " + pFile + ""); + if (file.get() == nullptr) { + throw DeadlyImportError("Failed to open MD2 file " + pFile + ""); + } // check whether the md3 file is large enough to contain // at least the file header fileSize = (unsigned int)file->FileSize(); - if( fileSize < sizeof(MD2::Header)) - throw DeadlyImportError( "MD2 File is too small"); + if (fileSize < sizeof(MD2::Header)) { + throw DeadlyImportError("MD2 File is too small"); + } std::vector mBuffer2(fileSize); file->Read(&mBuffer2[0], 1, fileSize); mBuffer = &mBuffer2[0]; - m_pcHeader = (BE_NCONST MD2::Header*)mBuffer; #ifdef AI_BUILD_BIG_ENDIAN diff --git a/code/MD3/MD3Loader.cpp b/code/MD3/MD3Loader.cpp index 2051ecdda..28799c0fc 100644 --- a/code/MD3/MD3Loader.cpp +++ b/code/MD3/MD3Loader.cpp @@ -747,8 +747,9 @@ void MD3Importer::InternReadFile( const std::string& pFile, aiScene* pScene, IOS std::unique_ptr file( pIOHandler->Open( pFile)); // Check whether we can read from the file - if( file.get() == NULL) - throw DeadlyImportError( "Failed to open MD3 file " + pFile + "."); + if (file.get() == nullptr) { + throw DeadlyImportError("Failed to open MD3 file " + pFile + "."); + } // Check whether the md3 file is large enough to contain the header fileSize = (unsigned int)file->FileSize(); diff --git a/code/MD5/MD5Loader.cpp b/code/MD5/MD5Loader.cpp index d428873df..2aa07df18 100644 --- a/code/MD5/MD5Loader.cpp +++ b/code/MD5/MD5Loader.cpp @@ -332,13 +332,12 @@ void MD5Importer::AttachChilds_Anim(int iParentID, aiNode *piParent, AnimBoneLis // ------------------------------------------------------------------------------------------------ // Load a MD5MESH file void MD5Importer::LoadMD5MeshFile() { - std::string pFile = mFile + "md5mesh"; - std::unique_ptr file(mIOHandler->Open(pFile, "rb")); + std::string filename = mFile + "md5mesh"; + std::unique_ptr file(mIOHandler->Open(filename, "rb")); // Check whether we can read from the file if (file.get() == nullptr || !file->FileSize()) { - ASSIMP_LOG_WARN("Failed to access MD5MESH file: " + pFile); - return; + throw DeadlyImportError("Failed to open MD5 file " + filename + "."); } bHadMD5Mesh = true; LoadFileIntoMemory(file.get()); @@ -552,9 +551,9 @@ void MD5Importer::LoadMD5AnimFile() { // Check whether we can read from the file if (!file.get() || !file->FileSize()) { - ASSIMP_LOG_WARN("Failed to read MD5ANIM file: " + pFile); - return; + throw DeadlyImportError("Failed to open MD3 file " + file + "."); } + LoadFileIntoMemory(file.get()); // parse the basic file structure diff --git a/code/MDL/HalfLife/HL1MDLLoader.h b/code/MDL/HalfLife/HL1MDLLoader.h index c4293259c..2891ddb1e 100644 --- a/code/MDL/HalfLife/HL1MDLLoader.h +++ b/code/MDL/HalfLife/HL1MDLLoader.h @@ -222,12 +222,14 @@ void HL1MDLLoader::load_file_into_buffer(const std::string &file_path, unsigned std::unique_ptr file(io_->Open(file_path)); - if (file.get() == NULL) + if (file.get() == nullptr) { throw DeadlyImportError("Failed to open MDL file " + DefaultIOSystem::fileName(file_path) + "."); + } const size_t file_size = file->FileSize(); - if (file_size < sizeof(MDLFileHeader)) + if (file_size < sizeof(MDLFileHeader)) { throw DeadlyImportError("MDL file is too small."); + } buffer = new unsigned char[1 + file_size]; file->Read((void *)buffer, 1, file_size); diff --git a/code/Raw/RawLoader.cpp b/code/Raw/RawLoader.cpp index 092323cc0..bb58026f0 100644 --- a/code/Raw/RawLoader.cpp +++ b/code/Raw/RawLoader.cpp @@ -104,7 +104,7 @@ void RAWImporter::InternReadFile( const std::string& pFile, std::unique_ptr file( pIOHandler->Open( pFile, "rb")); // Check whether we can read from the file - if( file.get() == NULL) { + if( file.get() == nullptr) { throw DeadlyImportError( "Failed to open RAW file " + pFile + "."); } diff --git a/code/X/XFileImporter.cpp b/code/X/XFileImporter.cpp index 846023b93..0b256b0bc 100644 --- a/code/X/XFileImporter.cpp +++ b/code/X/XFileImporter.cpp @@ -113,7 +113,7 @@ const aiImporterDesc* XFileImporter::GetInfo () const { void XFileImporter::InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler) { // read file into memory std::unique_ptr file( pIOHandler->Open( pFile)); - if ( file.get() == NULL ) { + if ( file.get() == nullptr ) { throw DeadlyImportError( "Failed to open file " + pFile + "." ); } diff --git a/include/assimp/irrXMLWrapper.h b/include/assimp/irrXMLWrapper.h index 65a7be298..52c174791 100644 --- a/include/assimp/irrXMLWrapper.h +++ b/include/assimp/irrXMLWrapper.h @@ -63,7 +63,7 @@ namespace Assimp { * @code * // open the file * std::unique_ptr file( pIOHandler->Open( pFile)); - * if( file.get() == NULL) { + * if( file.get() == nullptr ) { * throw DeadlyImportError( "Failed to open file " + pFile + "."); * } * From 20062865286d221b79e42b4eb3182d5ee7f91bd7 Mon Sep 17 00:00:00 2001 From: Filip Lundgren <45687559+ifiddynine@users.noreply.github.com> Date: Mon, 22 Jun 2020 23:14:16 +0200 Subject: [PATCH 099/115] Fix Maya PBR & stingray texture detection --- code/AssetLib/FBX/FBXConverter.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/code/AssetLib/FBX/FBXConverter.cpp b/code/AssetLib/FBX/FBXConverter.cpp index 261567e48..0a13ff766 100644 --- a/code/AssetLib/FBX/FBXConverter.cpp +++ b/code/AssetLib/FBX/FBXConverter.cpp @@ -2000,19 +2000,19 @@ void FBXConverter::SetTextureProperties(aiMaterial *out_mat, const TextureMap &_ TrySetTextureProperties(out_mat, _textures, "Maya|ReflectionMapTexture", aiTextureType_REFLECTION, mesh); // Maya PBR - TrySetTextureProperties(out_mat, _textures, "Maya|baseColor|file", aiTextureType_BASE_COLOR, mesh); - TrySetTextureProperties(out_mat, _textures, "Maya|normalCamera|file", aiTextureType_NORMAL_CAMERA, mesh); - TrySetTextureProperties(out_mat, _textures, "Maya|emissionColor|file", aiTextureType_EMISSION_COLOR, mesh); - TrySetTextureProperties(out_mat, _textures, "Maya|metalness|file", aiTextureType_METALNESS, mesh); - TrySetTextureProperties(out_mat, _textures, "Maya|diffuseRoughness|file", aiTextureType_DIFFUSE_ROUGHNESS, mesh); + TrySetTextureProperties(out_mat, _textures, "Maya|baseColor", aiTextureType_BASE_COLOR, mesh); + TrySetTextureProperties(out_mat, _textures, "Maya|normalCamera", aiTextureType_NORMAL_CAMERA, mesh); + TrySetTextureProperties(out_mat, _textures, "Maya|emissionColor", aiTextureType_EMISSION_COLOR, mesh); + TrySetTextureProperties(out_mat, _textures, "Maya|metalness", aiTextureType_METALNESS, mesh); + TrySetTextureProperties(out_mat, _textures, "Maya|diffuseRoughness", aiTextureType_DIFFUSE_ROUGHNESS, mesh); // Maya stingray - TrySetTextureProperties(out_mat, _textures, "Maya|TEX_color_map|file", aiTextureType_BASE_COLOR, mesh); - TrySetTextureProperties(out_mat, _textures, "Maya|TEX_normal_map|file", aiTextureType_NORMAL_CAMERA, mesh); - TrySetTextureProperties(out_mat, _textures, "Maya|TEX_emissive_map|file", aiTextureType_EMISSION_COLOR, mesh); - TrySetTextureProperties(out_mat, _textures, "Maya|TEX_metallic_map|file", aiTextureType_METALNESS, mesh); - TrySetTextureProperties(out_mat, _textures, "Maya|TEX_roughness_map|file", aiTextureType_DIFFUSE_ROUGHNESS, mesh); - TrySetTextureProperties(out_mat, _textures, "Maya|TEX_ao_map|file", aiTextureType_AMBIENT_OCCLUSION, mesh); + TrySetTextureProperties(out_mat, _textures, "Maya|TEX_color_map", aiTextureType_BASE_COLOR, mesh); + TrySetTextureProperties(out_mat, _textures, "Maya|TEX_normal_map", aiTextureType_NORMAL_CAMERA, mesh); + TrySetTextureProperties(out_mat, _textures, "Maya|TEX_emissive_map", aiTextureType_EMISSION_COLOR, mesh); + TrySetTextureProperties(out_mat, _textures, "Maya|TEX_metallic_map", aiTextureType_METALNESS, mesh); + TrySetTextureProperties(out_mat, _textures, "Maya|TEX_roughness_map", aiTextureType_DIFFUSE_ROUGHNESS, mesh); + TrySetTextureProperties(out_mat, _textures, "Maya|TEX_ao_map", aiTextureType_AMBIENT_OCCLUSION, mesh); // 3DSMax PBR TrySetTextureProperties(out_mat, _textures, "3dsMax|Parameters|base_color_map", aiTextureType_BASE_COLOR, mesh); From 5717ea466f04584b157598b568c98615bea6f71f Mon Sep 17 00:00:00 2001 From: Ryan Styrczula Date: Mon, 22 Jun 2020 17:19:26 -0400 Subject: [PATCH 100/115] FindInvalidDataProcess: Mark removed meshes as "out" There's a code path where an input scene only has a single mesh. In this case, if ProcessMesh returns 2, we delete the mesh and move on with the postprocessing. UpdateMeshReferences is not called and so the deleted mesh is left dangling in nodes. In a later step (SplitMesh in my testing), it then tries to deference a null pointer and we explode. With `out = true`, we can now hit the DeadlyImportError instead of a segfault. --- code/PostProcessing/FindInvalidDataProcess.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/code/PostProcessing/FindInvalidDataProcess.cpp b/code/PostProcessing/FindInvalidDataProcess.cpp index 3ad2446b3..42c5a4ca9 100644 --- a/code/PostProcessing/FindInvalidDataProcess.cpp +++ b/code/PostProcessing/FindInvalidDataProcess.cpp @@ -127,6 +127,7 @@ void FindInvalidDataProcess::Execute(aiScene *pScene) { pScene->mMeshes[a] = NULL; meshMapping[a] = UINT_MAX; + out = true; continue; } From 9188f56839a29f2ef526e47c492681d0338cec72 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Tue, 23 Jun 2020 11:55:51 +0100 Subject: [PATCH 101/115] Allow assert handling to be replaced. --- code/CMakeLists.txt | 1 + code/Common/AssertHandler.cpp | 72 +++++++++++++++++ code/Common/AssertHandler.h | 75 ++++++++++++++++++ include/assimp/ai_assert.h | 16 ++-- test/CMakeLists.txt | 1 + test/unit/Common/utAssertHandler.cpp | 111 +++++++++++++++++++++++++++ 6 files changed, 269 insertions(+), 7 deletions(-) create mode 100644 code/Common/AssertHandler.cpp create mode 100644 code/Common/AssertHandler.h create mode 100644 test/unit/Common/utAssertHandler.cpp diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index 000ebad6c..9f8f519d9 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -199,6 +199,7 @@ SET( Common_SRCS Common/simd.h Common/simd.cpp Common/material.cpp + Common/AssertHandler.cpp ) SOURCE_GROUP(Common FILES ${Common_SRCS}) diff --git a/code/Common/AssertHandler.cpp b/code/Common/AssertHandler.cpp new file mode 100644 index 000000000..63b64f828 --- /dev/null +++ b/code/Common/AssertHandler.cpp @@ -0,0 +1,72 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library (assimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2020, 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 AssertHandler.cpp + * @brief Implementation of assert handling logic. + */ + +#include "AssertHandler.h" + +#include +#include + +void Assimp::defaultAiAssertHandler(const char* failedExpression, const char* file, int line) +{ + std::cerr << "ai_assert failure in " << file << "(" << line << "): " << failedExpression << std::endl; + std::abort(); +} + +namespace +{ + Assimp::AiAssertHandler s_handler = Assimp::defaultAiAssertHandler; +} + +void Assimp::setAiAssertHandler(AiAssertHandler handler) +{ + s_handler = handler; +} + +void Assimp::aiAssertViolation(const char* failedExpression, const char* file, int line) +{ + s_handler(failedExpression, file, line); +} diff --git a/code/Common/AssertHandler.h b/code/Common/AssertHandler.h new file mode 100644 index 000000000..2515f0bf2 --- /dev/null +++ b/code/Common/AssertHandler.h @@ -0,0 +1,75 @@ +/* +Open Asset Import Library (assimp) +---------------------------------------------------------------------- + +Copyright (c) 2006-2020, 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 Provides facilities to replace the default assert handler. */ + +#ifndef INCLUDED_AI_ASSERTHANDLER_H +#define INCLUDED_AI_ASSERTHANDLER_H + +#include +#include + +namespace Assimp +{ + // --------------------------------------------------------------------------- + /** Signature of functions which handle assert violations. + */ + using AiAssertHandler = void (*)(const char* failedExpression, const char* file, int line); + + // --------------------------------------------------------------------------- + /** Set the assert handler. + */ + ASSIMP_API void setAiAssertHandler(AiAssertHandler handler); + + // --------------------------------------------------------------------------- + /** The assert handler which is set by default. + * + * This issues a message to stderr and calls abort. + */ + ASSIMP_API void defaultAiAssertHandler(const char* failedExpression, const char* file, int line); + + // --------------------------------------------------------------------------- + /** Dispatches an assert violation to the assert handler. + */ + ASSIMP_API void aiAssertViolation(const char* failedExpression, const char* file, int line); +} // end of namespace Assimp + +#endif // INCLUDED_AI_ASSERTHANDLER_H \ No newline at end of file diff --git a/include/assimp/ai_assert.h b/include/assimp/ai_assert.h index f018163bf..6045a9801 100644 --- a/include/assimp/ai_assert.h +++ b/include/assimp/ai_assert.h @@ -42,14 +42,16 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_ASSERT_H_INC #define AI_ASSERT_H_INC -#ifdef __GNUC__ -# pragma GCC system_header -#endif +#if defined(ASSIMP_BUILD_DEBUG) || defined(ASSIMP_BUILD_WITH_ASSERTS) + +namespace Assimp +{ + void aiAssertViolation(const char* failedExpression, const char* file, int line); +} + +# define ai_assert(expression) (void)((!!(expression)) || (Assimp::aiAssertViolation(#expression, __FILE__, __LINE__), 0)) +# define ai_assert_entry() ai_assert(false) -#ifdef ASSIMP_BUILD_DEBUG -# include -# define ai_assert(expression) assert( expression ) -# define ai_assert_entry() assert( false ) #else # define ai_assert(expression) # define ai_assert_entry() diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index a5f8086e9..8e1746ce2 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -87,6 +87,7 @@ SET( COMMON unit/Common/uiScene.cpp unit/Common/utLineSplitter.cpp unit/Common/utSpatialSort.cpp + unit/Common/utAssertHandler.cpp ) SET( IMPORTERS diff --git a/test/unit/Common/utAssertHandler.cpp b/test/unit/Common/utAssertHandler.cpp new file mode 100644 index 000000000..0ac4c90af --- /dev/null +++ b/test/unit/Common/utAssertHandler.cpp @@ -0,0 +1,111 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library (assimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2020, 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" + +/// Ensure this test has asserts on, even if the build type doesn't have asserts by default. +#if !defined(ASSIMP_BUILD_WITH_ASSERTS) +#define ASSIMP_BUILD_WITH_ASSERTS +#endif + +#include +#include + +namespace +{ + /// An exception which is thrown by the testAssertHandler + struct TestAssertException : std::exception + { + TestAssertException(const char* failedExpression, const char* file, int line) + : std::exception("Test Assert Exception") + , m_failedExpression(failedExpression) + , m_file(file) + , m_line(line) + { + } + + std::string m_failedExpression; + std::string m_file; + int m_line; + }; + + /// Swap the default handler, which aborts, by one which throws. + void testAssertHandler(const char* failedExpression, const char* file, int line) + { + throw TestAssertException(failedExpression, file, line); + } + + /// Ensure that the default assert handler is restored after the test is finished. + struct ReplaceHandlerScope + { + ReplaceHandlerScope() + { + Assimp::setAiAssertHandler(testAssertHandler); + } + + ~ReplaceHandlerScope() + { + Assimp::setAiAssertHandler(Assimp::defaultAiAssertHandler); + } + }; +} + +TEST(utAssertHandler, replaceWithThrow) +{ + ReplaceHandlerScope scope; + + try + { + ai_assert((2 + 2 == 5) && "Sometimes people put messages here"); + EXPECT_TRUE(false); + } + catch(const TestAssertException& e) + { + EXPECT_STREQ(e.m_failedExpression.c_str(), "(2 + 2 == 5) && \"Sometimes people put messages here\""); + EXPECT_STREQ(e.m_file.c_str(), __FILE__); + EXPECT_GT(e.m_line, 0); + EXPECT_LT(e.m_line, __LINE__); + } + catch(...) + { + EXPECT_TRUE(false); + } +} From 297764335297053b86b273ad922d4459dda3e229 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Tue, 23 Jun 2020 12:08:06 +0100 Subject: [PATCH 102/115] Fix. --- test/unit/Common/utAssertHandler.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/unit/Common/utAssertHandler.cpp b/test/unit/Common/utAssertHandler.cpp index 0ac4c90af..d04162bdc 100644 --- a/test/unit/Common/utAssertHandler.cpp +++ b/test/unit/Common/utAssertHandler.cpp @@ -52,11 +52,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. namespace { /// An exception which is thrown by the testAssertHandler - struct TestAssertException : std::exception + struct TestAssertException { TestAssertException(const char* failedExpression, const char* file, int line) - : std::exception("Test Assert Exception") - , m_failedExpression(failedExpression) + : m_failedExpression(failedExpression) , m_file(file) , m_line(line) { From ae05dbb2527da54e791e3a115975c3d06504093d Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Tue, 23 Jun 2020 21:11:18 +0200 Subject: [PATCH 103/115] define CheckValidFacesIndices also in release builds. --- code/AssetLib/glTF/glTFImporter.cpp | 403 +++++++++++++--------------- 1 file changed, 186 insertions(+), 217 deletions(-) diff --git a/code/AssetLib/glTF/glTFImporter.cpp b/code/AssetLib/glTF/glTFImporter.cpp index 33288313a..b4ef9b06f 100644 --- a/code/AssetLib/glTF/glTFImporter.cpp +++ b/code/AssetLib/glTF/glTFImporter.cpp @@ -48,12 +48,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include -#include -#include #include -#include -#include #include +#include +#include +#include +#include #include @@ -69,8 +69,7 @@ static const aiImporterDesc desc = { "", "", "", - aiImporterFlags_SupportTextFlavour | aiImporterFlags_SupportBinaryFlavour | aiImporterFlags_SupportCompressedFlavour - | aiImporterFlags_LimitedSupport | aiImporterFlags_Experimental, + aiImporterFlags_SupportTextFlavour | aiImporterFlags_SupportBinaryFlavour | aiImporterFlags_SupportCompressedFlavour | aiImporterFlags_LimitedSupport | aiImporterFlags_Experimental, 0, 0, 0, @@ -78,11 +77,8 @@ static const aiImporterDesc desc = { "gltf glb" }; -glTFImporter::glTFImporter() -: BaseImporter() -, meshOffsets() -, embeddedTexIdxs() -, mScene( nullptr ) { +glTFImporter::glTFImporter() : + BaseImporter(), meshOffsets(), embeddedTexIdxs(), mScene(nullptr) { // empty } @@ -90,11 +86,11 @@ glTFImporter::~glTFImporter() { // empty } -const aiImporterDesc* glTFImporter::GetInfo() const { +const aiImporterDesc *glTFImporter::GetInfo() const { return &desc; } -bool glTFImporter::CanRead(const std::string& pFile, IOSystem* pIOHandler, bool /* checkSig */) const { +bool glTFImporter::CanRead(const std::string &pFile, IOSystem *pIOHandler, bool /* checkSig */) const { const std::string &extension = GetExtension(pFile); if (extension != "gltf" && extension != "glb") { @@ -115,9 +111,8 @@ bool glTFImporter::CanRead(const std::string& pFile, IOSystem* pIOHandler, bool return false; } -inline -void SetMaterialColorProperty(std::vector& embeddedTexIdxs, Asset& /*r*/, glTF::TexProperty prop, aiMaterial* mat, - aiTextureType texType, const char* pKey, unsigned int type, unsigned int idx) { +inline void SetMaterialColorProperty(std::vector &embeddedTexIdxs, Asset & /*r*/, glTF::TexProperty prop, aiMaterial *mat, + aiTextureType texType, const char *pKey, unsigned int type, unsigned int idx) { if (prop.texture) { if (prop.texture->source) { aiString uri(prop.texture->source->uri); @@ -138,22 +133,22 @@ void SetMaterialColorProperty(std::vector& embeddedTexIdxs, Asset& /*r*/, g } } -void glTFImporter::ImportMaterials(glTF::Asset& r) { +void glTFImporter::ImportMaterials(glTF::Asset &r) { mScene->mNumMaterials = unsigned(r.materials.Size()); - mScene->mMaterials = new aiMaterial*[mScene->mNumMaterials]; + mScene->mMaterials = new aiMaterial *[mScene->mNumMaterials]; for (unsigned int i = 0; i < mScene->mNumMaterials; ++i) { - aiMaterial* aimat = mScene->mMaterials[i] = new aiMaterial(); + aiMaterial *aimat = mScene->mMaterials[i] = new aiMaterial(); - Material& mat = r.materials[i]; + Material &mat = r.materials[i]; /*if (!mat.name.empty())*/ { aiString str(mat.id /*mat.name*/); aimat->AddProperty(&str, AI_MATKEY_NAME); } - SetMaterialColorProperty(embeddedTexIdxs, r, mat.ambient, aimat, aiTextureType_AMBIENT, AI_MATKEY_COLOR_AMBIENT ); - SetMaterialColorProperty(embeddedTexIdxs, r, mat.diffuse, aimat, aiTextureType_DIFFUSE, AI_MATKEY_COLOR_DIFFUSE ); + SetMaterialColorProperty(embeddedTexIdxs, r, mat.ambient, aimat, aiTextureType_AMBIENT, AI_MATKEY_COLOR_AMBIENT); + SetMaterialColorProperty(embeddedTexIdxs, r, mat.diffuse, aimat, aiTextureType_DIFFUSE, AI_MATKEY_COLOR_DIFFUSE); SetMaterialColorProperty(embeddedTexIdxs, r, mat.specular, aimat, aiTextureType_SPECULAR, AI_MATKEY_COLOR_SPECULAR); SetMaterialColorProperty(embeddedTexIdxs, r, mat.emission, aimat, aiTextureType_EMISSIVE, AI_MATKEY_COLOR_EMISSIVE); @@ -172,29 +167,25 @@ void glTFImporter::ImportMaterials(glTF::Asset& r) { mScene->mNumMaterials = 1; // Delete the array of length zero created above. delete[] mScene->mMaterials; - mScene->mMaterials = new aiMaterial*[1]; + mScene->mMaterials = new aiMaterial *[1]; mScene->mMaterials[0] = new aiMaterial(); } } - -static inline void SetFace(aiFace& face, int a) -{ +static inline void SetFace(aiFace &face, int a) { face.mNumIndices = 1; face.mIndices = new unsigned int[1]; face.mIndices[0] = a; } -static inline void SetFace(aiFace& face, int a, int b) -{ +static inline void SetFace(aiFace &face, int a, int b) { face.mNumIndices = 2; face.mIndices = new unsigned int[2]; face.mIndices[0] = a; face.mIndices[1] = b; } -static inline void SetFace(aiFace& face, int a, int b, int c) -{ +static inline void SetFace(aiFace &face, int a, int b, int c) { face.mNumIndices = 3; face.mIndices = new unsigned int[3]; face.mIndices[0] = a; @@ -202,9 +193,7 @@ static inline void SetFace(aiFace& face, int a, int b, int c) face.mIndices[2] = c; } -#ifdef ASSIMP_BUILD_DEBUG -static inline bool CheckValidFacesIndices(aiFace* faces, unsigned nFaces, unsigned nVerts) -{ +static inline bool CheckValidFacesIndices(aiFace *faces, unsigned nFaces, unsigned nVerts) { for (unsigned i = 0; i < nFaces; ++i) { for (unsigned j = 0; j < faces[i].mNumIndices; ++j) { unsigned idx = faces[i].mIndices[j]; @@ -214,105 +203,98 @@ static inline bool CheckValidFacesIndices(aiFace* faces, unsigned nFaces, unsign } return true; } -#endif // ASSIMP_BUILD_DEBUG -void glTFImporter::ImportMeshes(glTF::Asset& r) -{ - std::vector meshes; +void glTFImporter::ImportMeshes(glTF::Asset &r) { + std::vector meshes; unsigned int k = 0; meshOffsets.clear(); for (unsigned int m = 0; m < r.meshes.Size(); ++m) { - Mesh& mesh = r.meshes[m]; + Mesh &mesh = r.meshes[m]; - // Check if mesh extensions is used - if(mesh.Extension.size() > 0) - { - for(Mesh::SExtension* cur_ext : mesh.Extension) - { + // Check if mesh extensions is used + if (mesh.Extension.size() > 0) { + for (Mesh::SExtension *cur_ext : mesh.Extension) { #ifdef ASSIMP_IMPORTER_GLTF_USE_OPEN3DGC - if(cur_ext->Type == Mesh::SExtension::EType::Compression_Open3DGC) - { - // Limitations for meshes when using Open3DGC-compression. - // It's a current limitation of sp... Specification have not this part still - about mesh compression. Why only one primitive? - // Because glTF is very flexibly. But in fact it ugly flexible. Every primitive can has own set of accessors and accessors can - // point to a-a-a-a-any part of buffer (through bufferview of course) and even to another buffer. We know that "Open3DGC-compression" - // is applicable only to part of buffer. As we can't guaranty continuity of the data for decoder, we will limit quantity of primitives. - // Yes indices, coordinates etc. still can br stored in different buffers, but with current specification it's a exporter problem. - // Also primitive can has only one of "POSITION", "NORMAL" and less then "AI_MAX_NUMBER_OF_TEXTURECOORDS" of "TEXCOORD". All accessor - // of primitive must point to one continuous region of the buffer. - if(mesh.primitives.size() > 2) throw DeadlyImportError("GLTF: When using Open3DGC compression then only one primitive per mesh are allowed."); + if (cur_ext->Type == Mesh::SExtension::EType::Compression_Open3DGC) { + // Limitations for meshes when using Open3DGC-compression. + // It's a current limitation of sp... Specification have not this part still - about mesh compression. Why only one primitive? + // Because glTF is very flexibly. But in fact it ugly flexible. Every primitive can has own set of accessors and accessors can + // point to a-a-a-a-any part of buffer (through bufferview of course) and even to another buffer. We know that "Open3DGC-compression" + // is applicable only to part of buffer. As we can't guaranty continuity of the data for decoder, we will limit quantity of primitives. + // Yes indices, coordinates etc. still can br stored in different buffers, but with current specification it's a exporter problem. + // Also primitive can has only one of "POSITION", "NORMAL" and less then "AI_MAX_NUMBER_OF_TEXTURECOORDS" of "TEXCOORD". All accessor + // of primitive must point to one continuous region of the buffer. + if (mesh.primitives.size() > 2) throw DeadlyImportError("GLTF: When using Open3DGC compression then only one primitive per mesh are allowed."); - Mesh::SCompression_Open3DGC* o3dgc_ext = (Mesh::SCompression_Open3DGC*)cur_ext; - Ref buf = r.buffers.Get(o3dgc_ext->Buffer); + Mesh::SCompression_Open3DGC *o3dgc_ext = (Mesh::SCompression_Open3DGC *)cur_ext; + Ref buf = r.buffers.Get(o3dgc_ext->Buffer); - buf->EncodedRegion_SetCurrent(mesh.id); - } - else + buf->EncodedRegion_SetCurrent(mesh.id); + } else #endif - { - throw DeadlyImportError("GLTF: Can not import mesh: unknown mesh extension (code: \"" + to_string(cur_ext->Type) + - "\"), only Open3DGC is supported."); - } - } - }// if(mesh.Extension.size() > 0) + { + throw DeadlyImportError("GLTF: Can not import mesh: unknown mesh extension (code: \"" + to_string(cur_ext->Type) + + "\"), only Open3DGC is supported."); + } + } + } // if(mesh.Extension.size() > 0) - meshOffsets.push_back(k); + meshOffsets.push_back(k); k += unsigned(mesh.primitives.size()); for (unsigned int p = 0; p < mesh.primitives.size(); ++p) { - Mesh::Primitive& prim = mesh.primitives[p]; + Mesh::Primitive &prim = mesh.primitives[p]; - aiMesh* aim = new aiMesh(); + aiMesh *aim = new aiMesh(); meshes.push_back(aim); aim->mName = mesh.id; if (mesh.primitives.size() > 1) { - ai_uint32& len = aim->mName.length; + ai_uint32 &len = aim->mName.length; aim->mName.data[len] = '-'; len += 1 + ASSIMP_itoa10(aim->mName.data + len + 1, unsigned(MAXLEN - len - 1), p); } switch (prim.mode) { - case PrimitiveMode_POINTS: - aim->mPrimitiveTypes |= aiPrimitiveType_POINT; - break; + case PrimitiveMode_POINTS: + aim->mPrimitiveTypes |= aiPrimitiveType_POINT; + break; - case PrimitiveMode_LINES: - case PrimitiveMode_LINE_LOOP: - case PrimitiveMode_LINE_STRIP: - aim->mPrimitiveTypes |= aiPrimitiveType_LINE; - break; + case PrimitiveMode_LINES: + case PrimitiveMode_LINE_LOOP: + case PrimitiveMode_LINE_STRIP: + aim->mPrimitiveTypes |= aiPrimitiveType_LINE; + break; - case PrimitiveMode_TRIANGLES: - case PrimitiveMode_TRIANGLE_STRIP: - case PrimitiveMode_TRIANGLE_FAN: - aim->mPrimitiveTypes |= aiPrimitiveType_TRIANGLE; - break; + case PrimitiveMode_TRIANGLES: + case PrimitiveMode_TRIANGLE_STRIP: + case PrimitiveMode_TRIANGLE_FAN: + aim->mPrimitiveTypes |= aiPrimitiveType_TRIANGLE; + break; } - Mesh::Primitive::Attributes& attr = prim.attributes; + Mesh::Primitive::Attributes &attr = prim.attributes; - if (attr.position.size() > 0 && attr.position[0]) { + if (attr.position.size() > 0 && attr.position[0]) { aim->mNumVertices = attr.position[0]->count; attr.position[0]->ExtractData(aim->mVertices); - } + } - if (attr.normal.size() > 0 && attr.normal[0]) attr.normal[0]->ExtractData(aim->mNormals); + if (attr.normal.size() > 0 && attr.normal[0]) attr.normal[0]->ExtractData(aim->mNormals); for (size_t tc = 0; tc < attr.texcoord.size() && tc < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++tc) { attr.texcoord[tc]->ExtractData(aim->mTextureCoords[tc]); aim->mNumUVComponents[tc] = attr.texcoord[tc]->GetNumComponents(); - aiVector3D* values = aim->mTextureCoords[tc]; + aiVector3D *values = aim->mTextureCoords[tc]; for (unsigned int i = 0; i < aim->mNumVertices; ++i) { values[i].y = 1 - values[i].y; // Flip Y coords } } - - aiFace* faces = 0; + aiFace *faces = 0; unsigned int nFaces = 0; if (prim.indices) { @@ -322,76 +304,75 @@ void glTFImporter::ImportMeshes(glTF::Asset& r) ai_assert(data.IsValid()); switch (prim.mode) { - case PrimitiveMode_POINTS: { - nFaces = count; - faces = new aiFace[nFaces]; - for (unsigned int i = 0; i < count; ++i) { - SetFace(faces[i], data.GetUInt(i)); - } - break; + case PrimitiveMode_POINTS: { + nFaces = count; + faces = new aiFace[nFaces]; + for (unsigned int i = 0; i < count; ++i) { + SetFace(faces[i], data.GetUInt(i)); } - - case PrimitiveMode_LINES: { - nFaces = count / 2; - if (nFaces * 2 != count) { - ASSIMP_LOG_WARN("The number of vertices was not compatible with the LINES mode. Some vertices were dropped."); - count = nFaces * 2; - } - faces = new aiFace[nFaces]; - for (unsigned int i = 0; i < count; i += 2) { - SetFace(faces[i / 2], data.GetUInt(i), data.GetUInt(i + 1)); - } - break; - } - - case PrimitiveMode_LINE_LOOP: - case PrimitiveMode_LINE_STRIP: { - nFaces = count - ((prim.mode == PrimitiveMode_LINE_STRIP) ? 1 : 0); - faces = new aiFace[nFaces]; - SetFace(faces[0], data.GetUInt(0), data.GetUInt(1)); - for (unsigned int i = 2; i < count; ++i) { - SetFace(faces[i - 1], faces[i - 2].mIndices[1], data.GetUInt(i)); - } - if (prim.mode == PrimitiveMode_LINE_LOOP) { // close the loop - SetFace(faces[count - 1], faces[count - 2].mIndices[1], faces[0].mIndices[0]); - } - break; - } - - case PrimitiveMode_TRIANGLES: { - nFaces = count / 3; - if (nFaces * 3 != count) { - ASSIMP_LOG_WARN("The number of vertices was not compatible with the TRIANGLES mode. Some vertices were dropped."); - count = nFaces * 3; - } - faces = new aiFace[nFaces]; - for (unsigned int i = 0; i < count; i += 3) { - SetFace(faces[i / 3], data.GetUInt(i), data.GetUInt(i + 1), data.GetUInt(i + 2)); - } - break; - } - case PrimitiveMode_TRIANGLE_STRIP: { - nFaces = count - 2; - faces = new aiFace[nFaces]; - SetFace(faces[0], data.GetUInt(0), data.GetUInt(1), data.GetUInt(2)); - for (unsigned int i = 3; i < count; ++i) { - SetFace(faces[i - 2], faces[i - 1].mIndices[1], faces[i - 1].mIndices[2], data.GetUInt(i)); - } - break; - } - case PrimitiveMode_TRIANGLE_FAN: - nFaces = count - 2; - faces = new aiFace[nFaces]; - SetFace(faces[0], data.GetUInt(0), data.GetUInt(1), data.GetUInt(2)); - for (unsigned int i = 3; i < count; ++i) { - SetFace(faces[i - 2], faces[0].mIndices[0], faces[i - 1].mIndices[2], data.GetUInt(i)); - } - break; + break; } - } - else { // no indices provided so directly generate from counts - // use the already determined count as it includes checks + case PrimitiveMode_LINES: { + nFaces = count / 2; + if (nFaces * 2 != count) { + ASSIMP_LOG_WARN("The number of vertices was not compatible with the LINES mode. Some vertices were dropped."); + count = nFaces * 2; + } + faces = new aiFace[nFaces]; + for (unsigned int i = 0; i < count; i += 2) { + SetFace(faces[i / 2], data.GetUInt(i), data.GetUInt(i + 1)); + } + break; + } + + case PrimitiveMode_LINE_LOOP: + case PrimitiveMode_LINE_STRIP: { + nFaces = count - ((prim.mode == PrimitiveMode_LINE_STRIP) ? 1 : 0); + faces = new aiFace[nFaces]; + SetFace(faces[0], data.GetUInt(0), data.GetUInt(1)); + for (unsigned int i = 2; i < count; ++i) { + SetFace(faces[i - 1], faces[i - 2].mIndices[1], data.GetUInt(i)); + } + if (prim.mode == PrimitiveMode_LINE_LOOP) { // close the loop + SetFace(faces[count - 1], faces[count - 2].mIndices[1], faces[0].mIndices[0]); + } + break; + } + + case PrimitiveMode_TRIANGLES: { + nFaces = count / 3; + if (nFaces * 3 != count) { + ASSIMP_LOG_WARN("The number of vertices was not compatible with the TRIANGLES mode. Some vertices were dropped."); + count = nFaces * 3; + } + faces = new aiFace[nFaces]; + for (unsigned int i = 0; i < count; i += 3) { + SetFace(faces[i / 3], data.GetUInt(i), data.GetUInt(i + 1), data.GetUInt(i + 2)); + } + break; + } + case PrimitiveMode_TRIANGLE_STRIP: { + nFaces = count - 2; + faces = new aiFace[nFaces]; + SetFace(faces[0], data.GetUInt(0), data.GetUInt(1), data.GetUInt(2)); + for (unsigned int i = 3; i < count; ++i) { + SetFace(faces[i - 2], faces[i - 1].mIndices[1], faces[i - 1].mIndices[2], data.GetUInt(i)); + } + break; + } + case PrimitiveMode_TRIANGLE_FAN: + nFaces = count - 2; + faces = new aiFace[nFaces]; + SetFace(faces[0], data.GetUInt(0), data.GetUInt(1), data.GetUInt(2)); + for (unsigned int i = 3; i < count; ++i) { + SetFace(faces[i - 2], faces[0].mIndices[0], faces[i - 1].mIndices[2], data.GetUInt(i)); + } + break; + } + } else { // no indices provided so directly generate from counts + + // use the already determined count as it includes checks unsigned int count = aim->mNumVertices; switch (prim.mode) { @@ -484,22 +465,22 @@ void glTFImporter::ImportMeshes(glTF::Asset& r) CopyVector(meshes, mScene->mMeshes, mScene->mNumMeshes); } -void glTFImporter::ImportCameras(glTF::Asset& r) { +void glTFImporter::ImportCameras(glTF::Asset &r) { if (!r.cameras.Size()) { return; } mScene->mNumCameras = r.cameras.Size(); - mScene->mCameras = new aiCamera*[r.cameras.Size()]; + mScene->mCameras = new aiCamera *[r.cameras.Size()]; for (size_t i = 0; i < r.cameras.Size(); ++i) { - Camera& cam = r.cameras[i]; + Camera &cam = r.cameras[i]; - aiCamera* aicam = mScene->mCameras[i] = new aiCamera(); + aiCamera *aicam = mScene->mCameras[i] = new aiCamera(); if (cam.type == Camera::Perspective) { - aicam->mAspect = cam.perspective.aspectRatio; + aicam->mAspect = cam.perspective.aspectRatio; aicam->mHorizontalFOV = cam.perspective.yfov * ((aicam->mAspect == 0.f) ? 1.f : aicam->mAspect); - aicam->mClipPlaneFar = cam.perspective.zfar; + aicam->mClipPlaneFar = cam.perspective.zfar; aicam->mClipPlaneNear = cam.perspective.znear; } else { aicam->mClipPlaneFar = cam.ortographic.zfar; @@ -513,30 +494,33 @@ void glTFImporter::ImportCameras(glTF::Asset& r) { } } -void glTFImporter::ImportLights(glTF::Asset& r) -{ +void glTFImporter::ImportLights(glTF::Asset &r) { if (!r.lights.Size()) return; mScene->mNumLights = r.lights.Size(); - mScene->mLights = new aiLight*[r.lights.Size()]; + mScene->mLights = new aiLight *[r.lights.Size()]; for (size_t i = 0; i < r.lights.Size(); ++i) { - Light& l = r.lights[i]; + Light &l = r.lights[i]; - aiLight* ail = mScene->mLights[i] = new aiLight(); + aiLight *ail = mScene->mLights[i] = new aiLight(); switch (l.type) { - case Light::Type_directional: - ail->mType = aiLightSource_DIRECTIONAL; break; + case Light::Type_directional: + ail->mType = aiLightSource_DIRECTIONAL; + break; - case Light::Type_spot: - ail->mType = aiLightSource_SPOT; break; + case Light::Type_spot: + ail->mType = aiLightSource_SPOT; + break; - case Light::Type_ambient: - ail->mType = aiLightSource_AMBIENT; break; + case Light::Type_ambient: + ail->mType = aiLightSource_AMBIENT; + break; - default: // Light::Type_point - ail->mType = aiLightSource_POINT; break; + default: // Light::Type_point + ail->mType = aiLightSource_POINT; + break; } CopyValue(l.color, ail->mColorAmbient); @@ -546,35 +530,32 @@ void glTFImporter::ImportLights(glTF::Asset& r) ail->mAngleOuterCone = l.falloffAngle; ail->mAngleInnerCone = l.falloffExponent; // TODO fix this, it does not look right at all - ail->mAttenuationConstant = l.constantAttenuation; - ail->mAttenuationLinear = l.linearAttenuation; + ail->mAttenuationConstant = l.constantAttenuation; + ail->mAttenuationLinear = l.linearAttenuation; ail->mAttenuationQuadratic = l.quadraticAttenuation; } } +aiNode *ImportNode(aiScene *pScene, glTF::Asset &r, std::vector &meshOffsets, glTF::Ref &ptr) { + Node &node = *ptr; -aiNode* ImportNode(aiScene* pScene, glTF::Asset& r, std::vector& meshOffsets, glTF::Ref& ptr) -{ - Node& node = *ptr; - - aiNode* ainode = new aiNode(node.id); + aiNode *ainode = new aiNode(node.id); if (!node.children.empty()) { ainode->mNumChildren = unsigned(node.children.size()); - ainode->mChildren = new aiNode*[ainode->mNumChildren]; + ainode->mChildren = new aiNode *[ainode->mNumChildren]; for (unsigned int i = 0; i < ainode->mNumChildren; ++i) { - aiNode* child = ImportNode(pScene, r, meshOffsets, node.children[i]); + aiNode *child = ImportNode(pScene, r, meshOffsets, node.children[i]); child->mParent = ainode; ainode->mChildren[i] = child; } } - aiMatrix4x4& matrix = ainode->mTransformation; + aiMatrix4x4 &matrix = ainode->mTransformation; if (node.matrix.isPresent) { CopyValue(node.matrix.value, matrix); - } - else { + } else { if (node.translation.isPresent) { aiVector3D trans; CopyValue(node.translation.value, trans); @@ -591,7 +572,6 @@ aiNode* ImportNode(aiScene* pScene, glTF::Asset& r, std::vector& m matrix = s * matrix; } - if (node.rotation.isPresent) { aiQuaternion rot; CopyValue(node.rotation.value, rot); @@ -629,22 +609,20 @@ aiNode* ImportNode(aiScene* pScene, glTF::Asset& r, std::vector& m return ainode; } -void glTFImporter::ImportNodes(glTF::Asset& r) -{ +void glTFImporter::ImportNodes(glTF::Asset &r) { if (!r.scene) return; - std::vector< Ref > rootNodes = r.scene->nodes; + std::vector> rootNodes = r.scene->nodes; // The root nodes unsigned int numRootNodes = unsigned(rootNodes.size()); if (numRootNodes == 1) { // a single root node: use it mScene->mRootNode = ImportNode(mScene, r, meshOffsets, rootNodes[0]); - } - else if (numRootNodes > 1) { // more than one root node: create a fake root - aiNode* root = new aiNode("ROOT"); - root->mChildren = new aiNode*[numRootNodes]; + } else if (numRootNodes > 1) { // more than one root node: create a fake root + aiNode *root = new aiNode("ROOT"); + root->mChildren = new aiNode *[numRootNodes]; for (unsigned int i = 0; i < numRootNodes; ++i) { - aiNode* node = ImportNode(mScene, r, meshOffsets, rootNodes[i]); + aiNode *node = ImportNode(mScene, r, meshOffsets, rootNodes[i]); node->mParent = root; root->mChildren[root->mNumChildren++] = node; } @@ -656,8 +634,7 @@ void glTFImporter::ImportNodes(glTF::Asset& r) //} } -void glTFImporter::ImportEmbeddedTextures(glTF::Asset& r) -{ +void glTFImporter::ImportEmbeddedTextures(glTF::Asset &r) { embeddedTexIdxs.resize(r.images.Size(), -1); int numEmbeddedTexs = 0; @@ -669,7 +646,7 @@ void glTFImporter::ImportEmbeddedTextures(glTF::Asset& r) if (numEmbeddedTexs == 0) return; - mScene->mTextures = new aiTexture*[numEmbeddedTexs]; + mScene->mTextures = new aiTexture *[numEmbeddedTexs]; // Add the embedded textures for (size_t i = 0; i < r.images.Size(); ++i) { @@ -679,18 +656,18 @@ void glTFImporter::ImportEmbeddedTextures(glTF::Asset& r) int idx = mScene->mNumTextures++; embeddedTexIdxs[i] = idx; - aiTexture* tex = mScene->mTextures[idx] = new aiTexture(); + aiTexture *tex = mScene->mTextures[idx] = new aiTexture(); size_t length = img.GetDataLength(); - void* data = img.StealData(); + void *data = img.StealData(); tex->mFilename = img.name; tex->mWidth = static_cast(length); tex->mHeight = 0; - tex->pcData = reinterpret_cast(data); + tex->pcData = reinterpret_cast(data); if (!img.mimeType.empty()) { - const char* ext = strchr(img.mimeType.c_str(), '/') + 1; + const char *ext = strchr(img.mimeType.c_str(), '/') + 1; if (ext) { if (strcmp(ext, "jpeg") == 0) ext = "jpg"; @@ -703,32 +680,26 @@ void glTFImporter::ImportEmbeddedTextures(glTF::Asset& r) } } -void glTFImporter::ImportCommonMetadata(glTF::Asset& a) -{ +void glTFImporter::ImportCommonMetadata(glTF::Asset &a) { ai_assert(mScene->mMetaData == nullptr); const bool hasVersion = !a.asset.version.empty(); const bool hasGenerator = !a.asset.generator.empty(); const bool hasCopyright = !a.asset.copyright.empty(); - if (hasVersion || hasGenerator || hasCopyright) - { + if (hasVersion || hasGenerator || hasCopyright) { mScene->mMetaData = new aiMetadata; - if (hasVersion) - { + if (hasVersion) { mScene->mMetaData->Add(AI_METADATA_SOURCE_FORMAT_VERSION, aiString(a.asset.version)); } - if (hasGenerator) - { + if (hasGenerator) { mScene->mMetaData->Add(AI_METADATA_SOURCE_GENERATOR, aiString(a.asset.generator)); } - if (hasCopyright) - { + if (hasCopyright) { mScene->mMetaData->Add(AI_METADATA_SOURCE_COPYRIGHT, aiString(a.asset.copyright)); } } } -void glTFImporter::InternReadFile(const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler) -{ +void glTFImporter::InternReadFile(const std::string &pFile, aiScene *pScene, IOSystem *pIOHandler) { // clean all member arrays meshOffsets.clear(); embeddedTexIdxs.clear(); @@ -739,7 +710,6 @@ void glTFImporter::InternReadFile(const std::string& pFile, aiScene* pScene, IOS glTF::Asset asset(pIOHandler); asset.Load(pFile, GetExtension(pFile) == "glb"); - // // Copy the data out // @@ -761,4 +731,3 @@ void glTFImporter::InternReadFile(const std::string& pFile, aiScene* pScene, IOS } #endif // ASSIMP_BUILD_NO_GLTF_IMPORTER - From edaa8e4a802ed9943e04500a64046661b56e94ef Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Wed, 24 Jun 2020 11:37:43 +0100 Subject: [PATCH 104/115] Need to use ASSIMP_BUILD_DEBUG. --- include/assimp/ai_assert.h | 2 +- test/unit/Common/utAssertHandler.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/assimp/ai_assert.h b/include/assimp/ai_assert.h index 6045a9801..320104cfb 100644 --- a/include/assimp/ai_assert.h +++ b/include/assimp/ai_assert.h @@ -42,7 +42,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_ASSERT_H_INC #define AI_ASSERT_H_INC -#if defined(ASSIMP_BUILD_DEBUG) || defined(ASSIMP_BUILD_WITH_ASSERTS) +#if defined(ASSIMP_BUILD_DEBUG) namespace Assimp { diff --git a/test/unit/Common/utAssertHandler.cpp b/test/unit/Common/utAssertHandler.cpp index d04162bdc..4a567c0c3 100644 --- a/test/unit/Common/utAssertHandler.cpp +++ b/test/unit/Common/utAssertHandler.cpp @@ -42,8 +42,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "UnitTestPCH.h" /// Ensure this test has asserts on, even if the build type doesn't have asserts by default. -#if !defined(ASSIMP_BUILD_WITH_ASSERTS) -#define ASSIMP_BUILD_WITH_ASSERTS +#if !defined(ASSIMP_BUILD_DEBUG) +#define ASSIMP_BUILD_DEBUG #endif #include From 170c00eee7120938ec6f2ef770b6e9a383d4dcda Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Wed, 24 Jun 2020 11:51:03 +0100 Subject: [PATCH 105/115] Useful comment. --- include/assimp/ai_assert.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/assimp/ai_assert.h b/include/assimp/ai_assert.h index 320104cfb..8b2b396f4 100644 --- a/include/assimp/ai_assert.h +++ b/include/assimp/ai_assert.h @@ -46,6 +46,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. namespace Assimp { + // Assert violation behavior can be customized: see AssertHandler.h. void aiAssertViolation(const char* failedExpression, const char* file, int line); } From 1466bbacf87ce6996a9c934668f8df3b08a7fef5 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Wed, 24 Jun 2020 20:30:02 +0200 Subject: [PATCH 106/115] fix unittests. --- code/AssetLib/MD5/MD5Loader.cpp | 145 ++++++++++++++++++-------------- code/AssetLib/MD5/MD5Loader.h | 15 ++-- 2 files changed, 87 insertions(+), 73 deletions(-) diff --git a/code/AssetLib/MD5/MD5Loader.cpp b/code/AssetLib/MD5/MD5Loader.cpp index 1790eac2a..5428a9c74 100644 --- a/code/AssetLib/MD5/MD5Loader.cpp +++ b/code/AssetLib/MD5/MD5Loader.cpp @@ -5,8 +5,6 @@ Open Asset Import Library (assimp) Copyright (c) 2006-2020, assimp team - - All rights reserved. Redistribution and use of this software in source and binary forms, @@ -82,7 +80,15 @@ static const aiImporterDesc desc = { // ------------------------------------------------------------------------------------------------ // Constructor to be privately used by Importer MD5Importer::MD5Importer() : - mIOHandler(nullptr), mBuffer(), fileSize(), iLineNumber(), pScene(), bHadMD5Mesh(), bHadMD5Anim(), bHadMD5Camera(), configNoAutoLoad(false) { + mIOHandler(nullptr), + mBuffer(), + mFileSize(), + mLineNumber(), + mScene(), + mHadMD5Mesh(), + mHadMD5Anim(), + mHadMD5Camera(), + mCconfigNoAutoLoad(false) { // empty } @@ -106,6 +112,7 @@ bool MD5Importer::CanRead(const std::string &pFile, IOSystem *pIOHandler, bool c const char *tokens[] = { "MD5Version" }; return SearchFileHeaderForToken(pIOHandler, pFile, tokens, 1); } + return false; } @@ -119,16 +126,15 @@ const aiImporterDesc *MD5Importer::GetInfo() const { // Setup import properties void MD5Importer::SetupProperties(const Importer *pImp) { // AI_CONFIG_IMPORT_MD5_NO_ANIM_AUTOLOAD - configNoAutoLoad = (0 != pImp->GetPropertyInteger(AI_CONFIG_IMPORT_MD5_NO_ANIM_AUTOLOAD, 0)); + mCconfigNoAutoLoad = (0 != pImp->GetPropertyInteger(AI_CONFIG_IMPORT_MD5_NO_ANIM_AUTOLOAD, 0)); } // ------------------------------------------------------------------------------------------------ // Imports the given file into the given scene structure. -void MD5Importer::InternReadFile(const std::string &pFile, - aiScene *_pScene, IOSystem *pIOHandler) { +void MD5Importer::InternReadFile(const std::string &pFile, aiScene *_pScene, IOSystem *pIOHandler) { mIOHandler = pIOHandler; - pScene = _pScene; - bHadMD5Mesh = bHadMD5Anim = bHadMD5Camera = false; + mScene = _pScene; + mHadMD5Mesh = mHadMD5Anim = mHadMD5Camera = false; // remove the file extension const std::string::size_type pos = pFile.find_last_of('.'); @@ -138,7 +144,7 @@ void MD5Importer::InternReadFile(const std::string &pFile, try { if (extension == "md5camera") { LoadMD5CameraFile(); - } else if (configNoAutoLoad || extension == "md5anim") { + } else if (mCconfigNoAutoLoad || extension == "md5anim") { // determine file extension and process just *one* file if (extension.length() == 0) { throw DeadlyImportError("Failure, need file extension to determine MD5 part type"); @@ -158,17 +164,17 @@ void MD5Importer::InternReadFile(const std::string &pFile, } // make sure we have at least one file - if (!bHadMD5Mesh && !bHadMD5Anim && !bHadMD5Camera) { + if (!mHadMD5Mesh && !mHadMD5Anim && !mHadMD5Camera) { throw DeadlyImportError("Failed to read valid contents out of this MD5* file"); } // Now rotate the whole scene 90 degrees around the x axis to match our internal coordinate system - pScene->mRootNode->mTransformation = aiMatrix4x4(1.f, 0.f, 0.f, 0.f, + mScene->mRootNode->mTransformation = aiMatrix4x4(1.f, 0.f, 0.f, 0.f, 0.f, 0.f, 1.f, 0.f, 0.f, -1.f, 0.f, 0.f, 0.f, 0.f, 0.f, 1.f); // the output scene wouldn't pass the validation without this flag - if (!bHadMD5Mesh) { - pScene->mFlags |= AI_SCENE_FLAGS_INCOMPLETE; + if (!mHadMD5Mesh) { + mScene->mFlags |= AI_SCENE_FLAGS_INCOMPLETE; } // clean the instance -- the BaseImporter instance may be reused later. @@ -182,16 +188,16 @@ void MD5Importer::LoadFileIntoMemory(IOStream *file) { UnloadFileFromMemory(); ai_assert(nullptr != file); - fileSize = (unsigned int)file->FileSize(); - ai_assert(fileSize); + mFileSize = (unsigned int)file->FileSize(); + ai_assert(mFileSize); // allocate storage and copy the contents of the file to a memory buffer - mBuffer = new char[fileSize + 1]; - file->Read((void *)mBuffer, 1, fileSize); - iLineNumber = 1; + mBuffer = new char[mFileSize + 1]; + file->Read((void *)mBuffer, 1, mFileSize); + mLineNumber = 1; // append a terminal 0 - mBuffer[fileSize] = '\0'; + mBuffer[mFileSize] = '\0'; // now remove all line comments from the file CommentRemover::RemoveLineComments("//", mBuffer, ' '); @@ -203,7 +209,7 @@ void MD5Importer::UnloadFileFromMemory() { // delete the file buffer delete[] mBuffer; mBuffer = nullptr; - fileSize = 0; + mFileSize = 0; } // ------------------------------------------------------------------------------------------------ @@ -339,31 +345,32 @@ void MD5Importer::LoadMD5MeshFile() { // Check whether we can read from the file if (file.get() == nullptr || !file->FileSize()) { - throw DeadlyImportError("Failed to open MD5 file " + filename + "."); + ASSIMP_LOG_WARN("Failed to access MD5MESH file: " + filename); + return; } - bHadMD5Mesh = true; + mHadMD5Mesh = true; LoadFileIntoMemory(file.get()); // now construct a parser and parse the file - MD5::MD5Parser parser(mBuffer, fileSize); + MD5::MD5Parser parser(mBuffer, mFileSize); // load the mesh information from it MD5::MD5MeshParser meshParser(parser.mSections); // create the bone hierarchy - first the root node and dummy nodes for all meshes - pScene->mRootNode = new aiNode(""); - pScene->mRootNode->mNumChildren = 2; - pScene->mRootNode->mChildren = new aiNode *[2]; + mScene->mRootNode = new aiNode(""); + mScene->mRootNode->mNumChildren = 2; + mScene->mRootNode->mChildren = new aiNode *[2]; // build the hierarchy from the MD5MESH file - aiNode *pcNode = pScene->mRootNode->mChildren[1] = new aiNode(); + aiNode *pcNode = mScene->mRootNode->mChildren[1] = new aiNode(); pcNode->mName.Set(""); - pcNode->mParent = pScene->mRootNode; + pcNode->mParent = mScene->mRootNode; AttachChilds_Mesh(-1, pcNode, meshParser.mJoints); - pcNode = pScene->mRootNode->mChildren[0] = new aiNode(); + pcNode = mScene->mRootNode->mChildren[0] = new aiNode(); pcNode->mName.Set(""); - pcNode->mParent = pScene->mRootNode; + pcNode->mParent = mScene->mRootNode; #if 0 if (pScene->mRootNode->mChildren[1]->mNumChildren) /* start at the right hierarchy level */ @@ -372,28 +379,31 @@ void MD5Importer::LoadMD5MeshFile() { // FIX: MD5 files exported from Blender can have empty meshes for (std::vector::const_iterator it = meshParser.mMeshes.begin(), end = meshParser.mMeshes.end(); it != end; ++it) { - if (!(*it).mFaces.empty() && !(*it).mVertices.empty()) - ++pScene->mNumMaterials; + if (!(*it).mFaces.empty() && !(*it).mVertices.empty()) { + ++mScene->mNumMaterials; + } } // generate all meshes - pScene->mNumMeshes = pScene->mNumMaterials; - pScene->mMeshes = new aiMesh *[pScene->mNumMeshes]; - pScene->mMaterials = new aiMaterial *[pScene->mNumMeshes]; + mScene->mNumMeshes = mScene->mNumMaterials; + mScene->mMeshes = new aiMesh *[mScene->mNumMeshes]; + mScene->mMaterials = new aiMaterial *[mScene->mNumMeshes]; // storage for node mesh indices - pcNode->mNumMeshes = pScene->mNumMeshes; + pcNode->mNumMeshes = mScene->mNumMeshes; pcNode->mMeshes = new unsigned int[pcNode->mNumMeshes]; - for (unsigned int m = 0; m < pcNode->mNumMeshes; ++m) + for (unsigned int m = 0; m < pcNode->mNumMeshes; ++m) { pcNode->mMeshes[m] = m; + } unsigned int n = 0; for (std::vector::iterator it = meshParser.mMeshes.begin(), end = meshParser.mMeshes.end(); it != end; ++it) { MD5::MeshDesc &meshSrc = *it; - if (meshSrc.mFaces.empty() || meshSrc.mVertices.empty()) + if (meshSrc.mFaces.empty() || meshSrc.mVertices.empty()) { continue; + } - aiMesh *mesh = pScene->mMeshes[n] = new aiMesh(); + aiMesh *mesh = mScene->mMeshes[n] = new aiMesh(); mesh->mPrimitiveTypes = aiPrimitiveType_TRIANGLE; // generate unique vertices in our internal verbose format @@ -423,17 +433,19 @@ void MD5Importer::LoadMD5MeshFile() { for (unsigned int jub = (*iter).mFirstWeight, w = jub; w < jub + (*iter).mNumWeights; ++w) { MD5::WeightDesc &weightDesc = meshSrc.mWeights[w]; /* FIX for some invalid exporters */ - if (!(weightDesc.mWeight < AI_MD5_WEIGHT_EPSILON && weightDesc.mWeight >= -AI_MD5_WEIGHT_EPSILON)) + if (!(weightDesc.mWeight < AI_MD5_WEIGHT_EPSILON && weightDesc.mWeight >= -AI_MD5_WEIGHT_EPSILON)) { ++piCount[weightDesc.mBone]; + } } } // check how many we will need - for (unsigned int p = 0; p < meshParser.mJoints.size(); ++p) + for (unsigned int p = 0; p < meshParser.mJoints.size(); ++p) { if (piCount[p]) mesh->mNumBones++; + } - if (mesh->mNumBones) // just for safety - { + // just for safety + if (mesh->mNumBones) { mesh->mBones = new aiBone *[mesh->mNumBones]; for (unsigned int q = 0, h = 0; q < meshParser.mJoints.size(); ++q) { if (!piCount[q]) continue; @@ -458,8 +470,9 @@ void MD5Importer::LoadMD5MeshFile() { // there are models which have weights which don't sum to 1 ... ai_real fSum = 0.0; - for (unsigned int jub = (*iter).mFirstWeight, w = jub; w < jub + (*iter).mNumWeights; ++w) + for (unsigned int jub = (*iter).mFirstWeight, w = jub; w < jub + (*iter).mNumWeights; ++w) { fSum += meshSrc.mWeights[w].mWeight; + } if (!fSum) { ASSIMP_LOG_ERROR("MD5MESH: The sum of all vertex bone weights is 0"); continue; @@ -467,11 +480,12 @@ void MD5Importer::LoadMD5MeshFile() { // process bone weights for (unsigned int jub = (*iter).mFirstWeight, w = jub; w < jub + (*iter).mNumWeights; ++w) { - if (w >= meshSrc.mWeights.size()) + if (w >= meshSrc.mWeights.size()) { throw DeadlyImportError("MD5MESH: Invalid weight index"); + } MD5::WeightDesc &weightDesc = meshSrc.mWeights[w]; - if (weightDesc.mWeight < AI_MD5_WEIGHT_EPSILON && weightDesc.mWeight >= -AI_MD5_WEIGHT_EPSILON) { + if (weightDesc.mWeight < AI_MD5_WEIGHT_EPSILON && weightDesc.mWeight >= -AI_MD5_WEIGHT_EPSILON) { continue; } @@ -510,7 +524,7 @@ void MD5Importer::LoadMD5MeshFile() { // generate a material for the mesh aiMaterial *mat = new aiMaterial(); - pScene->mMaterials[n] = mat; + mScene->mMaterials[n] = mat; // insert the typical doom3 textures: // nnn_local.tga - normal map @@ -553,13 +567,14 @@ void MD5Importer::LoadMD5AnimFile() { // Check whether we can read from the file if (!file.get() || !file->FileSize()) { - throw DeadlyImportError("Failed to open MD3 file " + pFile + "."); + ASSIMP_LOG_WARN("Failed to read MD5ANIM file: " + pFile); + return; } LoadFileIntoMemory(file.get()); // parse the basic file structure - MD5::MD5Parser parser(mBuffer, fileSize); + MD5::MD5Parser parser(mBuffer, mFileSize); // load the animation information from the parse tree MD5::MD5AnimParser animParser(parser.mSections); @@ -569,10 +584,10 @@ void MD5Importer::LoadMD5AnimFile() { animParser.mBaseFrames.size() != animParser.mAnimatedBones.size()) { ASSIMP_LOG_ERROR("MD5ANIM: No frames or animated bones loaded"); } else { - bHadMD5Anim = true; + mHadMD5Anim = true; - pScene->mAnimations = new aiAnimation *[pScene->mNumAnimations = 1]; - aiAnimation *anim = pScene->mAnimations[0] = new aiAnimation(); + mScene->mAnimations = new aiAnimation *[mScene->mNumAnimations = 1]; + aiAnimation *anim = mScene->mAnimations[0] = new aiAnimation(); anim->mNumChannels = (unsigned int)animParser.mAnimatedBones.size(); anim->mChannels = new aiNodeAnim *[anim->mNumChannels]; for (unsigned int i = 0; i < anim->mNumChannels; ++i) { @@ -638,15 +653,15 @@ void MD5Importer::LoadMD5AnimFile() { // If we didn't build the hierarchy yet (== we didn't load a MD5MESH), // construct it now from the data given in the MD5ANIM. - if (!pScene->mRootNode) { - pScene->mRootNode = new aiNode(); - pScene->mRootNode->mName.Set(""); + if (!mScene->mRootNode) { + mScene->mRootNode = new aiNode(); + mScene->mRootNode->mName.Set(""); - AttachChilds_Anim(-1, pScene->mRootNode, animParser.mAnimatedBones, (const aiNodeAnim **)anim->mChannels); + AttachChilds_Anim(-1, mScene->mRootNode, animParser.mAnimatedBones, (const aiNodeAnim **)anim->mChannels); // Call SkeletonMeshBuilder to construct a mesh to represent the shape - if (pScene->mRootNode->mNumChildren) { - SkeletonMeshBuilder skeleton_maker(pScene, pScene->mRootNode->mChildren[0]); + if (mScene->mRootNode->mNumChildren) { + SkeletonMeshBuilder skeleton_maker(mScene, mScene->mRootNode->mChildren[0]); } } } @@ -662,11 +677,11 @@ void MD5Importer::LoadMD5CameraFile() { if (!file.get() || !file->FileSize()) { throw DeadlyImportError("Failed to read MD5CAMERA file: " + pFile); } - bHadMD5Camera = true; + mHadMD5Camera = true; LoadFileIntoMemory(file.get()); // parse the basic file structure - MD5::MD5Parser parser(mBuffer, fileSize); + MD5::MD5Parser parser(mBuffer, mFileSize); // load the camera animation data from the parse tree MD5::MD5CameraParser cameraParser(parser.mSections); @@ -680,14 +695,14 @@ void MD5Importer::LoadMD5CameraFile() { // Construct output graph - a simple root with a dummy child. // The root node performs the coordinate system conversion - aiNode *root = pScene->mRootNode = new aiNode(""); + aiNode *root = mScene->mRootNode = new aiNode(""); root->mChildren = new aiNode *[root->mNumChildren = 1]; root->mChildren[0] = new aiNode(""); root->mChildren[0]->mParent = root; // ... but with one camera assigned to it - pScene->mCameras = new aiCamera *[pScene->mNumCameras = 1]; - aiCamera *cam = pScene->mCameras[0] = new aiCamera(); + mScene->mCameras = new aiCamera *[mScene->mNumCameras = 1]; + aiCamera *cam = mScene->mCameras[0] = new aiCamera(); cam->mName = ""; // FIXME: Fov is currently set to the first frame's value @@ -704,8 +719,8 @@ void MD5Importer::LoadMD5CameraFile() { cuts.push_back(static_cast(frames.size() - 1)); } - pScene->mNumAnimations = static_cast(cuts.size() - 1); - aiAnimation **tmp = pScene->mAnimations = new aiAnimation *[pScene->mNumAnimations]; + mScene->mNumAnimations = static_cast(cuts.size() - 1); + aiAnimation **tmp = mScene->mAnimations = new aiAnimation *[mScene->mNumAnimations]; for (std::vector::const_iterator it = cuts.begin(); it != cuts.end() - 1; ++it) { aiAnimation *anim = *tmp++ = new aiAnimation(); diff --git a/code/AssetLib/MD5/MD5Loader.h b/code/AssetLib/MD5/MD5Loader.h index cfdd9ed0e..f62a57e68 100644 --- a/code/AssetLib/MD5/MD5Loader.h +++ b/code/AssetLib/MD5/MD5Loader.h @@ -4,7 +4,6 @@ Open Asset Import Library (assimp) Copyright (c) 2006-2020, assimp team - All rights reserved. Redistribution and use of this software in source and binary forms, @@ -156,25 +155,25 @@ protected: char *mBuffer; /** Size of the file */ - unsigned int fileSize; + unsigned int mFileSize; /** Current line number. For debugging purposes */ - unsigned int iLineNumber; + unsigned int mLineNumber; /** Scene to be filled */ - aiScene *pScene; + aiScene *mScene; /** true if a MD5MESH file has already been parsed */ - bool bHadMD5Mesh; + bool mHadMD5Mesh; /** true if a MD5ANIM file has already been parsed */ - bool bHadMD5Anim; + bool mHadMD5Anim; /** true if a MD5CAMERA file has already been parsed */ - bool bHadMD5Camera; + bool mHadMD5Camera; /** configuration option: prevent anim autoload */ - bool configNoAutoLoad; + bool mCconfigNoAutoLoad; }; } // end of namespace Assimp From f6b4370f6ac1bf2db0ef9edeb0ff1ce8c7e61aab Mon Sep 17 00:00:00 2001 From: Evangel Date: Fri, 26 Jun 2020 14:26:45 +1000 Subject: [PATCH 107/115] Added arbitrary recursive metadata to allow for glTF2's extensions to be properly represented. Primary changes are to include/assimp/metadata.h, adding in the aiMetadata GetAiType function, adding the operator= to allow an aiMetadata type to be assigned, adding a check for the AI_AIMETADATA type flag as it can't be trivially memcpy'd. operator= is implemented with a by-value argument as then the copy is made by the copy constructor and we can just swap everything out and let the destructor handle the mess. Implemented parsing of the "extensions" flag on all glTF2 Nodes. Doesn't use the ReadValue helper function on numbers as it did not seem to fill out the Nullable structure properly. --- code/AssetLib/glTF2/glTF2Asset.h | 44 +++++++++++++++++++++++++++ code/AssetLib/glTF2/glTF2Asset.inl | 39 ++++++++++++++++++++++++ code/AssetLib/glTF2/glTF2Importer.cpp | 32 +++++++++++++++++-- include/assimp/metadata.h | 30 ++++++++++++++++-- 4 files changed, 140 insertions(+), 5 deletions(-) diff --git a/code/AssetLib/glTF2/glTF2Asset.h b/code/AssetLib/glTF2/glTF2Asset.h index ffecd3dbf..543bef95c 100644 --- a/code/AssetLib/glTF2/glTF2Asset.h +++ b/code/AssetLib/glTF2/glTF2Asset.h @@ -784,6 +784,48 @@ struct Mesh : public Object { void Read(Value &pJSON_Object, Asset &pAsset_Root); }; +struct CustomExtension : public Object { + // + // A struct containing custom extension data added to a glTF2 file + // Has to contain Object, Array, String, Double, Uint64, and Int64 at a minimum + // String, Double, Uint64, and Int64 are stored in the Nullables + // Object and Array are stored in the std::vector + // + + Nullable mStringValue; + Nullable mDoubleValue; + Nullable mUint64Value; + Nullable mInt64Value; + + // std::vector handles both Object and Array + Nullable> mValues; + + operator bool() const { + return Size(); + } + + size_t Size() const { + if (mValues.isPresent) { + return mValues.value.size(); + } else if (mStringValue.isPresent || mDoubleValue.isPresent || mUint64Value.isPresent || mInt64Value.isPresent) { + return 1; + } + return 0; + } + + CustomExtension() = default; + + CustomExtension(const CustomExtension& other) + : Object(other) + , mStringValue(other.mStringValue) + , mDoubleValue(other.mDoubleValue) + , mUint64Value(other.mUint64Value) + , mInt64Value(other.mInt64Value) + , mValues(other.mValues) + { + } +}; + struct Node : public Object { std::vector> children; std::vector> meshes; @@ -802,6 +844,8 @@ struct Node : public Object { Ref parent; //!< This is not part of the glTF specification. Used as a helper. + CustomExtension extensions; + Node() {} void Read(Value &obj, Asset &r); }; diff --git a/code/AssetLib/glTF2/glTF2Asset.inl b/code/AssetLib/glTF2/glTF2Asset.inl index 5a99525b2..71b164149 100644 --- a/code/AssetLib/glTF2/glTF2Asset.inl +++ b/code/AssetLib/glTF2/glTF2Asset.inl @@ -1207,6 +1207,43 @@ inline void Light::Read(Value &obj, Asset & /*r*/) { } } +inline CustomExtension ReadExtensions(const char *name, Value& obj) { + CustomExtension ret; + ret.name = name; + if (obj.IsObject()) { + ret.mValues.isPresent = true; + for (auto it = obj.MemberBegin(); it != obj.MemberEnd(); ++it) { + auto& val = it->value; + ret.mValues.value.push_back(ReadExtensions(it->name.GetString(), val)); + } + } + else if (obj.IsArray()) { + ret.mValues.value.reserve(obj.Size()); + ret.mValues.isPresent = true; + for (unsigned int i = 0; i < obj.Size(); ++i) + { + ret.mValues.value.push_back(ReadExtensions(name, obj[i])); + } + } + else if (obj.IsNumber()) { + if (obj.IsUint64()) { + ret.mUint64Value.value = obj.GetUint64(); + ret.mUint64Value.isPresent = true; + } else if (obj.IsInt64()) { + ret.mInt64Value.value = obj.GetInt64(); + ret.mInt64Value.isPresent = true; + } else if (obj.IsDouble()) { + ret.mDoubleValue.value = obj.GetDouble(); + ret.mDoubleValue.isPresent = true; + } + } + else if (obj.IsString()) { + ReadValue(obj, ret.mStringValue); + ret.mStringValue.isPresent = true; + } + return ret; +} + inline void Node::Read(Value &obj, Asset &r) { if (name.empty()) { name = id; @@ -1261,6 +1298,8 @@ inline void Node::Read(Value &obj, Asset &r) { Value *curExtensions = FindObject(obj, "extensions"); if (nullptr != curExtensions) { + this->extensions = ReadExtensions("extensions", *curExtensions); + if (r.extensionsUsed.KHR_lights_punctual) { if (Value *ext = FindObject(*curExtensions, "KHR_lights_punctual")) { Value *curLight = FindUInt(*ext, "light"); diff --git a/code/AssetLib/glTF2/glTF2Importer.cpp b/code/AssetLib/glTF2/glTF2Importer.cpp index 1c044e7ce..3a3c66e15 100644 --- a/code/AssetLib/glTF2/glTF2Importer.cpp +++ b/code/AssetLib/glTF2/glTF2Importer.cpp @@ -847,6 +847,24 @@ static std::string GetNodeName(const Node &node) { return node.name.empty() ? node.id : node.name; } +void ParseExtensions(aiMetadata *metadata, const CustomExtension &extension, unsigned int depth = 0) { + if (extension.mStringValue.isPresent) { + metadata->Add(extension.name.c_str(), aiString(extension.mStringValue.value)); + } else if (extension.mDoubleValue.isPresent) { + metadata->Add(extension.name.c_str(), extension.mDoubleValue.value); + } else if (extension.mUint64Value.isPresent) { + metadata->Add(extension.name.c_str(), extension.mUint64Value.value); + } else if (extension.mInt64Value.isPresent) { + metadata->Add(extension.name.c_str(), static_cast(extension.mInt64Value.value)); + } else if (extension.mValues.isPresent) { + aiMetadata val; + for (size_t i = 0; i < extension.mValues.value.size(); ++i) { + ParseExtensions(&val, extension.mValues.value[i], depth + 2); + } + metadata->Add(extension.name.c_str(), val); + } +} + aiNode *ImportNode(aiScene *pScene, glTF2::Asset &r, std::vector &meshOffsets, glTF2::Ref &ptr) { Node &node = *ptr; @@ -863,6 +881,11 @@ aiNode *ImportNode(aiScene *pScene, glTF2::Asset &r, std::vector & } } + if (node.extensions) { + ainode->mMetaData = new aiMetadata; + ParseExtensions(ainode->mMetaData, node.extensions); + } + GetNodeTransform(ainode->mTransformation, node); if (!node.meshes.empty()) { @@ -957,8 +980,13 @@ aiNode *ImportNode(aiScene *pScene, glTF2::Asset &r, std::vector & //range is optional - see https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_lights_punctual //it is added to meta data of parent node, because there is no other place to put it if (node.light->range.isPresent) { - ainode->mMetaData = aiMetadata::Alloc(1); - ainode->mMetaData->Set(0, "PBR_LightRange", node.light->range.value); + if (!ainode->mMetaData) { + ainode->mMetaData = aiMetadata::Alloc(1); + ainode->mMetaData->Set(0, "PBR_LightRange", node.light->range.value); + } + else { + ainode->mMetaData->Add("PBR_LightRange", node.light->range.value); + } } } diff --git a/include/assimp/metadata.h b/include/assimp/metadata.h index 684508a71..95d919584 100644 --- a/include/assimp/metadata.h +++ b/include/assimp/metadata.h @@ -69,7 +69,8 @@ typedef enum aiMetadataType { AI_DOUBLE = 4, AI_AISTRING = 5, AI_AIVECTOR3D = 6, - AI_META_MAX = 7, + AI_AIMETADATA = 7, + AI_META_MAX = 8, #ifndef SWIG FORCE_32BIT = INT_MAX @@ -100,6 +101,8 @@ struct aiMetadataEntry { #include +struct aiMetadata; + // ------------------------------------------------------------------------------- /** * Helper functions to get the aiType enum entry for a type @@ -127,6 +130,9 @@ inline aiMetadataType GetAiType(const aiString &) { inline aiMetadataType GetAiType(const aiVector3D &) { return AI_AIVECTOR3D; } +inline aiMetadataType GetAiType(const aiMetadata &) { + return AI_AIMETADATA; +} #endif // __cplusplus @@ -204,6 +210,11 @@ struct aiMetadata { rhs.Get(mKeys[i], v); mValues[i].mData = new aiVector3D(v); } break; + case AI_AIMETADATA: { + aiMetadata v; + rhs.Get(mKeys[i], v); + mValues[i].mData = new aiMetadata(v); + } break; #ifndef SWIG case FORCE_32BIT: #endif @@ -213,7 +224,15 @@ struct aiMetadata { } } - /** + aiMetadata &operator=(aiMetadata rhs) { + using std::swap; + swap(mNumProperties, rhs.mNumProperties); + swap(mKeys, rhs.mKeys); + swap(mValues, rhs.mValues); + return *this; + } + + /** * @brief The destructor. */ ~aiMetadata() { @@ -245,6 +264,9 @@ struct aiMetadata { case AI_AIVECTOR3D: delete static_cast(data); break; + case AI_AIMETADATA: + delete static_cast(data); + break; #ifndef SWIG case FORCE_32BIT: #endif @@ -323,8 +345,10 @@ struct aiMetadata { mValues[index].mType = GetAiType(value); // Copy the given value to the dynamic storage - if (nullptr != mValues[index].mData) { + if (nullptr != mValues[index].mData && AI_AIMETADATA != mValues[index].mType) { ::memcpy(mValues[index].mData, &value, sizeof(T)); + } else if (nullptr != mValues[index].mData && AI_AIMETADATA == mValues[index].mType) { + *static_cast(mValues[index].mData) = value; } else { mValues[index].mData = new T(value); } From d75d59a4fde93d070364cd3e7035eebc5428abf1 Mon Sep 17 00:00:00 2001 From: Evangel Date: Fri, 26 Jun 2020 15:07:42 +1000 Subject: [PATCH 108/115] Added operator== and operator!= to aiMetadata to allow for testing. Updated utMetadata.copy_test to reflect that there's now 8 metadata types. --- include/assimp/metadata.h | 83 +++++++++++++++++++++++++++++++++++++++ test/unit/utMetadata.cpp | 11 +++++- 2 files changed, 93 insertions(+), 1 deletion(-) diff --git a/include/assimp/metadata.h b/include/assimp/metadata.h index 95d919584..52121fbf1 100644 --- a/include/assimp/metadata.h +++ b/include/assimp/metadata.h @@ -442,6 +442,89 @@ struct aiMetadata { return false; } + friend bool CompareKeys(const aiMetadata &lhs, const aiMetadata &rhs) { + if (lhs.mNumProperties != rhs.mNumProperties) { + return false; + } + + for (unsigned int i = 0; i < lhs.mNumProperties; ++i) { + if (lhs.mKeys[i] != rhs.mKeys[i]) { + return false; + } + } + return true; + } + + friend bool CompareValues(const aiMetadata &lhs, const aiMetadata &rhs) { + if (lhs.mNumProperties != rhs.mNumProperties) { + return false; + } + + for (unsigned int i = 0; i < lhs.mNumProperties; ++i) { + if (lhs.mValues[i].mType != rhs.mValues[i].mType) { + return false; + } + + switch (lhs.mValues[i].mType) { + case AI_BOOL: { + if (*static_cast(lhs.mValues[i].mData) != *static_cast(rhs.mValues[i].mData)) { + return false; + } + } break; + case AI_INT32: { + if (*static_cast(lhs.mValues[i].mData) != *static_cast(rhs.mValues[i].mData)) { + return false; + } + } break; + case AI_UINT64: { + if (*static_cast(lhs.mValues[i].mData) != *static_cast(rhs.mValues[i].mData)) { + return false; + } + } break; + case AI_FLOAT: { + if (*static_cast(lhs.mValues[i].mData) != *static_cast(rhs.mValues[i].mData)) { + return false; + } + } break; + case AI_DOUBLE: { + if (*static_cast(lhs.mValues[i].mData) != *static_cast(rhs.mValues[i].mData)) { + return false; + } + } break; + case AI_AISTRING: { + if (*static_cast(lhs.mValues[i].mData) != *static_cast(rhs.mValues[i].mData)) { + return false; + } + } break; + case AI_AIVECTOR3D: { + if (*static_cast(lhs.mValues[i].mData) != *static_cast(rhs.mValues[i].mData)) { + return false; + } + } break; + case AI_AIMETADATA: { + if (*static_cast(lhs.mValues[i].mData) != *static_cast(rhs.mValues[i].mData)) { + return false; + } + } break; +#ifndef SWIG + case FORCE_32BIT: +#endif + default: + break; + } + } + + return true; + } + + friend bool operator==(const aiMetadata &lhs, const aiMetadata &rhs) { + return CompareKeys(lhs, rhs) && CompareValues(lhs, rhs); + } + + friend bool operator!=(const aiMetadata &lhs, const aiMetadata &rhs) { + return !(lhs == rhs); + } + #endif // __cplusplus }; diff --git a/test/unit/utMetadata.cpp b/test/unit/utMetadata.cpp index a605107db..81ab61435 100644 --- a/test/unit/utMetadata.cpp +++ b/test/unit/utMetadata.cpp @@ -197,9 +197,11 @@ TEST_F( utMetadata, copy_test ) { m_data->Set( 5, "aiString", strVal ); aiVector3D vecVal( 1, 2, 3 ); m_data->Set( 6, "aiVector3D", vecVal ); + aiMetadata metaVal; + m_data->Set( 7, "aiMetadata", metaVal ); aiMetadata copy( *m_data ); - EXPECT_EQ( 7u, copy.mNumProperties ); + EXPECT_EQ( 8u, copy.mNumProperties ); // bool test { @@ -251,4 +253,11 @@ TEST_F( utMetadata, copy_test ) { EXPECT_TRUE( copy.Get( "aiVector3D", v ) ); EXPECT_EQ( vecVal, v ); } + + // metadata test + { + aiMetadata v; + EXPECT_TRUE( copy.Get( "aiMetadata", v ) ); + EXPECT_EQ( metaVal, v ); + } } From 6d85280c8dcd936a19caedf07eb9d454e3e511a8 Mon Sep 17 00:00:00 2001 From: Evangel Date: Sat, 27 Jun 2020 12:53:26 +1000 Subject: [PATCH 109/115] Added bool, removed unused debug parameter --- code/AssetLib/glTF2/glTF2Asset.h | 4 +++- code/AssetLib/glTF2/glTF2Asset.inl | 4 ++++ code/AssetLib/glTF2/glTF2Importer.cpp | 6 ++++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/code/AssetLib/glTF2/glTF2Asset.h b/code/AssetLib/glTF2/glTF2Asset.h index 543bef95c..f79ddee87 100644 --- a/code/AssetLib/glTF2/glTF2Asset.h +++ b/code/AssetLib/glTF2/glTF2Asset.h @@ -796,6 +796,7 @@ struct CustomExtension : public Object { Nullable mDoubleValue; Nullable mUint64Value; Nullable mInt64Value; + Nullable mBoolValue; // std::vector handles both Object and Array Nullable> mValues; @@ -807,7 +808,7 @@ struct CustomExtension : public Object { size_t Size() const { if (mValues.isPresent) { return mValues.value.size(); - } else if (mStringValue.isPresent || mDoubleValue.isPresent || mUint64Value.isPresent || mInt64Value.isPresent) { + } else if (mStringValue.isPresent || mDoubleValue.isPresent || mUint64Value.isPresent || mInt64Value.isPresent || mBoolValue.isPresent) { return 1; } return 0; @@ -821,6 +822,7 @@ struct CustomExtension : public Object { , mDoubleValue(other.mDoubleValue) , mUint64Value(other.mUint64Value) , mInt64Value(other.mInt64Value) + , mBoolValue(other.mBoolValue) , mValues(other.mValues) { } diff --git a/code/AssetLib/glTF2/glTF2Asset.inl b/code/AssetLib/glTF2/glTF2Asset.inl index 71b164149..94f8d9ffa 100644 --- a/code/AssetLib/glTF2/glTF2Asset.inl +++ b/code/AssetLib/glTF2/glTF2Asset.inl @@ -1241,6 +1241,10 @@ inline CustomExtension ReadExtensions(const char *name, Value& obj) { ReadValue(obj, ret.mStringValue); ret.mStringValue.isPresent = true; } + else if (obj.IsBool()) { + ret.mBoolValue.value = obj.GetBool(); + ret.mBoolValue.isPresent = true; + } return ret; } diff --git a/code/AssetLib/glTF2/glTF2Importer.cpp b/code/AssetLib/glTF2/glTF2Importer.cpp index 3a3c66e15..4d740d8c1 100644 --- a/code/AssetLib/glTF2/glTF2Importer.cpp +++ b/code/AssetLib/glTF2/glTF2Importer.cpp @@ -847,7 +847,7 @@ static std::string GetNodeName(const Node &node) { return node.name.empty() ? node.id : node.name; } -void ParseExtensions(aiMetadata *metadata, const CustomExtension &extension, unsigned int depth = 0) { +void ParseExtensions(aiMetadata *metadata, const CustomExtension &extension) { if (extension.mStringValue.isPresent) { metadata->Add(extension.name.c_str(), aiString(extension.mStringValue.value)); } else if (extension.mDoubleValue.isPresent) { @@ -856,10 +856,12 @@ void ParseExtensions(aiMetadata *metadata, const CustomExtension &extension, uns metadata->Add(extension.name.c_str(), extension.mUint64Value.value); } else if (extension.mInt64Value.isPresent) { metadata->Add(extension.name.c_str(), static_cast(extension.mInt64Value.value)); + } else if (extension.mBoolValue.isPresent) { + metadata->Add(extension.name.c_str(), extension.mBoolValue.value); } else if (extension.mValues.isPresent) { aiMetadata val; for (size_t i = 0; i < extension.mValues.value.size(); ++i) { - ParseExtensions(&val, extension.mValues.value[i], depth + 2); + ParseExtensions(&val, extension.mValues.value[i]); } metadata->Add(extension.name.c_str(), val); } From b2f05a9a54d61d5d38790efec6c118a89ac04b68 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sun, 28 Jun 2020 19:18:36 +0200 Subject: [PATCH 110/115] rename fuzzer target --- fuzz/{assimp_fuzzer.cpp => assimp_fuzzer.cc} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename fuzz/{assimp_fuzzer.cpp => assimp_fuzzer.cc} (100%) diff --git a/fuzz/assimp_fuzzer.cpp b/fuzz/assimp_fuzzer.cc similarity index 100% rename from fuzz/assimp_fuzzer.cpp rename to fuzz/assimp_fuzzer.cc From 30f09e9fc019a078228ea818ba7dc1a41b436a3c Mon Sep 17 00:00:00 2001 From: Hill Ma Date: Sun, 28 Jun 2020 17:36:21 -0700 Subject: [PATCH 111/115] Fix build when ASSIMP_DOUBLE_PRECISION is on. Tested: $ cmake -DASSIMP_DOUBLE_PRECISION=1 -DASSIMP_BUILD_MDL_IMPORTER=0 ..; make The MDL importer is disabled due to the fact that there is some float-only code in MDL. This also means bin/assimp and bin/unit would not link successfully with the above build flags. --- code/Common/Assimp.cpp | 2 +- code/Common/SpatialSort.cpp | 2 +- code/PostProcessing/ProcessHelper.h | 2 +- include/assimp/cimport.h | 2 +- test/unit/AssimpAPITest_aiMatrix4x4.cpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/code/Common/Assimp.cpp b/code/Common/Assimp.cpp index 33de72e0f..26aa52300 100644 --- a/code/Common/Assimp.cpp +++ b/code/Common/Assimp.cpp @@ -1079,7 +1079,7 @@ ASSIMP_API void aiMatrix4DecomposeIntoScalingAxisAnglePosition( const C_STRUCT aiMatrix4x4 *mat, C_STRUCT aiVector3D *scaling, C_STRUCT aiVector3D *axis, - float *angle, + ai_real *angle, C_STRUCT aiVector3D *position) { ai_assert(nullptr != mat); ai_assert(nullptr != scaling); diff --git a/code/Common/SpatialSort.cpp b/code/Common/SpatialSort.cpp index 86e22b242..3b8a64606 100644 --- a/code/Common/SpatialSort.cpp +++ b/code/Common/SpatialSort.cpp @@ -214,7 +214,7 @@ BinFloat ToBinary(const ai_real &pValue) { const bool OneComplement = ((-42 == ~42) && (binValue & 0x80000000)); if (DefaultValue) - return BinFloat(1 << (CHAR_BIT * sizeof(BinFloat) - 1)) - binValue; + return BinFloat(BinFloat(1) << (CHAR_BIT * sizeof(BinFloat) - 1)) - binValue; // One's complement? else if (OneComplement) return BinFloat(-0) - binValue; diff --git a/code/PostProcessing/ProcessHelper.h b/code/PostProcessing/ProcessHelper.h index 660555ef0..8520b21ec 100644 --- a/code/PostProcessing/ProcessHelper.h +++ b/code/PostProcessing/ProcessHelper.h @@ -222,7 +222,7 @@ template <> struct MinMaxChooser { void operator()(aiVertexWeight &min, aiVertexWeight &max) { MinMaxChooser()(min.mVertexId, max.mVertexId); - MinMaxChooser()(min.mWeight, max.mWeight); + MinMaxChooser()(min.mWeight, max.mWeight); } }; diff --git a/include/assimp/cimport.h b/include/assimp/cimport.h index a6ab93051..3e1b75a31 100644 --- a/include/assimp/cimport.h +++ b/include/assimp/cimport.h @@ -1044,7 +1044,7 @@ ASSIMP_API void aiMatrix4DecomposeIntoScalingAxisAnglePosition( const C_STRUCT aiMatrix4x4* mat, C_STRUCT aiVector3D* scaling, C_STRUCT aiVector3D* axis, - float* angle, + ai_real* angle, C_STRUCT aiVector3D* position); // -------------------------------------------------------------------------------- diff --git a/test/unit/AssimpAPITest_aiMatrix4x4.cpp b/test/unit/AssimpAPITest_aiMatrix4x4.cpp index 2c89726e0..89883dc0d 100644 --- a/test/unit/AssimpAPITest_aiMatrix4x4.cpp +++ b/test/unit/AssimpAPITest_aiMatrix4x4.cpp @@ -176,7 +176,7 @@ TEST_F(AssimpAPITest_aiMatrix4x4, aiMatrix4DecomposeIntoScalingAxisAnglePosition aiVector3D scaling_c, scaling_cpp, axis_c, axis_cpp, position_c, position_cpp; - float angle_c, angle_cpp; + ai_real angle_c, angle_cpp; result_c = result_cpp = get_predetermined_transformation_matrix_for_decomposition(); result_cpp.Decompose(scaling_cpp, axis_cpp, angle_cpp, position_cpp); From ba94bfd1975c3b2bedf04d8c078a4a8160c90208 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Mon, 29 Jun 2020 09:51:00 +0200 Subject: [PATCH 112/115] Move patreon to contribution --- Readme.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Readme.md b/Readme.md index 15e76b9d2..66b0a31df 100644 --- a/Readme.md +++ b/Readme.md @@ -25,16 +25,6 @@ Additionally, assimp features various __mesh post processing tools__: normals an This is the development repo containing the latest features and bugfixes. For productive use though, we recommend one of the stable releases available from [Github Assimp Releases](https://github.com/assimp/assimp/releases). -Monthly donations via Patreon: -
[![Patreon](https://cloud.githubusercontent.com/assets/8225057/5990484/70413560-a9ab-11e4-8942-1a63607c0b00.png)](http://www.patreon.com/assimp) - -
- -One-off donations via PayPal: -
[![PayPal](https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=4JRJVPXC4QJM4) - -
- Please check our Wiki as well: https://github.com/assimp/assimp/wiki If you want to check our Model-Database, use the following repo: https://github.com/assimp/assimp-mdb @@ -196,6 +186,16 @@ Become a financial contributor and help us sustain our community. [[Contribute]( +Monthly donations via Patreon: +
[![Patreon](https://cloud.githubusercontent.com/assets/8225057/5990484/70413560-a9ab-11e4-8942-1a63607c0b00.png)](http://www.patreon.com/assimp) + +
+ +One-off donations via PayPal: +
[![PayPal](https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=4JRJVPXC4QJM4) + +
+ #### Organizations Support this project with your organization. Your logo will show up here with a link to your website. [[Contribute](https://opencollective.com/assimp/contribute)] From 28b65c84b0ca2dcd2e6c38d3fac209c3890f9207 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Mon, 29 Jun 2020 09:52:36 +0200 Subject: [PATCH 113/115] Create fileformats.md Optimize the readabilaty of the frontpage. --- doc/Fileformats.md | 87 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 doc/Fileformats.md diff --git a/doc/Fileformats.md b/doc/Fileformats.md new file mode 100644 index 000000000..c9116e2e7 --- /dev/null +++ b/doc/Fileformats.md @@ -0,0 +1,87 @@ +#### Supported file formats #### + +__Importers__: + +- 3D +- [3DS](https://en.wikipedia.org/wiki/.3ds) +- [3MF](https://en.wikipedia.org/wiki/3D_Manufacturing_Format) +- AC +- [AC3D](https://en.wikipedia.org/wiki/AC3D) +- ACC +- AMJ +- ASE +- ASK +- B3D +- [BLEND](https://en.wikipedia.org/wiki/.blend_(file_format)) +- [BVH](https://en.wikipedia.org/wiki/Biovision_Hierarchy) +- CMS +- COB +- [DAE/Collada](https://en.wikipedia.org/wiki/COLLADA) +- [DXF](https://en.wikipedia.org/wiki/AutoCAD_DXF) +- ENFF +- [FBX](https://en.wikipedia.org/wiki/FBX) +- [glTF 1.0](https://en.wikipedia.org/wiki/GlTF#glTF_1.0) + GLB +- [glTF 2.0](https://en.wikipedia.org/wiki/GlTF#glTF_2.0): + At the moment for glTF2.0 the following extensions are supported: + + KHR_lights_punctual ( 5.0 ) + + KHR_materials_pbrSpecularGlossiness ( 5.0 ) + + KHR_materials_unlit ( 5.0 ) + + KHR_texture_transform ( 5.1 under test ) +- HMB +- IFC-STEP +- IRR / IRRMESH +- [LWO](https://en.wikipedia.org/wiki/LightWave_3D) +- LWS +- LXO +- [M3D](https://bztsrc.gitlab.io/model3d) +- MD2 +- MD3 +- MD5 +- MDC +- MDL +- MESH / MESH.XML +- MOT +- MS3D +- NDO +- NFF +- [OBJ](https://en.wikipedia.org/wiki/Wavefront_.obj_file) +- [OFF](https://en.wikipedia.org/wiki/OFF_(file_format)) +- [OGEX](https://en.wikipedia.org/wiki/Open_Game_Engine_Exchange) +- [PLY](https://en.wikipedia.org/wiki/PLY_(file_format)) +- PMX +- PRJ +- Q3O +- Q3S +- RAW +- SCN +- SIB +- SMD +- [STP](https://en.wikipedia.org/wiki/ISO_10303-21) +- [STL](https://en.wikipedia.org/wiki/STL_(file_format)) +- TER +- UC +- VTA +- X +- [X3D](https://en.wikipedia.org/wiki/X3D) +- XGL +- ZGL + +Additionally, some formats are supported by dependency on non-free code or external SDKs (not built by default): + +- [C4D](https://en.wikipedia.org/wiki/Cinema_4D) (https://github.com/assimp/assimp/wiki/Cinema4D-&-Melange) IMporting geometry + node hierarchy are currently supported + +__Exporters__: + +- DAE (Collada) +- STL +- OBJ +- PLY +- X +- 3DS +- JSON (for WebGl, via https://github.com/acgessler/assimp2json) +- ASSBIN +- STEP +- glTF 1.0 (partial) +- glTF 2.0 (partial) +- 3MF ( experimental ) +- FBX ( experimental ) From 9a873388545788e4fbd891cff424fd63675b5aa9 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Mon, 29 Jun 2020 09:55:29 +0200 Subject: [PATCH 114/115] Update Readme.md --- Readme.md | 87 +------------------------------------------------------ 1 file changed, 1 insertion(+), 86 deletions(-) diff --git a/Readme.md b/Readme.md index 66b0a31df..dc54870a0 100644 --- a/Readme.md +++ b/Readme.md @@ -30,92 +30,7 @@ Please check our Wiki as well: https://github.com/assimp/assimp/wiki If you want to check our Model-Database, use the following repo: https://github.com/assimp/assimp-mdb #### Supported file formats #### - -__Importers__: - -- 3D -- [3DS](https://en.wikipedia.org/wiki/.3ds) -- [3MF](https://en.wikipedia.org/wiki/3D_Manufacturing_Format) -- AC -- [AC3D](https://en.wikipedia.org/wiki/AC3D) -- ACC -- AMJ -- ASE -- ASK -- B3D -- [BLEND](https://en.wikipedia.org/wiki/.blend_(file_format)) -- [BVH](https://en.wikipedia.org/wiki/Biovision_Hierarchy) -- CMS -- COB -- [DAE/Collada](https://en.wikipedia.org/wiki/COLLADA) -- [DXF](https://en.wikipedia.org/wiki/AutoCAD_DXF) -- ENFF -- [FBX](https://en.wikipedia.org/wiki/FBX) -- [glTF 1.0](https://en.wikipedia.org/wiki/GlTF#glTF_1.0) + GLB -- [glTF 2.0](https://en.wikipedia.org/wiki/GlTF#glTF_2.0): - At the moment for glTF2.0 the following extensions are supported: - + KHR_lights_punctual ( 5.0 ) - + KHR_materials_pbrSpecularGlossiness ( 5.0 ) - + KHR_materials_unlit ( 5.0 ) - + KHR_texture_transform ( 5.1 under test ) -- HMB -- IFC-STEP -- IRR / IRRMESH -- [LWO](https://en.wikipedia.org/wiki/LightWave_3D) -- LWS -- LXO -- [M3D](https://bztsrc.gitlab.io/model3d) -- MD2 -- MD3 -- MD5 -- MDC -- MDL -- MESH / MESH.XML -- MOT -- MS3D -- NDO -- NFF -- [OBJ](https://en.wikipedia.org/wiki/Wavefront_.obj_file) -- [OFF](https://en.wikipedia.org/wiki/OFF_(file_format)) -- [OGEX](https://en.wikipedia.org/wiki/Open_Game_Engine_Exchange) -- [PLY](https://en.wikipedia.org/wiki/PLY_(file_format)) -- PMX -- PRJ -- Q3O -- Q3S -- RAW -- SCN -- SIB -- SMD -- [STP](https://en.wikipedia.org/wiki/ISO_10303-21) -- [STL](https://en.wikipedia.org/wiki/STL_(file_format)) -- TER -- UC -- VTA -- X -- [X3D](https://en.wikipedia.org/wiki/X3D) -- XGL -- ZGL - -Additionally, some formats are supported by dependency on non-free code or external SDKs (not built by default): - -- [C4D](https://en.wikipedia.org/wiki/Cinema_4D) (https://github.com/assimp/assimp/wiki/Cinema4D-&-Melange) IMporting geometry + node hierarchy are currently supported - -__Exporters__: - -- DAE (Collada) -- STL -- OBJ -- PLY -- X -- 3DS -- JSON (for WebGl, via https://github.com/acgessler/assimp2json) -- ASSBIN -- STEP -- glTF 1.0 (partial) -- glTF 2.0 (partial) -- 3MF ( experimental ) -- FBX ( experimental ) +You can find the complete list of supported file-formats [here](https://github.com/assimp/assimp/blob/master/doc/Fileformats.md) ### Building ### Take a look into the https://github.com/assimp/assimp/blob/master/Build.md file. We are available in vcpkg, and our build system is CMake; if you used CMake before there is a good chance you know what to do. From 03340787ecf769837fabc2b7ba9adfa6a46f4f66 Mon Sep 17 00:00:00 2001 From: Marc-Antoine Lortie Date: Mon, 29 Jun 2020 07:50:51 -0400 Subject: [PATCH 115/115] Fixed variable in loop - HL1MDLLoader.cpp Commit 7e5a0acc48efc54d7aa7900c36cd63db1fbeec9b made changes to HL1MDLLoader.cpp. Several variables have been renamed. A loop variable 'i' was renamed to faceIdx, but one reference was left unchanged. --- code/AssetLib/MDL/HalfLife/HL1MDLLoader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/AssetLib/MDL/HalfLife/HL1MDLLoader.cpp b/code/AssetLib/MDL/HalfLife/HL1MDLLoader.cpp index 261214dac..2bb7b42ee 100644 --- a/code/AssetLib/MDL/HalfLife/HL1MDLLoader.cpp +++ b/code/AssetLib/MDL/HalfLife/HL1MDLLoader.cpp @@ -829,7 +829,7 @@ void HL1MDLLoader::read_meshes() { } } else { for (int faceIdx = 0; faceIdx < num_faces; ++faceIdx) { - if (i & 1) { + if (faceIdx & 1) { // Preserve winding order. mesh_faces.push_back(HL1MeshFace{ tricmds[faceIdx + 1],